Merge tag 'v5.5-rc4' into locking/kcsan, to resolve conflicts
[sfrench/cifs-2.6.git] / scripts / Makefile.lib
index 3fa32f83b2d74c05a71ebb2fdc0a426471637875..587a7d03c4cdadc559bedc73479e6514672eb89a 100644 (file)
@@ -138,6 +138,16 @@ _c_flags += $(if $(patsubst n%,, \
        $(CFLAGS_KCOV))
 endif
 
+#
+# Enable KCSAN flags except some files or directories we don't want to check
+# (depends on variables KCSAN_SANITIZE_obj.o, KCSAN_SANITIZE)
+#
+ifeq ($(CONFIG_KCSAN),y)
+_c_flags += $(if $(patsubst n%,, \
+       $(KCSAN_SANITIZE_$(basetarget).o)$(KCSAN_SANITIZE)y), \
+       $(CFLAGS_KCSAN))
+endif
+
 # $(srctree)/$(src) for including checkin headers from generated source files
 # $(objtree)/$(obj) for including generated headers from checkin source files
 ifeq ($(KBUILD_EXTMOD),)