Add android-x86.
authorAndy Polyakov <appro@openssl.org>
Sat, 15 Oct 2011 08:32:16 +0000 (08:32 +0000)
committerAndy Polyakov <appro@openssl.org>
Sat, 15 Oct 2011 08:32:16 +0000 (08:32 +0000)
Configure
TABLE
config
crypto/perlasm/x86asm.pl
crypto/perlasm/x86gas.pl
fips/fips_canister.c

index 76aedb68ecce3acf33b9c35de24ce38fa216f835..ed8c4c0bdacad68b819c0dd5c16076937581a432 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -400,6 +400,7 @@ my %table=(
 
 # Android: linux-* but without -DTERMIO and pointers to headers and libs.
 "android","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"android-x86","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:".eval{my $asm=${x86_elf_asm};$asm=~s/:elf/:android/;$asm}.":dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 "android-armv7","gcc:-march=armv7-a -mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 
 #### *BSD [do see comment about ${BSDthreads} above!]
diff --git a/TABLE b/TABLE
index 4292c1092ce1c864a25fc84a27264897e13389b2..47b7af934b56135e1dd3827fa66c45358399a775 100644 (file)
--- a/TABLE
+++ b/TABLE
@@ -1089,6 +1089,39 @@ $ranlib       =
 $arflags      = 
 $multilib     = 
 
+*** android-x86
+$cc           = gcc
+$cflags       = -mandroid -I$(ANDROID_DEV)/include -B$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall
+$unistd       = 
+$thread_cflag = -D_REENTRANT
+$sys_id       = 
+$lflags       = -ldl
+$bn_ops       = BN_LLONG DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT
+$cpuid_obj    = x86cpuid.o
+$bn_obj       = bn-586.o co-586.o x86-mont.o x86-gf2m.o
+$des_obj      = des-586.o crypt586.o
+$aes_obj      = aes-586.o vpaes-x86.o aesni-x86.o
+$bf_obj       = bf-586.o
+$md5_obj      = md5-586.o
+$sha1_obj     = sha1-586.o sha256-586.o sha512-586.o
+$cast_obj     = cast-586.o
+$rc4_obj      = rc4-586.o
+$rmd160_obj   = rmd-586.o
+$rc5_obj      = rc5-586.o
+$wp_obj       = wp_block.o wp-mmx.o
+$cmll_obj     = cmll-x86.o
+$modes_obj    = ghash-x86.o
+$engines_obj  = e_padlock-x86.o
+$perlasm_scheme = android
+$dso_scheme   = dlfcn
+$shared_target= linux-shared
+$shared_cflag = -fPIC
+$shared_ldflag = 
+$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
+$ranlib       = 
+$arflags      = 
+$multilib     = 
+
 *** aux3-gcc
 $cc           = gcc
 $cflags       = -O2 -DTERMIO
diff --git a/config b/config
index 7a40df5774123c24b823d2f64f669764ad18ef1e..37f86b068a6ecf46bece55b962bf8f59884896ea 100755 (executable)
--- a/config
+++ b/config
@@ -830,6 +830,7 @@ case "$GUESSOS" in
   beos-*) OUT="$GUESSOS" ;;
   x86pc-*-qnx6) OUT="QNX6-i386" ;;
   *-*-qnx6) OUT="QNX6" ;;
+  x86-*-android|i?86-*-android) OUT="android-x86" ;;
   armv[7-9]*-*-android) OUT="android-armv7" ;;
   *) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;;
 esac
index b7ddb8137f306011dfe327e3d431c3d213b437f4..eb543db2f66eb979371d67e2e25f4e6a5cc861cd 100644 (file)
@@ -218,7 +218,7 @@ sub ::asm_init
     $filename=$fn;
     $i386=$cpu;
 
-    $elf=$cpp=$coff=$aout=$macosx=$win32=$netware=$mwerks=0;
+    $elf=$cpp=$coff=$aout=$macosx=$win32=$netware=$mwerks=$android=0;
     if    (($type eq "elf"))
     {  $elf=1;                 require "x86gas.pl";    }
     elsif (($type eq "a\.out"))
@@ -235,6 +235,8 @@ sub ::asm_init
     {  $win32=1;               require "x86masm.pl";   }
     elsif (($type eq "macosx"))
     {  $aout=1; $macosx=1;     require "x86gas.pl";    }
+    elsif (($type eq "android"))
+    {  $elf=1; $android=1;     require "x86gas.pl";    }
     else
     {  print STDERR <<"EOF";
 Pick one target type from
index 3a791062983558935d6239d1858b2666acab2ac7..f6b8cc9679f991fa80081077dc4c2b888fe73b9c 100644 (file)
@@ -209,7 +209,14 @@ sub ::picmeup
 sub ::initseg
 { my $f=$nmdecor.shift;
 
-    if ($::elf)
+    if ($::android)
+    {  $initseg.=<<___;
+.section       .init_array
+.align 4
+.long  $f
+___
+    }
+    elsif ($::elf)
     {  $initseg.=<<___;
 .section       .init
        call    $f
index a209172f437d41aa42b6b6c2fd0e3e7f1aa49d86..f00fc7b365ae1403a52582d9b2bb6d42369859a1 100644 (file)
@@ -28,7 +28,8 @@ const void         *FIPS_text_end(void);
 #endif
 
 #if !defined(FIPS_REF_POINT_IS_CROSS_COMPILER_AWARE)
-# if   (defined(__ANDROID__) && (defined(__arm__) || defined(__arm)))  || \
+# if   (defined(__ANDROID__) && (defined(__arm__) || defined(__arm)    || \
+                                 defined(__i386__)|| defined(__i386))) || \
        (defined(__vxworks)   && (defined(__ppc__) || defined(__ppc)))  || \
        (defined(__linux)     && defined(__PPC__) && !defined(__PPC64__))
 #  define FIPS_REF_POINT_IS_CROSS_COMPILER_AWARE