1

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:

I didn't follow any outside directions. I just used what was provided in the repo.

2
  • __strlen_chk is part of FORTIFY_SOURCE. How did you build OpenSSL? Did you follow the instructions at OpenSSL and Android? Show at least one compile command with arm-linux-androideabi-gcc. Are you using ANDROID_SYSROOT? Commented Jun 4, 2014 at 22:18
  • I built the openssl that was part of android-4.4_r1. No special options, just used mmma on my project. I'm not sure whether or not I'm using ANDROID_SYSROOT (new to Android). Commented Jun 4, 2014 at 22:21

1 Answer 1

2

Try set D_FORTIFY_SOURCE=0 when building. I've solved this with libcurl, with details in the last part here http://qiankanglai.me/misc/2014/08/31/android-libcurl/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.