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 87BEF1382C5 for ; Fri, 30 Mar 2018 11:43:17 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7D4E7E09CD; Fri, 30 Mar 2018 11:43:16 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.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 44962E09CD for ; Fri, 30 Mar 2018 11:43:16 +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 AC599335D35 for ; Fri, 30 Mar 2018 11:43:14 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4429E272 for ; Fri, 30 Mar 2018 11:43:13 +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: <1522410188.bdb069df283ccbe1e3f5fd39bb2270ec640a67b7.slyfox@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/glibc/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-libs/glibc/glibc-2.27-r1.ebuild sys-libs/glibc/glibc-9999.ebuild X-VCS-Directories: sys-libs/glibc/ X-VCS-Committer: slyfox X-VCS-Committer-Name: Sergei Trofimovich X-VCS-Revision: bdb069df283ccbe1e3f5fd39bb2270ec640a67b7 X-VCS-Branch: master Date: Fri, 30 Mar 2018 11:43:13 +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-Archives-Salt: 132eed9c-7463-45f6-bdc5-9d164db32b8c X-Archives-Hash: 68ff802883b00e857f384244e3bdb8a7 commit: bdb069df283ccbe1e3f5fd39bb2270ec640a67b7 Author: Sergei Trofimovich gentoo org> AuthorDate: Fri Mar 30 11:41:50 2018 +0000 Commit: Sergei Trofimovich gentoo org> CommitDate: Fri Mar 30 11:43:08 2018 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bdb069df sys-libs/glibc: fix glibc-headers bootstrap on non-multilib host The error is found by wm_ attempting to build a cross-compiler CHOST=powerpc-unknown-linux-gnu CTARGET=mips64-unknown-linux-gnu Boostrap failed on glibc-headers (./configure phase) as: configure:2623: powerpc-unknown-linux-gnu-gcc -mabi=n32 -c \ -O1 -pipe -U_FORTIFY_SOURCE conftest.c >&5 powerpc-unknown-linux-gnu-gcc: error: \ unrecognized command line option '-mabi=n32'; did you mean '-mabi=d32'? Note how target's ABI is mexed into host's compiler flags. The error above happens on every host=non-multilib target=multilib combination. I've reproduced it on: CHOST=i686-pc-linux-gnu CTARGET=mips64-unknown-linux-gnu The fix is not to inject target's CFLAGS ABI into CC for USE=headers-only bootstrap step as we don't have cross-compiler yet. Tested by successfully bootstrapping cross-compiler on CHOST=i686-pc-linux-gnu CTARGET=mips64-unknown-linux-gnu Package-Manager: Portage-2.3.26, Repoman-2.3.7 sys-libs/glibc/glibc-2.27-r1.ebuild | 7 +++++++ sys-libs/glibc/glibc-9999.ebuild | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/sys-libs/glibc/glibc-2.27-r1.ebuild b/sys-libs/glibc/glibc-2.27-r1.ebuild index a175b225e18..b281c00fac3 100644 --- a/sys-libs/glibc/glibc-2.27-r1.ebuild +++ b/sys-libs/glibc/glibc-2.27-r1.ebuild @@ -457,6 +457,13 @@ setup_env() { export ABI=${ABI:-${DEFAULT_ABI:-default}} + if use headers-only ; then + # Avoid mixing host's CC and target's CFLAGS_${ABI}: + # At this bootstrap stage we have only binutils for + # target but not compiler yet. + einfo "Skip CC ABI injection. We can't use (cross-)compiler yet." + return 0 + fi local VAR=CFLAGS_${ABI} # We need to export CFLAGS with abi information in them because glibc's # configure script checks CFLAGS for some targets (like mips). Keep diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild index 52fe095e5fd..17f8cdafed5 100644 --- a/sys-libs/glibc/glibc-9999.ebuild +++ b/sys-libs/glibc/glibc-9999.ebuild @@ -457,6 +457,13 @@ setup_env() { export ABI=${ABI:-${DEFAULT_ABI:-default}} + if use headers-only ; then + # Avoid mixing host's CC and target's CFLAGS_${ABI}: + # At this bootstrap stage we have only binutils for + # target but not compiler yet. + einfo "Skip CC ABI injection. We can't use (cross-)compiler yet." + return 0 + fi local VAR=CFLAGS_${ABI} # We need to export CFLAGS with abi information in them because glibc's # configure script checks CFLAGS for some targets (like mips). Keep