summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2023-07-22 06:47:52 +0200
committerMasahiro Yamada <masahiroy@kernel.org>2023-07-24 17:59:32 +0200
commita06d9ef897d59f719102e2890abd8a2b91e29a60 (patch)
treedd0d4f32d9e52da374a6ae0fefa6c908a1ab9658 /scripts
parentkbuild: rpm-pkg: use %{makeflags} to pass common Make options (diff)
downloadlinux-a06d9ef897d59f719102e2890abd8a2b91e29a60.tar.xz
linux-a06d9ef897d59f719102e2890abd8a2b91e29a60.zip
kbuild: rpm-pkg: record ARCH option in spec file
Currently, we rely on the top Makefile defining ARCH option when we run 'make rpm-pkg' or 'make binrpm-pkg'. It does not apply when we run 'make srcrpm-pkg', and separately run 'rpmbuild' for the generated SRPM. This is a problem for cross-build. Just like the Debian package, save the value of ARCH in the spec file. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/package/mkspec4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
index a1ce6677880a..0befb4e2ac6b 100755
--- a/scripts/package/mkspec
+++ b/scripts/package/mkspec
@@ -38,8 +38,10 @@ EXCLUDES="$RCS_TAR_IGNORE --exclude=*vmlinux* --exclude=*.mod \
# $S: this line is enabled only when building source package
# $M: this line is enabled only when CONFIG_MODULES is enabled
sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
+%define ARCH ${ARCH}
+
%{!?make: %define make make}
-%define makeflags %{?_smp_mflags}
+%define makeflags %{?_smp_mflags} ARCH=%{ARCH}
Name: kernel
Summary: The Linux Kernel