`ld.lld: error: undefined symbol: __tls_get_addr' when trying to use ldc2 to compile to android24 target

TheZipCreator thezipcreator at protonmail.com
Wed Nov 27 11:50:29 UTC 2024


I'm trying to compile to Android 24, but I can't get it to work. 
I get the following error:
```
ld.lld: error: undefined symbol: __tls_get_addr
>>> referenced by sections_elf_shared.d
>>>               
>>> sections_elf_shared.o:(_D2rt19sections_elf_shared13initTLSRangesFNbNiZPS4core8internal9container5array__T5ArrayTAvZQk) in archive /home/z/things/compilers/ldc2/bin/../lib-android_aarch64/libdruntime-ldc.a
>>> referenced by sections_elf_shared.d
>>>               sections_elf_shared.o:(_d_dso_registry) in 
>>> archive 
>>> /home/z/things/compilers/ldc2/bin/../lib-android_aarch64/libdruntime-ldc.a
clang: error: linker command failed with exit code 1 (use -v to 
see invocation)
Error: 
/home/z/things/android-ndk-r27/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang failed with status: 1
```
Compiling with `--emulated-tls` (and `-Xcc=-femulate-tls`) 
doesn't seem to fix it. I'm using 
`android-ndk-r27/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang` as my compiler. Running it with android 30 works, but it's not the target I'm trying to compile to.

I'm not sure what I'm supposed to do to get this to compile.


More information about the Digitalmars-d-learn mailing list