diff options
Diffstat (limited to 'scripts/Makefile.lib')
-rw-r--r-- | scripts/Makefile.lib | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index fc5fe3d7e8..c4d307ae30 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -120,6 +120,14 @@ _c_flags = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(basetarget).o) _a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o) _cpp_flags = $(CPPFLAGS) $(EXTRA_CPPFLAGS) $(CPPFLAGS_$(@F)) +ifeq ($(CONFIG_UBSAN),y) +_CFLAGS_UBSAN = $(eval _CFLAGS_UBSAN := $(CFLAGS_UBSAN))$(_CFLAGS_UBSAN) +_c_flags += $(if $(patsubst n%,, \ + $(UBSAN_SANITIZE_$(basetarget).o)$(UBSAN_SANITIZE)$(CONFIG_UBSAN_SANITIZE_ALL)), \ + $(_CFLAGS_UBSAN)) +PBL_CPPFLAGS += $(call cc-option,-fno-sanitize=all) +endif + # If building barebox in a separate objtree expand all occurrences # of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/'). |