From 1583ec425b023ba0ad21c302a3252f40664a5f7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 7 Feb 2020 03:05:51 +0100 Subject: [PATCH] Disable GCC plugins for external modules in autoconf.h too And also move config related commands into one place. Fixes QubesOS/qubes-issues#2844 (cherry picked from commit e67cae1f740f133dc8dd163cdb25fbee92f92fac) --- kernel.spec.in | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/kernel.spec.in b/kernel.spec.in index 4d0ecbc..2021707 100644 --- a/kernel.spec.in +++ b/kernel.spec.in @@ -280,11 +280,6 @@ rm -rf %buildroot/lib/modules/%kernelrelease/build/Documentation rm -rf %buildroot/lib/modules/%kernelrelease/build/scripts/tracing rm -f %buildroot/lib/modules/%kernelrelease/build/scripts/spdxcheck.py -# disable GCC plugins for external modules build, to not fail if different gcc -# version is used -sed -e 's/^\(CONFIG_GCC_PLUGIN.*\)=y/# \1 is not set/' .config > \ - %buildroot/lib/modules/%kernelrelease/build/.config - rm -f %buildroot/lib/modules/%kernelrelease/build/scripts/*.o rm -f %buildroot/lib/modules/%kernelrelease/build/scripts/*/*.o @@ -305,6 +300,13 @@ if [ -f tools/objtool/objtool ]; then popd fi +# disable GCC plugins for external modules build, to not fail if different gcc +# version is used +sed -e 's/^\(CONFIG_GCC_PLUGIN.*\)=y/# \1 is not set/' .config > \ + %buildroot/lib/modules/%kernelrelease/build/.config +sed -e '/^#define CONFIG_GCC_PLUGIN/d' include/generated/autoconf.h > \ + %buildroot/lib/modules/%kernelrelease/build/include/generated/autoconf.h + # Copy .config to include/config/auto.conf so "make prepare" is unnecessary. cp %buildroot/lib/modules/%kernelrelease/build/.config %buildroot/lib/modules/%kernelrelease/build/include/config/auto.conf @@ -312,6 +314,7 @@ cp %buildroot/lib/modules/%kernelrelease/build/.config %buildroot/lib/modules/%k # external modules can be built touch -r %buildroot/lib/modules/%kernelrelease/build/Makefile %buildroot/lib/modules/%kernelrelease/build/include/generated/uapi/linux/version.h touch -r %buildroot/lib/modules/%kernelrelease/build/.config %buildroot/lib/modules/%kernelrelease/build/include/config/auto.conf +touch -r %buildroot/lib/modules/%kernelrelease/build/.config %buildroot/lib/modules/%kernelrelease/build/include/generated/autoconf.h if test -s vmlinux.id; then cp vmlinux.id %buildroot/lib/modules/%kernelrelease/build/vmlinux.id