mirror of
https://github.com/gnustep/tools-make.git
synced 2025-04-23 22:33:28 +00:00
Initial address sanitization support
This commit is contained in:
parent
c6a561d713
commit
3618354637
1 changed files with 16 additions and 0 deletions
16
common.make
16
common.make
|
@ -769,6 +769,22 @@ ifeq ($(GNUSTEP_TARGET_OS), windows)
|
|||
endif
|
||||
endif
|
||||
|
||||
# Sanitization must be enabled explicitly and shall _not_ be used in production,
|
||||
# as it may leak sensitive info or result in privilege escalation due to unchecked
|
||||
# use of variables (https://www.openwall.com/lists/oss-security/2016/02/17/9).
|
||||
|
||||
ifeq ($(asan), yes)
|
||||
ADDITIONAL_FLAGS += -fsanitize=address
|
||||
# We use the clang or gcc to drive the linking process. The driver will
|
||||
# add the required runtime libraries for address sanitizer.
|
||||
INTERNAL_LDFLAGS += -fsanitize=address
|
||||
|
||||
# Not omitting the frame pointer results in more readable stack traces
|
||||
ifneq ($(filter -fno-omit-frame-pointer, $(ADDTIONAL_FLAGS)), -fno-omit-frame-pointer)
|
||||
ADDITIONAL_FLAGS += -fno-omit-frame-pointer
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(warn), no)
|
||||
ADDITIONAL_FLAGS += -UGSWARN
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue