Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Dec 2011 16:29:57 +0200
From:      Kostik Belousov <kostikbel@gmail.com>
To:        "O. Hartmann" <ohartman@zedat.fu-berlin.de>
Cc:        Current FreeBSD <freebsd-current@freebsd.org>, Ports FreeBSD <freebsd-ports@freebsd.org>
Subject:   Re: /usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd9.0/4.6.3/../../../libstdc++.a: could not read symbols: Bad value
Message-ID:  <20111228142957.GX50300@deviant.kiev.zoral.com.ua>
In-Reply-To: <4EFB2344.3000302@zedat.fu-berlin.de>
References:  <4EFAF3FC.60002@zedat.fu-berlin.de> <20111228135808.GW50300@deviant.kiev.zoral.com.ua> <4EFB2344.3000302@zedat.fu-berlin.de>

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

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

On Wed, Dec 28, 2011 at 03:10:12PM +0100, O. Hartmann wrote:
> Am 12/28/11 14:58, schrieb Kostik Belousov:
> > On Wed, Dec 28, 2011 at 11:48:28AM +0100, O. Hartmann wrote:
> >> Hello out here.
> >>
> >> I run into a problem since one of the last portupdates and I do not kn=
ow
> >> whether this has to do with binutils or gcc46 or even FreeBSD 9.0/10.0
> >> AMD64.
> >>
> >> Background:
> >> We use a scientific graphical toolset for planetary research called
> >> ISIS3, which is provided by the USGS. We patched ISIS3 to run on FreeB=
SD
> >> 8/9/10 so far and it ran well with FreeBSD 8.2-STABLE and 9.0-PRE a
> >> couple of weeks ago.
> >> On all of my boxes, I do frequently a portupgrade, so I saw binutils g=
ot
> >> bumped up and gcc 4.6 is also getting really frequently changed these =
days.
> >> After a some portupdates within the last weeks, I just decided to
> >> compile ISIS3 again to keep it "fresh and on track", but it won't
> >> compile anymore.
> >>
> >> On all FreeBSD 9.0-PRERELEASE and FreeBSD 10.0-CURRENT (all AMD64 and
> >> CLANG built) I receive in some subfolders containing sources the
> >> follwoing error:
> >>
> >> [...]
> >>     Adding API object [UniqueIOCachingAlgorithm]
> >>     Adding API object [UniversalGroundMap]
> >>     Adding API object [UserInterface]
> >>     Adding API object [VariableLineScanCameraDetectorMap]
> >>     Adding API object [VecFilter]
> >>     Adding API object [WorldMapper]
> >>     Adding API object [iException]
> >>     Adding API object [iString]
> >>     Adding API object [iTime]
> >>   Working on Package [mex] (11:30:15)
> >>     Adding API object [HrscCamera]
> >> /usr/local/bin/ld:
> >> /usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd9.0/4.6.3/../../../libs=
tdc++.a(functexcept.o):
> >> relocation R_X86_64_32 against `std::bad_exception::~bad_exception()'
> >> can not be used when making a shared object; recompile with -fPIC
> >> /usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd9.0/4.6.3/../../../libs=
tdc++.a:
> >> could not read symbols: Bad value
> >> collect2: ld returned 1 exit status
> >> gmake[5]: *** [plugin] Error 1
> >> cp: libHrscCamera.so: No such file or directory
> >> gmake[4]: *** [install] Error 1
> > The error is completely clear as it is: the build tries to link static
> > library libstdc++.so into shared object. This is not supported.
>=20
> Thanks, Kostik, for the fast response.
> The error isn't so clear to me, sorry. I thought libstdc++.a is the
> static library and it is taken to be referenced/compiled into a shared
Linked in.

> object created by the application I try to compile.
Right, and this is not supported. Code linked into shared object must
be compiled PIC. An .a library usually does not contain objects compiled
by PIC, ld just dutifully reported back.

>=20
> I'm much more confused now, since I thought the last time I compiled
> that piece of software, I never got any error like that. Well, clang
> fails with some obscure errors on the code itself and I'm unwilling to
> correct them, I'll try the legacy gcc 4.2.1 and will report what's
> happening.

It might have worked by accident (because libstdc++.a objects referenced=20
during the link did not carried unsupported relocations), or, much more
likely, the build system has changed and started doing stupid things.
It must not link static libraries into shared objects.

You should examine why it does this, and fix it. Changing compilers is
just wasting a time.

--M6R/iNHleSlW4Gwu
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (FreeBSD)

iEYEARECAAYFAk77J+UACgkQC3+MBN1Mb4jLqACgqmZ+kfdT2b/UZ3LSXK9oQOpA
siQAoPZuCMqkkDqFz90xGH3vZpBXSXTA
=dv5v
-----END PGP SIGNATURE-----

--M6R/iNHleSlW4Gwu--



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