amd64/127640: GCC will not build shared libraries with -fprofile-generate on amd64

Kostik Belousov kostikbel at gmail.com
Fri Sep 26 20:09:19 UTC 2008


On Fri, Sep 26, 2008 at 11:12:31AM +0100, Dieter wrote:
> > > > Note that libgcov needs to be recompiled with -fPIC.
> > > > The R_X86_64_32 issue is systematic on amd64. When you build a shared
> > > > object, better make sure that all .o are compiled with -fPIC.
> > >=20
> > > So shouldn't the system come with both static and shared versions
> > > of all the libraries?
> > 
> > The system does. OP linked system supplied libgcov.a into .so.
> > Should /usr/lib/libgcov.a be built with -fPIC, is debatable. I think it
> > is overkill for most other static libs from /usr/lib. Note that there
> > are reasonable arguments against supplying static system libraries like
> > libc and libpthread.
> 
> The thread started with "porting a specialized database library to FreeBSD".
> One can expect problems when porting new code.  But the PIC problem is
> bigger than that.  Ports don't compile due to this problem.  Ports should
> compile cleanly out of the box, on all archs, with no problems.
> 
> Example:  On amd64, 7.0, try to build python25.  I get:
> 
> /usr/bin/ld: /usr/lib/crtbeginT.o: relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
> /usr/lib/crtbeginT.o: could not read symbols: Bad value
> *** Error code 1
> 
> Stop in /usr/ports/lang/python25/work/Python-2.5.1/portbld.shared.

You are mixing unrelated issues.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-amd64/attachments/20080926/63aad8fb/attachment.pgp


More information about the freebsd-amd64 mailing list