Skip to content

Commit 973e60e

Browse files
committed
Fix Makefile assignment bug
When a user provides variable=value as an argument to make, all assignments to that variable are ignored within the Makefile because the user has explicitly overrode variable to be "value". This made the ENABLE_ASAN assignment to be ignored, resulting in Toxic always enabling ASAN unless you run `make ENABLE_ASAN=disabled`, which is not documented and not how it's intended to work. This can be fixed by prefixing the assignment with "override", but to be in line with other argument assignments we just change the variable name. See more at: https://www.gnu.org/software/make/manual/html_node/Overriding.html
1 parent ae94bc5 commit 973e60e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ else
2828
endif
2929

3030
# Check if LLVM Address Sanitizer is enabled
31-
ENABLE_ASAN := $(shell if [ -z "$(ENABLE_ASAN)" ] || [ "$(ENABLE_ASAN)" = "0" ] ; then echo disabled ; else echo enabled ; fi)
32-
ifneq ($(ENABLE_ASAN), disabled)
31+
ASAN := $(shell if [ -z "$(ENABLE_ASAN)" ] || [ "$(ENABLE_ASAN)" = "0" ] ; then echo disabled ; else echo enabled ; fi)
32+
ifneq ($(ASAN), disabled)
3333
CFLAGS += -fsanitize=address -fno-omit-frame-pointer
3434
endif
3535

0 commit comments

Comments
 (0)