From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 61E171382C5 for ; Fri, 22 May 2020 09:40:34 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7D171E089C; Fri, 22 May 2020 09:40:33 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 601FAE089C for ; Fri, 22 May 2020 09:40:33 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3258134F2D6 for ; Fri, 22 May 2020 09:40:31 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 714EA21E for ; Fri, 22 May 2020 09:40:25 +0000 (UTC) From: "Sergei Trofimovich" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sergei Trofimovich" Message-ID: <1590140366.d91cd5bdc56a6fcb71a998fd8ba81b47c9a13246.slyfox@gentoo> Subject: [gentoo-commits] proj/gcc-config:master commit in: / X-VCS-Repository: proj/gcc-config X-VCS-Files: Makefile gcc-config X-VCS-Directories: / X-VCS-Committer: slyfox X-VCS-Committer-Name: Sergei Trofimovich X-VCS-Revision: d91cd5bdc56a6fcb71a998fd8ba81b47c9a13246 X-VCS-Branch: master Date: Fri, 22 May 2020 09:40:25 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 981c0a9d-d01e-48d3-bc87-62f615b66959 X-Archives-Hash: 31edcf97a1b1cf93d7dc218b6cd2bc56 commit: d91cd5bdc56a6fcb71a998fd8ba81b47c9a13246 Author: Sergei Trofimovich gentoo org> AuthorDate: Fri May 22 09:39:26 2020 +0000 Commit: Sergei Trofimovich gentoo org> CommitDate: Fri May 22 09:39:26 2020 +0000 URL: https://gitweb.gentoo.org/proj/gcc-config.git/commit/?id=d91cd5bd gcc-config: add build-time and runtime switches to disable native symlinks We have two knobs here: 1. Build-time knob USE_NATIVE_LINKS to set a default, defaults to 'yes' (existing behaviour) 2. Run-time --enable-native-links / --disable-native-links knobs. These are not persistent across gcc-config runs and are meant for manual testing. Undocumented for now. Reported-by: Kent Fredric Bug: https://bugs.gentoo.org/724454 Signed-off-by: Sergei Trofimovich gentoo.org> Makefile | 8 ++++++++ gcc-config | 8 ++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 2b3b235..c74adec 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,10 @@ +# configurable options: +# Avoid installing native symlinks like: +# /usr/bin/gcc -> ${CTARGET}-gcc +# and keep only +# ${CTARGET}-gcc +USE_NATIVE_LINKS ?= yes + EPREFIX ?= PN = gcc-config @@ -27,6 +34,7 @@ clean: -e 's:@GENTOO_EPREFIX@:$(EPREFIX):g' \ -e 's:@GENTOO_LIBDIR@:$(SUBLIBDIR):g' \ -e 's:@PV@:$(PV):g' \ + -e 's:@USE_NATIVE_LINKS@:$(USE_NATIVE_LINKS):g' \ $< > $@ chmod a+rx $@ diff --git a/gcc-config b/gcc-config index beeb82a..9dc09e0 100755 --- a/gcc-config +++ b/gcc-config @@ -261,9 +261,10 @@ update_wrappers() { done # For all toolchains, we want to create the fully qualified - # `tuple-foo`. Only native ones do we want the simple `foo`. + # `tuple-foo`. Only native ones do we want the simple `foo` + # and only for USE_NATIVE_LINKS=yes mode. local all_wrappers=( ${new_wrappers[@]/#/${CTARGET}-} ) - if ! is_cross_compiler ; then + if ! is_cross_compiler && [[ ${USE_NATIVE_LINKS} == 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 ) @@ -952,6 +953,7 @@ FORCE="no" CC_COMP= ENV_D="${EROOT}etc/env.d" GCC_ENV_D="${ENV_D}/gcc" +USE_NATIVE_LINKS="@USE_NATIVE_LINKS@" for x in "$@" ; do case "${x}" in @@ -1005,6 +1007,8 @@ for x in "$@" ; do echo "${argv0}: @PV@" exit 0 ;; + --enable-native-links) USE_NATIVE_LINKS="yes" ;; + --disable-native-links) USE_NATIVE_LINKS="no" ;; -*) die "Invalid switch! Run ${argv0} without parameters for help." ;;