Recompile with -fPIC (was "building a patched ghc")

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Recompile with -fPIC (was "building a patched ghc")

José Pedro Magalhães
Hi all,

I'm getting the same error as Alexy below in some 64bit linux system. What can I do? Adding -fPIC and also -dynamic does not seem to solve the problem. Also, this only happens with a perf build; devel1 works fine.


Thanks,
Pedro

On Sat, Jun 26, 2010 at 05:56, braver <[hidden email]> wrote:
An attempt to build the trunk gets me this:

/opt/portage/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.4/../../../../x86_64-
pc-linux-gnu/bin/ld: rts/dist/build/RtsStartup.dyn_o: relocation
R_X86_64_PC32 against symbol `StgRun' can not be used when making a
shared object; recompile with -fPIC

-- I use prefix portage on a CentOS box, admittedly a non-standard
setup.  Its gcc is found first and it wants -fPIC...  Should I just
add it to CFLAGS or what?

-- Alexy
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe


_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: Recompile with -fPIC (was "building a patched ghc")

Wolfram Kahl
I am not certain, but this may be the same problem that I once had,
and that was solved by updating to binutils-2.20.

 ld --version
GNU ld (GNU Binutils) 2.20.1.20100303


Wolfram


On Fri, Feb 18, 2011 at 11:34:03AM +0100, José Pedro Magalhães wrote:

> Hi all,
>
> I'm getting the same error as Alexy below in some 64bit linux system. What
> can I do? Adding -fPIC and also -dynamic does not seem to solve the problem.
> Also, this only happens with a perf build; devel1 works fine.
>
>
> Thanks,
> Pedro
>
> On Sat, Jun 26, 2010 at 05:56, braver <[hidden email]> wrote:
>
> > An attempt to build the trunk gets me this:
> >
> > /opt/portage/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.4/../../../../x86_64-
> > pc-linux-gnu/bin/ld: rts/dist/build/RtsStartup.dyn_o: relocation
> > R_X86_64_PC32 against symbol `StgRun' can not be used when making a
> > shared object; recompile with -fPIC
> >
> > -- I use prefix portage on a CentOS box, admittedly a non-standard
> > setup.  Its gcc is found first and it wants -fPIC...  Should I just
> > add it to CFLAGS or what?
> >
> > -- Alexy
> > _______________________________________________
> > Haskell-Cafe mailing list
> > [hidden email]
> > http://www.haskell.org/mailman/listinfo/haskell-cafe
> >
>
>
> !DSPAM:4d5e4b2789541804284693!

> _______________________________________________
> Glasgow-haskell-users mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>
>
> !DSPAM:4d5e4b2789541804284693!


_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: Recompile with -fPIC (was "building a patched ghc")

José Pedro Magalhães
Thanks for the tip. I cannot easily update binutils. I am with version 2.17.50.0.6-14.el5 20061020. On another machine (32bit) it works fine...


Cheers,
Pedro

2011/2/18 Wolfram Kahl <[hidden email]>
I am not certain, but this may be the same problem that I once had,
and that was solved by updating to binutils-2.20.

 ld --version
GNU ld (GNU Binutils) 2.20.1.20100303


Wolfram


On Fri, Feb 18, 2011 at 11:34:03AM +0100, José Pedro Magalhães wrote:
> Hi all,
>
> I'm getting the same error as Alexy below in some 64bit linux system. What
> can I do? Adding -fPIC and also -dynamic does not seem to solve the problem.
> Also, this only happens with a perf build; devel1 works fine.
>
>
> Thanks,
> Pedro
>
> On Sat, Jun 26, 2010 at 05:56, braver <[hidden email]> wrote:
>
> > An attempt to build the trunk gets me this:
> >
> > /opt/portage/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.4/../../../../x86_64-
> > pc-linux-gnu/bin/ld: rts/dist/build/RtsStartup.dyn_o: relocation
> > R_X86_64_PC32 against symbol `StgRun' can not be used when making a
> > shared object; recompile with -fPIC
> >
> > -- I use prefix portage on a CentOS box, admittedly a non-standard
> > setup.  Its gcc is found first and it wants -fPIC...  Should I just
> > add it to CFLAGS or what?
> >
> > -- Alexy
> > _______________________________________________
> > Haskell-Cafe mailing list
> > [hidden email]
> > http://www.haskell.org/mailman/listinfo/haskell-cafe
> >
>
>
> !DSPAM:4d5e4b2789541804284693!

> _______________________________________________
> Glasgow-haskell-users mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>
>
> !DSPAM:4d5e4b2789541804284693!



_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: Recompile with -fPIC (was "building a patched ghc")

scooter.phd@gmail.com
In reply to this post by José Pedro Magalhães
You've got an object file compiled with 32-bit code, hence the relocation error. fPIC won't help you much (the linker error isn't helpful.) It's a matter of sifting through the make output to find the file or files that aren't compiled in 64-bit mode.
Sent from my Verizon Wireless BlackBerry

-----Original Message-----
From: José Pedro Magalhães <[hidden email]>
Sender: [hidden email]
Date: Fri, 18 Feb 2011 11:34:03
To: GHC users<[hidden email]>
Cc: braver<[hidden email]>
Subject: Recompile with -fPIC (was "building a patched ghc")

_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users