mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-31 08:25:38 +00:00
mk: add 'SANITIZE_UNDEFINED' option
'SANITIZE_UNDEFINED = yes' in 'target.mk' adds the '-fsanitize=undefined' compiler flag and links the program with libubsan and libsanitizer_common. Issue #3072
This commit is contained in:
parent
c2884a6e63
commit
5569d2ddc2
@ -23,6 +23,13 @@ ifeq ($(COVERAGE),yes)
|
||||
LIBS += libgcov
|
||||
endif
|
||||
|
||||
#
|
||||
# Add libraries for undefined behavior sanitizer if requested
|
||||
#
|
||||
ifeq ($(SANITIZE_UNDEFINED),yes)
|
||||
LIBS += libubsan libsanitizer_common
|
||||
endif
|
||||
|
||||
#
|
||||
# Include lib-import description files
|
||||
#
|
||||
|
@ -119,6 +119,13 @@ endif
|
||||
CC_OPT += -fprofile-arcs -ftest-coverage -fprofile-dir=$(PROFILE_DIR)
|
||||
endif
|
||||
|
||||
#
|
||||
# Enable the undefined behavior sanitizer if requested
|
||||
#
|
||||
ifeq ($(SANITIZE_UNDEFINED),yes)
|
||||
CC_OPT += -fsanitize=undefined
|
||||
endif
|
||||
|
||||
#
|
||||
# Default optimization and warning levels
|
||||
#
|
||||
|
Loading…
x
Reference in New Issue
Block a user