Add -DGS_WITH_ASAN=1 when building with asan

This commit is contained in:
rfm 2024-11-20 14:26:20 +00:00
parent 4074b9f8d3
commit 80c7154cd0
2 changed files with 10 additions and 1 deletions

View file

@ -1,3 +1,10 @@
2024-11-20 Richard Frith-Macdonald <rfm@gnu.org>
* common.make: when building with the address/leak sanitizer
(-asan=yes on command line or GS_WITH_ASAN=1 in the environment)
we add -DGS_WITH_ASAN=1 for the preprocessor so that compiled
code can take this into account.
2024-08-20 Wolfgang Lux <wolfgang.lux@gmail.com>
* TestFramework/gnustep-tests.in: Only return plain files when

View file

@ -780,7 +780,9 @@ ifeq ($(GS_WITH_ASAN), 1)
asan = yes
endif
ifeq ($(asan), yes)
ADDITIONAL_FLAGS += -fsanitize=address
# We tell the complier to build with the sanitiser and define a preprocessor
# flag so that the compuked code can conditionally handle that specially.
ADDITIONAL_FLAGS += -fsanitize=address -DGS_WITH_ASAN=1
# 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