https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69329

            Bug ID: 69329
           Summary: [6 Regression] --with-build-config=bootstrap-asan
                    fails because LSAN_OPTIONS is not honored
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: miyuki at gcc dot gnu.org
  Target Milestone: ---

Starting with r229111 (libsanitizer merge from upstream) bootstrap with asan
fails, because of errors reported by leak sanitizer. Configuration:

$ ../src/configure --enable-languages=c,c++,lto,fortran
--prefix=/opt/gcc-6-asan --enable-clocale=gnu --disable-nls --with-system-zlib
--with-build-config=bootstrap-asan

This build step fails (from gcc subdirectory):
$ make s-common-target-hooks-def-h
build/genhooks "Common Target Hook" \
                                     > tmp-common-target-hooks-def.h

=================================================================
==16342==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 52842 byte(s) in 1923 object(s) allocated from:
    #0 0x4a8a88 in __interceptor_malloc
../../../../src/libsanitizer/asan/asan_malloc_linux.cc:38
    #1 0x4e06f7 in xmalloc ../../src/libiberty/xmalloc.c:148

SUMMARY: AddressSanitizer: 52842 byte(s) leaked in 1923 allocation(s).
Makefile:2314: recipe for target 's-common-target-hooks-def-h' failed
make: *** [s-common-target-hooks-def-h] Error 1

r229112 has some fix in bootstrap-asan.mk:
export LSAN_OPTIONS="detect_leaks=0"

If I run 'make' from gcc subdirectory like this:

$ LSAN_OPTIONS="detect_leaks=0" make s-common-target-hooks-def-h

it works fine, but for some reason this environment variable is not propagated
from top-level make, i.e. running top-level 'make' as

$ LSAN_OPTIONS="detect_leaks=0" make

does not help.

Reply via email to