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 968AC15800A for ; Fri, 21 Jul 2023 12:47:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F11AFE0952; Fri, 21 Jul 2023 12:46:33 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B9AABE094F for ; Fri, 21 Jul 2023 12:46:33 +0000 (UTC) From: Sam James To: gentoo-dev@lists.gentoo.org Cc: toolchain@gentoo.org, dist-kernel@gentoo.org, sparc@gentoo.org, Sam James Subject: [gentoo-dev] [PATCH 3/6] kernel-build.eclass: add special-case for sparc arch/ directory Date: Fri, 21 Jul 2023 13:46:09 +0100 Message-ID: <20230721124615.1797438-3-sam@gentoo.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230721124615.1797438-1-sam@gentoo.org> References: <20230721124615.1797438-1-sam@gentoo.org> 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: 242a20f9-c702-4145-8f61-1e491d5b5a7e X-Archives-Hash: 5dc78e88c49b07dc2ea06d3d0288f098 Unfortunately, we still have a mess wrt dual-bitness arches. For sparc, there's arch/sparc, with ARCH=sparc being "whatever the toolchain is", ARCH=sparc32 being "give me a 32-bit kernel", and ARCH=sparc64 being "give me a 64-bit kernel". You do, seemingly, need to actually pass ARCH=sparc64 to guarantee correct results, as various kernel Makefiles check for the ARCH value, even though ARCH=sparc will pop out a 64-bit kernel. (I originally updated toolchain-funcs.eclass's tc-ninja_magic_to_arch, but we later found that doesn't look particularly sturdy. Per at the very least 5ba800962a80d4158b73fb91a7779df7b770c750 ("kbuild: update ARCH alias info for sparc") upstream, although it seems to go back a fair bit earlier, ARCH=sparc when building the kernel means "sparc64" if on a sparc64 host.) Signed-off-by: Sam James --- eclass/kernel-build.eclass | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass index ff615a02d0ebf..276a08a104e0e 100644 --- a/eclass/kernel-build.eclass +++ b/eclass/kernel-build.eclass @@ -257,6 +257,14 @@ kernel-build_src_install() { local kern_arch=$(tc-arch-kernel) local dir_ver=${PV}${KV_LOCALVERSION} local kernel_dir=/usr/src/linux-${dir_ver} + + if use sparc ; then + # We don't want tc-arch-kernel's sparc64, even though we do + # need to pass ARCH=sparc64 to the build system. It's a quasi-alias + # in Kbuild. + kern_arch=sparc + fi + dodir "${kernel_dir}/arch/${kern_arch}" mv include scripts "${ED}${kernel_dir}/" || die mv "arch/${kern_arch}/include" \ -- 2.41.0