Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Sep 2008 11:12:31 +0100
From:      Dieter <freebsd@sopwith.solgatos.com>
To:        freebsd-amd64@freebsd.org
Subject:   Re: amd64/127640: GCC will not build shared libraries with -fprofile-generate on amd64 
Message-ID:  <200809261812.SAA00764@sopwith.solgatos.com>
In-Reply-To: Your message of "Fri, 26 Sep 2008 20:10:18 %2B0300." <20080926171018.GX47828@deviant.kiev.zoral.com.ua> 

next in thread | previous in thread | raw e-mail | index | archive | help
> > > 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200809261812.SAA00764>