public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download: 
* Re: [gentoo-dev] [RFC] Dealing with global /usr/bin/libtool use vs CC/CXX etc.
  @ 2021-01-11  8:52 99% ` Jaco Kroon
  0 siblings, 0 replies; 1+ results
From: Jaco Kroon @ 2021-01-11  8:52 UTC (permalink / raw
  To: gentoo-dev, Michał Górny

Hi Michał,

On 2021/01/10 15:34, Michał Górny wrote:
> Hi,
>
> The vast majority of libtool-based programs use configure script to
> generate libtool.  However, a few non-autoconf packages also use libtool
> by calling system-installed /usr/bin/libtool.  The problem is that this
> libtool hardcodes the values of CC/CXX at its' build time, so unless it
> is rebuilt frequently, packages end up using the stale values.
> The problem is known since 2005 [1] and hasn't been resolved yet.
>
> I can think of two ways of solving it:
>
> 1. We could patch system-installed libtool to respect environment
> variables such as CC, CXX, etc.  This will probably require carrying
> a (possibly non-trivial) patch forever.  On the bright side, libtool is
> not exactly a package seeing frequent releases.  I mean, the current
> version is from 2015.
>
> 2. We could regenerate libtool and force local instance of libtool
> in the packages needing it.  The main advantage of this is that it's
> a no-brainer.  I could make a quick eclass that does configure a local
> instance and prepends it into PATH.
>
> WDYT?

3.  Have it always use some fixed compiler somewhere (ie, compile it
with CC=/usr/bin/cc-libtool-wrapper CXX=/usr/bin/cxx-libtool-wrapper
which quite literally is just scripts that does):

exec "${CC}" "$@"

and

exec "${CXX}" "$@"

(with some added logic that if those variables points to itself it needs
to do a bit of extra work, or use "${LIBTOOL_CC:-${CC}}" style and
compile libtool with LIBTOOL_CC=${CC} CC=/usr/bin/cc-libtool-wrapper ...
I'd still add logic to detect the infinite recursion of CC=$0 though ...).

Would be happy to supply a suitable script if you're interested that you
can then just symlink the variants to
(libtool-tool-wrapper-{cc,cxx,ld,ar,...})

Kind Regards,
Jaco



^ permalink raw reply	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-01-10 13:34     [gentoo-dev] [RFC] Dealing with global /usr/bin/libtool use vs CC/CXX etc Michał Górny
2021-01-11  8:52 99% ` Jaco Kroon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox