diff mbox

PR69329 --with-build-config=bootstrap-asan fails because LSAN_OPTIONS is not honored

Message ID 56A4C951.3060600@gmail.com
State New
Headers show

Commit Message

Mikhail Maltsev Jan. 24, 2016, 12:53 p.m. UTC
Hi all!

--with-build-config=bootstrap-asan build currently fails, because address
sanitizer now has memory leak detection enabled by default. bootstrap-asan contains

export LSAN_OPTIONS="detect_leaks=0"

but unfortunately this environment variable is set in top-level Makefile and is
not propagated to Makefile-s in subdirectories. The attached patch fixes this by
adding LSAN_OPTIONS to BASE_FLAGS_TO_PASS. It also incorporates Jakub's comments
from bugzilla.

Bootstrapped and regtested on x86_64-pc-linux-gnu with default configuration and
also with "--with-build-config=bootstrap-asan".

OK for trunk?

Comments

Jakub Jelinek Jan. 24, 2016, 2:59 p.m. UTC | #1
On Sun, Jan 24, 2016 at 03:53:37PM +0300, Mikhail Maltsev wrote:
> Hi all!
> 
> --with-build-config=bootstrap-asan build currently fails, because address
> sanitizer now has memory leak detection enabled by default. bootstrap-asan contains
> 
> export LSAN_OPTIONS="detect_leaks=0"
> 
> but unfortunately this environment variable is set in top-level Makefile and is
> not propagated to Makefile-s in subdirectories. The attached patch fixes this by
> adding LSAN_OPTIONS to BASE_FLAGS_TO_PASS. It also incorporates Jakub's comments
> from bugzilla.
> 
> Bootstrapped and regtested on x86_64-pc-linux-gnu with default configuration and
> also with "--with-build-config=bootstrap-asan".
> 
> OK for trunk?
> 
> -- 
> Regards,
>     Mikhail Maltsev
> 
> ChangeLog:
> 
> 2016-01-24  Mikhail Maltsev  <maltsevm@gmail.com>
> 
>         PR bootstrap/69329
>         * Makefile.in: Regenerate.
>         * Makefile.tpl (BASE_FLAGS_TO_PASS): Add LSAN_OPTIONS.

Please swap the two lines of the ChangeLog entry, the regeneration
is because the tpl file has changed.

Ok with that change, thanks.

	Jakub
diff mbox

Patch

diff --git a/Makefile.in b/Makefile.in
index 2733c4d..20d1c90 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -789,7 +789,8 @@  BASE_FLAGS_TO_PASS = \
 	$(CXX_FOR_TARGET_FLAG_TO_PASS) \
 	"TFLAGS=$(TFLAGS)" \
 	"CONFIG_SHELL=$(SHELL)" \
-	"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" 
+	"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
+	$(if $(LSAN_OPTIONS),"LSAN_OPTIONS=$(LSAN_OPTIONS)")
 
 # We leave this in just in case, but it is not needed anymore.
 RECURSE_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS)
diff --git a/Makefile.tpl b/Makefile.tpl
index f7bb77e..2567365 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -590,7 +590,8 @@  BASE_FLAGS_TO_PASS =[+ FOR flags_to_pass +][+ IF optional +] \
 	$(CXX_FOR_TARGET_FLAG_TO_PASS) \
 	"TFLAGS=$(TFLAGS)" \
 	"CONFIG_SHELL=$(SHELL)" \
-	"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" 
+	"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
+	$(if $(LSAN_OPTIONS),"LSAN_OPTIONS=$(LSAN_OPTIONS)")
 
 # We leave this in just in case, but it is not needed anymore.
 RECURSE_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS)