From cd87d88a930a0b58cfca38678d2e757491c17b26 Mon Sep 17 00:00:00 2001 From: Albert Cervin Date: Thu, 7 Mar 2024 21:56:36 +0100 Subject: Fix asan errors It found some really nasty ones :) --- Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index d469509..43b2be9 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,13 @@ datadir = $(prefix)/share/dged CFLAGS += -Werror -g -O2 -std=c99 -I $(.CURDIR)/src -I $(.CURDIR)/src/main -DDATADIR="$(datadir)" +ASAN ?= false + +.if $(ASAN:tl) == true +CFLAGS += -fsanitize=address -fno-omit-frame-pointer +LDFLAGS += -fsanitize=address +.endif + .if $(SYNTAX_ENABLE:tl) == true HEADERS += src/dged/syntax.h SOURCES += src/dged/syntax.c @@ -73,7 +80,7 @@ FILES = $(DEPS) $(MAIN_OBJS) $(OBJS) dged libdged.a $(TEST_OBJS) $(PLATFORM_OBJS grammars: if [ -n "$$TREESITTER_GRAMMARS" ]; then \ IFS=":"; for p in "$$TREESITTER_GRAMMARS"; do \ - cp -rL "$$p"/ grammars; \ + cp -rL --no-preserve=mode "$$p"/ grammars; \ done \ else \ @echo "TODO: download and build default set of grammars"; \ -- cgit v1.2.3