commit: 0aa27096d9614b631e016586a8f6eb4df696ff75
Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Tue May 20 16:30:34 2025 +0000
Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Thu Jun 5 10:55:05 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0aa27096
linux-info.eclass: Set the correct ARCH for make in getfilevar
Currently, it unsets ARCH, so it uses the build architecture. This is
fine if you have the full kernel sources, which is usually the case.
However, an install-extmod-build script was added to Linux fairly
recently that installs just the files needed to build out-of-tree
modules in a distro-neutral manner. It saves space by only including the
arch files for the target architecture.
I checked the history, and tc-arch-kernel didn't exist when the unset
line was added. If it had, this approach probably would have been taken
at the time.
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
eclass/linux-info.eclass | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
index c7950b4e2292..42cde638cf27 100644
--- a/eclass/linux-info.eclass
+++ b/eclass/linux-info.eclass
@@ -219,7 +219,7 @@ qeerror() { qout eerror "${@}" ; }
# done by including the 'configfile', and printing the variable with Make.
# It WILL break if your makefile has missing dependencies!
getfilevar() {
- local ERROR basefname basedname myARCH="${ARCH}"
+ local ERROR basefname basedname
ERROR=0
[[ -z "${1}" ]] && ERROR=1
@@ -232,16 +232,13 @@ getfilevar() {
else
basefname="$(basename ${2})"
basedname="$(dirname ${2})"
- unset ARCH
# We use nonfatal because we want the caller to take care of
things #373151
# Pass need-config= to make to avoid config check in kernel
Makefile.
# Pass dot-config=0 to avoid the config check in kernels prior
to 5.4.
echo -e "e:\\n\\t@echo \$(${1})\\ninclude ${basefname}" | \
nonfatal emake -C "${basedname}" --no-print-directory
M="${T}" \
- dot-config=0 need-config= need-compiler= -s -f -
2>/dev/null
-
- ARCH=${myARCH}
+ ARCH="$(tc-arch-kernel)" dot-config=0 need-config=
need-compiler= -s -f - 2>/dev/null
fi
}