don't do things that don't work in clang (#3584)

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
This commit is contained in:
Matthew Kennedy 2021-11-19 23:40:41 -08:00 committed by GitHub
parent bb57a4b084
commit 754e832a7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 9 deletions

View File

@ -55,14 +55,6 @@ ADEFS = $(DADEFS) $(UADEFS)
LIBS = $(DLIBS) $(ULIBS)
# Various settings
IS_MAC = no
ifneq ($(OS),Windows_NT)
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
IS_MAC = yes
endif
endif
ifeq ($(IS_MAC),yes)
ODFLAGS = -x --syms
ASFLAGS = $(MCFLAGS) -Wa $(ADEFS)

View File

@ -20,6 +20,13 @@ else
SANITIZE = no
endif
IS_MAC = no
ifneq ($(OS),Windows_NT)
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
IS_MAC = yes
endif
endif
# Compiler options here.
ifeq ($(USE_OPT),)
@ -63,7 +70,11 @@ endif
# Enable address sanitizer for C++ files, but not on Windows since x86_64-w64-mingw32-g++ doesn't support it.
ifeq ($(SANITIZE),yes)
USE_CPPOPT += -fsanitize=address -fsanitize=bounds-strict -fno-sanitize-recover=all
ifeq ($(IS_MAC),yes)
USE_CPPOPT += -fsanitize=address
else
USE_CPPOPT += -fsanitize=address -fsanitize=bounds-strict -fno-sanitize-recover=all
endif
endif
# Enable this if you want the linker to remove unused code and data