-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Error Building Android, CLang, MacOS, NDK 20: Final linker can't find crtbegin_so.o or crtend_so.o #2674
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
Comments
You have to |
@brada4 Thank you for your fast response. I tried I think the NDK is finding its own runtime successfully given the output of the which clang:
/Users/doug.smith/Library/Android/sdk/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang
which ar:
/Users/doug.smith/Library/Android/sdk/ndk/20.1.5948944/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/aarch64-linux-android/bin/ar
which ld:
/Users/doug.smith/Library/Android/sdk/ndk/20.1.5948944/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/aarch64-linux-android/bin/ld |
Could you check where in your NDK installation path the crtbegin_so.o is located ? Perhaps that would provide a hint to what is missing |
@martin-frbg: There is a
|
#2005 (comment) looks related though not on darwin |
@martin-frbg: Thank you for pointing me to #2005, that was related and very helpful! I was able to make it work starting from there. Here's what worked (NDK r20b, targeting API 23 instead of 21 as in the #2005). The difference between #2005 and mine (besides mine being Darwin) is that armeabi-v7a: #!/bin/bash
export NDK=$1
export TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64
export CLANG=$NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi23-clang
export AR=$TOOLCHAIN/bin/arm-linux-androideabi-ar
export SOURCE_DIR=OpenBLAS
export INSTALL_DIR=../android-openblas/armeabi-v7a
rm -rf $INSTALL_DIR
cd $SOURCE_DIR || exit $?
make clean || exit $?
make \
TARGET=ARMV7 \
ONLY_CBLAS=1 \
CC="$CLANG -g -marm -mfpu=vfp -mfloat-abi=softfp " \
AR=$AR \
HOSTCC=gcc \
ARM_SOFTFP_ABI=1 \
-j4 \
|| exit $?
make PREFIX=$INSTALL_DIR install || exit $? arm64-v8a: #!/bin/bash
export NDK=$1
export TOOLCHAIN=$NDK/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64
export CLANG=$NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang
export AR=$TOOLCHAIN/bin/aarch64-linux-android-ar
export SOURCE_DIR=OpenBLAS
export INSTALL_DIR=../android-openblas/arm64-v8a
rm -rf $INSTALL_DIR
cd $SOURCE_DIR || exit $?
make clean || exit $?
make \
TARGET=CORTEXA57 \
ONLY_CBLAS=1 \
CC="$CLANG -g -marm -mfpu=vfp -mfloat-abi=softfp " \
AR=$AR \
HOSTCC=gcc \
-j4 \
|| exit $?
make PREFIX=$INSTALL_DIR install || exit $? It might help another user if you updated your Wiki. Particularly, this is what I was trying to make work and couldn't ever get it to work: https://github.com/xianyi/OpenBLAS/wiki/How-to-build-OpenBLAS-for-Android#building-with-android-ndk-using-clang-compiler. |
Unfortunately that wiki page becomes outdated every now and then (and probably confused/confusing in between) as I currently do not have the environments to test Android builds myself. I usually try to update it with information gleaned from tickets such as this but I must have forgotten to do this with GavinAndre's contribution, only dimly remembering that we had a related ticket somewhere. Btw you have write access to the wiki as well. |
Hello,
I've worked through many things to make it almost all the way through a build of OpenBLAS for
armeabi-v7a
andarm64-v8a
with the above listed platform and NDK, but am unable to overcome the what appears to be the last linker problem.Here's the error I'm seeing:
Here's the shell script I'm using:
I appreciate any help you can offer!
The text was updated successfully, but these errors were encountered: