Reputation: 41
I'm getting this error when I try to link 64bit lib.
unsupported ELF machine number 183
I think since 32bit toolmachine is trying to link 64bit lib this error is coming. Does someone know how to overcome this?
Upvotes: 4
Views: 5094
Reputation: 759
Very old question, but I had recently the same problem when trying to compile a simple command-line application for Android NDK.
You have to make sure, all compilation parameters fit together: e.g. if you use 64 bit libs, you have to also use the 64 bit toolchain:
export NDK_ROOT=/ndk
SRC_FILES="hello.c"
OUT_FILE=hello
${NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang \
--target=aarch64-none-linux-android \
--gcc-toolchain=${NDK_ROOT}/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 \
-I include/ \
--sysroot=${NDK_ROOT}/platforms/android-24/arch-arm64/ -D__ANDROID_API__=24 -DANDROID_ABI=arm64-v8a -g -DANDROID \
-isystem ${NDK_ROOT}/sysroot/usr/include \
-isystem ${NDK_ROOT}/sysroot/usr/include/aarch64-linux-android \
-ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes \
-pie -fpie -fuse-ld=gold -std=gnu99 \
-o ${OUT_FILE} ${SRC_FILES} -L . -lsome-64bit-lib
I had mixed up --gcc-toolchain
with a 32-bit one and got exactly the same problem as you.
Maybe someone else stumbles upon this problem after some time again.
Upvotes: 1