CFLAGS+= -fPIC per default?

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


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

to ports/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 and all the
ports running on amd64 should automatically be fixed on the new arch.

Just my $0.02,

Hendrik Scholz - hscholz at -
cell phone: 404-606-5324 (US) 0160-1570-272 (DE)

More information about the freebsd-amd64 mailing list