From 49d5ecadc74b3c095fcff3ee9db6793acc55ecbf Mon Sep 17 00:00:00 2001 From: d0p1 Date: Wed, 16 Feb 2022 09:27:58 +0100 Subject: [PATCH] build: use asan & ubsan in debug build --- configure | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 86b7a11d..8021c4db 100755 --- a/configure +++ b/configure @@ -34,11 +34,12 @@ my %env = ( PID_DIR => '/var/run', SYSROOT => '', CFLAGS => '', + LDFLAGS => '', VERSION => $VERSION ); my %files_map = ( - 'src/conf/netsukuku.conf.in' => 'src/conf/netsukuku.conf', + 'meta/conf/netsukuku.conf.in' => 'meta/conf/netsukuku.conf', 'src/config.h.in' => 'src/config.h', 'Makefile.in' => 'Makefile' ); @@ -72,7 +73,8 @@ GetOptions( pod2usage(0) if $help; if ($debug) { - $env{'CFLAGS'} = "-DDEBUG -ggdb $env{'CFLAGS'}"; + $env{'CFLAGS'} = "-DDEBUG -ggdb -fsanitize=address -fsanitize=undefined $env{'CFLAGS'}"; + $env{'LDFLAGS'} = "-lasan -lubsan $env{'LDFLAGS'}" } else { $env{'CFLAGS'} = "-DNDEBUG"; } @@ -110,4 +112,4 @@ configure [options] --sysroot Makefile will copy all the files under sysroot during installation (default: '') --debug build the debug code -=cut \ No newline at end of file +=cut