public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Steven J. Long" <slong@rathaus.eclipse.co.uk>
To: gentoo-dev@lists.gentoo.org
Subject: [gentoo-dev] Re: Re: Re: Re: crossdev and multilib interference
Date: Thu, 19 Jun 2014 22:20:23 +0100	[thread overview]
Message-ID: <20140619212023.GC4582@rathaus.eclipse.co.uk> (raw)
In-Reply-To: <1403017001.11300.1.camel@rook>

On Tue, Jun 17, 2014 at 10:56 -0400, Alexandre Rostovtsev wrote:
> All multilib packages that use pkgconfig, for one thing. (Which means almost
> all multilib packages.) Because current crossdev versions blindly install their
> /usr/bin/i686-pc-linux-gnu-pkg-config wrapper script, overwriting the binary
> belonging to pkgconfig[abi_x86_32].

Well I've spent far too long at crossdev code, only to see this and realise
you can simply hard-mask:
  cross-i686-pc-linux-gnu/{binutils,gcc,glibc,pkg-config}
in the amd64 multilib profile, unless I'm missing something. You'd be
hard-pushed to install a clashing crossdev with such a mask, afaict.

If you do want to change crossdev[1], afaict you're looking at interaction
between toolchain.eclass (and toolchain-binutils, and likely -funcs),
crossdev and gcc-config. I could well be wrong, as ever. This is just my
preliminary understanding, and maybe it'll provoke a more thorough
explanation.

Crossdev set_links() links the overlay to the tree. toolchain.eclass installs
the versioned links so the internal gcc-bin path is exposed in /usr/bin, in
toolchain_src_install(). For cross-toolchains, it only installs prefixed ones:
 dosym ${BINPATH}/${CTARGET}-${x} /usr/bin/${CTARGET}-${x}-${GCC_CONFIG_VER}

For a native compiler it first, in: "${D}"${BINPATH} does:
 ln -sf ${CTARGET}-${x} ${x}     # unversioned private link
 dosym ${BINPATH}/${CTARGET}-${x} /usr/bin/${x}-${GCC_CONFIG_VER}
 
..then the above. Note that the prefixed link is effectively a race as to
which was installed last, but only in the case of a clash.

gcc-config update_wrappers() makes links in the user's path, though all of
them are run via wrapper.c[2], aka /usr/lib/misc/gcc-config. This is a
multi-switch binary based on argv[0]/$0. However it specifically notes
that it's intended to be used with a PATH-based setup [3]:

/* Find the first file with suitable name in PATH.  The idea here is
 * that we do not want to bind ourselfs to something static like the
 * default profile, or some odd environment variable, but want to be
 * able to build something with a non default gcc by just tweaking
 * the PATH ... */

crossdev dirs are added to path after system ones in env.d; that's where
gcc-config gets the paths to use from.

crossdev uninstall() removes CTARGET-based links. Note that your native
machine CBUILD == CHOST, also has CTARGET = CHOST, so this would also
be a reason to block/mask according to arch.

I haven't reviewed wrapper.c as well as I'd like: some of it seems a bit
odd but I'd need more time. I did wonder why it doesn't just use
readlink(3P) til I saw that comment.

Anyhow, that all seems a bit pointless when you can just hardmask the
specific crossdev configuration that causes the problem on multilib
profiles, and the same mechanism can be applied elsewhere, as decided
by the arch-team (eg for: o32/n32/n64)

Although canadian-cross and ROOT-based toolchains are another matter.

Regards,
steveL

[1] ie stop installing symlinks in /usr/bin for CTARGET-gcc, as well as
env.d files, and just provide a sh wrapper in each PORTAGE_CONFIGROOT
(= cross-overlay) that can be sourced from /etc/profile or anywhere
else, to add the same settings instead as and when the user chooses.

The most you'd need is the ability to choose whether it takes precedence
over current PATH or not, and that's probably easiest with a variant
'source' ('.' in shell) so cross-builds do, and the profile one doesn't.

[2] http://git.overlays.gentoo.org/gitweb/?p=proj/gcc-config.git;a=blob;f=wrapper.c;hb=HEAD
[3] ll 125-129 h=b00e8187a6063e329049ab9a57023fe9113c598d;hb=HEAD
-- 
#friendly-coders -- We're friendly, but we're not /that/ friendly ;-)


  parent reply	other threads:[~2014-06-19 20:57 UTC|newest]

