summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Le Cuirot <chewi@gentoo.org>2025-05-20 17:30:34 +0100
committerJames Le Cuirot <chewi@gentoo.org>2025-06-05 11:55:05 +0100
commit0aa27096d9614b631e016586a8f6eb4df696ff75 (patch)
tree1992b59fa331a79409956c5646c3a41e6b83be99
parenta8ecc34b1aa9e625fc953130f5b5082df0bb60d7 (diff)
downloadgentoo-0aa27096d9614b631e016586a8f6eb4df696ff75.tar.gz
gentoo-0aa27096d9614b631e016586a8f6eb4df696ff75.tar.bz2
gentoo-0aa27096d9614b631e016586a8f6eb4df696ff75.zip
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@gentoo.org>
-rw-r--r--eclass/linux-info.eclass7
1 files 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
}