Daniel
Daniel

Reputation: 2004

OpenSSL compiles for wrong target

I'm trying to build FIPS compliant OpenSSL for android (4.1.2 if it matters) and I've got a problem.

I've been following the steps from http://wiki.openssl.org/index.php/FIPS_Library_and_Android#OpenSSL_FIPS_Components and this is what happens:

$ export ANDROID_SDK_ROOT=/opt/android-sdk/
$ export ANDROID_NDK_ROOT=/opt/android-ndk-r9b/
$ export FIPS_SIG /home/<username>/work/openssl/openssl-fips-2.0.5/util/incore

$ ./setenv-android.sh

$ cd openssl-fips-2.0.5/
$ ./config
$ make

$ readelf -h ./fips/fipscanister.o | grep -i 'class\|machine'
  Class:                             ELF64
  Machine:                           Advanced Micro Devices X86-64

I believe this class and machine should be ELF32 and ARM as per the instructions. I've somehow built for the box I'm working on not for android. Any ideas?

Upvotes: 0

Views: 147

Answers (1)

Daniel
Daniel

Reputation: 2004

The difference a dot makes:

./setenv-android.sh

is incorrect and needs to be

. ./setenv-android.sh

The difference is that the first sets up the environment variables for the script process - which then exits losing everything. The second sets it all up in the same process that ran the script which is the desired outcome.

Upvotes: 1

Related Questions