mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-07 11:50:24 +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
|
LIBS += libgcov
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
#
|
||||||
|
# Add libraries for undefined behavior sanitizer if requested
|
||||||
|
#
|
||||||
|
ifeq ($(SANITIZE_UNDEFINED),yes)
|
||||||
|
LIBS += libubsan libsanitizer_common
|
||||||
|
endif
|
||||||
|
|
||||||
#
|
#
|
||||||
# Include lib-import description files
|
# Include lib-import description files
|
||||||
#
|
#
|
||||||
|
@ -119,6 +119,13 @@ endif
|
|||||||
CC_OPT += -fprofile-arcs -ftest-coverage -fprofile-dir=$(PROFILE_DIR)
|
CC_OPT += -fprofile-arcs -ftest-coverage -fprofile-dir=$(PROFILE_DIR)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
#
|
||||||
|
# Enable the undefined behavior sanitizer if requested
|
||||||
|
#
|
||||||
|
ifeq ($(SANITIZE_UNDEFINED),yes)
|
||||||
|
CC_OPT += -fsanitize=undefined
|
||||||
|
endif
|
||||||
|
|
||||||
#
|
#
|
||||||
# Default optimization and warning levels
|
# Default optimization and warning levels
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user