Building a dmd that works on old systems: TLS problems with libc

Atila Neves via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Oct 3 07:21:00 PDT 2014


On Friday, 3 October 2014 at 10:47:11 UTC, David Nadlinger wrote:
> On Friday, 3 October 2014 at 08:47:07 UTC, Atila Neves wrote:
>>    ld: <...>/libphobos2.a(sections_linux_570_420.o): undefined 
>> reference to symbol '__tls_get_addr@@GLIBC_2.3'
>>    /lib64/ld-linux-x86-64.so.2: error adding symbols: DSO 
>> missing from command line
>>    collect2: error: ld returned 1 exit status
>
> So to be clear, this is with a libphobos2.a built on the target 
> system? The error message looks like you might have a Phobos 
> library built for a newer libc.
>
> David

Yes, built on the target system. It gets worse in that I 
"installed" gcc 4.8 by compiling it and changing my PATH and 
LD_LIBRARY_PATH to use it. At first I thought that was the 
problem and it sort of is but isn't.

I removed my custom installations from PATH and LD_LIBRARY_PATH 
and used the system compiler but got the same problem.

Then I tried only using dmd to compile and linking it myself. 
That worked, but the resulting binary crashed. After loading it 
up in gdb, it crashed in __tls_get_addr....

Atila


More information about the Digitalmars-d-learn mailing list