From 705211ef496866cd32f5afb5213af7e8beee3d9c Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sun, 16 Jan 2022 11:50:55 -0500 Subject: [PATCH] define UBSan flags for SHARED_FLAGS to reuse it --- Makefile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 19d1e69..3772f5e 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,10 @@ ifeq ($(CONFIG_NATIVE),true) SHARED_FLAGS += -march=native endif +ifeq ($(CONFIG_UBSAN),true) + SHARED_FLAGS += -fsanitize=undefined -fno-sanitize-recover=undefined +endif + CFLAGS := $(CFLAGS) -std=c17 $(SHARED_FLAGS) -Wmissing-prototypes CXXFLAGS := $(CXXFLAGS) -std=c++17 -fsized-deallocation $(SHARED_FLAGS) LDFLAGS := $(LDFLAGS) -Wl,--as-needed,-z,defs,-z,relro,-z,now,-z,nodlopen,-z,text @@ -48,11 +52,6 @@ endif OBJECTS := $(addprefix $(OUT)/,$(OBJECTS)) -ifeq ($(CONFIG_UBSAN),true) - CFLAGS += -fsanitize=undefined -fno-sanitize-recover=undefined - CXXFLAGS += -fsanitize=undefined -fno-sanitize-recover=undefined -endif - ifeq (,$(filter $(CONFIG_SEAL_METADATA),true false)) $(error CONFIG_SEAL_METADATA must be true or false) endif