We have some code that compiles and runs as intended using gpc-20020502 based on gcc 2.95.2. I am now trying to get it running with gpc-20060325 based on gcc-3.4.4.
As a demonstration the program
Program Test_err; Var errno:integer; external name 'errno'; Begin Writeln(@Error number is ',Errno); End;
Compiles but fails to link with 20060325 :
"/usr/bin/ld: errno: TLS definition in /lib/libc.so.6 section .tbss mismatches non-TLS reference in /tmp/ccae8f7a.o"
The same program runs correctly with 20020522 when external name is replaced by the older syntax asmname. A bit of googling suggests this is a common problem and not limited to gpc but I can't find how I am now supposed to access errno. Any suggestions?