Blob Blame History Raw
diff -up ./nss/lib/freebl/fipsfreebl.c.ppc_no_init_support ./nss/lib/freebl/fipsfreebl.c
--- ./nss/lib/freebl/fipsfreebl.c.ppc_no_init_support	2014-10-17 18:49:18.235965317 -0700
+++ ./nss/lib/freebl/fipsfreebl.c	2014-10-17 18:49:18.256965469 -0700
@@ -33,7 +33,7 @@
 
 
 /* GCC Attribute */
-#ifdef __GNUC__
+#if defined(__GNUC__) && !defined(NSS_NO_INIT_SUPPORT)
 #define INIT_FUNCTION __attribute__((constructor))
 #else
 #define INIT_FUNCTION
@@ -1748,12 +1748,12 @@ bl_startup_tests(void)
  */
 SECStatus
 BL_FIPSEntryOK(PRBool freebl_only) {
-#ifdef NO_INIT_SUPPORT
+#ifdef NSS_NO_INIT_SUPPORT
    /* this should only be set on platforms that can't handle one of the INIT
     * schemes.  This code allows those platforms to continue to function, 
-    * though they don't meet the strict NIST requirements. If NO_INIT_SUPPORT
+    * though they don't meet the strict NIST requirements. If NSS_NO_INIT_SUPPORT
     * is not set, and init support has not been properly enabled, freebl
-    * will always fail because of the test below */
+    * will always fail because of the test below
     */
     if (!self_tests_freebl_ran) {
 	bl_startup_tests();
diff -up ./nss/lib/freebl/Makefile.ppc_no_init_support ./nss/lib/freebl/Makefile
--- ./nss/lib/freebl/Makefile.ppc_no_init_support	2014-06-24 13:45:27.000000000 -0700
+++ ./nss/lib/freebl/Makefile	2014-10-17 18:49:18.257965476 -0700
@@ -87,6 +87,10 @@ ifdef LINUX
 	DEFINES += -D__GNU_SOURCE=1
 endif
 endif
+ifdef NSS_NO_INIT_SUPPORT
+    DEFINES += -DNSS_NO_INIT_SUPPORT
+endif
+
 ifdef FREEBL_PRELINK_COMMAND
 	DEFINES +=-DFREEBL_PRELINK_COMMAND=\"$(FREEBL_PRELINK_COMMAND)\"
 endif
@@ -220,6 +224,11 @@ ifeq ($(CPU_ARCH),arm)
     DEFINES += -DSHA_NO_LONG_LONG # avoid 64-bit arithmetic in SHA512
     MPI_SRCS += mpi_arm.c
 endif
+ifeq ($(CPU_ARCH),ppc)
+ifdef USE_64
+    DEFINES += -DNSS_NO_INIT_SUPPORT
+endif # USE_64
+endif # ppc
 endif # Linux
 
 ifeq ($(OS_TARGET),AIX)
diff -up ./nss/lib/softoken/fipstest.c.ppc_no_init_support ./nss/lib/softoken/fipstest.c
--- ./nss/lib/softoken/fipstest.c.ppc_no_init_support	2014-10-17 18:49:18.213965159 -0700
+++ ./nss/lib/softoken/fipstest.c	2014-10-17 18:49:18.257965476 -0700
@@ -25,7 +25,7 @@
 #endif
 
 /* GCC Attribute */
-#ifdef __GNUC__
+#if defined(__GNUC__) && !defined(NSS_NO_INIT_SUPPORT)
 #define INIT_FUNCTION __attribute__((constructor))
 #else
 #define INIT_FUNCTION
@@ -634,11 +634,11 @@ sftk_startup_tests(void)
  */
 CK_RV
 sftk_FIPSEntryOK() {
-#ifdef NO_INIT_SUPPORT
+#ifdef NSS_NO_INIT_SUPPORT
    /* this should only be set on platforms that can't handle one of the INIT
     * schemes.  This code allows those platforms to continue to function, 
-    * though they don't meet the strict NIST requirements. If NO_INIT_SUPPORT
-    * is noe set, and init support has not been properly enabled, softken
+    * though they don't meet the strict NIST requirements. If NSS_NO_INIT_SUPPORT
+    * is not set, and init support has not been properly enabled, softken
     * will always fail because of the test below 
     */
     if (!sftk_self_tests_ran) {
diff -up ./nss/lib/softoken/Makefile.ppc_no_init_support ./nss/lib/softoken/Makefile
--- ./nss/lib/softoken/Makefile.ppc_no_init_support	2014-10-17 18:49:18.258965483 -0700
+++ ./nss/lib/softoken/Makefile	2014-10-17 18:51:41.124993988 -0700
@@ -20,6 +20,16 @@ include $(CORE_DEPTH)/coreconf/config.mk
 # (3) Include "component" configuration information. (OPTIONAL)       #
 #######################################################################
 
+ifdef NSS_NO_INIT_SUPPORT
+    DEFINES += -DNSS_NO_INIT_SUPPORT
+endif
+ifeq ($(OS_TARGET),Linux)
+ifeq ($(CPU_ARCH),ppc)
+ifdef USE_64
+    DEFINES += -DNSS_NO_INIT_SUPPORT
+endif # USE_64
+endif # ppc
+endif # Linux
 
 
 #######################################################################