Thread overview: 85+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-12 15:46 [gentoo-dev] crossdev and multilib interference hasufell
2014-03-12 16:06 ` Alexandre Rostovtsev
2014-03-12 18:56   ` Alexis Ballier
2014-03-16 11:50   ` Greg Turner
2014-03-26  6:07     ` Mike Frysinger
2014-03-26 12:25       ` [gentoo-dev] " Steven J. Long
2014-03-26 16:12         ` Mike Frysinger
2014-03-26 16:23           ` Ian Stakenvicius
2014-03-27  2:41             ` Mike Frysinger
2014-03-27  4:41               ` Alexandre Rostovtsev
2014-03-27  6:07                 ` Mike Frysinger
2014-03-27  6:31                   ` Alexandre Rostovtsev
2014-03-27  6:41                     ` Mike Frysinger
2014-03-27  6:51                       ` Michał Górny
2014-03-27  7:23                         ` Mike Frysinger
2014-03-27  6:58                       ` Samuli Suominen
2014-03-27  8:41           ` [gentoo-dev] " Steven J. Long
2014-03-28  6:36             ` Mike Frysinger
2014-03-30  9:53               ` [gentoo-dev] " Steven J. Long
2014-06-15 20:35                 ` hasufell
2014-06-15 20:43                   ` Chí-Thanh Christopher Nguyễn
2014-06-16 13:37                     ` hasufell
2014-06-16 18:42                       ` Steev Klimaszewski
2014-06-16 19:31                         ` hasufell
2014-06-16 19:42                           ` Jeroen Roovers
2014-06-16 19:47                             ` hasufell
2014-06-16 20:05                               ` Joshua Kinard
2014-06-16 20:24                                 ` hasufell
2014-06-16 20:59                                   ` Joshua Kinard
2014-06-16 22:10                                     ` hasufell
2014-06-16 23:38                                       ` Joshua Kinard
2014-06-17  1:47                                         ` hasufell
2014-06-17  2:17                                           ` Joshua Kinard
2014-06-17 12:30                                             ` hasufell
2014-06-17 12:49                                               ` Rich Freeman
2014-06-17 13:53                                                 ` hasufell
2014-06-17 14:17                                                 ` Joshua Kinard
2014-06-17 14:56                                                   ` Alexandre Rostovtsev
2014-06-17 15:10                                                     ` Michał Górny
2014-06-18 15:24                                                       ` Peter Stuge
2014-06-19  7:58                                                         ` Michał Górny
2014-06-17 15:20                                                     ` Joshua Kinard
2014-06-18  5:08                                                       ` Alexandre Rostovtsev
2014-06-18  6:24                                                         ` Joshua Kinard
2014-06-18 14:18                                                           ` Ian Stakenvicius
2014-06-19 21:20                                                     ` Steven J. Long [this message]
2014-06-20 20:10                                                       ` [gentoo-dev] " Ian Stakenvicius
2014-06-21 10:31                                                         ` Greg Turner
2014-06-21 20:47                                                           ` Michał Górny
2014-08-01  9:05                                                         ` Steven J. Long
2014-08-01 14:36                                                           ` Ian Stakenvicius
2014-08-01 18:17                                                             ` [gentoo-dev] " Steven J. Long
2014-06-18  4:29                                                   ` [gentoo-dev] " Ryan Hill
2014-06-17 14:04                                               ` [gentoo-dev] Re: " Joshua Kinard
2014-06-17 14:38                                                 ` hasufell
2014-06-17 15:02                                                   ` Joshua Kinard
2014-06-17 15:18                                                     ` hasufell
2014-06-17 15:37                                                     ` hasufell
2014-06-17 12:48                                             ` hasufell
2014-06-17 14:31                                               ` Joshua Kinard
2014-06-17 13:25                                         ` Ian Stakenvicius
2014-06-17 14:22                                           ` Michał Górny
2014-06-17 14:34                                             ` Joshua Kinard
2014-06-16 23:25                                   ` Patrick Lauer
2014-06-16 20:27                                 ` Ian Stakenvicius
2014-06-16 21:42                                   ` [gentoo-dev] " Jeroen Roovers
2014-06-17  0:03                                     ` Joshua Kinard
2014-06-16 20:25                         ` [gentoo-dev] Re: Re: " hasufell
2014-06-16  2:24                   ` [gentoo-dev] " Ryan Hill
2014-06-16 13:27                     ` hasufell
2014-06-17  4:52                       ` Ryan Hill
2014-06-17 12:29                         ` hasufell
2014-03-29  1:21       ` [gentoo-dev] " Maciej Mrozowski
2014-03-16 12:01   ` Greg Turner
2014-03-13  8:55 ` Michał Górny
2014-03-13 12:20   ` Alexandre Rostovtsev
2014-03-26  5:17   ` Mike Frysinger
2014-03-27  6:13     ` Mike Frysinger
2014-03-27  6:51       ` Michał Górny
2014-03-27  7:18         ` Mike Frysinger
2014-03-27  9:10           ` Michał Górny
2014-03-27 14:23             ` Mike Frysinger
2014-03-27 14:31               ` Michał Górny
2014-03-28  6:33                 ` Mike Frysinger
2014-03-29 21:39                   ` Michał Górny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140619212023.GC4582@rathaus.eclipse.co.uk \
    --to=slong@rathaus.eclipse.co.uk \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox