[Intel-gfx] [PATCH] drm/i915: Make DRM_I915_WERROR depend on !COMPILE_TEST

Damien Lespiau damien.lespiau at intel.com
Sun May 24 02:48:07 PDT 2015


With allyesconfig/allmodconfig, kbuild enables all the options it can,
including DRM_I915_WERROR. That's not really what we want with -Werror,
and this was breaking the build for Andrew.

Andrew suggested to use COMPILE_TEST as a way to 'detect' these
configurations.

An alternative would be to inverse the condition of the option:
DRM_I915_NO_WERROR. Setting that one to Y would have no effect, at the
price of a bit of confusion.

Another alternative would be to introduce a allyesmodconfig_n property
to config entries, like the allnoconfig_y one we have today:

  - "allnoconfig_y"
    This declares the symbol as one that should have the value y when
    using "allnoconfig". Used for symbols that hide other symbols.

Of course, allyesmodconfig_n would set the value to n when using
"allmodconfig" or "allmodconfig". That alternative needs a bit more work
though and may not be desirable, given that even allnoconfig_y is used
only once today.

Reported-by: Andrew Morton <akpm at linux-foundation.org>
Suggested-by: Andrew Morton <akpm at linux-foundation.org>
Cc: Andrew Morton <akpm at linux-foundation.org>
Cc: Chris Wilson <chris at chris-wilson.co.uk>
Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
---
 drivers/gpu/drm/i915/Kconfig.debug | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/Kconfig.debug b/drivers/gpu/drm/i915/Kconfig.debug
index 070a035..9d6ec64 100644
--- a/drivers/gpu/drm/i915/Kconfig.debug
+++ b/drivers/gpu/drm/i915/Kconfig.debug
@@ -1,5 +1,8 @@
 config DRM_I915_WERROR
 	bool "Force GCC to throw an error instead of a warning when compiling"
+	# We use the dependency on !COMPILE_TEST to not be enabled in
+	# allmodconfig or allyesconfig configurations
+	depends on !COMPILE_TEST
 	default n
 	---help---
 	  Add -Werror to the build flags for (and only for) i915.ko
-- 
2.1.0



More information about the Intel-gfx mailing list