Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Jun 2011 12:16:08 +0300
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Stephen Montgomery-Smith <stephen@missouri.edu>
Cc:        "ports@FreeBSD.org" <ports@freebsd.org>, Stas Timokhin <devel@stasyan.com>, ade@freebsd.org
Subject:   Re: libtool issues
Message-ID:  <20110620091608.GG48734@deviant.kiev.zoral.com.ua>
In-Reply-To: <4DFEE295.3090204@missouri.edu>
References:  <4DFEE295.3090204@missouri.edu>

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

--3C1+oG8NxxW+Hf7i
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Jun 20, 2011 at 01:03:01AM -0500, Stephen Montgomery-Smith wrote:
> I am maintainer of the science/vis5d+ port.  It doesn't build on the=20
> i386 with FreeBSD-8.0-RELEASE, as is shown here:
>=20
> http://pointyhat.freebsd.org/errorlogs/i386-errorlogs/a.8.20110223062852/=
vis5d+-1.2.1_15.log
>=20
> I know that other ports have this problem such as science/libctl.  This=
=20
> port is currently marked broken for exactly this reason.
>=20
> I have a work around at this PR: ports/155105.  This work around was=20
> improved in ports/155655 (see the follow up comment by the maintainer,=20
> who submits a patch to libctl).
>=20
> I also reported the problem at ports/155546, although I don't think my=20
> solution there is very good, and my description of the bug wa very=20
> incomplete.  Furthermore, it turns out that this problem does not take=20
> place under the FreeBSD-8.2-STABLE.  This can make the problem a little=
=20
> bit hard to diagnose.  Nevertheless I can see this problem recurring=20
> systematically again in the future, because libtool was not designed for=
=20
> multiple compiler environments.
>=20
> It would be great to find a work around.  One way would be to put in=20
> some kind of construction like ports/155105 or ports/155655 into=20
> Mk/bsd.autotools.mk.  So whenever the port has USE_LIBTOOLS set, we have=
=20
> the following code
>=20
> LIBTOOLS_DIR=3D${WRKDIR}/.libtools.dir.${PORTNAME}.${PREFIX:S/\//_/g}
> ${LN} -s ${LOCALBASE}/bin/${CC} ${LIBTOOLS_DIR}/cc
> ${LN} -s ${LOCALBASE}/bin/${CXX} ${LIBTOOLS_DIR}/c++
> MAKE_ENV+=3D PATH=3D${LIBTOOLS_DIR}:$$PATH
>=20
> Or one could instead modify devel/libtools, maybe something like this.=20
> Rename bin/libtool to libexec/libtool.sh, and then rewrite the libtool=20
> script as something like:
>=20
> #!/bin/sh
> PREFIX=3D/usr/local
> TEMPCCDIR=3D`mktemp -d -t /tmp`
> export PATH=3D${WRKDIR}:$PATH
> ${LN} -s ${LOCALBASE}/bin/${CC} ${TEMPCCDIR}/cc
> ${LN} -s ${LOCALBASE}/bin/${CXX} ${TEMPCCDIR}/c++
> ${PREFIX}/libexec/libtool.sh $@
> rm -r ${TEMPCCDIR}
>=20
> I know these are real hacks.  But since we are trying to patch something=
=20
> into libtool that it really isn't designed for, perhaps my hackish=20
> approach has advantages.  In particular, one doesn't have to redesign=20
> different patches every time there is a libtool version update.
>=20
> Just some ideas.  In the meantime, do you think it is OK to commit=20
> ports/155105 and the libctl part of ports/155655?  It would be nice to=20
> get these ports working again on the i386, at least on a temporary basis.

The libtool binding to the compiler is done for the reason. Your hack
will cause more subtle breakage, since it causes libtool to be used with
compiler with different internals. In particular, libtool overrides the
linking stage arguments, manually providing crt* objects. This is what
breaks your ports, but the hack has the same undefined consequences
there. You are just lucky that you do not see them.

Wouldn't it be easier to have per-compiler libtool port ?
devel/libtool for the base compiler, devel/libtool-gcc45 for lang/gcc45,
probably devel/libtool-clang_base for clang from base and so on.


--3C1+oG8NxxW+Hf7i
Content-Type: application/pgp-signature
Content-Disposition: inline

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

iEYEARECAAYFAk3/D9gACgkQC3+MBN1Mb4hNCwCeJRAG5k8CVZuxvi0Ddw1uDCPZ
ZUQAnj9yES7RWh64FJw5Be+plSabPv6Z
=XbhW
-----END PGP SIGNATURE-----

--3C1+oG8NxxW+Hf7i--



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