I'm working on an Android platform build with android-4.4_r1 (KRT16S). I can compile the source (it's a big project) into a *.so file without any trouble.
If I try to build the source into a command line executable with include $(BUILD_EXECUTABLE)
(basically just wrapping the library with a command line interface), I run into the following errors when linking:
out/target/product/flo/obj/lib/libssl.so: error: undefined reference to '__strlen_chk'
out/target/product/flo/obj/lib/libssl.so: error: undefined reference to '__strchr_chk'
out/target/product/flo/obj/lib/libcrypto.so: error: undefined reference to '__strrchr_chk'
out/target/product/flo/obj/lib/libcrypto.so: error: undefined reference to '__sprintf_chk'
out/target/product/flo/obj/lib/libcrypto.so: error: undefined reference to '__strcat_chk'
I've seen reference to this problem here and here, but I'm not sure how to fix it. Do I need to build openssl differently to work in the executable?
Update
This is how I built openssl:
- repo init -u https://android.googlesource.com/platform/manifest -b android-4.4_r1.2
- repo sync
- source build/envsetup.sh
- lunch full_flo-eng
- cd into the openssl directory
- mm -B
I didn't follow any outside directions. I just used what was provided in the repo.
__strlen_chk
is part ofFORTIFY_SOURCE
. How did you build OpenSSL? Did you follow the instructions at OpenSSL and Android? Show at least one compile command witharm-linux-androideabi-gcc
. Are you usingANDROID_SYSROOT
? – jww