]> code.ossystems Code Review - meta-freescale.git/blob
2d722d8a2a53ea5213fd7b81cb7b1735bf3388f8
[meta-freescale.git] /
1 From 7d770f0324498d1fa78300cc5cecc8c1dcd3b788 Mon Sep 17 00:00:00 2001
2 From: Andy Polyakov <appro@openssl.org>
3 Date: Sun, 21 Oct 2012 18:19:41 +0000
4 Subject: [PATCH 04/26] linux-pcc: make it more robust and recognize
5  KERNEL_BITS variable.
6
7 (cherry picked from commit 78c3e20579d3baa159c8b51b59d415b6e521614b)
8
9 Change-Id: I769c466f052305681ab54a1b6545d94c7fbf5a9d
10 Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
11 ---
12  config          | 19 +++++++++++++------
13  crypto/ppccap.c |  7 +++++++
14  2 files changed, 20 insertions(+), 6 deletions(-)
15
16 diff --git a/config b/config
17 index 41fa2a6..f37b9e6 100755
18 --- a/config
19 +++ b/config
20 @@ -587,13 +587,20 @@ case "$GUESSOS" in
21         fi
22         ;;
23    ppc64-*-linux2)
24 -       echo "WARNING! If you wish to build 64-bit library, then you have to"
25 -       echo "         invoke './Configure linux-ppc64' *manually*."
26 -       if [ "$TEST" = "false" -a -t 1 ]; then
27 -           echo "         You have about 5 seconds to press Ctrl-C to abort."
28 -           (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
29 +       if [ -z "$KERNEL_BITS" ]; then
30 +           echo "WARNING! If you wish to build 64-bit library, then you have to"
31 +           echo "         invoke './Configure linux-ppc64' *manually*."
32 +           if [ "$TEST" = "false" -a -t 1 ]; then
33 +               echo "         You have about 5 seconds to press Ctrl-C to abort."
34 +               (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
35 +           fi
36 +       fi
37 +       if [ "$KERNEL_BITS" = "64" ]; then
38 +           OUT="linux-ppc64"
39 +       else
40 +           OUT="linux-ppc"
41 +           (echo "__LP64__" | gcc -E -x c - 2>/dev/null | grep "^__LP64__" 2>&1 > /dev/null) || options="$options -m32"
42         fi
43 -       OUT="linux-ppc"
44         ;;
45    ppc-*-linux2) OUT="linux-ppc" ;;
46    ppc60x-*-vxworks*) OUT="vxworks-ppc60x" ;;
47 diff --git a/crypto/ppccap.c b/crypto/ppccap.c
48 index f71ba66..531f1b3 100644
49 --- a/crypto/ppccap.c
50 +++ b/crypto/ppccap.c
51 @@ -4,6 +4,9 @@
52  #include <setjmp.h>
53  #include <signal.h>
54  #include <unistd.h>
55 +#ifdef __linux
56 +#include <sys/utsname.h>
57 +#endif
58  #include <crypto.h>
59  #include <openssl/bn.h>
60  
61 @@ -102,6 +105,10 @@ void OPENSSL_cpuid_setup(void)
62  
63         if (sizeof(size_t)==4)
64                 {
65 +#ifdef __linux
66 +               struct utsname uts;
67 +               if (uname(&uts)==0 && strcmp(uts.machine,"ppc64")==0)
68 +#endif
69                 if (sigsetjmp(ill_jmp,1) == 0)
70                         {
71                         OPENSSL_ppc64_probe();
72 -- 
73 2.3.5
74