Gentoo Archives: gentoo-dev

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] New USE=-native-symlinks for gcc-config and binutils-config
Date: Fri, 22 May 2020 21:36:20
Message-Id: 20200522223602.1ceed811@sf
1 'tc-directly' tracker https://bugs.gentoo.org/243502 tracks
2 packages that don't respect users' CC/AR/LD flags.
3
4 I added new USE=-native-symlinks mode for gcc-config and
5 binutils-config to ease detection of such packages.
6
7 Native symlinks are still installed by default. Nothing should
8 break for users who use default USE flags.
9
10 USE=-native-symlinks removes a bunch of links that most packages
11 use by default until are overridden explicitly. Incomplete list is:
12 - /lib/cpp
13 - /usr/bin/{gcc,cc,g++,c++,...}
14 - /usr/bin/{as,ld,ranlib,dwp,...}
15
16 The rule of thumb is: if a tool does not have ${CTARGET}- prefix
17 it will probably disappear with USE=-native-symlinks.
18
19 (At least eventually) 'emerge' should still be able to build most
20 of packages in such environment. I expect initial breakage will be
21 huge though.
22
23 Using './configure && make && make install' style workflow will be more
24 tedious. One workaround at least for gcc is to use something like:
25 $ PATH="$(gcc-config -B):$PATH"
26 It's not perfect. We'll see if toolchain can provide nicer environment.
27
28 Typical fixes for autoconf style build systems is to use macros like:
29 - AC_PROG_CC
30 - AM_PROG_AR
31 - AC_CHECK_TOOL(DWP, dwp)
32 and so on to detect tool that corresponds to --host=/--target= flags
33 and allows user's override via environment variable.
34
35 --
36
37 Sergei

Replies