ghc-6.4 fPIC compilation problem on amd64

ariep at xs4all.nl ariep at xs4all.nl
Tue May 10 11:28:58 EDT 2005


Hi,

When trying to compile ghc-6.4 from source on my amd64 using a 6.2.2
binary (obtained via gentoo portage), I get the following error message:

#####
make all
[...]
/usr/bin/ghc -o ghc-pkg.bin -H16m -O -cpp -Wall -fno-warn-name-shadowing
-fno-warn-unused-matches -i../../lib/compat -Rghc-timing   
-L../../lib/compat -lghccompat   Main.o Version.o
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../../x86_64-pc-linux-gnu/bin/ld:
Main.o: relocation R_X86_64_32 against `__stginit_Main_' can not be used
when making a shared object; recompile with -fPIC
Main.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
<<ghc: 6713240 bytes, 3 GCs, 68040/68040 avg/max bytes residency (1
samples), 6M in use, 0.00 INIT (0.00 elapsed), 0.03 MUT (0.03 elapsed),
0.00 GC (0.02 elapsed) :ghc>>
make[4]: *** [ghc-pkg.bin] Error 1
#####

I added -fPIC to CFLAGS, LDFLAGS and the ghc options (the latter by
'./configure --with-ghc="/usr/bin/ghc -fPIC"'), without effect: ghc does
not know an -fPIC, the other two attempts gave the same error message as
above.

What am I doing wrong?

Thank you for your time,

Arie Peterson



More information about the Glasgow-haskell-users mailing list