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

Build for Android with Clang #2229

Closed
wants to merge 1 commit into from
Closed

Build for Android with Clang #2229

wants to merge 1 commit into from

Conversation

yan12125
Copy link

Checklist
  • documentation is added or updated
  • tests are added or updated
  • CLA is signed
Description of change

Add support for building for Android with NDK's clang. Targets master yet I guess 1.1 branch can be applied as well.

Documentation incomplete. See util/configure-android.sh and .travis.yml for usage of ./Configure. See also https://travis-ci.org/yan12125/openssl/builds/191712918 for a test build.

@kroeckx
Copy link
Member

kroeckx commented Jan 15, 2017

So this currently adds 12 new travis targets that only build. I'm not sure that it's useful to try and build all those targets. Is it possible to run the test suite for any of them?

@@ -170,10 +170,10 @@ HTMLSUFFIX=html


CROSS_COMPILE= {- $config{cross_compile_prefix} -}
CC= $(CROSS_COMPILE){- $target{cc} -}
CC= {- $target{cc} -}
Copy link
Member

Choose a reason for hiding this comment

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

This will most likely break things, nor do I see why you're removing it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Presumably reason is that you cross-compile by calling clang with no prefix. Instead you rely on -target option...

Anyway, I'd also say that this is inappropriate. Instead just don't set any CROSS_COMPILE variable when using clang.

@dot-asm
Copy link
Contributor

dot-asm commented Jan 15, 2017

I've been looking at travis config. This adds whole hour of CPU time. It's hardly appropriate. Ironic thing is that significant portion of time is used unpacking NDK zip (in each build), as well as installing compilers that won't be used... But even if optimized, I'd also say that we should pick just one target for continuous testing. I suppose clang would be most appropriate since they apparently plan to eventually remove gcc from NDK...

@richsalz
Copy link
Contributor

I agree we don't want to add all those build-only targets. At most one. And all those android config targets should all be moved into a separate file.

@yan12125
Copy link
Author

Thanks for all the feedbacks. Please let me explain them one by one.

About bloated .travis.yml: Agreed. I removed those new Travis targets. At first I put them there just to verify that my patches works fine. Actually, I test openssl for android in my repo from time to time, so I don't miss any breakages in openssl.

In response to @kroeckx's comment:

Is it possible to run the test suite for any of them?

Currently I use the Termux app to get a working copy of Perl on Android. Unfortunately, seems it doesn't provide useful APIs to control it - human operations are necessary to get openssl's test suite running on Android.

About the problem of $CROSS_COMPILE: First, nothing will get broken as those variables are not removed. Instead, they're moved from unix-Makefile.tmpl to Configure. Second, in unix-Makefile.tmpl, AR and RANLIB relies on CROSS_COMPILE. Without CROSS_COMPILE, I have to set at least AR and RANLIB to get correct commands. For example,

AR=aarch64-linux-android-ar
RANLIB=aarch64-linux-android-ranlib

If that sounds fine, I'll drop CROSS_COMPILE-related patches.

Last, about @richsalz's comment:

And all those android config targets should all be moved into a separate file.

Reasonable. What's the naming convention for files in Configurations? Is "50-android.conf" a good name?

@dot-asm
Copy link
Contributor

dot-asm commented Jan 16, 2017

Is it possible to run the test suite for any of them?

... [no] ...

This is not strictly true. If linked statically OpenSSL Android binaries can be executed on Linux host. If Android target is x86[_64], then make test works as is. If target is non-x86, then it's possible to use qemu by setting up EXE_SHELL environment variable. [That's how MIPS64R6 support was tested.] Note that I didn't say that make works as is, only make test. As for make, even though it's possible to pass -static flag to Configure(*), resulting Makefile needs minor fix-up, namely removal of -pie and -ldl flags to get binaries linked...

(*) -static alone is sufficient for Linux targets, and it's even possible to execute such binaries on Android units. [That's by the way how I usually perform ARM benchmarks.]

@dot-asm
Copy link
Contributor

dot-asm commented Jan 16, 2017

.. just don't set any CROSS_COMPILE variable when using clang.

AR and RANLIB relies on CROSS_COMPILE. Without CROSS_COMPILE, I have to set at least AR and RANLIB to get correct commands.

Or you can modify $PATH so that it uses target-specific un-prefixed tools. I mean there are un-prefixed binaries too, e.g. in toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/aarch64-linux-android/bin/...

Trouble with special treatment of CROSS_COMPILE triggered by a word clang is that it becomes less flexible and non-uniform. For example CROSS_COMPILE can as well be a directory name, not necessarily platform-this-n-that-, so what happens if somebody wants to env CROSS_COMPILE=/my/platform/clang/bin/ ./Configure something?

@dot-asm
Copy link
Contributor

dot-asm commented Jan 16, 2017

Is "50-android.conf" a good name?

I'd vote for 20-android.conf to denote that it's not exclusively community-supported targets. I mean 10-* is what we officially support(*), 50-* and following are de-facto community-supported, not regularly supported and unsupported stuff...

(*) modulo fact that there are few legacy platforms that we don't actually know if they work, and intension is to move them out as we gather information about them.

