diff options
author | Ionen Wolkens <ionen@gentoo.org> | 2022-06-01 12:12:05 -0400 |
---|---|---|
committer | Ionen Wolkens <ionen@gentoo.org> | 2022-06-01 13:08:43 -0400 |
commit | 2619dd7945d742b208b545c97b2c7635c17d9256 (patch) | |
tree | 11d66e9cf9f1b25912d6740ed5a8927dea6f537e /x11-drivers | |
parent | app-office/libreoffice-bin-debug: Version bump (diff) | |
download | gentoo-2619dd7945d742b208b545c97b2c7635c17d9256.tar.gz gentoo-2619dd7945d742b208b545c97b2c7635c17d9256.tar.bz2 gentoo-2619dd7945d742b208b545c97b2c7635c17d9256.zip |
x11-drivers/nvidia-drivers: warn if incompatible gcc plugins
This isn't specific to nvidia-drivers (even a blank test.c
fails), but it's not uncommon this is the only third party
module that a user have and a warning wouldn't hurt.
Normally not an issue given gcc plugins are typically not
enabled by default (or the option is set, but individual
plugins are disabled) and mismatching is mostly fine.
Also note about kernel-bin given the module-specific bits
/can/ be rebuilt and it may sound confusing otherwise.
Bug: https://bugs.gentoo.org/849011
Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
Diffstat (limited to 'x11-drivers')
6 files changed, 96 insertions, 6 deletions
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-390.151.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-390.151.ebuild index a76225d551c3..899eae8420ab 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-390.151.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-390.151.ebuild @@ -177,7 +177,22 @@ src_compile() { NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out ) - use driver && linux-mod_src_compile + if use driver; then + if linux_chkconfig_present GCC_PLUGINS; then + mkdir "${T}"/plugin-test || die + echo "obj-m += test.o" > "${T}"/plugin-test/Kbuild || die + > "${T}"/plugin-test/test.c || die + if [[ $(LC_ALL=C make -C "${KV_OUT_DIR}" ARCH="$(tc-arch-kernel)" \ + HOSTCC="$(tc-getBUILD_CC)" M="${T}"/plugin-test 2>&1) \ + =~ "error: incompatible gcc/plugin version" ]]; then + ewarn "Warning: detected kernel was built with different gcc/plugin versions," + ewarn "you may need to 'make clean' and rebuild your kernel with the current" + ewarn "gcc version (or re-emerge for distribution kernels, including kernel-bin)." + fi + fi + + linux-mod_src_compile + fi if use persistenced; then # 390.xx persistenced does not auto-detect libtirpc diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-470.129.06.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-470.129.06.ebuild index 19ecb17aad10..6d7c0b7fb3bc 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-470.129.06.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-470.129.06.ebuild @@ -175,7 +175,22 @@ src_compile() { XNVCTRL_CFLAGS=-fPIC #840389 ) - use driver && linux-mod_src_compile + if use driver; then + if linux_chkconfig_present GCC_PLUGINS; then + mkdir "${T}"/plugin-test || die + echo "obj-m += test.o" > "${T}"/plugin-test/Kbuild || die + > "${T}"/plugin-test/test.c || die + if [[ $(LC_ALL=C make -C "${KV_OUT_DIR}" ARCH="$(tc-arch-kernel)" \ + HOSTCC="$(tc-getBUILD_CC)" M="${T}"/plugin-test 2>&1) \ + =~ "error: incompatible gcc/plugin version" ]]; then + ewarn "Warning: detected kernel was built with different gcc/plugin versions," + ewarn "you may need to 'make clean' and rebuild your kernel with the current" + ewarn "gcc version (or re-emerge for distribution kernels, including kernel-bin)." + fi + fi + + linux-mod_src_compile + fi emake "${NV_ARGS[@]}" -C nvidia-modprobe use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-470.62.30.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-470.62.30.ebuild index 8c77f921b745..42d21e9962a4 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-470.62.30.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-470.62.30.ebuild @@ -175,7 +175,22 @@ src_compile() { XNVCTRL_CFLAGS=-fPIC #840389 ) - use driver && linux-mod_src_compile + if use driver; then + if linux_chkconfig_present GCC_PLUGINS; then + mkdir "${T}"/plugin-test || die + echo "obj-m += test.o" > "${T}"/plugin-test/Kbuild || die + > "${T}"/plugin-test/test.c || die + if [[ $(LC_ALL=C make -C "${KV_OUT_DIR}" ARCH="$(tc-arch-kernel)" \ + HOSTCC="$(tc-getBUILD_CC)" M="${T}"/plugin-test 2>&1) \ + =~ "error: incompatible gcc/plugin version" ]]; then + ewarn "Warning: detected kernel was built with different gcc/plugin versions," + ewarn "you may need to 'make clean' and rebuild your kernel with the current" + ewarn "gcc version (or re-emerge for distribution kernels, including kernel-bin)." + fi + fi + + linux-mod_src_compile + fi emake "${NV_ARGS[@]}" -C nvidia-modprobe use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-510.73.05.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-510.73.05.ebuild index 0921e41c8ac8..0401adaf9dd2 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-510.73.05.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-510.73.05.ebuild @@ -180,7 +180,22 @@ src_compile() { XNVCTRL_CFLAGS=-fPIC #840389 ) - use driver && linux-mod_src_compile + if use driver; then + if linux_chkconfig_present GCC_PLUGINS; then + mkdir "${T}"/plugin-test || die + echo "obj-m += test.o" > "${T}"/plugin-test/Kbuild || die + > "${T}"/plugin-test/test.c || die + if [[ $(LC_ALL=C make -C "${KV_OUT_DIR}" ARCH="$(tc-arch-kernel)" \ + HOSTCC="$(tc-getBUILD_CC)" M="${T}"/plugin-test 2>&1) \ + =~ "error: incompatible gcc/plugin version" ]]; then + ewarn "Warning: detected kernel was built with different gcc/plugin versions," + ewarn "you may need to 'make clean' and rebuild your kernel with the current" + ewarn "gcc version (or re-emerge for distribution kernels, including kernel-bin)." + fi + fi + + linux-mod_src_compile + fi emake "${NV_ARGS[@]}" -C nvidia-modprobe use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-515.43.04.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-515.43.04.ebuild index b3f07bbc73fc..becc8ad64bec 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-515.43.04.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-515.43.04.ebuild @@ -203,7 +203,22 @@ src_compile() { XNVCTRL_CFLAGS=-fPIC #840389 ) - use driver && linux-mod_src_compile + if use driver; then + if linux_chkconfig_present GCC_PLUGINS; then + mkdir "${T}"/plugin-test || die + echo "obj-m += test.o" > "${T}"/plugin-test/Kbuild || die + > "${T}"/plugin-test/test.c || die + if [[ $(LC_ALL=C make -C "${KV_OUT_DIR}" ARCH="$(tc-arch-kernel)" \ + HOSTCC="$(tc-getBUILD_CC)" M="${T}"/plugin-test 2>&1) \ + =~ "error: incompatible gcc/plugin version" ]]; then + ewarn "Warning: detected kernel was built with different gcc/plugin versions," + ewarn "you may need to 'make clean' and rebuild your kernel with the current" + ewarn "gcc version (or re-emerge for distribution kernels, including kernel-bin)." + fi + fi + + linux-mod_src_compile + fi emake "${NV_ARGS[@]}" -C nvidia-modprobe use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-515.48.07.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-515.48.07.ebuild index 462e7a7ec053..f5bb02ed1629 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-515.48.07.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-515.48.07.ebuild @@ -202,7 +202,22 @@ src_compile() { XNVCTRL_CFLAGS=-fPIC #840389 ) - use driver && linux-mod_src_compile + if use driver; then + if linux_chkconfig_present GCC_PLUGINS; then + mkdir "${T}"/plugin-test || die + echo "obj-m += test.o" > "${T}"/plugin-test/Kbuild || die + > "${T}"/plugin-test/test.c || die + if [[ $(LC_ALL=C make -C "${KV_OUT_DIR}" ARCH="$(tc-arch-kernel)" \ + HOSTCC="$(tc-getBUILD_CC)" M="${T}"/plugin-test 2>&1) \ + =~ "error: incompatible gcc/plugin version" ]]; then + ewarn "Warning: detected kernel was built with different gcc/plugin versions," + ewarn "you may need to 'make clean' and rebuild your kernel with the current" + ewarn "gcc version (or re-emerge for distribution kernels, including kernel-bin)." + fi + fi + + linux-mod_src_compile + fi emake "${NV_ARGS[@]}" -C nvidia-modprobe use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced |