Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Mar 2006 13:42:10 -0500
From:      Kris Kennaway <kris@obsecurity.org>
To:        Kris Kennaway <kris@obsecurity.org>, pfgshield-freebsd@yahoo.com, freebsd-ports@FreeBSD.org
Subject:   Re: amd64 and -fPIC
Message-ID:  <20060307184210.GA33347@xor.obsecurity.org>
In-Reply-To: <20060307183756.GD73973@isis.sigpipe.cz>
References:  <20060220041815.3229.qmail@web32907.mail.mud.yahoo.com> <20060220043813.GA82552@xor.obsecurity.org> <20060307183756.GD73973@isis.sigpipe.cz>

next in thread | previous in thread | raw e-mail | index | archive | help

--/04w6evG8XlLl3ft
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Mar 07, 2006 at 07:37:56PM +0100, Roman Neuhauser wrote:
> # kris@obsecurity.org / 2006-02-19 23:38:13 -0500:
> > On Mon, Feb 20, 2006 at 05:18:15AM +0100, pfgshield-freebsd@yahoo.com w=
rote:
> > > Hi;
> > >=20
> > > amd64 has a rather nasty issue: in order to mix shared and static lib=
raries
> > > everything has to be built with -fPIC. Most ports are either static o=
r dynamic
> > > so it's usually not a problem, but I'm stating to find problems in th=
e math
> > > section: packages like arpack and glpk are only built static and with=
out -fPIC.
> > > And lately we are only building the dynamic version of ATLAS so packa=
ges that
> > > use many math libraries will have problems on amd64.
> > >=20
> > > Someone would say the easy way out of this would be to add -fPIC to e=
verything
> > > by default, which works, but has some performance issues. If someone =
has a
> > > better solution I would like to hear it (please!) but if not I would =
like to
> > > suggest instead a general guideline:
> > >=20
> > > If the package includes a library that might be used frequently and d=
oesn't
> > > include a shared version please add -fPIC to the amd64 version of the=
 port, for
> > > example for math/arpack (and feel free to commit this):
> >=20
> > The best solution is to make the port also build a shared version;
> > it's usually not that difficult to modify the makefile.  That way you
> > don't have to add nasty hacks.
>=20
>     That doesn't solve the problem, which is: the static library is
>     almost useless, and users might actually want or need to use the
>     static library.

Why do you say it's useless?  The point of a static library is for
static linking, and this works fine on amd64 or any other
architecture.

>     net/libpcap only installs lib/libpcap.so if you install into /usr,
>     probably because all the dependent ports would need to be taught
>     to look in /usr/local/lib first.

I don't know what you're saying here.

>     misc/ossp-uuid's ${PREFIX}/lib/libuuid.a (it configures with
>     --disable-shared) cannot be used in shared libraries on amd64
>     because the port doesn't use -fPIC on this platform.

The bug is presumably the --disable-shared.

>     Ports that install static libraries *need* to use -fPIC on amd64.

No, they need to also install shared libraries.

Kris
--/04w6evG8XlLl3ft
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (FreeBSD)

iD8DBQFEDdQCWry0BWjoQKURAo18AKDu/BRLRjVYUhnBfG6pQV/q/kPG7wCfWJGd
ucI/O9TXCZSC04CHZHA2hek=
=O2lb
-----END PGP SIGNATURE-----

--/04w6evG8XlLl3ft--



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