Skip to content

Commit

Permalink
android: hack the OpenSSL Makefile for Clang
Browse files Browse the repository at this point in the history
OpenSSL fails to build after 'make depend'.

1) The -mandroid flag is not supported on Clang.
Remove it from the Makefile.
2) Some .S files throw:
    error: invalid instruction
Remove the *_ASM defines from the Makefile.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
  • Loading branch information
neolit123 committed Apr 30, 2018
1 parent d031bb9 commit 97ba5b5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packaging/android/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,12 @@ if [ ! -e "$PKG_CONFIG_LIBDIR/libssl.pc" ] ; then
bash -x ./config shared no-ssl2 no-ssl3 no-comp no-hw no-engine --openssldir="$PREFIX"
# sed -i.bak -e 's/soname=\$\$SHLIB\$\$SHLIB_SOVER\$\$SHLIB_SUFFIX/soname=\$\$SHLIB/g' Makefile.shared
make depend
# remove the -mandroid flag for clang as it's not supported
# also remove all _ASM defines as those throw errors
if [ ${CC_NAME} = "clang" ]; then
sed -i 's/-mandroid//' Makefile
sed -i 's/-DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM//' Makefile
fi
make
# now fix the reference to libcrypto.so.1.0.0 to be just to libcrypto.so
perl -pi -e 's/libcrypto.so.1.0.0/libcrypto.so\x00\x00\x00\x00\x00\x00/' libssl.so.1.0.0
Expand Down

0 comments on commit 97ba5b5

Please sign in to comment.