5

openssl is included in the Android operating system, and Google also includes some arm4/thumb assembler code in their builds (aes/asm/aes-armv4.s, bn/asm/armv4-mont.s, sha/asm/sha1-armv4-large.s, sha/asm/sha256-armv4.s, sha/asm/sha512-armv4.s). I have the Android openssl building with ndk-build but it will only builds properly with the plain C aes_core.c, not the arm4 files. It even creates the .o files, but it can't find the *.o.d.org files, which I have no idea where they come from.

Any ideas on this?

/usr/local/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-gcc -MMD -MP -MF /Users/hans/code/eighthave/openssl-android/obj/local/armeabi/objs/crypto/aes/asm/aes-armv4.o.d.org -fpic -ffunction-sections -funwind-tables -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wno-psabi -march=armv5te -mtune=xscale -msoft-float -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -I/Users/hans/code/eighthave/openssl-android -I/Users/hans/code/eighthave/openssl-android/crypto/asn1 -I/Users/hans/code/eighthave/openssl-android/crypto/evp -I/Users/hans/code/eighthave/openssl-android/include -I/Users/hans/code/eighthave/openssl-android/include/openssl -Iexternal/zlib -I/Users/hans/code/eighthave/openssl-android/crypto -DANDROID -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN -DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_CAPIENG -DOPENSSL_NO_CAST -DOPENSSL_NO_CMS -DOPENSSL_NO_GMP -DOPENSSL_NO_IDEA -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_SHA0 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SEED -DOPENSSL_NO_STORE -DOPENSSL_NO_WHIRLPOOL -DOPENSSL_NO_HW -DOPENSSL_NO_ENGINE -DZLIB -DNO_WINDOWS_BRAINDEATH -DOPENSSL_BN_ASM_MONT -DAES_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -Wa,--noexecstack -O2 -DNDEBUG -g -I/usr/local/android-ndk/platforms/android-8/arch-arm/usr/include -c /Users/hans/code/eighthave/openssl-android/crypto/aes/asm/aes-armv4.s -o /Users/hans/code/eighthave/openssl-android/obj/local/armeabi/objs/crypto/aes/asm/aes-armv4.o && rm -f /Users/hans/code/eighthave/openssl-android/obj/local/armeabi/objs/crypto/aes/asm/aes-armv4.o.d && mv /Users/hans/code/eighthave/openssl-android/obj/local/armeabi/objs/crypto/aes/asm/aes-armv4.o.d.org /Users/hans/code/eighthave/openssl-android/obj/local/armeabi/objs/crypto/aes/asm/aes-armv4.o.d mv: cannot stat `/Users/hans/code/eighthave/openssl-android/obj/local/armeabi/objs/crypto/aes/asm/aes-armv4.o.d.org': No such file or directory make: * [/Users/hans/code/eighthave/openssl-android/obj/local/armeabi/objs/crypto/aes/asm/aes-armv4.o] Error 1

starblue
  • 55,348
  • 14
  • 97
  • 151

1 Answers1

3

I have the exact same problem, and I am looking for a workaround. I am using this version instead: https://github.com/fries/android-external-openssl

I am using the Android NDK r5b

awakecoding
  • 428
  • 5
  • 15
  • 4
    I actually just found a way to make it work. Reading this: http://osdir.com/ml/android-ndk/2010-06/msg00602.html I edited crypto/Android.mk to put uppercase 'S' instead of 's' to the 5 '.s' files listed at the beginning of the makefile. I also renamed the actual mentioned files from .s to .S, and it now compiles correctly. – awakecoding Feb 10 '11 at 02:40
  • Bingo, that did it for me, I just changed .s to .S in the `crypto/Android.mk`, and it built! – Hans-Christoph Steiner Feb 10 '11 at 19:37
  • 1
    According to the [gcc docs](http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Overall-Options.html), a .s is "Assembler code" and a .S is "Assembler code which must be preprocessed". Perhaps the original Android dev who did this work is on a Windows or Mac OS X box, which do not have case-sensitive file systems... – Hans-Christoph Steiner Feb 10 '11 at 19:45