Gentoo Archives: gentoo-dev

From: Manoj Gupta <manojgupta@××××××.com>
To: Sergei Trofimovich <slyich@×××××.com>
Cc: gentoo-dev@l.g.o, Sergei Trofimovich <slyfox@g.o>, Mike Frysinger <vapier@g.o>, toolchain@g.o
Subject: [gentoo-dev] Re: [PATCH] gcc-config: Add option to not install cc/f77 wrappers.
Date: Tue, 03 Mar 2020 03:04:06
Message-Id: CAH=QcshZG2x6Uc-=g=RcHSG74QWPgeMQmKtueWmF1N2BWGpwfA@mail.gmail.com
1 On Thu, Feb 27, 2020 at 11:20 PM Sergei Trofimovich <slyich@×××××.com>
2 wrote:
3
4 > On Thu, 27 Feb 2020 at 22:41, Manoj Gupta <manojgupta@××××××.com> wrote:
5 > >
6 > >
7 > >
8 > > On Thu, Feb 27, 2020 at 11:22 AM Manoj Gupta <manojgupta@××××××.com>
9 > wrote:
10 > >>
11 > >> gcc-config installs cc/f77 by default. This may be undesired on
12 > >> systems that want to set their own versions of cc/f77.
13 > >>
14 > >> Add option "-n"/"--no-default-vars" to not install the cc/f77
15 > >> wrappers.
16 > >>
17 > >> Signed-off-by: Manoj Gupta <manojgupta@××××××.com>
18 > >> ---
19 > >> gcc-config | 6 +++++-
20 > >> 1 file changed, 5 insertions(+), 1 deletion(-)
21 > >>
22 > >> diff --git a/gcc-config b/gcc-config
23 > >> index f03a46a..6f306db 100755
24 > >> --- a/gcc-config
25 > >> +++ b/gcc-config
26 > >> @@ -262,7 +262,7 @@ update_wrappers() {
27 > >> # For all toolchains, we want to create the fully qualified
28 > >> # `tuple-foo`. Only native ones do we want the simple `foo`.
29 > >> local all_wrappers=( ${new_wrappers[@]/#/${CTARGET}-} )
30 > >> - if ! is_cross_compiler ; then
31 > >> + if ! is_cross_compiler && [[ "${DEFAULT_PROGS}" == "yes" ]];
32 > then
33 > >> all_wrappers+=( "${new_wrappers[@]}" )
34 > >> # There are a few fun extra progs which we have to
35 > handle #412319
36 > >> all_wrappers+=( cc:gcc f77:g77 )
37 > >> @@ -951,6 +951,7 @@ FORCE="no"
38 > >> CC_COMP=
39 > >> ENV_D="${EROOT}etc/env.d"
40 > >> GCC_ENV_D="${ENV_D}/gcc"
41 > >> +DEFAULT_PROGS="yes"
42 > >>
43 > >> for x in "$@" ; do
44 > >> case "${x}" in
45 > >> @@ -972,6 +973,9 @@ for x in "$@" ; do
46 > >> -l|--list-profiles)
47 > >> set_doit list_profiles
48 > >> ;;
49 > >> + -n|--no-default-vars)
50 > >> + DEFAULT_PROGS="no"
51 > >> + ;;
52 > >> -S|--split-profile)
53 > >> if [[ ( $1 != "-S" && $1 != "--split-profile" )
54 > || $# -eq 1 ]] ; then
55 > >> usage 1
56 > >> --
57 > >>
58 > >
59 > > Not sure of the correct mailing list for patches to gcc-config so also
60 > adding toolchain@gentoo .
61 > >
62 >
63 > toolchain@g.o should generally be fine.
64 >
65 > Today cc->gcc and gcc->${CHOST}-gcc symlinks are effectively owned by
66 > a single sys-devel/gcc-config package.
67 > gcc-config is calld to update symlinks every time sys-devel/gcc is
68 > installed/updated. That way we never get cc/gcc
69 > out of sync.
70 >
71 > Your change makes /usr/bin/cc an orphan symlink. I think we need to
72 > still keep a 'cc'/'f77' ownership somewhere
73 > (say, a separate package).
74 >
75 > I suggest making a decision to handle or not handle 'cc'/'f77' and
76 > gcc-config build-time, not gcc-config call-time.
77 > That way sys-devel/gcc updates will behave the same as manual
78 > 'gcc-config-' calls.
79 >
80 > Mechanically that could be a Makefile variable that switches the
81 > behaviour on/off at
82 > https://gitweb.gentoo.org/proj/gcc-config.git/tree/Makefile
83 > and exposed as an USE flag on sys-devel/gcc-config ebuild.
84 >
85 > Later we can create a separate ebuild to manage /usr/bin/cc. For gcc
86 > it's not hard, as gcc-config always provides /usr/bin/gcc and
87 > /usr/bin/${CHOST}-gcc.
88 > These can be static symlinks that don't require maintenance updates.
89 >
90 > Thanks for the suggestion. I will look into adding a Makefile variable
91 exposed via an USE flag.
92 Regarding the separate ebuild, I hope someone more knowledgeable
93 than me regarding ebuilds can handle that.
94
95 Thanks,
96 Manoj
97
98
99 > For clang it's less straightforward as gentoo's clang does not provide
100 > stable path to symlink to.
101 >
102 > --
103 > Sergei
104 >

Replies