diff options
author | Sam James <sam@gentoo.org> | 2023-07-21 03:09:59 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2023-07-21 18:56:51 +0100 |
commit | 293d9443082622ae54c1ddbf7335c25a1f4d39a2 (patch) | |
tree | 3b0cc32831d94030c56b3aeaffa25deb91e5c625 /eclass | |
parent | dist-kernel-utils.eclass: dist-kernel_get_image_path: handle sparc (diff) | |
download | gentoo-293d9443082622ae54c1ddbf7335c25a1f4d39a2.tar.gz gentoo-293d9443082622ae54c1ddbf7335c25a1f4d39a2.tar.bz2 gentoo-293d9443082622ae54c1ddbf7335c25a1f4d39a2.zip |
kernel-build.eclass: add special-case for sparc arch/ directory
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 <sam@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/kernel-build.eclass | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass index ff615a02d0eb..276a08a104e0 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" \ |