Blame SOURCES/nss-softokn-3.16-ppc-no-init_support.patch

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