From ff6144f064790f2c60c8c22a29df9052e2f240df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Obiltschnig?= Date: Wed, 16 Jun 2021 08:33:13 +0200 Subject: [PATCH] support sanitizers in build configs --- build/config/Darwin-clang-libc++ | 11 ++++++----- build/config/Linux | 10 ++++++---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/build/config/Darwin-clang-libc++ b/build/config/Darwin-clang-libc++ index 4a724ccf0..94b316ba4 100644 --- a/build/config/Darwin-clang-libc++ +++ b/build/config/Darwin-clang-libc++ @@ -12,6 +12,7 @@ LINKMODE ?= SHARED ARCHFLAGS ?= -arch $(OSARCH) +SANITIZEFLAGS ?= OSFLAGS ?= -mmacosx-version-min=10.11 -isysroot $(shell xcrun --show-sdk-path) OPENSSL_DIR ?= /usr/local/opt/openssl @@ -43,11 +44,11 @@ SHAREDLIBLINKEXT = .dylib # # Compiler and Linker Flags # -CFLAGS = $(ARCHFLAGS) $(OSFLAGS) -std=c99 -CXXFLAGS = $(ARCHFLAGS) $(OSFLAGS) -std=c++14 -stdlib=libc++ -Wall -Wno-sign-compare -Wno-unused-variable -Wno-unused-function -Wno-unneeded-internal-declaration -LINKFLAGS = $(ARCHFLAGS) $(OSFLAGS) -stdlib=libc++ -SHLIBFLAGS = $(ARCHFLAGS) $(OSFLAGS) -stdlib=libc++ -DYLIBFLAGS = $(ARCHFLAGS) $(OSFLAGS) -stdlib=libc++ +CFLAGS = $(ARCHFLAGS) $(OSFLAGS) $(SANITIZEFLAGS) -std=c11 +CXXFLAGS = $(ARCHFLAGS) $(OSFLAGS) $(SANITIZEFLAGS) -std=c++14 -stdlib=libc++ -Wall -Wno-sign-compare -Wno-unused-variable -Wno-unused-function -Wno-unneeded-internal-declaration +LINKFLAGS = $(ARCHFLAGS) $(OSFLAGS) $(SANITIZEFLAGS) -stdlib=libc++ +SHLIBFLAGS = $(ARCHFLAGS) $(OSFLAGS) $(SANITIZEFLAGS) -stdlib=libc++ +DYLIBFLAGS = $(ARCHFLAGS) $(OSFLAGS) $(SANITIZEFLAGS) -stdlib=libc++ STATICOPT_CC = STATICOPT_CXX = STATICOPT_LINK = diff --git a/build/config/Linux b/build/config/Linux index bcc04ba58..959db5e13 100644 --- a/build/config/Linux +++ b/build/config/Linux @@ -1,7 +1,7 @@ # # Linux # -# Make settings for Linux 2.6/gcc 3.3 +# Make settings for Linux/gcc # # @@ -10,6 +10,8 @@ # LINKMODE ?= SHARED +SANITIZEFLAGS ?= + # # Define Tools # @@ -36,13 +38,13 @@ SHAREDLIBLINKEXT = .so # # Compiler and Linker Flags # -CFLAGS = -std=c99 +CFLAGS = $(SANITIZEFLAGS) -std=c11 CFLAGS32 = CFLAGS64 = -CXXFLAGS = -std=c++14 -Wall -Wno-sign-compare +CXXFLAGS = $(SANITIZEFLAGS) -std=c++14 -Wall -Wno-sign-compare CXXFLAGS32 = CXXFLAGS64 = -LINKFLAGS = +LINKFLAGS = $(SANITIZEFLAGS) LINKFLAGS32 = LINKFLAGS64 = STATICOPT_CC =