aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authorame <[email protected]>2025-02-11 02:36:44 -0600
committerame <[email protected]>2025-02-11 02:36:44 -0600
commit590135ce9a1cb629c9cc31c9c528feac3885f7fc (patch)
treee3dbd795d2a6a017fc814a1bb5497b07047aff9b /makefile
parente7cafd86b947ad654c8081e238faba4df5bd3c33 (diff)
fixes and asan slopgit add .
Diffstat (limited to 'makefile')
-rw-r--r--makefile17
1 files changed, 16 insertions, 1 deletions
diff --git a/makefile b/makefile
index 991b84f..8f5d9a5 100644
--- a/makefile
+++ b/makefile
@@ -24,7 +24,22 @@ all: $(TARGET)
release: CFLAGS += -O3
release: all
-debug: CFLAGS += -g
+# ok so im pretty sure asan should be linked too, however dlclose needs to be masked anyways
+# and since libasan needs to be the first thing to load, you'll have to add it anyways
+# run with something like 'LD_PRELOAD="/usr/lib/gcc/x86_64-pc-linux-gnu/14/libasan.so ./fakedlclose.so" lua5.4 ...'
+# fakedlclose.so should be something as simple as the following:
+#
+# "
+# #include <stdio.h>
+# int dlclose(void *handle) {;}
+# "
+#
+# code (& fix) courtesy of
+# https://github.com/google/sanitizers/issues/89#issuecomment-406316683
+#
+# this also requires lua to be built with asan
+
+debug: CFLAGS += -ggdb3 -static-libasan -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer -fno-optimize-sibling-calls
debug: all
reg: