ghc-6.4 fPIC compilation problem on amd64

Simon Marlow simonmar at microsoft.com
Wed May 11 05:32:43 EDT 2005


On 10 May 2005 16:29, ariep at xs4all.nl wrote:

> 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/b
in/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
> #####

That's a new one on me.  Does your 6.2.2 build otherwise work, i.e. can
you build & run programs with it?

> 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.

GHC doesn't support -fPIC on amd64 right now.  Maybe it will in the
future.

Cheers,
	Simon


More information about the Glasgow-haskell-users mailing list