Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OpenSSL cross-compaile warnings #201

Merged
merged 1 commit into from Mar 25, 2020
Merged

Fix OpenSSL cross-compaile warnings #201

merged 1 commit into from Mar 25, 2020

Conversation

noloader
Copy link
Contributor

@noloader noloader commented Mar 25, 2020

This PR cleans up OpenSSL warnings when cross-compiling. It also uses the same 15-android.conf and setenv-android.sh as Unbound.

OpenSSL has a penchant for ignoring user flags. When Travis jobs were added that used ANDROID_API=23 (the minimum) it produced warnings like the following because OpenSSL stomped on Unbound's flags.

armv7a-linux-androideabi23-clang  -I. -Iinclude -fPIC -pthread -D__ANDROID_API__
=23 -march=armv7-a -mthumb -mfloat-abi=softfp -funwind-tables -fexceptions --sys
root=/home/travis/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot -DOP
ENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSLDIR="\"/home/travis/android23-armv7a\"
" -DENGINESDIR="\"/home/travis/android23-armv7a/lib/engines-1.1\"" -D__ANDROID_A
PI__=29 -DNDEBUG  -MMD -MF apps/app_rand.d.tmp -MT apps/app_rand.o -c -o apps/ap
p_rand.o apps/app_rand.c

In file included from <built-in>:374:
<command line>:6:9: warning: '__ANDROID_API__' macro redefined
      [-Wmacro-redefined]
#define __ANDROID_API__ 29
        ^
<command line>:1:9: note: previous definition is here
#define __ANDROID_API__ 23
        ^

The issue is cleared by removing the function android_ndk from 15-android.conf.

A sample build with the noisy warnings is available here

warning: '__ANDROID_API__' macro redefined
@noloader noloader changed the title Fix OpenSSL corss-compaile warnings Fix OpenSSL cross-compaile warnings Mar 25, 2020
@@ -65,7 +84,7 @@ case "$AOSP_CPU" in
CXXFLAGS="-march=armv7-a -mthumb -mfloat-abi=softfp -funwind-tables -fexceptions -frtti"
;;

armv8|armv8a|aarch64|arm64|arm64-v8a)
armv8*|aarch64|arm64)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was it supposed to be arm64* here or the change is indeed intended?
The arm64-v8a option is not accounted for anymore but I also see that we don't use it with travis.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe Android uses arm64 alone. But arm64* should be fine too. arm64* will help users who do something like ANDROID_CPU=arm64-v8a. I'd make the change if I were you.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor Author

@noloader noloader Mar 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gthess, I grabbed the change for Crypto++ at Commit ccb3e869eddd. Thanks.

gthess added a commit that referenced this pull request Mar 25, 2020
- Merge PR #201 from noloader: Fix OpenSSL cross-compaile warnings.
@gthess gthess merged commit c228e0a into NLnetLabs:master Mar 25, 2020
@noloader noloader deleted the android branch March 26, 2020 14:30
noloader referenced this pull request in weidai11/cryptopp Mar 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants