Open Dadoum opened 3 years ago
Looks like your LDC wasn't linked against our modded LLVM. Official releases from GitHub should do.
Getting this:
/usr/bin/ld.bfd: _D4core9exception6_storeG128v: TLS definition in /usr/bin/../lib/libdruntime-ldc.a(exception.o) section .tbss._D4core9exception6_storeG128v mismatches non-TLS reference in main.o
Should the clang from NDK also be patched ?
Nope, it's only used as linker driver. As the msg says, the problem is your compiled main.o
compiled by LDC.
(The source code is the hello world in dlang.org)
Linux toolchain ldc2 is 1.25.1 like the android libraries, and the android ndk is the one on AUR too
Linux toolchain ldc2 is 1.25.1
Apparently not from GitHub here. We don't maintain any distro packages officially, so presumably most don't use our custom LLVM, and that comes with restrictions. This LLVM requirement for custom TLS emulation on Android is mentioned in https://wiki.dlang.org/Build_D_for_Android#Cross-compilation.
Yes the second error comes from the binary version downloaded from releases (I overwrote the package files)
Hmm; I don't remember anything about the TLS emulation on x86, but at least ARM (32+64 bit) should definitely link fine, as CI tests cross-building LDC itself + dub + some more tools.
Maybe it can help you aarch64 is also failing for another reason: (the message is repeated a lot of time:
/usr/bin/ld.bfd: main.o: Relocations in generic ELF (EM: 183)
Hmm. FWIW, CI uses Android NDK r21d or r21e, the LTS release, not r22 as currently on Arch apparently.
Command:
ldc2.conf:
Output:
The same error occurs when using aarch64.