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 68841138334 for ; Sun, 22 Dec 2019 22:32:48 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8FD8FE0CD4; Sun, 22 Dec 2019 22:32:47 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 6C659E0CD4 for ; Sun, 22 Dec 2019 22:32:47 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 3DB7F34DA8B for ; Sun, 22 Dec 2019 22:32:46 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 727F417F31 for ; Sun, 22 Dec 2019 22:32:44 +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: <1577053779.1ebd639ccc8605f3e69b5973788101264902559e.slyfox@gentoo> Subject: [gentoo-commits] proj/crossdev:master commit in: / X-VCS-Repository: proj/crossdev X-VCS-Files: crossdev X-VCS-Directories: / X-VCS-Committer: slyfox X-VCS-Committer-Name: Sergei Trofimovich X-VCS-Revision: 1ebd639ccc8605f3e69b5973788101264902559e X-VCS-Branch: master Date: Sun, 22 Dec 2019 22:32:44 +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: 3db562ba-1cbe-4030-99b5-688c519fbb28 X-Archives-Hash: a399cd4b4d3e2cedc3eaa79262b72f28 commit: 1ebd639ccc8605f3e69b5973788101264902559e Author: Sergei Trofimovich gentoo org> AuthorDate: Sun Dec 22 22:29:39 2019 +0000 Commit: Sergei Trofimovich gentoo org> CommitDate: Sun Dec 22 22:29:39 2019 +0000 URL: https://gitweb.gentoo.org/proj/crossdev.git/commit/?id=1ebd639c crossdev: refuse to install crossdev on all CHOST ABIs, not just default In bug #500338 attempt to install toolchain for secondary ABY (x86 on amd64 system) clobbered native tools with tools that target --systroot=/usr/${CTARGET}. That is never an intended state. Block all CHOSTs and suggest using sys-devel/multilib-gcc-wrapper for distcc-like workloads. Bug: https://bugs.gentoo.org/500338 Signed-off-by: Sergei Trofimovich gentoo.org> crossdev | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/crossdev b/crossdev index cec8170..b0c44c5 100755 --- a/crossdev +++ b/crossdev @@ -486,6 +486,7 @@ show_repo_cfg() { setup_portage_vars() { local arch=${ARCH} arch_set=${ARCH+set} local chost=${CHOST} chost_set=${CHOST+set} + local abi unset ARCH CHOST eval $(portageq envvar -v PORT_LOGDIR PORTAGE_TMPDIR ARCH CHOST) parse_repo_config @@ -496,6 +497,17 @@ setup_portage_vars() { HCHOST=${CHOST} [[ ${chost_set} == "set" ]] && CHOST=${chost} || unset CHOST + # Collect all CHOST* visible for for host. We need to make sure + # not to clobber any of native CHOSTs. + HCHOSTS=(${HCHOST}) + for abi in $(portageq envvar ABI MULTILIB_ABIS DEFAULT_ABI); do + HCHOSTS+=($(portageq envvar CHOST_${abi})) + done + # uniq + HCHOSTS=( + $(printf "%s\n" "${HCHOSTS[@]}" | sort -u) + ) + # see if user told us where to write things, otherwise # set up some repos.conf magic if possible. if not, # install our stuff to the first overlay in the list. @@ -682,6 +694,7 @@ UOPTS= TARCH= HARCH= HCHOST= +HCHOSTS=() CTARGET= MULTILIB_ABIS="default" MULTILIB_USE="" @@ -844,6 +857,15 @@ if [[ ${HCHOST} == "${CTARGET}" ]] ; then exit 1 fi +for hchost in "${HCHOSTS[@]}"; do + if [[ ${hchost} == "${CTARGET}" ]] ; then + eerror "Refusing to create a cross-compiler using the same" + eerror "target name as your host utils." + eerror "Consider using sys-devel/multilib-gcc-wrapper package." + exit 1 + fi +done + # grab user settings d="${CONFIGROOT}/crossdev/${CTARGET}" for v in MULTILIB_ABIS USE BVER GVER KVER LVER STAGE CFLAGS LDFLAGS ASFLAGS ; do @@ -935,7 +957,7 @@ info() { hr - einfo "crossdev version: ${CROSSDEV_VER}" einfo "Host Portage ARCH: ${HARCH}" -einfo "Host Portage System: ${HCHOST}" +einfo "Host Portage System: ${HCHOST} (${HCHOSTS[*]})" einfo "Target Portage ARCH: ${TARCH}" einfo "Target System: ${CTARGET}" einfo "Stage: ${STAGE} (${STAGE_DISP[${STAGE}]})"