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)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id D00C415800F for ; Sat, 21 Jan 2023 11:04:18 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id ADCF5E08EC; Sat, 21 Jan 2023 11:04:14 +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 6BBC6E0864 for ; Sat, 21 Jan 2023 11:04:14 +0000 (UTC) From: James Le Cuirot To: gentoo-dev Cc: James Le Cuirot Subject: [gentoo-dev] [PATCH] kernel-2.eclass: Make xmakeopts an array for spaces in toolchain vars Date: Sat, 21 Jan 2023 11:03:56 +0000 Message-Id: <20230121110356.12183-1-chewi@gentoo.org> X-Mailer: git-send-email 2.39.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: c1c17b70-fb27-4d6f-8ee4-1ef83d47f24f X-Archives-Hash: aba6cac58e48bae58f5a74778e1f92e7 Variables like CC can have spaces for additional arguments. This is particularly useful for reliably setting the sysroot. Signed-off-by: James Le Cuirot --- eclass/kernel-2.eclass | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass index 873d4a204669..f7fcf15743f0 100644 --- a/eclass/kernel-2.eclass +++ b/eclass/kernel-2.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2022 Gentoo Authors +# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: kernel-2.eclass @@ -756,13 +756,22 @@ env_setup_xmakeopts() { # When cross-compiling, we need to set the ARCH/CROSS_COMPILE # variables properly or bad things happen ! - xmakeopts="ARCH=${KARCH}" + xmakeopts=( ARCH="${KARCH}" ) if [[ ${CTARGET} != ${CHOST} ]] && ! cross_pre_c_headers; then - xmakeopts="${xmakeopts} CROSS_COMPILE=${CTARGET}-" + xmakeopts+=( CROSS_COMPILE="${CTARGET}-" ) elif type -p ${CHOST}-ar >/dev/null; then - xmakeopts="${xmakeopts} CROSS_COMPILE=${CHOST}-" + xmakeopts+=( CROSS_COMPILE="${CHOST}-" ) fi - xmakeopts="${xmakeopts} HOSTCC=$(tc-getBUILD_CC) CC=$(tc-getCC) LD=$(tc-getLD) AR=$(tc-getAR) NM=$(tc-getNM) OBJCOPY=$(tc-getOBJCOPY) READELF=$(tc-getREADELF) STRIP=$(tc-getSTRIP)" + xmakeopts+=( + HOSTCC="$(tc-getBUILD_CC)" + CC="$(tc-getCC)" + LD="$(tc-getLD)" + AR="$(tc-getAR)" + NM="$(tc-getNM)" + OBJCOPY="$(tc-getOBJCOPY)" + READELF="$(tc-getREADELF)" + STRIP="$(tc-getSTRIP)" + ) export xmakeopts } @@ -850,7 +859,7 @@ install_headers() { local ddir=$(kernel_header_destdir) env_setup_xmakeopts - emake headers_install INSTALL_HDR_PATH="${ED}"${ddir}/.. ${xmakeopts} + emake headers_install INSTALL_HDR_PATH="${ED}"${ddir}/.. "${xmakeopts[@]}" # let other packages install some of these headers rm -rf "${ED}"${ddir}/scsi || die #glibc/uclibc/etc... -- 2.39.1