diff options
author | Mark Wielaard <mark@klomp.org> | 2021-12-05 02:22:26 +0100 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2021-12-09 00:29:48 +0100 |
commit | 5ba884a576afb0ec22660678790621b2a1c4a8e1 (patch) | |
tree | 6d4782418b13256c4b7337bf802f46340a9cada7 /libcpu | |
parent | b947f95c2ce7520bf439386209c95454f1add69e (diff) | |
download | elfutils-5ba884a576afb0ec22660678790621b2a1c4a8e1.tar.gz |
configure: Add --enable-sanitize-address
--enable-sanitize-address makes sure that all code is compiled with
-fsanitizer=address and all tests run against libasan.
It can be combined with --enable-sanitize-undefined, but not with
--enable-valgrind.
In maintainer mode there is one program that causes leaks, i386_gendis,
so disable leak detection for that program.
One testcase, test_nlist, needs special linker flags, make sure it also
uses -fsanitizer=address when using the address sanitizer.
Signed-off-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'libcpu')
-rw-r--r-- | libcpu/ChangeLog | 5 | ||||
-rw-r--r-- | libcpu/Makefile.am | 10 |
2 files changed, 14 insertions, 1 deletions
diff --git a/libcpu/ChangeLog b/libcpu/ChangeLog index 7cca9419..48fbba19 100644 --- a/libcpu/ChangeLog +++ b/libcpu/ChangeLog @@ -1,3 +1,8 @@ +2021-12-04 Mark Wielaard <mark@klomp.org> + + * Makefile.am (GENDIS_ENV): New variable, depends on + USE_ADDRESS_SANITIZER. + 2020-12-20 Dmitry V. Levin <ldv@altlinux.org> * .gitignore: New file. diff --git a/libcpu/Makefile.am b/libcpu/Makefile.am index 43844ecf..57d0a164 100644 --- a/libcpu/Makefile.am +++ b/libcpu/Makefile.am @@ -61,8 +61,16 @@ noinst_HEADERS += memory-access.h i386_parse.h i386_data.h noinst_PROGRAMS = i386_gendis$(EXEEXT) +# i386_gendis doesn't clean up, ignore leaks. +# It is just a build tool to generate source in maintainer mode. +if USE_ADDRESS_SANITIZER +GENDIS_ENV=env ASAN_OPTIONS=detect_leaks=0 +else +GENDIS_ENV= +endif + $(srcdir)/%_dis.h: %_defs i386_gendis$(EXEEXT) - $(AM_V_GEN)./i386_gendis$(EXEEXT) $< > $@T + $(AM_V_GEN) $(GENDIS_ENV) ./i386_gendis$(EXEEXT) $< > $@T $(AM_V_at)mv -f $@T $@ else |