Disable GCC plugins for out of tree kernel modules

kernel modules built in VM often use different gcc version, which makes
provided gcc plugins incompatible. Since rebuilding those plugins may
not be straight forward (extra gcc headers needed, possibly kernel
config changes needed if gcc version differs significantly), disable
them for out of tree modules.

Fixes QubesOS/qubes-issues#2844

(cherry picked from commit e3a342006f)
This commit is contained in:
Marek Marczykowski-Górecki 2019-06-06 01:43:20 +02:00
parent 55de5a6d2e
commit 07374ebe08
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -253,7 +253,11 @@ cp Module.markers %buildroot/lib/modules/%kernelrelease/build
fi
rm -rf %buildroot/lib/modules/%kernelrelease/build/Documentation
cp .config %buildroot/lib/modules/%kernelrelease/build
# 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