From owner-freebsd-amd64@FreeBSD.ORG Wed Apr 27 20:29:01 2005 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 78D1616A4CE; Wed, 27 Apr 2005 20:29:01 +0000 (GMT) Received: from obsecurity.dyndns.org (CPE0050040655c8-CM00111ae02aac.cpe.net.cable.rogers.com [69.194.102.111]) by mx1.FreeBSD.org (Postfix) with ESMTP id 06F2243D1F; Wed, 27 Apr 2005 20:29:01 +0000 (GMT) (envelope-from kris@obsecurity.org) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id 33257514C9; Wed, 27 Apr 2005 13:29:00 -0700 (PDT) Date: Wed, 27 Apr 2005 13:29:00 -0700 From: Kris Kennaway To: Michael Hopkins Message-ID: <20050427202900.GA52508@xor.obsecurity.org> References: <20050427192112.GA30646@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jI8keyz6grp/JLjh" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i cc: kan@freebsd.org cc: "freebsd-amd64@freebsd.org" cc: Kris Kennaway Subject: Re: Shared library relocation R_X86_64_32 solution on amd64? X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2005 20:29:01 -0000 --jI8keyz6grp/JLjh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 27, 2005 at 08:38:59PM +0100, Michael Hopkins wrote: > >> It has been mentioned a few times on this list: my understanding of th= is > >> issue is that you can't link to shared libraries unless they have been > >> compiled with -fPIC. Is that right? > >=20 > > Yes, and libobjc.a isn't a shared library, so you can't link it into on= e. > >=20 > Do you know why this problem appears to be specific to amd64? It's not, ia64 and sparc64 have similar requirements. > >> I have two main questions in this post. > >>=20 > >> 1) What installs libobjc.a? I want to reinstall it with CFLAGS +=3D -= fPIC. I > >> assumed that it was installed by gcc-objc but after reinstalling that = with > >> -fPIC the libobjc.a library was untouched! > >=20 > > Since it's in /usr/lib, it's part of the base system. We don't seem > > to install a shared library version of that, >=20 > I may have been creating a red herring when I said it needed to link to a > shared library. I think the actual issue is linking any kind of amd64 > library which hasn't been made with -fPIC into another shared library - I > await clarification from others who know better about these things. Yeah, by definition you should only be using -fPIC with shared (relocatable) libraries). > > so you should talk to > > kan@. > >=20 > Does this mean kan@freebsd.org? I have copied to that address in case. Yes. > >> sure it will hit a lot of people on many different ports and if it's a= tier > >> 1 platform then don't we need to have a proper strategy for dealing wi= th > >> this? > >=20 > > Well, yeah, there is a proper strategy. "Link shared objects to > > shared libraries". > >=20 > Did you see that the simlar earlier problem was solved by rebuilding ffca= ll > with -fPIC? I don't think libcallback.a is a shared library either but t= he > link was made possible by the rebuild. You generally shouldn't be compiling static (.a) libraries with -fPIC because this causes performance penalities for applications that really want to link statically with them. > I am still not completely clear whether the cause of this problem is: >=20 > 1) the GNUstep source code > 2) the GNUstep makefile > 3) the FreeBSD amd64 default library setup > 4) the FreeBSD amd64 'linking logic' > 5) something else? For the error above, it looks like at least 3) (i.e. FreeBSD should provide a libobjc.so). Whether or not gnustep will use it, or if there are further problems, I can't say. Kris --jI8keyz6grp/JLjh Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (FreeBSD) iD8DBQFCb/YLWry0BWjoQKURAvHhAKCLMs8OZFcGARhs9Ca91LFHKsLLIgCfexLJ b1FDR0x/FaJIvEoAW+dWuzw= =SfdC -----END PGP SIGNATURE----- --jI8keyz6grp/JLjh--