1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

samba_autoconf: fix undefined behaviour sanitizer compile flags

Added the -g option, -fsaniize=null and -fsanitize=alignment, removed
the -fno-omit-frame-pointer option.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
Gary Lockyer 2019-05-16 11:29:34 +12:00 committed by Andreas Schneider
parent f0ea080098
commit 93131652a7

View File

@ -795,13 +795,16 @@ int main(void) {
if (Options.options.address_sanitizer or
Options.options.undefined_sanitizer):
conf.ADD_CFLAGS('-fno-omit-frame-pointer -O1', testflags=True)
conf.ADD_CFLAGS('-g -O1', testflags=True)
if Options.options.address_sanitizer:
conf.ADD_CFLAGS('-fno-omit-frame-pointer', testflags=True)
conf.ADD_CFLAGS('-fsanitize=address', testflags=True)
conf.ADD_LDFLAGS('-fsanitize=address', testflags=True)
conf.env['ADDRESS_SANITIZER'] = True
if Options.options.undefined_sanitizer:
conf.ADD_CFLAGS('-fsanitize=undefined', testflags=True)
conf.ADD_CFLAGS('-fsanitize=null', testflags=True)
conf.ADD_CFLAGS('-fsanitize=alignment', testflags=True)
conf.ADD_LDFLAGS('-fsanitize=undefined', testflags=True)
conf.env['UNDEFINED_SANITIZER'] = True