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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A4664158087 for ; Mon, 17 Jan 2022 11:10:21 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BD4A32BC025; Mon, 17 Jan 2022 11:10:13 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CEE2DE075F for ; Mon, 17 Jan 2022 11:10:12 +0000 (UTC) From: Sam James To: gentoo-dev@lists.gentoo.org Cc: cross@gentoo.org, base-system@gentoo.org, chewi@gentoo.org, Sam James Subject: [gentoo-dev] [PATCH 1/4] autotools.eclass: don't inject -I${SYSROOT} to aclocal Date: Mon, 17 Jan 2022 11:09:47 +0000 Message-Id: <20220117110950.139015-1-sam@gentoo.org> X-Mailer: git-send-email 2.34.1 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: 1c08e0ae-93f1-4488-ab40-78497b06a278 X-Archives-Hash: 215f153596b3843ec9349dbed9baf1e7 When -I${SYSROOT} is injected, it'll override the default of -Im4, which results in trying to install macros to ${SYSROOT} (a sandbox violation) when they can't be found. >From aclocal(1): ``` -I DIR add directory to search list for .m4 files --install copy third-party files to the first -I directory ``` The first directry is normally -Im4 if anything, whereas when injected (when ${SYSROOT} is defined), it ends up being ${SYSROOT}, not m4 (so we try to copy macros to somewhere outside of the build directory). In EAPI 7+, this is almost always the case! We don't generally expect to find macros (particularly things like autoconf-archive) in ${SYSROOT} because that's for DEPEND-class dependencies, then they end up being copied in unnecessarily and wrongly. We could drop this just for < EAPI 7, but I'm not sure there's much point there either. As Chewi observed in bug 677002, you can't assume they'll be present in ${SYSROOT} anyway, and frankly, the cross-compilation (and --root, --sysroot, and so on) situation is rather bleak for earlier EAPIs, which is why we did all that work for 7. Bug: https://bugs.gentoo.org/710792 Closes: https://bugs.gentoo.org/677002 Closes: https://bugs.gentoo.org/738918 Thanks-to: James Le Cuirot Signed-off-by: Sam James --- eclass/autotools.eclass | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass index 95c92cc6df8ca..e2572290f0cbe 100644 --- a/eclass/autotools.eclass +++ b/eclass/autotools.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: autotools.eclass @@ -666,12 +666,6 @@ autotools_m4sysdir_include() { # First try to use the paths the system integrator has set up. local paths=( $(eval echo ${AT_SYS_M4DIR}) ) - if [[ ${#paths[@]} -eq 0 && -n ${SYSROOT} ]] ; then - # If they didn't give us anything, then default to the SYSROOT. - # This helps when cross-compiling. - local path="${SYSROOT}/usr/share/aclocal" - [[ -d ${path} ]] && paths+=( "${path}" ) - fi _autotools_m4dir_include "${paths[@]}" } -- 2.34.1