Package: nvidia-kernel-dkms
Version: 375.82-4
Severity: normal
Tags: patch
I have a vanilla kernel with CONFIG_GCC_PLUGINS, CONFIG_GCC_PLUGIN_STRUCTLEAK
and CONFIG_GCC_PLUGIN_RANDSTRUCT and conftest fails because KBUILD_CFLAGS
contains the following:
-fplugin=./scripts/gcc-plugins/structleak_plugin.so
-fplugin=./scripts/gcc-plugins/randomize_layout_plugin.so
but conftest runs with a different pwd than the module build itself.
I'm attaching a patch inspired by
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/scripts/Kbuild.include?h=v4.13.7#n118
that fixes the build.
-- System Information:
Debian Release: buster/sid
APT prefers testing
APT policy: (980, 'testing'), (980, 'stable'), (500, 'unstable-debug'), (500,
'testing-debug'), (500, 'unstable'), (500, 'stable'), (200, 'experimental'),
(1, 'experimental-debug')
Architecture: i386 (x86_64)
Foreign Architectures: amd64
Kernel: Linux 4.13.7-lis64+ (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=cs_CZ.UTF-8, LC_CTYPE=cs_CZ.UTF-8 (charmap=UTF-8),
LANGUAGE=cs_CZ.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Init: systemd (via /run/systemd/system)
Versions of packages nvidia-kernel-dkms:amd64 depends on:
ii dkms 2.3-3
ii nvidia-installer-cleanup 20151021+4
ii nvidia-kernel-support [nvidia-kernel-support--v1] 375.82-4
Versions of packages nvidia-kernel-dkms:amd64 recommends:
ii libcuda1 375.82-4
ii nvidia-driver 375.82-4
nvidia-kernel-dkms:amd64 suggests no packages.
-- no debconf information
-- debsums errors found:
debsums: changed file /usr/src/nvidia-current-375.82/Kbuild (from
nvidia-kernel-dkms:amd64 package)
--
Tomáš Janoušek, a.k.a. Pivník, a.k.a. Liskni_si, http://work.lisk.in/
diff -up nvidia-current-375.82/Kbuild.gcc-plugins nvidia-current-375.82/Kbuild
--- nvidia-current-375.82/Kbuild.gcc-plugins 2017-10-14 17:57:47.973641062 +0200
+++ nvidia-current-375.82/Kbuild 2017-10-14 17:58:09.590859002 +0200
@@ -94,7 +94,7 @@ NV_CONFTEST_CMD := /bin/sh $(NV_CONFTEST
"$(CC)" "$(HOST_CC)" $(ARCH) $(NV_KERNEL_SOURCES) $(NV_KERNEL_OUTPUT)
NV_CONFTEST_CFLAGS := $(shell $(NV_CONFTEST_CMD) build_cflags)
-NV_CONFTEST_CFLAGS += $(filter-out -Werror%,$(KBUILD_CFLAGS))
+NV_CONFTEST_CFLAGS += $(filter-out -Werror% $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS))
NV_CONFTEST_COMPILE_TEST_HEADERS := $(obj)/conftest/macros.h
NV_CONFTEST_COMPILE_TEST_HEADERS += $(obj)/conftest/functions.h