[llvm-dev] cross compile thread local not link?

Roger Pack via llvm-dev llvm-dev at lists.llvm.org
Mon Jan 16 10:30:16 PST 2017


As a note, using crystal to cross compile (uses llvm "emit object code" method):


if I cross compile initially on OS X --target
x86_64-unknown-windows-cygnus , I get this:

.build/crystal_cyg.o:(.text+0x5c8): undefined reference to `_tls_index'
.build/crystal_cyg.o:(.text+0x5c8): relocation truncated to fit:
R_X86_64_PC32 against undefined symbol `_tls_index'
...
.build/crystal_cyg.o:(.text+0x7b07b3): undefined reference to
`LLVMInitializeARMAsmPrinter'
.build/crystal_cyg.o:(.text+0x959227): undefined reference to
`LLVMSetModuleDataLayout'
collect2: error: ld returned 1 exit status

I believe this failure means that it is having some kind of link
failure for "thread local storage" (AFAIK cygwin has no tls_index) so
it's something of an incompatibility LLVM introduces [?]
The LLVMInitializeARMAsmPrinter reference I assume means the llvm's
were built with different options initially, and/or different
versions, but I never got that far to resolve those.

Similar thing if cross compiled initially on linux:

.build/crystal_cyg.o:(.text+0x5c9): undefined reference to
`__emutls_v.Thread::current:init'
.build/crystal_cyg.o:(.text+0x5c9): relocation truncated to fit:
R_X86_64_PC32 against undefined symbol
`__emutls_v.Thread::current:init'
.build/crystal_cyg.o:(.text+0x7aa3b4): undefined reference to
`LLVMInitializeAArch64TargetInfo'
...

Are these expected?
Cheers!


More information about the llvm-dev mailing list