From 9de33d06d259e46b914a68e2b0936a2416a7a3e8 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Wed, 13 Mar 2024 18:26:24 -0400 Subject: [PATCH] Specifying -fsanitize=... early seems good. --- GNUmakefile | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 45a7c451..2ae789cd 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -16,6 +16,18 @@ UNAME_M := $(shell uname -m) ANDROID_SDK ?= ~/Android/Sdk +ifeq ($(UNAME_M),x86_64) +ifneq ($(UNAME_S),Haiku) +debug: CFLAGS += -fsanitize=address -fsanitize=undefined -fno-common +debug: LDFLAGS += -fsanitize=address -fsanitize=undefined +endif +endif + +ifeq ($(UNAME_M),aarch64) +debug: CFLAGS += -fsanitize=address -fsanitize=undefined -fno-common +debug: LDFLAGS += -fsanitize=address -fsanitize=undefined +endif + ifeq ($(UNAME_S),Darwin) BUILD_TYPES := macosdebug macosrelease iosdebug iosrelease iossimdebug iossimrelease else ifeq ($(UNAME_S),Linux) @@ -209,18 +221,6 @@ $(IOS_TARGETS): LDFLAGS += -Ldeps/openssl/ios/ios64-xcrun/usr/local/lib $(IOSSIM_TARGETS): CFLAGS += -Ideps/openssl/ios/iossimulator-xcrun/usr/local/include $(IOSSIM_TARGETS): LDFLAGS += -Ldeps/openssl/ios/iossimulator-xcrun/usr/local/lib -ifeq ($(UNAME_M),x86_64) -ifneq ($(UNAME_S),Haiku) -debug: CFLAGS += -fsanitize=address -fsanitize=undefined -fno-common -debug: LDFLAGS += -fsanitize=address -fsanitize=undefined -endif -endif - -ifeq ($(UNAME_M),aarch64) -debug: CFLAGS += -fsanitize=address -fsanitize=undefined -fno-common -debug: LDFLAGS += -fsanitize=address -fsanitize=undefined -endif - get_objs = \ $(foreach build_type,$(BUILD_TYPES),$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)))))) \ $(foreach build_type,debug release,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_unix))))) \