On Thu, Feb 27, 2020 at 11:20 PM Sergei Trofimovich <[email protected]>
wrote:

> On Thu, 27 Feb 2020 at 22:41, Manoj Gupta <[email protected]> wrote:
> >
> >
> >
> > On Thu, Feb 27, 2020 at 11:22 AM Manoj Gupta <[email protected]>
> wrote:
> >>
> >> gcc-config installs cc/f77 by default. This may be undesired on
> >> systems that want to set their own versions of cc/f77.
> >>
> >> Add option "-n"/"--no-default-vars" to not install the cc/f77
> >> wrappers.
> >>
> >> Signed-off-by: Manoj Gupta <[email protected]>
> >> ---
> >>  gcc-config | 6 +++++-
> >>  1 file changed, 5 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/gcc-config b/gcc-config
> >> index f03a46a..6f306db 100755
> >> --- a/gcc-config
> >> +++ b/gcc-config
> >> @@ -262,7 +262,7 @@ update_wrappers() {
> >>         # For all toolchains, we want to create the fully qualified
> >>         # `tuple-foo`.  Only native ones do we want the simple `foo`.
> >>         local all_wrappers=( ${new_wrappers[@]/#/${CTARGET}-} )
> >> -       if ! is_cross_compiler ; then
> >> +       if ! is_cross_compiler && [[ "${DEFAULT_PROGS}" == "yes" ]];
> then
> >>                 all_wrappers+=( "${new_wrappers[@]}" )
> >>                 # There are a few fun extra progs which we have to
> handle #412319
> >>                 all_wrappers+=( cc:gcc f77:g77 )
> >> @@ -951,6 +951,7 @@ FORCE="no"
> >>  CC_COMP=
> >>  ENV_D="${EROOT}etc/env.d"
> >>  GCC_ENV_D="${ENV_D}/gcc"
> >> +DEFAULT_PROGS="yes"
> >>
> >>  for x in "$@" ; do
> >>         case "${x}" in
> >> @@ -972,6 +973,9 @@ for x in "$@" ; do
> >>                 -l|--list-profiles)
> >>                         set_doit list_profiles
> >>                         ;;
> >> +               -n|--no-default-vars)
> >> +                       DEFAULT_PROGS="no"
> >> +                       ;;
> >>                 -S|--split-profile)
> >>                         if [[ ( $1 != "-S" && $1 != "--split-profile" )
> || $# -eq 1 ]] ; then
> >>                                 usage 1
> >> --
> >>
> >
> > Not sure of the correct mailing list for patches to gcc-config so also
> adding toolchain@gentoo .
> >
>
> [email protected] should generally be fine.
>
> Today cc->gcc and gcc->${CHOST}-gcc symlinks are effectively owned by
> a single sys-devel/gcc-config package.
> gcc-config is calld to update symlinks every time sys-devel/gcc is
> installed/updated. That way we never get cc/gcc
> out of sync.
>
> Your change makes /usr/bin/cc an orphan symlink. I think we need to
> still keep a 'cc'/'f77' ownership somewhere
> (say, a separate package).
>
> I suggest making a decision to handle or not handle 'cc'/'f77' and
> gcc-config build-time, not gcc-config call-time.
> That way sys-devel/gcc updates will behave the same as manual
> 'gcc-config-' calls.
>
> Mechanically that could be a Makefile variable that switches the
> behaviour on/off at
> https://gitweb.gentoo.org/proj/gcc-config.git/tree/Makefile
> and exposed as an USE flag on sys-devel/gcc-config ebuild.
>
> Later we can create a separate ebuild to manage /usr/bin/cc. For gcc
> it's not hard, as gcc-config always provides /usr/bin/gcc and
> /usr/bin/${CHOST}-gcc.
> These can be static symlinks that don't require maintenance updates.
>
> Thanks for the suggestion. I will look into adding a Makefile variable
exposed via an USE flag.
Regarding the separate ebuild, I hope someone more knowledgeable
than me regarding ebuilds can handle that.

Thanks,
Manoj


> For clang it's less straightforward as gentoo's clang does not provide
> stable path to symlink to.
>
> --
> Sergei
>

Reply via email to