summaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.package
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2022-07-14 14:02:40 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2022-07-27 21:18:00 +0900
commit3089b2be0cce14bd026a1018b8f6e5aed8244545 (patch)
tree12d2e0d3c5c8419a67b4460fb40ee5ff533cc9eb /scripts/Makefile.package
parent59316eac0e5ba5863594a793f6d8b5d8ccb8e880 (diff)
downloadlinux-stable-3089b2be0cce14bd026a1018b8f6e5aed8244545.tar.gz
linux-stable-3089b2be0cce14bd026a1018b8f6e5aed8244545.tar.bz2
linux-stable-3089b2be0cce14bd026a1018b8f6e5aed8244545.zip
kbuild: rpm-pkg: fix build error when _arch is undefined
Cross-building (bin)rpm-pkg fails on several architectures. For example, 'make ARCH=arm binrpm-pkg' fails like follows: sh ./scripts/package/mkspec prebuilt > ./binkernel.spec rpmbuild --define "_builddir ." --target \ arm -bb ./binkernel.spec Building target platforms: arm Building for target arm warning: line 19: It's not recommended to have unversioned Obsoletes: Obsoletes: kernel-headers Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.0S8t2F + umask 022 + cd . + mkdir -p /home/masahiro/rpmbuild/BUILDROOT/kernel-5.19.0_rc6-19.%{_arch}/boot + make -f ./Makefile image_name + cp arch/arm/boot/zImage /home/masahiro/rpmbuild/BUILDROOT/kernel-5.19.0_rc6-19.%{_arch}/boot/vmlinuz-5.19.0-rc6 + make -f ./Makefile INSTALL_MOD_PATH=/home/masahiro/rpmbuild/BUILDROOT/kernel-5.19.0_rc6-19.%{_arch} modules_install make[3]: *** No rule to make target '/home/masahiro/rpmbuild/BUILDROOT/kernel-5.19.0_rc6-19.arch/arm/crypto/aes-arm-bs.ko{_arch}/lib/modules/5.19.0-rc6/kernel/%', needed by '__modinst'. Stop. make[2]: *** [Makefile:1768: modules_install] Error 2 error: Bad exit status from /var/tmp/rpm-tmp.0S8t2F (%install) By default, 'buildroot' contains %{_arch} (see /usr/lib/rpm/macros). _arch is generally defined in /usr/lib/rpm/platforms/*/macros, where the platform sub-directory is specified by --target= option for cross builds. If the given arch does not exist, %{_arch} is not expanded. In the example above, --target=arm is passed to rpmbuild, but /usr/lib/rpm/platforms/arm-linux/ does not exist. The '%' character in the path confuses GNU make and rpmbuild. The same occurs for such architectures as csky, microblaze, nios2, etc. Define _arch if it has not been defined. Reported-by: Jason Self <jason@bluehome.net> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts/Makefile.package')
0 files changed, 0 insertions, 0 deletions