History

integer-wrap: Force full rebuild when .scl file changes

Since the integer wrapping sanitizer's behavior depends on its associated .scl file, we must force a full rebuild if the file changes. If not, instrumentation may differ between targets based on when they were built. Generate a new header file, integer-wrap.h, any time the Clang .scl file changes. Include the header file in compiler-version.h when its associated feature name, INTEGER_WRAP, is defined. This will be picked up by fixdep and force rebuilds where needed.

Kees Cook committed 1 year ago

Commit 11bb1671 parent 056000c3 files · +16 −0Browse files

Showing the changes to scripts/basic (1 of 3 files). Show all

Unified · Split

scripts/basic/Makefile+5−0
@@ -14,3 +14,8 @@ cmd_create_randstruct_seed = \ · 13 unmodified lines
1414 $(obj)/randstruct.seed: $(gen-randstruct-seed) FORCE
1515 $(call if_changed,create_randstruct_seed)
1616 always-$(CONFIG_RANDSTRUCT) += randstruct.seed
17+
18+# integer-wrap: if the .scl file changes, we need to do a full rebuild.
19+$(obj)/../../include/generated/integer-wrap.h: $(srctree)/scripts/integer-wrap-ignore.scl FORCE
20+ $(call if_changed,touch)
21+always-$(CONFIG_UBSAN_INTEGER_WRAP) += ../../include/generated/integer-wrap.h