ifndef DEBUG
CFLAGS += -O2 -DNDEBUG
endif
+ifeq ($(DEBUG_ASAN), 1)
+CFLAGS += -fsanitize=address
+endif
CFLAGS += -DP_HAVE_MMAP=$(if $(NO_MMAP),0,1) \
-DP_HAVE_PTHREAD=$(if $(NO_PTHREAD),0,1) \
-DP_HAVE_POSIX_MEMALIGN=$(if $(NO_POSIX_MEMALIGN),0,1) \
CC_LINK ?= $(CC)
CC_AS ?= $(CC)
LDFLAGS += $(MAIN_LDFLAGS)
+ifeq ($(DEBUG_ASAN), 1)
+LDFLAGS += -static-libasan
+endif
EXTRA_LDFLAGS ?= -Wl,-Map=$@.map
LDLIBS += $(MAIN_LDLIBS)
ifdef PCNT
ifeq "$(ARCH)" "arm"
OBJS += plugins/gpu_unai/gpu_arm.o
endif
-plugins/gpu_unai/gpulib_if.o: CFLAGS += -DREARMED -O3
+plugins/gpu_unai/gpulib_if.o: CFLAGS += -DREARMED -DUSE_GPULIB=1 -O3
CC_LINK = $(CXX)
endif