diff mbox series

[5/7] wmediumd: support compilation with asan/ubsan

Message ID 20200323162245.cd34fabda35f.I5780f136bab2971b28698e2bb045387bf41add84@changeid
State New
Headers show
Series more wmediumd updates | expand

Commit Message

Johannes Berg March 23, 2020, 3:25 p.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

Use "make SANITIZE=1" to get asan/ubsan for checking for errors.

---
 wmediumd/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

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)