Skip to content

Commit

Permalink
build: use asan & ubsan in debug build
Browse files Browse the repository at this point in the history
  • Loading branch information
d0p1s4m4 committed Feb 16, 2022
1 parent c243113 commit 49d5eca
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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'
);
Expand Down Expand Up @@ -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";
}
Expand Down Expand Up @@ -110,4 +112,4 @@ configure [options]
--sysroot Makefile will copy all the files under sysroot during installation (default: '')
--debug build the debug code
=cut
=cut

0 comments on commit 49d5eca

Please sign in to comment.