components/openssl/openssl-1.0.1-fips-140/patches/38_remove_illegal_instruction_calls.patch
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/openssl/openssl-1.0.1-fips-140/patches/38_remove_illegal_instruction_calls.patch Mon Aug 25 14:20:21 2014 -0700
@@ -0,0 +1,70 @@
+#
+# This patch was developed in-house.
+# This is Solaris-specific: not suitable for upstream.
+#
+--- openssl-1.0.1h/crypto/sparcv9cap.c.~1~ Mon Aug 4 15:18:42 2014
++++ openssl-1.0.1h/crypto/sparcv9cap.c Mon Aug 4 15:30:21 2014
+@@ -5,6 +5,7 @@
+ #include <signal.h>
+ #include <sys/time.h>
+ #include <openssl/bn.h>
++#include <sys/auxv.h>
+
+ #define SPARCV9_TICK_PRIVILEGED (1<<0)
+ #define SPARCV9_PREFER_FPU (1<<1)
+@@ -31,7 +32,6 @@
+ void _sparcv9_vis1_probe(void);
+ unsigned long _sparcv9_vis1_instrument(void);
+ void _sparcv9_vis2_probe(void);
+-void _sparcv9_fmadd_probe(void);
+
+ unsigned long OPENSSL_rdtsc(void)
+ {
+@@ -171,6 +171,7 @@
+ struct sigaction common_act,ill_oact,bus_oact;
+ sigset_t all_masked,oset;
+ static int trigger=0;
++ uint_t ui = 0;
+
+ if (trigger) return;
+ trigger=1;
+@@ -183,6 +184,7 @@
+
+ /* Initial value, fits UltraSPARC-I&II... */
+ OPENSSL_sparcv9cap_P = SPARCV9_PREFER_FPU|SPARCV9_TICK_PRIVILEGED;
++ (void) getisax(&ui, 1);
+
+ sigfillset(&all_masked);
+ sigdelset(&all_masked,SIGILL);
+@@ -222,11 +224,8 @@
+ }
+ }
+
+- if (sigsetjmp(common_jmp,1) == 0)
+- {
+- _sparcv9_fmadd_probe();
++ if (ui & AV_SPARC_FMAF)
+ OPENSSL_sparcv9cap_P |= SPARCV9_FMADD;
+- }
+
+ sigaction(SIGBUS,&bus_oact,NULL);
+ sigaction(SIGILL,&ill_oact,NULL);
+--- openssl-1.0.1h/crypto/sparccpuid.S.~1~ Mon Aug 4 15:18:57 2014
++++ openssl-1.0.1h/crypto/sparccpuid.S Mon Aug 4 15:30:34 2014
+@@ -304,16 +304,6 @@
+ .type _sparcv9_vis2_probe,#function
+ .size _sparcv9_vis2_probe,.-_sparcv9_vis2_probe
+
+-.global _sparcv9_fmadd_probe
+-.align 8
+-_sparcv9_fmadd_probe:
+- .word 0x81b00d80 !fxor %f0,%f0,%f0
+- .word 0x85b08d82 !fxor %f2,%f2,%f2
+- retl
+- .word 0x81b80440 !fmaddd %f0,%f0,%f2,%f0
+-.type _sparcv9_fmadd_probe,#function
+-.size _sparcv9_fmadd_probe,.-_sparcv9_fmadd_probe
+-
+ .global OPENSSL_cleanse
+ .align 32
+ OPENSSL_cleanse: