Gentoo Archives: gentoo-dev

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: [PATCH] multilib.eclass: populate AR and NM in multilib_toolchain_setup(), bug #724558
Date: Sat, 23 May 2020 08:19:20
Message-Id: 20200523091911.214605b1@sf
In Reply to: [gentoo-dev] [PATCH] multilib.eclass: populate AR and NM in multilib_toolchain_setup(), bug #724558 by Sergei Trofimovich
1 On Fri, 22 May 2020 23:42:48 +0100
2 Sergei Trofimovich <slyfox@g.o> wrote:
3
4 > For both multilib and non-multilib profiles binutils provides
5 > tools with native ABI prefix only. For example on amd64 there
6 > is only 'x86_64-pc-linux-gnu-nm' and 'nm'.
7 >
8 > On abi_x86_32 tools are usually configured with --host=i686-pc-linux-gnu.
9 > Configure tries i686-pc-linux-gnu-nm, then falls back to 'nm'.
10 >
11 > The change overrides NM to 'x86_64-pc-linux-gnu-nm' for
12 > multilib setup similar to other environment variables.
13 >
14 > Reported-by: Kent Fredric
15 > Closes: https://bugs.gentoo.org/724558
16 > Signed-off-by: Sergei Trofimovich <slyfox@g.o>
17 > ---
18 > eclass/multilib.eclass | 2 ++
19 > 1 file changed, 2 insertions(+)
20 >
21 > diff --git a/eclass/multilib.eclass b/eclass/multilib.eclass
22 > index bbaab709b4f..25e90dea44c 100644
23 > --- a/eclass/multilib.eclass
24 > +++ b/eclass/multilib.eclass
25 > @@ -484,11 +484,13 @@ multilib_toolchain_setup() {
26 > # Set the CHOST native first so that we pick up the native
27 > # toolchain and not a cross-compiler by accident #202811.
28 > export CHOST=$(get_abi_CHOST ${DEFAULT_ABI})
29 > + export AR="$(tc-getAR)" # Avoid 'ar', use '${CHOST}-ar'
30 > export CC="$(tc-getCC) $(get_abi_CFLAGS)"
31 > export CXX="$(tc-getCXX) $(get_abi_CFLAGS)"
32 > export F77="$(tc-getF77) $(get_abi_CFLAGS)"
33 > export FC="$(tc-getFC) $(get_abi_CFLAGS)"
34 > export LD="$(tc-getLD) $(get_abi_LDFLAGS)"
35 > + export NM="$(tc-getNM)" # Avoid 'nm', use '${CHOST}-nm'
36 > export CHOST=$(get_abi_CHOST $1)
37 > export PKG_CONFIG_LIBDIR=${EPREFIX}/usr/$(get_libdir)/pkgconfig
38 > export PKG_CONFIG_PATH=${EPREFIX}/usr/share/pkgconfig
39
40 Also added OBJDUMP, RANLIB and STRIP as they are used in most
41 libraries used by autotools. Pushed as:
42 https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dd35b529194fdcadf324fd4f0a466a61aa1dfadb
43
44 --
45
46 Sergei