[fpc-devel] x86_64 linking issue (2.1.4)
jonas.maebe at elis.ugent.be
Fri May 25 21:25:37 CEST 2007
On 25 mei 2007, at 18:50, Alan Krause wrote:
> The problem arises when the linker attempts to put all the pieces
> together into one .so :
> /usr/bin/ld: uCUNASP_CLCalc.o: relocation R_X86_64_32S against
> `U_UCUNASP_CLCALC_CUNASPCLSET' can not be used when making a shared
> object; recompile with -fPIC
> uCUNASP_CLCalc.o: could not read symbols: Bad value
> I have successfully created a shared library, so it is not an -fPIC
> issue (I think, and am compiling with the -Cg flag as well).
> The CUNASPCLSET refers to a public unit-wide variable (a custom
> record type). If I redeclare the record type as an object and
> dynamically create the variable in the unit's initialization
> section (and free it up on finalization), then the error
> disappears, and a similar issue pops up with another record type in
> a different unit - I have also seen a similar error appear with a
> unit level array [0..10] of double.
> Again - the code works fine on 32-bit linux, but not for x86_64.
> Does anyone have any ideas?
It's a bug in the compiler. Please submit a bug report with a
compilable sample that demonstrates the problem.
More information about the fpc-devel