diff --git a/Makefile b/Makefile index 1fa7ab9..724c152 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,17 @@ # SPDX-License-Identifier: GPL-2.0 # # Define V=1 for more verbose compile. +# Define S=1 for sanitation checks. CFLAGS += -Wall -Iinclude TOOL_CFLAGS += -O2 -g $(CFLAGS) $(BASIC_CFLAGS) +ifeq "$(S)" "1" +TOOL_CFLAGS += -fsanitize=address -fsanitize=leak -fsanitize=undefined \ + -fsanitize-address-use-after-scope -fstack-check +endif + MODULE_LD := script/iop.ld # FIXME: -O0 -> -O2 IOP_CFLAGS += -O0 -march=r3000 -EL -msoft-float -fomit-frame-pointer \