From: Johannes Berg <johannes.berg@xxxxxxxxx> Use "make SANITIZE=1" to get asan/ubsan for checking for errors. --- wmediumd/Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wmediumd/Makefile b/wmediumd/Makefile index 585f488a9bd5..f75c4e8b4e3e 100644 --- a/wmediumd/Makefile +++ b/wmediumd/Makefile @@ -53,6 +53,12 @@ OBJECTS=wmediumd.o config.o per.o OBJECTS += lib/loop.o lib/sched.o lib/schedctrl.o OBJECTS += lib/uds.o lib/vhost.o lib/wallclock.o +ifeq ($(SANITIZE),1) +CFLAGS += -fsanitize=undefined,address +# apparently these have to come first for some reason +override LDFLAGS := -lasan -lubsan $(LDFLAGS) +endif + all: wmediumd wmediumd: $(OBJECTS) -- 2.25.1