CFLAGS+= -fPIC per default?

Hendrik Scholz hscholz at raisdorf.net
Sat Feb 21 11:47:19 PST 2004


Hi!

I'm just fixing a bunch of ports reported broken on amd64 by bento.
Most of these errors are related to a common linker problem:
ld: foo.o: relocation R_X86_64_32 can not be used when making a shared 
object; recompile with -fPIC

Passing -fPIC via CFLAGS fixes the problem in 80% of the cases (the 
remaining
ports need proper CFLAGS handling in the third party application).

Adding CFLAGS= -fPIC to /etc/make.conf may be a local solution but are
there any drawbacks by adding something like
.if ${ARCH} == "amd64"
CFLAGS+= -fPIC
.endif

to ports/Mk/bsd.port.mk?

Remaining apps that need fixing then can be patched properly without the
amd64 statement, thus making future additions easier, i.e. when the
yet-to-be-announced 128Bit architecture needs -fVANILLA_COKE to compile
stuff a similar statement can be added to bsd.port.mk and all the
ports running on amd64 should automatically be fixed on the new arch.

Just my $0.02,
	Hendrik

-- 
Hendrik Scholz - hscholz at raisdorf.net - http://www.raisdorf.net/
cell phone: 404-606-5324 (US) 0160-1570-272 (DE)



More information about the freebsd-amd64 mailing list