Gentoo Archives: gentoo-dev

From: Daniel Campbell <zlg@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH] toolchain.eclass: set CHOST for gcc-config calls
Date: Tue, 27 Dec 2016 08:23:15
Message-Id: 789d9ae1-d0f6-393a-fe1b-83fc68e393a8@gentoo.org
In Reply to: [gentoo-dev] [PATCH] toolchain.eclass: set CHOST for gcc-config calls by Mike Gilbert
1 On 12/26/2016 12:22 PM, Mike Gilbert wrote:
2 > Bug: https://bugs.gentoo.org/603776
3 > ---
4 > eclass/toolchain.eclass | 8 ++++----
5 > 1 file changed, 4 insertions(+), 4 deletions(-)
6 >
7 > diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
8 > index 55249b00249b..97511ee12440 100644
9 > --- a/eclass/toolchain.eclass
10 > +++ b/eclass/toolchain.eclass
11 > @@ -2119,13 +2119,13 @@
12 >
13 > do_gcc_config() {
14 > if ! should_we_gcc_config ; then
15 > - env -i ROOT="${ROOT}" gcc-config --use-old --force
16 > + env -i CHOST="${CHOST}" ROOT="${ROOT}" gcc-config --use-old --force
17 > return 0
18 > fi
19 >
20 > local current_gcc_config target
21 >
22 > - current_gcc_config=$(env -i ROOT="${ROOT}" gcc-config -c ${CTARGET} 2>/dev/null)
23 > + current_gcc_config=$(env -i CHOST="${CHOST}" ROOT="${ROOT}" gcc-config -c ${CTARGET} 2>/dev/null)
24 > if [[ -n ${current_gcc_config} ]] ; then
25 > local current_specs use_specs
26 > # figure out which specs-specific config is active
27 > @@ -2159,12 +2159,12 @@ should_we_gcc_config() {
28 > # if the current config is invalid, we definitely want a new one
29 > # Note: due to bash quirkiness, the following must not be 1 line
30 > local curr_config
31 > - curr_config=$(env -i ROOT="${ROOT}" gcc-config -c ${CTARGET} 2>&1) || return 0
32 > + curr_config=$(env -i CHOST="${CHOST}" ROOT="${ROOT}" gcc-config -c ${CTARGET} 2>&1) || return 0
33 >
34 > # if the previously selected config has the same major.minor (branch) as
35 > # the version we are installing, then it will probably be uninstalled
36 > # for being in the same SLOT, make sure we run gcc-config.
37 > - local curr_config_ver=$(env -i ROOT="${ROOT}" gcc-config -S ${curr_config} | awk '{print $2}')
38 > + local curr_config_ver=$(env -i CHOST="${CHOST}" ROOT="${ROOT}" gcc-config -S ${curr_config} | awk '{print $2}')
39 >
40 > local curr_branch_ver=$(get_version_component_range 1-2 ${curr_config_ver})
41 >
42 >
43
44 Seems like an obvious bug and fix; is there any reason passing CHOST
45 around might be a bad idea? It seems to me that it enforces the behavior
46 it's meant to have to begin with and makes it more obvious that CHOST is
47 used.
48
49 --
50 Daniel Campbell - Gentoo Developer
51 OpenPGP Key: 0x1EA055D6 @ hkp://keys.gnupg.net
52 fpr: AE03 9064 AE00 053C 270C 1DE4 6F7A 9091 1EA0 55D6

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] [PATCH] toolchain.eclass: set CHOST for gcc-config calls Joakim Tjernlund <Joakim.Tjernlund@××××××××.com>
Re: [gentoo-dev] [PATCH] toolchain.eclass: set CHOST for gcc-config calls Mike Gilbert <floppym@g.o>