简体   繁体   中英

Where is /system/bin/linker from NDK toolchain when cross compiling

I am attempting to build an autoconf project against the NDK toolchain on a CentOS host, so I can use the shared objects generated as part of a native-lib android application.

While compiling, I am receiving errors about a missing /system/bin/linker64 file. (bad ELF interpreter: No such file or directory)

Is this part of the NDK toolchain, and I can just sym-link /system/bin/linker64 to something in the toolchain, or to my CentOS dynamic linker, or what?

I set up my environment with:

$NDK/build/tools/make_standalone_toolchain.py \
  --arch x86_64\
  --api 26 \
  --install-dir=my-toolchain

and I have sourced this file to set my environment:

# Add the standalone toolchain to the search path.
export PATH=$PATH:`pwd`/my-toolchain/bin

# Tell configure what tools to use.
target_host=x86_64-linux-android
export AR=$target_host-ar
export AS=$target_host-clang
export CC=$target_host-clang
export CXX=$target_host-clang++
export LD=$target_host-ld
export STRIP=$target_host-strip

# Tell configure what flags Android requires.
export CFLAGS="-fPIE -fPIC"
export LDFLAGS="-pie

I have run run my configure script with

./configure --host=$target_host ....

Nowhere. That's not a part of the toolchain.

If you're seeing that as part of your build, it means something tried to run an Android binary on your host. That shouldn't have happened.

My guess: your autoconf project is set up to run the "does the compiler work" test binary, and doesn't understand that x86_64 Android is not the same as x86_64 GNU/Linux. I've seen this problem in other projects (gdbserver is the one that comes to mind).

You'll need to look closer at what is being run and why; there isn't enough information here to say with certainty what you need to fix.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM