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.
Showing the changes to scripts (2 of 3 files). Show all
Unified · Split
| @@ -15,6 +15,7 @@ ubsan-cflags-$(CONFIG_UBSAN_TRAP) += $(call cc-option,-fsanitize-trap=undefined · 14 unmodified lines | ||
| 15 | 15 | export CFLAGS_UBSAN := $(ubsan-cflags-y) |
| 16 | 16 | |
| 17 | 17 | ubsan-integer-wrap-cflags-$(CONFIG_UBSAN_INTEGER_WRAP) += \ |
| 18 | + -DINTEGER_WRAP \ | |
| 18 | 19 | -fsanitize-undefined-ignore-overflow-pattern=all \ |
| 19 | 20 | -fsanitize=signed-integer-overflow \ |
| 20 | 21 | -fsanitize=unsigned-integer-overflow \ |
| @@ -14,3 +14,8 @@ cmd_create_randstruct_seed = \ · 13 unmodified lines | ||
| 14 | 14 | $(obj)/randstruct.seed: $(gen-randstruct-seed) FORCE |
| 15 | 15 | $(call if_changed,create_randstruct_seed) |
| 16 | 16 | 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 | |