Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Feb 2004 14:47:11 -0500
From:      Hendrik Scholz <hscholz@raisdorf.net>
To:        <freebsd-amd64@FreeBSD.org> <freebsd-amd64@FreeBSD.org> <freebsd-amd64@FreeBSD.org>
Subject:   CFLAGS+= -fPIC per default?
Message-ID:  <BD6DAE5F-64A6-11D8-ACAA-000A95BAD088@raisdorf.net>

next in thread | raw e-mail | index | archive | help
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@raisdorf.net - http://www.raisdorf.net/
cell phone: 404-606-5324 (US) 0160-1570-272 (DE)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BD6DAE5F-64A6-11D8-ACAA-000A95BAD088>