@@ -893,7 +893,7 @@ sub vms_info {
# CROSS_COMPILE=arm-linux-adroideabi-
# PATH=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.8/prebuild/linux-x86_64/bin
#
"android" => {
"android-base" => {
inherit_from => [ "linux-generic32" ],
Copy link
Contributor

Choose a reason for hiding this comment

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

Do use template => 1 in intermediate targets!

Copy link
Author

Choose a reason for hiding this comment

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

Done!

"android-armeabi" => {
inherit_from => [ "android", asm("armv4_asm") ],
"android-armeabi-base" => {
inherit_from => [ asm("armv4_asm") ],
Copy link
Contributor

Choose a reason for hiding this comment

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

This are practically indistinguishable from assemby module templates. One can argue that there should be common ELF-specific templates that can be used in both Linux and Android targets. Meanwhile I'd suggest to omit them and inherit directly from *_asm in compiler-specific targets. Yes, there will be duplicates, but as already said, it makes more sense to unify all ELF targets, which would be separate effort.

Copy link
Author

Choose a reason for hiding this comment

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

I feel this strange. Take android-mips-base for example:

    "android-mips-base" => {
        inherit_from     => [ asm("mips32_asm") ],
        template         => 1,
        perlasm_scheme   => "o32",
    },

I thought perlasm_scheme => "o32" is an extra directive for asm("mips32_asm")? Move asm("mips32_asm") to compiler-specific targets sounds strange. Or I should move perlasm_scheme as well?

Copy link
Contributor

@dot-asm dot-asm Jan 22, 2017

Choose a reason for hiding this comment

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

Move asm("mips32_asm") to compiler-specific targets sounds strange.

Not to seasoned MIPS programmer :-) Normally, i.e. in cases other than Android, MIPS systems support multiple ABIs. And in such cases you'd actually "tie" perlasm_scheme and compiler flags together, i.e. they have to match. But my objection is really more about minimizing templates. It does make code more readable. I mean when you look at say android-mips, you have to unravel one less template. And it's also better for sheer amount of lines. I mean pair of perlasm_scheme in android-mips and android-mips-clang is shorter than template...

Copy link
Contributor

Choose a reason for hiding this comment

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

when you look at say android-mips, you have to unravel one less template.

I meant "you would have to unravel one less template [if there was no android-mips-base]".

inherit_from => [ "android-base" ],
cc => "clang",
cxx => "clang++",
cflags => add(picker(default => "-gcc-toolchain \$(GCC_TOOLCHAIN) -fno-integrated-as")),
Copy link
Contributor

Choose a reason for hiding this comment

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

As for -fno-integrated-as. Is it actually so that all platforms "require" it? "Require" in quotes is reference to the fact that there was bug reported with ARM (right?) integrated clang assembler. If only single platform is problematic, then I'd argue that only that one should get the flag...

Copy link
Author

Choose a reason for hiding this comment

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

Currently on NDK r14 beta 1, arm, aarch64 mips and x86 requires it, so I add -fno-integrated-as to those targets.
Here are failing commands in those targets: errors.txt. I guess x86 and mips can be fixed in NDK or LLVM. For it's fixed I suggest disabling integrated assemblers.

"android64-x86_64" => {
inherit_from => [ "android64", asm("x86_64_asm") ],
"android64-x86_64-base" => {
inherit_from => [ asm("x86_64_asm") ],
Copy link
Contributor

Choose a reason for hiding this comment

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

There actually is a bug here. Not contributor's fault! It was there all along. One has to omit RC4_CHAR inherited from linux-generic64...

@yan12125
Copy link
Author

This is not strictly true. If linked statically OpenSSL Android binaries can be executed on Linux host

First, I don't think running Android binaries on Linux brings persuasive test results. Unlike ELF on FreeBSD or PE/PE+ on Unix (via Wine), Linux is not designed to be compatible with Android binaries. Second, static builds are broken (android/ndk#272)

Trouble with special treatment of CROSS_COMPILE triggered by a word clang is that it becomes less flexible and non-uniform.

Got it. I remove CROSS_COMPILE related changes.

I'd vote for 20-android.conf

Done!

@petrovr
Copy link

petrovr commented Jan 22, 2017

Modification is difficult to read - to understand modification I have to split into 2 parts : to extract existing android targets into new file and then updates from this issue.
Main modification is to add a lot of templates bases on existing configurations.
It seems to me main idea of templates is to use flag -mandroid for gcc and -target LLVM_TRIPLET for clang.

Question is why to use -mandroid for gcc?
In GCC online documentation for first time in version 4.6 we could find option documented as "-mandroid: Compile code compatible with Android platform. This is the default on ‘--linux-android’ targets. When compiling, this option enables -mbionic, -fPIC, -fno-exceptions and -fno-rtti by default. .." .
It seems to me option is required for GCC pre 4.6 releases.
My oldest installed NDK version is r10d(December 2014) with gcc 4.6, 4.8 and 4.9 and current stable r13b is with gcc 4.9.

I think that removing option -mandroid is enough to allow build with clang. Users of oldest gcc has to specify -mandroid and clang users should use -target LLVM_TRIPLET.
In both cases users has to override compiler (CC). Cross-compile prefix is not enough.

@yan12125
Copy link
Author

In *-clang targets, there are more flags than -target, for example -fno-integrated-as. It sounds a bad idea to force OpenSSL users to understand which targets require -fno-integrated-as.

Question is why to use -mandroid for gcc?

I guess OpenSSL aims to support as old toolchains as possible without bothering users with compiler internals.

@dot-asm
Copy link
Contributor

dot-asm commented Jan 22, 2017

Question is why to use -mandroid for gcc?

I guess OpenSSL aims to support as old toolchains as possible without bothering users with compiler internals.

Right.

@dot-asm
Copy link
Contributor

dot-asm commented Jan 22, 2017

clang users should use -target LLVM_TRIPLET.

It's safer to put it into config than to let user mistype it. Well, user still has a number of environment variables to get wrong, but goal is to minimize amount of things to get wrong, not to maximize. Besides the triplet is tied to assembly pack, so that it's really not something that user is free to mix-n-match.

In both cases users has to override compiler (CC). Cross-compile prefix is not enough.

??? Cross-compile prefix is enough with gcc. As for clang suggestion is to not set cross-compile prefix, but manipulate PATH so that you have clang as well as un-prefixed tools such as ar and ranlib. It does work. Yeah, it's inconsistent, but what can one do?

@dot-asm
Copy link
Contributor

dot-asm commented Jan 22, 2017

This is not strictly true. If linked statically OpenSSL Android binaries can be executed on Linux host

First, I don't think running Android binaries on Linux brings persuasive test results. Unlike ELF on FreeBSD or PE/PE+ on Unix (via Wine), Linux is not designed to be compatible with Android binaries.

When it comes to statically linked executable it all boils down to system call numbers. So the question is if Android changes any of Linux system call numbers, even more specifically those used by OpenSSL test suite. And there is a lot of evidence that it doesn't. As already mentioned, 'make test' does run and produced meaningful output on Linux, be it native or qemu-user-assisted. The keyword, again, is that Android is built on top of Linux kernel and [most of] its user-kernel interface is unmodified. Also once again note that we are not looking at arbitrary Android application, but specifically at OpenSSL test programs which are just "console" applications.

Second, static builds are broken (android/ndk#272)

Well, this of course can be problematic. But I'd count on linker to tell me when it becomes impossible to use them. I mean as long as one can link and as long as tests produce meaningful result, I see no reason not to trust them.

@dot-asm
Copy link
Contributor

dot-asm commented Jan 23, 2017

I think that removing option -mandroid is enough to allow build with clang. Users of oldest gcc has to specify -mandroid and clang users should use -target LLVM_TRIPLET.

In other words suggestion is to have unified Android target[s] and put responsibility of setting CC environment variable and passing compiler-specific things like -target at config-time on user. While this is an option, and there is kind of "tradition" to give users quite a bit of power at config-time, I'd say that the said "tradition" is not really about unconstrained flexibility. I mean there are boundaries for the provided flexibility. This of course asks for question where/how to draw this boundary. For example there is no boundary between gcc and clang on Linux, right? In sense that there is no dedicated clang target and you can switch to clang by setting CC environment variable. Yes, but in such "traditional" case we are looking at so to say single-triplet installations, and there are no additional tidbits that have to be tied up together. This is not case here, as already mentioned, the triplet has to match assembly pack (and not to forget integrated-as limitation), and I'd say that arranging dedicated clang targets is justified here...

@petrovr
Copy link

petrovr commented Jan 23, 2017 via email

@petrovr
Copy link

petrovr commented Jan 23, 2017 via email

@petrovr
Copy link

petrovr commented Jan 23, 2017 via email

@petrovr
Copy link

petrovr commented Jan 23, 2017

Some initial comments on build with llvm (after remove of -mandroid).

  1. Build pass without modification for ABI arm64-v8a, mips64 and x86_64. This is because minimum platform version is 21.

  2. Build fail for armeabi-v7a, mips and x86 if platform is less then 21. Issue is from stdatomic.h , in following statement:
    ..............................
    #if STDC_VERSION >= 201112L
    # include <uchar.h> /* For char16_t and char32_t. */
    #endif
    ..............................
    Header uchar.h does not exist in platforms before 21.
    With flag -std=c99 build fail in assembler :(
    As work around I could build with -D__STDC_NO_ATOMICS__

  3. Work-around from b) does not work for ABI armeabi, dur to unresolved externals to many __atomic... functions. Perhaps related to compiler flags as my build script use "... -march=armv5te -mtune=xscale -msoft-float -mthumb ..." similar and native build in android studio.

Build of master branch succeed with gcc 4.9 for all 7 ABI-filters.
I guess that gcc build with flag -std=c11 fail if platforms is less then 21 but this case is not tested yet.

@dot-asm
Copy link
Contributor

dot-asm commented Jan 23, 2017

My opinion is do not share responsibility between openssl configuration and user build command.

Well, following this logic we don't need any config lines whatsoever. Why not let user specify everything? I'm talking about everything, not just Android :-) Yes, I recognize that user has enough ways to screw it up by setting wrong environment variables, yet, I'd consider retaining control over things we can reliably control as desirable. "triplet matching assembly pack" means that you can't use -target i686-none-linux-android with ARM pack. But I think I see your point now. You're saying that there is need for specifying distinct -targets for same assembly pack, more specifically ARMv4 pack. Right? In gcc case you have freedom to pass additional -march or -D__ARM_MAX_ARCH__=8 at config-time and former is not an option in current suggestion. Yes, that needs additional consideration...

@yan12125
Copy link
Author

Header uchar.h does not exist in platforms before 21.

Platform headers in platforms/android-X/arch-Y/usr/include are not reliable. Use unified headers instead - this is my next goal after this PR.

Also, I'd like to hear NDK developers for Clang bugs (?) on x86 and MIPS before moving on.
android/ndk#285
android/ndk#286

yan12125 pushed a commit to yan12125/python3-android that referenced this pull request Mar 21, 2017
yan12125 pushed a commit to yan12125/python3-android that referenced this pull request Mar 21, 2017
@openssl-machine openssl-machine added the hold: cla required The contributor needs to submit a license agreement label Mar 21, 2017
@yan12125
Copy link
Author

Hello, NDK r14 is out, and the aforementioned two bugs are still in the NDK, so -fno-integrated-as workaround is still necessary. I think this pull request is ready for a second review.

For CLA: I'll read it and submit it soon

@yan12125 yan12125 changed the title [WIP] Build for Android with Clang Build for Android with Clang Mar 21, 2017
@openssl-machine openssl-machine added the hold: cla required The contributor needs to submit a license agreement label Mar 21, 2017
leap-code-o-matic pushed a commit to leapcode/bitmask_android that referenced this pull request May 4, 2017
* PROBLEM:
  * most recent version (r14b) of `android-ndk` uses `clang` for cross-compilation
  * BUT: `openssl` cannot compile successfully w/ `clang`
  * AND: we depend on `openssl` transitively through `ics-openvpn`
    while trying to use `android-ndk` r14b

* FIX:
  * downgrade to `android-ndk` (12b) (most recent versoin that still
    uses `gcc` instead of `clang`)
  * modify some of the default

* REMAINING PROBLEMS:
  * some string translations for Jamaica now break the build (unclear
    why -- outdated country abbreviation? ja for jm???)
  * we are now using a version of ndk that is 2 versions old and a
    version of ics-openvpn (pinned to a 3.1.2016 commit via submodule)
    that depends on an outdated version of `openssl`, which raises
    security concerns. updating to the most recent version will force
    us to wade into all the dependency problems amongst `ics-openvpn`/`openssl`/`ndk`

* REFERENCES:
  * on `openssl` incompatibility w/ clang: openssl/openssl#2229
  * on `ics-openvpn` problems with `ndk`: android/ndk#144
@dtrembovetski
Copy link

Any hope of this landing soon?

@t-j-h
Copy link
Member

t-j-h commented Nov 10, 2017

This still needs a CLA in place ...

@dtrembovetski
Copy link

@yan12125 ndk r16 is out now, would it be possible to complete this?
@t-j-h Is there a path where someone with CLA could commandeer the request if the original poster is no longer interested/available?

@yan12125
Copy link
Author

I'm currently not working on this and I don't think I can continue it in near future. I have a local patch at https://github.com/yan12125/python3-android/blob/563bd3388b48c7cf5cfaee92339953b2e393fed6/mk/openssl/ndk-clang-targets.patch, which should work for NDK r16. If anyone wants to finish this PR, I guess it's legal to start from my local patch as the latter is released with WTFPL.

@harlanc
Copy link

harlanc commented Jan 12, 2018

@yan12125 hello,I just use clang to build openssl according to your PL but encounter some errors.My environments are as follows:

  • OS macOS 10.13.2
  • openssl version : 1.1.0 stable.
  • NDK version. r14b
  • cross-compile platform android armv7a

I just update the two conf files: 10-main.conf and 20-android.conf,the option about pick os/compiler from: is android-armeabi-clang.When issue ./Configure,I found that two variables cannot get the values:

  • $(CROSS_SYSROOT) and $(GCC_TOOLCHAIN)

so I input them in 20-android.conf manually. The configure results are as follows:

`./Configure zlib-dynamic no-shared --openssldir=/Users/zexu/github/ijkplayer/android/contrib/build/openssl-armv7a/output --cross-compile-prefix=arm-linux-androideabi- android-armeabi-clang
Configuring OpenSSL version 1.1.0h-dev (0x10100080L)
no-asan [default] OPENSSL_NO_ASAN
no-crypto-mdebug [default] OPENSSL_NO_CRYPTO_MDEBUG
no-crypto-mdebug-backtrace [default] OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
no-dynamic-engine [forced]
no-ec_nistp_64_gcc_128 [default] OPENSSL_NO_EC_NISTP_64_GCC_128
no-egd [default] OPENSSL_NO_EGD
no-fuzz-afl [default] OPENSSL_NO_FUZZ_AFL
no-fuzz-libfuzzer [default] OPENSSL_NO_FUZZ_LIBFUZZER
no-heartbeats [default] OPENSSL_NO_HEARTBEATS
no-md2 [default] OPENSSL_NO_MD2 (skip dir)
no-msan [default] OPENSSL_NO_MSAN
no-rc5 [default] OPENSSL_NO_RC5 (skip dir)
no-sctp [default] OPENSSL_NO_SCTP
no-shared [option]
no-ssl-trace [default] OPENSSL_NO_SSL_TRACE
no-ssl3 [default] OPENSSL_NO_SSL3
no-ssl3-method [default] OPENSSL_NO_SSL3_METHOD
no-ubsan [default] OPENSSL_NO_UBSAN
no-unit-test [default] OPENSSL_NO_UNIT_TEST
no-weak-ssl-ciphers [default] OPENSSL_NO_WEAK_SSL_CIPHERS
Configuring for android-armeabi-clang
CC =arm-linux-androideabi-clang
CFLAG =-Wall -O3 -pthread -fPIC --sysroot=/Users/zexu/github/ijkplayer/android/contrib/build/openssl-armv7a/toolchain/sysroot -Wa,--noexecstack -gcc-toolchain /Users/zexu/github/ijkplayer/android/contrib/build/openssl-armv7a/toolchain -target armv7-none-linux-androideabi -fno-integrated-as
SHARED_CFLAG =-fPIC -DOPENSSL_USE_NODELETE
DEFINES =ZLIB ZLIB_SHARED DSO_DLFCN HAVE_DLFCN_H NDEBUG OPENSSL_THREADS OPENSSL_NO_DYNAMIC_ENGINE OPENSSL_PIC OPENSSL_BN_ASM_MONT OPENSSL_BN_ASM_GF2m SHA1_ASM SHA256_ASM SHA512_ASM AES_ASM BSAES_ASM GHASH_ASM ECP_NISTZ256_ASM POLY1305_ASM
LFLAG =
PLIB_LFLAG =
EX_LIBS =-ldl
APPS_OBJ =
CPUID_OBJ =armcap.o armv4cpuid.o
UPLINK_OBJ =
BN_ASM =bn_asm.o armv4-mont.o armv4-gf2m.o
EC_ASM =ecp_nistz256.o ecp_nistz256-armv4.o
DES_ENC =des_enc.o fcrypt_b.o
AES_ENC =aes_cbc.o aes-armv4.o bsaes-armv7.o aesv8-armx.o
BF_ENC =bf_enc.o
CAST_ENC =c_enc.o
RC4_ENC =rc4_enc.o rc4_skey.o
RC5_ENC =rc5_enc.o
MD5_OBJ_ASM =
SHA1_OBJ_ASM =sha1-armv4-large.o sha256-armv4.o sha512-armv4.o
RMD160_OBJ_ASM=
CMLL_ENC =camellia.o cmll_misc.o cmll_cbc.o
MODES_OBJ =ghash-armv4.o ghashv8-armx.o
PADLOCK_OBJ =
CHACHA_ENC =chacha-armv4.o
POLY1305_OBJ =poly1305-armv4.o
BLAKE2_OBJ =
PROCESSOR =
RANLIB =arm-linux-androideabi-ranlib
ARFLAGS =
PERL =perl

THIRTY_TWO_BIT mode
BN_LLONG mode
RC4 uses unsigned char

Configured for android-armeabi-clang.


`

the compile is OK but link errors happen at last:

:; LIBDEPS="${LIBDEPS:--L. -lcrypto -ldl }"; LDCMD="${LDCMD:-arm-linux-androideabi-clang}"; LDFLAGS="${LDFLAGS:--DZLIB -DZLIB_SHARED -DDSO_DLFCN -DHAVE_DLFCN_H -DNDEBUG -DOPENSSL_THREADS -DOPENSSL_NO_DYNAMIC_ENGINE -DOPENSSL_PIC -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/Users/zexu/github/ijkplayer/android/contrib/build/openssl-armv7a/output\"" -DENGINESDIR="\"/usr/local/lib/engines-1.1\"" -Wall -O3 -pthread -fPIC --sysroot=/Users/zexu/github/ijkplayer/android/contrib/build/openssl-armv7a/toolchain/sysroot -Wa,--noexecstack -gcc-toolchain /Users/zexu/github/ijkplayer/android/contrib/build/openssl-armv7a/toolchain -target armv7-none-linux-androideabi -fno-integrated-as -pie }"; LIBPATH=for x in $LIBDEPS; do echo $x; done | sed -e 's/^ *-L//;t' -e d | uniq; LIBPATH=echo $LIBPATH | sed -e 's/ /:/g'; echo LD_LIBRARY_PATH=$LIBPATH:$LD_LIBRARY_PATH ${LDCMD} ${LDFLAGS} -o ${APPNAME:=fuzz/asn1-test} fuzz/asn1.o fuzz/test-corpus.o ${LIBDEPS}; LD_LIBRARY_PATH=$LIBPATH:$LD_LIBRARY_PATH ${LDCMD} ${LDFLAGS} -o ${APPNAME:=fuzz/asn1-test} fuzz/asn1.o fuzz/test-corpus.o ${LIBDEPS} ) make[2]: Entering directory /Users/zexu/github/ijkplayer/android/contrib/openssl-armv7a'
( :; LIBDEPS="${LIBDEPS:--L. -lcrypto -ldl }"; LDCMD="${LDCMD:-arm-linux-androideabi-clang}"; LDFLAGS="${LDFLAGS:--DZLIB -DZLIB_SHARED -DDSO_DLFCN -DHAVE_DLFCN_H -DNDEBUG -DOPENSSL_THREADS -DOPENSSL_NO_DYNAMIC_ENGINE -DOPENSSL_PIC -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR=""/Users/zexu/github/ijkplayer/android/contrib/build/openssl-armv7a/output"" -DENGINESDIR=""/usr/local/lib/engines-1.1"" -Wall -O3 -pthread -fPIC --sysroot=/Users/zexu/github/ijkplayer/android/contrib/build/openssl-armv7a/toolchain/sysroot -Wa,--noexecstack -gcc-toolchain /Users/zexu/github/ijkplayer/android/contrib/build/openssl-armv7a/toolchain -target armv7-none-linux-androideabi -fno-integrated-as -pie }"; LIBPATH=for x in $LIBDEPS; do echo $x; done | sed -e 's/^ *-L//;t' -e d | uniq; LIBPATH=echo $LIBPATH | sed -e 's/ /:/g'; echo LD_LIBRARY_PATH=$LIBPATH:$LD_LIBRARY_PATH ${LDCMD} ${LDFLAGS} -o ${APPNAME:=fuzz/bignum-test} fuzz/bignum.o fuzz/test-corpus.o ${LIBDEPS}; LD_LIBRARY_PATH=$LIBPATH:$LD_LIBRARY_PATH ${LDCMD} ${LDFLAGS} -o ${APPNAME:=fuzz/bignum-test} fuzz/bignum.o fuzz/test-corpus.o ${LIBDEPS} )
make[2]: Entering directory /Users/zexu/github/ijkplayer/android/contrib/openssl-armv7a' ( :; LIBDEPS="${LIBDEPS:--L. -lcrypto -ldl }"; LDCMD="${LDCMD:-arm-linux-androideabi-clang}"; LDFLAGS="${LDFLAGS:--DZLIB -DZLIB_SHARED -DDSO_DLFCN -DHAVE_DLFCN_H -DNDEBUG -DOPENSSL_THREADS -DOPENSSL_NO_DYNAMIC_ENGINE -DOPENSSL_PIC -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/Users/zexu/github/ijkplayer/android/contrib/build/openssl-armv7a/output\"" -DENGINESDIR="\"/usr/local/lib/engines-1.1\"" -Wall -O3 -pthread -fPIC --sysroot=/Users/zexu/github/ijkplayer/android/contrib/build/openssl-armv7a/toolchain/sysroot -Wa,--noexecstack -gcc-toolchain /Users/zexu/github/ijkplayer/android/contrib/build/openssl-armv7a/toolchain -target armv7-none-linux-androideabi -fno-integrated-as -pie }"; LIBPATH=for x in $LIBDEPS; do echo $x; done | sed -e 's/^ *-L//;t' -e d | uniq; LIBPATH=echo $LIBPATH | sed -e 's/ /:/g'`; echo LD_LIBRARY_PATH=$LIBPATH:$LD_LIBRARY_PATH ${LDCMD} ${LDFLAGS} -o ${APPNAME:=fuzz/asn1parse-test} fuzz/asn1parse.o fuzz/test-corpus.o ${LIBDEPS}; LD_LIBRARY_PATH=$LIBPATH:$LD_LIBRARY_PATH ${LDCMD} ${LDFLAGS} -o ${APPNAME:=fuzz/asn1parse-test} fuzz/asn1parse.o fuzz/test-corpus.o ${LIBDEPS} )
LD_LIBRARY_PATH=.: arm-linux-androideabi-clang -DZLIB -DZLIB_SHARED -DDSO_DLFCN -DHAVE_DLFCN_H -DNDEBUG -DOPENSSL_THREADS -DOPENSSL_NO_DYNAMIC_ENGINE -DOPENSSL_PIC -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="/Users/zexu/github/ijkplayer/android/contrib/build/openssl-armv7a/output" -DENGINESDIR="/usr/local/lib/engines-1.1" -Wall -O3 -pthread -fPIC --sysroot=/Users/zexu/github/ijkplayer/android/contrib/build/openssl-armv7a/toolchain/sysroot -Wa,--noexecstack -gcc-toolchain /Users/zexu/github/ijkplayer/android/contrib/build/openssl-armv7a/toolchain -target armv7-none-linux-androideabi -fno-integrated-as -pie -o fuzz/asn1parse-test fuzz/asn1parse.o fuzz/test-corpus.o -L. -lcrypto -ldl
LD_LIBRARY_PATH=.: arm-linux-androideabi-clang -DZLIB -DZLIB_SHARED -DDSO_DLFCN -DHAVE_DLFCN_H -DNDEBUG -DOPENSSL_THREADS -DOPENSSL_NO_DYNAMIC_ENGINE -DOPENSSL_PIC -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="/Users/zexu/github/ijkplayer/android/contrib/build/openssl-armv7a/output" -DENGINESDIR="/usr/local/lib/engines-1.1" -Wall -O3 -pthread -fPIC --sysroot=/Users/zexu/github/ijkplayer/android/contrib/build/openssl-armv7a/toolchain/sysroot -Wa,--noexecstack -gcc-toolchain /Users/zexu/github/ijkplayer/android/contrib/build/openssl-armv7a/toolchain -target armv7-none-linux-androideabi -fno-integrated-as -pie -o fuzz/bignum-test fuzz/bignum.o fuzz/test-corpus.o -L. -lcrypto -ldl
LD_LIBRARY_PATH=.: arm-linux-androideabi-clang -DZLIB -DZLIB_SHARED -DDSO_DLFCN -DHAVE_DLFCN_H -DNDEBUG -DOPENSSL_THREADS -DOPENSSL_NO_DYNAMIC_ENGINE -DOPENSSL_PIC -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="/Users/zexu/github/ijkplayer/android/contrib/build/openssl-armv7a/output" -DENGINESDIR="/usr/local/lib/engines-1.1" -Wall -O3 -pthread -fPIC --sysroot=/Users/zexu/github/ijkplayer/android/contrib/build/openssl-armv7a/toolchain/sysroot -Wa,--noexecstack -gcc-toolchain /Users/zexu/github/ijkplayer/android/contrib/build/openssl-armv7a/toolchain -target armv7-none-linux-androideabi -fno-integrated-as -pie -o fuzz/asn1-test fuzz/asn1.o fuzz/test-corpus.o -L. -lcrypto -ldl
clang38clang38clang38: : : warningwarningwarning: : : argument unused during compilation: '-Wa,--noexecstack'argument unused during compilation: '-Wa,--noexecstack'argument unused during compilation: '-Wa,--noexecstack'

./libcrypto.a(armcap.o):crypto/armcap.c:function OPENSSL_rdtsc: error: undefined reference to '_armv7_tick'
./libcrypto.a(armcap.o):crypto/armcap.c:function OPENSSL_rdtsc: error: undefined reference to '_armv7_tick'
./libcrypto.a(armcap.o):crypto/armcap.c:function OPENSSL_cpuid_setup: error: undefined reference to '_armv7_neon_probe'
./libcrypto.a(armcap.o):crypto/armcap.c:function OPENSSL_cpuid_setup: error: undefined reference to '_armv8_aes_probe'
./libcrypto.a(armcap.o):crypto/armcap.c:function OPENSSL_cpuid_setup: error: undefined reference to '_armv7_neon_probe'
./libcrypto.a(armcap.o):crypto/armcap.c:function OPENSSL_cpuid_setup: error: undefined reference to '_armv8_pmull_probe'
./libcrypto.a(armcap.o):crypto/armcap.c:function OPENSSL_cpuid_setup: error: undefined reference to '_armv8_aes_probe'
./libcrypto.a(armcap.o):crypto/armcap.c:function OPENSSL_cpuid_setup: error: undefined reference to '_armv8_sha1_probe'
./libcrypto.a(armcap.o):crypto/armcap.c:function OPENSSL_cpuid_setup: error: undefined reference to '_armv8_pmull_probe'
./libcrypto.a(armcap.o):crypto/armcap.c:function OPENSSL_cpuid_setup: error: undefined reference to '_armv8_sha1_probe'
./libcrypto.a(armcap.o):crypto/armcap.c:function OPENSSL_cpuid_setup: error: undefined reference to '_armv8_sha256_probe'
./libcrypto.a(armcap.o):crypto/armcap.c:function OPENSSL_cpuid_setup: error: undefined reference to '_armv7_tick'
./libcrypto.a(armcap.o):crypto/armcap.c:function OPENSSL_cpuid_setup: error: undefined reference to '_armv8_sha256_probe'
./libcrypto.a(armcap.o):crypto/armcap.c:function OPENSSL_cpuid_setup: error: undefined reference to '_armv7_tick'
./libcrypto.a(armcap.o):crypto/armcap.c:function OPENSSL_rdtsc: error: undefined reference to '_armv7_tick'
./libcrypto.a(armcap.o):crypto/armcap.c:function OPENSSL_cpuid_setup: error: undefined reference to '_armv7_neon_probe'
./libcrypto.a(armcap.o):crypto/armcap.c:function OPENSSL_cpuid_setup: error: undefined reference to '_armv8_aes_probe'
./libcrypto.a(armcap.o):crypto/armcap.c:function OPENSSL_cpuid_setup: error: undefined reference to '_armv8_pmull_probe'
./libcrypto.a(armcap.o):crypto/armcap.c:function OPENSSL_cpuid_setup: error: undefined reference to '_armv8_sha1_probe'
./libcrypto.a(armcap.o):crypto/armcap.c:function OPENSSL_cpuid_setup: error: undefined reference to '_armv8_sha256_probe'
./libcrypto.a(armcap.o):crypto/armcap.c:function OPENSSL_cpuid_setup: error: undefined reference to '_armv7_tick'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_init_key: error: undefined reference to 'aes_v8_set_decrypt_key'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_init_key: error: undefined reference to 'aes_v8_set_encrypt_key'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_init_key: error: undefined reference to 'bsaes_cbc_encrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_init_key: error: undefined reference to 'aes_v8_decrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_init_key: error: undefined reference to 'aes_v8_cbc_encrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_init_key: error: undefined reference to 'bsaes_ctr32_encrypt_blocks'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_init_key: error: undefined reference to 'aes_v8_encrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_init_key: error: undefined reference to 'aes_v8_ctr32_encrypt_blocks'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_init_key: error: undefined reference to 'aes_v8_cbc_encrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_gcm_init_key: error: undefined reference to 'aes_v8_set_encrypt_key'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_gcm_init_key: error: undefined reference to 'aes_v8_encrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_gcm_init_key: error: undefined reference to 'aes_v8_ctr32_encrypt_blocks'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_gcm_init_key: error: undefined reference to 'bsaes_ctr32_encrypt_blocks'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_xts_init_key: error: undefined reference to 'aes_v8_set_encrypt_key'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_xts_init_key: error: undefined reference to 'aes_v8_set_decrypt_key'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_xts_init_key: error: undefined reference to 'aes_v8_set_encrypt_key'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_xts_init_key: error: undefined reference to 'aes_v8_encrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_xts_init_key: error: undefined reference to 'aes_v8_decrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_xts_init_key: error: undefined reference to 'aes_v8_encrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_xts_init_key: error: undefined reference to 'bsaes_xts_decrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_xts_init_key: error: undefined reference to 'bsaes_xts_encrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_ocb_init_key: error: undefined reference to 'aes_v8_set_decrypt_key'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_ocb_init_key: error: undefined reference to 'aes_v8_decrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_init_key: error: undefined reference to 'aes_v8_set_decrypt_key'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_init_key: error: undefined reference to 'aes_v8_set_encrypt_key'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_init_key: error: undefined reference to 'bsaes_cbc_encrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_init_key: error: undefined reference to 'aes_v8_decrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_init_key: error: undefined reference to 'aes_v8_cbc_encrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_init_key: error: undefined reference to 'bsaes_ctr32_encrypt_blocks'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_init_key: error: undefined reference to 'aes_v8_encrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_init_key: error: undefined reference to 'aes_v8_ctr32_encrypt_blocks'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_init_key: error: undefined reference to 'aes_v8_cbc_encrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_gcm_init_key: error: undefined reference to 'aes_v8_set_encrypt_key'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_gcm_init_key: error: undefined reference to 'aes_v8_encrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_gcm_init_key: error: undefined reference to 'aes_v8_ctr32_encrypt_blocks'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_gcm_init_key: error: undefined reference to 'bsaes_ctr32_encrypt_blocks'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_xts_init_key: error: undefined reference to 'aes_v8_set_encrypt_key'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_xts_init_key: error: undefined reference to 'aes_v8_set_decrypt_key'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_xts_init_key: error: undefined reference to 'aes_v8_set_encrypt_key'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_xts_init_key: error: undefined reference to 'aes_v8_encrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_xts_init_key: error: undefined reference to 'aes_v8_decrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_xts_init_key: error: undefined reference to 'aes_v8_encrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_xts_init_key: error: undefined reference to 'bsaes_xts_decrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_xts_init_key: error: undefined reference to 'bsaes_xts_encrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_ocb_init_key: error: undefined reference to 'aes_v8_set_decrypt_key'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_ocb_init_key: error: undefined reference to 'aes_v8_decrypt'
./libcrypto.a(gcm128.o):crypto/modes/gcm128.c:function CRYPTO_gcm128_init: error: undefined reference to 'gcm_init_neon'
./libcrypto.a(gcm128.o):crypto/modes/gcm128.c:function CRYPTO_gcm128_init: error: undefined reference to 'gcm_ghash_neon'
./libcrypto.a(gcm128.o):crypto/modes/gcm128.c:function CRYPTO_gcm128_init: error: undefined reference to 'gcm_gmult_neon'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_init_key: error: undefined reference to 'aes_v8_set_decrypt_key'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_init_key: error: undefined reference to 'aes_v8_set_encrypt_key'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_init_key: error: undefined reference to 'bsaes_cbc_encrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_init_key: error: undefined reference to 'aes_v8_decrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_init_key: error: undefined reference to 'aes_v8_cbc_encrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_init_key: error: undefined reference to 'bsaes_ctr32_encrypt_blocks'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_init_key: error: undefined reference to 'aes_v8_encrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_init_key: error: undefined reference to 'aes_v8_ctr32_encrypt_blocks'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_init_key: error: undefined reference to 'aes_v8_cbc_encrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_gcm_init_key: error: undefined reference to 'aes_v8_set_encrypt_key'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_gcm_init_key: error: undefined reference to 'aes_v8_encrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_gcm_init_key: error: undefined reference to 'aes_v8_ctr32_encrypt_blocks'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_gcm_init_key: error: undefined reference to 'bsaes_ctr32_encrypt_blocks'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_xts_init_key: error: undefined reference to 'aes_v8_set_encrypt_key'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_xts_init_key: error: undefined reference to 'aes_v8_set_decrypt_key'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_xts_init_key: error: undefined reference to 'aes_v8_set_encrypt_key'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_xts_init_key: error: undefined reference to 'aes_v8_encrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_xts_init_key: error: undefined reference to 'aes_v8_decrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_xts_init_key: error: undefined reference to 'aes_v8_encrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_xts_init_key: error: undefined reference to 'bsaes_xts_decrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_xts_init_key: error: undefined reference to 'bsaes_xts_encrypt'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_ocb_init_key: error: undefined reference to 'aes_v8_set_decrypt_key'
./libcrypto.a(e_aes.o):crypto/evp/e_aes.c:function aes_ocb_init_key: error: undefined reference to 'aes_v8_decrypt'
./libcrypto.a(gcm128.o):crypto/modes/gcm128.c:function CRYPTO_gcm128_init: error: undefined reference to 'gcm_init_neon'
./libcrypto.a(gcm128.o):crypto/modes/gcm128.c:function CRYPTO_gcm128_init: error: undefined reference to 'gcm_ghash_neon'
./libcrypto.a(gcm128.o):crypto/modes/gcm128.c:function CRYPTO_gcm128_init: error: undefined reference to 'gcm_gmult_neon'
./libcrypto.a(gcm128.o):crypto/modes/gcm128.c:function CRYPTO_gcm128_init: error: undefined reference to 'gcm_init_neon'
./libcrypto.a(gcm128.o):crypto/modes/gcm128.c:function CRYPTO_gcm128_init: error: undefined reference to 'gcm_ghash_neon'
./libcrypto.a(gcm128.o):crypto/modes/gcm128.c:function CRYPTO_gcm128_init: error: undefined reference to 'gcm_gmult_neon'
clang38: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [link_app.] Error 1
clang38: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: Leaving directory /Users/zexu/github/ijkplayer/android/contrib/openssl-armv7a' make[1]: *** [fuzz/asn1-test] Error 2 make[1]: *** Waiting for unfinished jobs.... clang38: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [link_app.] Error 1 make[2]: Leaving directory /Users/zexu/github/ijkplayer/android/contrib/openssl-armv7a'
make[1]: *** [fuzz/bignum-test] Error 2
make[2]: *** [link_app.] Error 1
make[2]: Leaving directory /Users/zexu/github/ijkplayer/android/contrib/openssl-armv7a' make[1]: *** [fuzz/asn1parse-test] Error 2 make[1]: Leaving directory /Users/zexu/github/ijkplayer/android/contrib/openssl-armv7a'
make: *** [all] Error 2
`

can you please give me some tips about how to resolve this problem??

==========================================================================
update 2018.01.13. 17:02

  • I upgrade the NDK from r14b to r16b.

  • clean

  • make stand alone toolchain
    $ ./make-standalone-toolchain.sh --install-dir=/Users/zexu/github/ijkplayer/android/contrib/build/openssl-armv7a/toolchain --platform=android-23 --toolchain=arm-linux-androideabi-4.9

  • configure
    ./Configure zlib-dynamic no-shared --openssldir=/Users/zexu/github/ijkplayer/android/contrib/build/openssl-armv7a/output --cross-compile-prefix=arm-linux-androideabi- android-armeabi-clang Configuring OpenSSL version 1.1.0h-dev (0x10100080L) no-asan [default] OPENSSL_NO_ASAN no-crypto-mdebug [default] OPENSSL_NO_CRYPTO_MDEBUG no-crypto-mdebug-backtrace [default] OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE no-dynamic-engine [forced] no-ec_nistp_64_gcc_128 [default] OPENSSL_NO_EC_NISTP_64_GCC_128 no-egd [default] OPENSSL_NO_EGD no-fuzz-afl [default] OPENSSL_NO_FUZZ_AFL no-fuzz-libfuzzer [default] OPENSSL_NO_FUZZ_LIBFUZZER no-heartbeats [default] OPENSSL_NO_HEARTBEATS no-md2 [default] OPENSSL_NO_MD2 (skip dir) no-msan [default] OPENSSL_NO_MSAN no-rc5 [default] OPENSSL_NO_RC5 (skip dir) no-sctp [default] OPENSSL_NO_SCTP no-shared [option] no-ssl-trace [default] OPENSSL_NO_SSL_TRACE no-ssl3 [default] OPENSSL_NO_SSL3 no-ssl3-method [default] OPENSSL_NO_SSL3_METHOD no-ubsan [default] OPENSSL_NO_UBSAN no-unit-test [default] OPENSSL_NO_UNIT_TEST no-weak-ssl-ciphers [default] OPENSSL_NO_WEAK_SSL_CIPHERS Configuring for android-armeabi-clang CC =arm-linux-androideabi-clang CFLAG =-Wall -O3 -pthread -fPIC --sysroot=/Users/zexu/github/ijkplayer/android/contrib/build/openssl-armv7a/toolchain/sysroot -gcc-toolchain /Users/zexu/github/ijkplayer/android/contrib/build/openssl-armv7a/toolchain -target armv7-none-linux-androideabi -fno-integrated-as SHARED_CFLAG =-fPIC -DOPENSSL_USE_NODELETE DEFINES =ZLIB ZLIB_SHARED DSO_DLFCN HAVE_DLFCN_H NDEBUG OPENSSL_THREADS OPENSSL_NO_DYNAMIC_ENGINE OPENSSL_PIC OPENSSL_BN_ASM_MONT OPENSSL_BN_ASM_GF2m SHA1_ASM SHA256_ASM SHA512_ASM AES_ASM BSAES_ASM GHASH_ASM ECP_NISTZ256_ASM POLY1305_ASM LFLAG = PLIB_LFLAG = EX_LIBS =-ldl APPS_OBJ = CPUID_OBJ =armcap.o armv4cpuid.o UPLINK_OBJ = BN_ASM =bn_asm.o armv4-mont.o armv4-gf2m.o EC_ASM =ecp_nistz256.o ecp_nistz256-armv4.o DES_ENC =des_enc.o fcrypt_b.o AES_ENC =aes_cbc.o aes-armv4.o bsaes-armv7.o aesv8-armx.o BF_ENC =bf_enc.o CAST_ENC =c_enc.o RC4_ENC =rc4_enc.o rc4_skey.o RC5_ENC =rc5_enc.o MD5_OBJ_ASM = SHA1_OBJ_ASM =sha1-armv4-large.o sha256-armv4.o sha512-armv4.o RMD160_OBJ_ASM= CMLL_ENC =camellia.o cmll_misc.o cmll_cbc.o MODES_OBJ =ghash-armv4.o ghashv8-armx.o PADLOCK_OBJ = CHACHA_ENC =chacha-armv4.o POLY1305_OBJ =poly1305-armv4.o BLAKE2_OBJ = PROCESSOR = RANLIB =arm-linux-androideabi-ranlib ARFLAGS = PERL =perl

  • complile

echo ""
echo "--------------------"
echo "[*] compile openssl"
echo "--------------------"
make depend
make -j4
make install_sw

no erros appear this time ,but executable file openssl is not generated,but two static librarieslibcrypto.a and libssl.a are generated successfully. openssldir is empty

@petrovr
Copy link

petrovr commented Jan 13, 2018 via email

@yan12125
Copy link
Author

As both OpenSSL and Android NDK are changing fast, I'm not sure I have time catching up both. As a result, it's better to close this pull request to prevent more confusions. Thanks for all review comments and testing feedbacks.

@yan12125 yan12125 closed this Jan 13, 2018
@yan12125 yan12125 deleted the build-for-android-with-clang branch January 13, 2018 16:49
@jainabhinav249
Copy link

I am using android-ndk 14 and i am getting the clang:error: unknown argument: '-mandroid' when i am trying to build openssl can any one help me

@yan12125
Copy link
Author

yan12125 commented Mar 5, 2019

@jainabhinav249 https://github.com/openssl/openssl/blob/master/NOTES.ANDROID should be helpful. Also make sure you're using the latest OpenSSL 1.1.1. Older OpenSSL versions may not work fine with Android.

@jainabhinav249
Copy link

Thank you so much @yan12125

@MrCsabaToth
Copy link

So bitcoin/bitcoin#16110 is merged...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hold: cla required The contributor needs to submit a license agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet