diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2021-04-08 09:49:30 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2021-04-08 09:49:30 -0400 |
commit | 2b8d134be46071f6869ed45ebbf521d91c93fb66 (patch) | |
tree | b7e9539146a59fd0cfa2dd562f217bbccbbf8aac /sim/common/Make-common.in | |
parent | 16e311ab6d4d379da18ad03bc5373f621f488f41 (diff) | |
download | gdb-2b8d134be46071f6869ed45ebbf521d91c93fb66.zip gdb-2b8d134be46071f6869ed45ebbf521d91c93fb66.tar.gz gdb-2b8d134be46071f6869ed45ebbf521d91c93fb66.tar.bz2 |
sim: set ASAN_OPTIONS=detect_leaks=0 when running igen and opc2c
The igen/dgen and opc2c tools leak their heap-allocated memory (on
purpose) at program exit, which makes AddressSanitizer fail the tool
execution. This breaks the build, as it makes the tool return a
non-zero exit code.
Fix that by disabling leak detection through the setting of that
environment variable.
I also changed the opc2c rules for m32c to go through a temporary file.
What happened is that the failing opc2c would produce an incomplete file
(probably because ASan exits the process before stdout is flushed).
This meant that further make attempts didn't try to re-create the file,
as it already existed. A "clean" was therefore necessary. This can
also happen in regular builds if the user interrupts the build (^C) in
the middle of the opc2c execution and tries to resume it. Going to a
temporary file avoids this issue.
sim/m32c/ChangeLog:
* Makefile.in: Set ASAN_OPTIONS when running opc2c.
sim/mips/ChangeLog:
* Makefile.in: Set ASAN_OPTIONS when running igen.
sim/mn10300/ChangeLog:
* Makefile.in: Set ASAN_OPTIONS when running igen.
sim/ppc/ChangeLog:
* Makefile.in: Set ASAN_OPTIONS when running igen.
sim/v850/ChangeLog:
* Makefile.in: Set ASAN_OPTIONS when running igen.
Change-Id: I00f21d4dc1aff0ef73471925d41ce7c23e83e082
Diffstat (limited to 'sim/common/Make-common.in')
-rw-r--r-- | sim/common/Make-common.in | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in index c8445bc..28f50ab 100644 --- a/sim/common/Make-common.in +++ b/sim/common/Make-common.in @@ -111,6 +111,10 @@ COMPILE.post = -c -o $@ COMPILE = $(COMPILE.pre) $(ALL_CFLAGS) $(COMPILE.post) POSTCOMPILE = @true +# igen leaks memory, and therefore makes AddressSanitizer unhappy. Disable +# leak detection while running it. +IGEN = ASAN_OPTIONS=detect_leaks=0 ../igen/igen + # Each simulator's Makefile.in defines one or more of these variables # to override our settings as necessary. There is no need to define these # in the simulator's Makefile.in if one is using the default value. In fact |