Skip to content

Commit

Permalink
Switching to -Os to compile OpenSSL on Android. It has been reported …
Browse files Browse the repository at this point in the history
…by other

projects that -O3 might produce wrong code (android/ndk#110).
  • Loading branch information
kneth committed Jun 29, 2016
1 parent b6604f6 commit 9118980
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,8 @@ EOF
(cd openssl && mv Makefile Makefile.dep && sed -e 's/\-mandroid//g' Makefile.dep > Makefile) || exit 1
DEPFLAGS="$(grep DEPFLAG= Makefile | head -1 | cut -f2 -d=)"
$MAKE -C "openssl" DEPFLAG="$DEPFLAGS -I$temp_dir/sysroot/usr/include -I$temp_dir/sysroot/usr/include/linux -I$temp_dir/include/c++/4.9/tr1 -I$temp_dir/include/c++/4.9" depend || exit 1
(cd openssl && mv Makefile.dep Makefile) || exit 1
# -O3 seems to be buggy on Android
(cd openssl && sed -e 's/O3/Os/g' Makefile.dep > Makefile && rm -f Makefile.dep) || exit 1
PATH="$path" CC="$cc" CFLAGS="$cflags_arch" PERL="perl" $MAKE -C "openssl" build_crypto || exit 1
cp "openssl/libcrypto.a" "$ANDROID_DIR/$libcrypto_name" || exit 1
fi
Expand Down
1 change: 1 addition & 0 deletions release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
(#1478)
* New feature in the unit test framework: Ability to specify log level
threshold for custom intra test logging (`UNITTEST_LOG_LEVEL`).
* Switch from `-O3` to `-Os` to compile OpenSSL: https://github.com/android-ndk/ndk/issues/110

----------------------------------------------

Expand Down

0 comments on commit 9118980

Please sign in to comment.