On Fri, Nov 01, 2013 at 04:13:05PM -0700, Konstantin Serebryany wrote:
> Jukub,
>
> This works!
> New patch attached.
Konstantin,
This patch, when applied on top of r204305, bootstraps fine on
x86_64-apple-darwin12 but
produces a lot of regressions with...
make -k check RUNTESTFLAGS="asan.exp --target_board=unix'{-m64}'"
Native configuration is x86_64-apple-darwin12.5.0
=== g++ tests ===
Running target unix/-m64
FAIL: c-c++-common/asan/global-overflow-1.c -O0 execution test
FAIL: c-c++-common/asan/global-overflow-1.c -O1 execution test
FAIL: c-c++-common/asan/global-overflow-1.c -O2 execution test
FAIL: c-c++-common/asan/global-overflow-1.c -O3 -fomit-frame-pointer
execution test
FAIL: c-c++-common/asan/global-overflow-1.c -O3 -g execution test
FAIL: c-c++-common/asan/global-overflow-1.c -Os execution test
FAIL: c-c++-common/asan/global-overflow-1.c -O2 -flto -flto-partition=none
execution test
FAIL: c-c++-common/asan/global-overflow-1.c -O2 -flto execution test
FAIL: c-c++-common/asan/heap-overflow-1.c -O0 execution test
FAIL: c-c++-common/asan/heap-overflow-1.c -O1 execution test
FAIL: c-c++-common/asan/heap-overflow-1.c -O2 execution test
FAIL: c-c++-common/asan/heap-overflow-1.c -O3 -fomit-frame-pointer execution
test
FAIL: c-c++-common/asan/heap-overflow-1.c -O3 -g execution test
FAIL: c-c++-common/asan/heap-overflow-1.c -Os execution test
FAIL: c-c++-common/asan/heap-overflow-1.c -O2 -flto -flto-partition=none
execution test
FAIL: c-c++-common/asan/heap-overflow-1.c -O2 -flto execution test
FAIL: c-c++-common/asan/memcmp-1.c -O0 execution test
FAIL: c-c++-common/asan/memcmp-1.c -O1 execution test
FAIL: c-c++-common/asan/memcmp-1.c -O2 execution test
FAIL: c-c++-common/asan/memcmp-1.c -O3 -fomit-frame-pointer execution test
FAIL: c-c++-common/asan/memcmp-1.c -O3 -g execution test
FAIL: c-c++-common/asan/memcmp-1.c -Os execution test
FAIL: c-c++-common/asan/memcmp-1.c -O2 -flto -flto-partition=none execution
test
FAIL: c-c++-common/asan/memcmp-1.c -O2 -flto execution test
FAIL: c-c++-common/asan/null-deref-1.c -O0 execution test
FAIL: c-c++-common/asan/null-deref-1.c -O1 execution test
FAIL: c-c++-common/asan/null-deref-1.c -O2 execution test
FAIL: c-c++-common/asan/null-deref-1.c -O3 -fomit-frame-pointer execution test
FAIL: c-c++-common/asan/null-deref-1.c -O3 -g execution test
FAIL: c-c++-common/asan/null-deref-1.c -Os execution test
FAIL: c-c++-common/asan/null-deref-1.c -O2 -flto -flto-partition=none
execution test
FAIL: c-c++-common/asan/null-deref-1.c -O2 -flto execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c -O0 execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c -O1 execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c -O2 execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c -O3 -fomit-frame-pointer
execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c -O3 -g execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c -Os execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c -O2 -flto -flto-partition=none
execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c -O2 -flto execution test
FAIL: c-c++-common/asan/sleep-before-dying-1.c -O2 execution test
FAIL: c-c++-common/asan/sleep-before-dying-1.c -O2 -flto -flto-partition=none
execution test
FAIL: c-c++-common/asan/sleep-before-dying-1.c -O2 -flto execution test
FAIL: c-c++-common/asan/stack-overflow-1.c -O0 execution test
FAIL: c-c++-common/asan/stack-overflow-1.c -O1 execution test
FAIL: c-c++-common/asan/stack-overflow-1.c -O2 execution test
FAIL: c-c++-common/asan/stack-overflow-1.c -O3 -fomit-frame-pointer execution
test
FAIL: c-c++-common/asan/stack-overflow-1.c -O3 -g execution test
FAIL: c-c++-common/asan/stack-overflow-1.c -Os execution test
FAIL: c-c++-common/asan/stack-overflow-1.c -O2 -flto -flto-partition=none
execution test
FAIL: c-c++-common/asan/stack-overflow-1.c -O2 -flto execution test
FAIL: c-c++-common/asan/strip-path-prefix-1.c -O2 execution test
FAIL: c-c++-common/asan/strip-path-prefix-1.c -O2 -flto -flto-partition=none
execution test
FAIL: c-c++-common/asan/strip-path-prefix-1.c -O2 -flto execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c -O0 execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c -O1 execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c -O2 execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c -O3 -fomit-frame-pointer
execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c -O3 -g execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c -Os execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c -O2 -flto -flto-partition=none
execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c -O2 -flto execution test
FAIL: c-c++-common/asan/use-after-free-1.c -O0 execution test
FAIL: c-c++-common/asan/use-after-free-1.c -O1 execution test
FAIL: c-c++-common/asan/use-after-free-1.c -O2 execution test
FAIL: c-c++-common/asan/use-after-free-1.c -O3 -fomit-frame-pointer execution
test
FAIL: c-c++-common/asan/use-after-free-1.c -O3 -g execution test
FAIL: c-c++-common/asan/use-after-free-1.c -Os execution test
FAIL: c-c++-common/asan/use-after-free-1.c -O2 -flto -flto-partition=none
execution test
FAIL: c-c++-common/asan/use-after-free-1.c -O2 -flto execution test
FAIL: g++.dg/asan/deep-stack-uaf-1.C -O0 execution test
FAIL: g++.dg/asan/deep-stack-uaf-1.C -O1 execution test
FAIL: g++.dg/asan/deep-stack-uaf-1.C -O2 execution test
FAIL: g++.dg/asan/deep-stack-uaf-1.C -O3 -fomit-frame-pointer execution test
FAIL: g++.dg/asan/deep-stack-uaf-1.C -O3 -g execution test
FAIL: g++.dg/asan/deep-stack-uaf-1.C -Os execution test
FAIL: g++.dg/asan/deep-tail-call-1.C -O0 execution test
FAIL: g++.dg/asan/deep-tail-call-1.C -O1 execution test
FAIL: g++.dg/asan/deep-tail-call-1.C -O2 execution test
FAIL: g++.dg/asan/deep-tail-call-1.C -O3 -fomit-frame-pointer execution test
FAIL: g++.dg/asan/deep-tail-call-1.C -O3 -g execution test
FAIL: g++.dg/asan/deep-tail-call-1.C -Os execution test
FAIL: g++.dg/asan/deep-tail-call-1.C -O2 -flto -flto-partition=none execution
test
FAIL: g++.dg/asan/deep-tail-call-1.C -O2 -flto execution test
FAIL: g++.dg/asan/deep-thread-stack-1.C -O0 execution test
FAIL: g++.dg/asan/deep-thread-stack-1.C -O1 execution test
FAIL: g++.dg/asan/deep-thread-stack-1.C -O2 execution test
FAIL: g++.dg/asan/deep-thread-stack-1.C -O3 -fomit-frame-pointer execution
test
FAIL: g++.dg/asan/deep-thread-stack-1.C -O3 -g execution test
FAIL: g++.dg/asan/deep-thread-stack-1.C -Os execution test
FAIL: g++.dg/asan/deep-thread-stack-1.C -O2 -flto -flto-partition=none
execution test
FAIL: g++.dg/asan/deep-thread-stack-1.C -O2 -flto execution test
FAIL: g++.dg/asan/interception-failure-test-1.C -O0 output pattern test, is
==15047==AddressSanitizer CHECK failed:
../../../../gcc-4.9-20131101/libsanitizer/sanitizer_common/sanitizer_mac.cc:146
"((env_ptr)) != (0)" (0x0, 0x0)
FAIL: g++.dg/asan/interception-failure-test-1.C -O1 output pattern test, is
==15061==AddressSanitizer CHECK failed:
../../../../gcc-4.9-20131101/libsanitizer/sanitizer_common/sanitizer_mac.cc:146
"((env_ptr)) != (0)" (0x0, 0x0)
FAIL: g++.dg/asan/interception-failure-test-1.C -O2 output pattern test, is
==15075==AddressSanitizer CHECK failed:
../../../../gcc-4.9-20131101/libsanitizer/sanitizer_common/sanitizer_mac.cc:146
"((env_ptr)) != (0)" (0x0, 0x0)
FAIL: g++.dg/asan/interception-failure-test-1.C -O3 -fomit-frame-pointer
output pattern test, is ==15090==AddressSanitizer CHECK failed:
../../../../gcc-4.9-20131101/libsanitizer/sanitizer_common/sanitizer_mac.cc:146
"((env_ptr)) != (0)" (0x0, 0x0)
FAIL: g++.dg/asan/interception-failure-test-1.C -O3 -g output pattern test,
is ==15104==AddressSanitizer CHECK failed:
../../../../gcc-4.9-20131101/libsanitizer/sanitizer_common/sanitizer_mac.cc:146
"((env_ptr)) != (0)" (0x0, 0x0)
FAIL: g++.dg/asan/interception-failure-test-1.C -Os output pattern test, is
==15118==AddressSanitizer CHECK failed:
../../../../gcc-4.9-20131101/libsanitizer/sanitizer_common/sanitizer_mac.cc:146
"((env_ptr)) != (0)" (0x0, 0x0)
FAIL: g++.dg/asan/interception-failure-test-1.C -O2 -flto -flto-partition=none
output pattern test, is ==15142==AddressSanitizer CHECK failed:
../../../../gcc-4.9-20131101/libsanitizer/sanitizer_common/sanitizer_mac.cc:146
"((env_ptr)) != (0)" (0x0, 0x0)
FAIL: g++.dg/asan/interception-failure-test-1.C -O2 -flto output pattern
test, is ==15168==AddressSanitizer CHECK failed:
../../../../gcc-4.9-20131101/libsanitizer/sanitizer_common/sanitizer_mac.cc:146
"((env_ptr)) != (0)" (0x0, 0x0)
FAIL: g++.dg/asan/large-func-test-1.C -O0 execution test
FAIL: g++.dg/asan/large-func-test-1.C -O1 execution test
FAIL: g++.dg/asan/large-func-test-1.C -O2 execution test
FAIL: g++.dg/asan/large-func-test-1.C -O3 -fomit-frame-pointer execution test
FAIL: g++.dg/asan/large-func-test-1.C -O3 -g execution test
FAIL: g++.dg/asan/large-func-test-1.C -Os execution test
FAIL: g++.dg/asan/large-func-test-1.C -O2 -flto -flto-partition=none
execution test
FAIL: g++.dg/asan/large-func-test-1.C -O2 -flto execution test
FAIL: g++.dg/asan/symbolize-callback-1.C -O2 execution test
FAIL: g++.dg/asan/symbolize-callback-1.C -O2 -flto -flto-partition=none
execution test
FAIL: g++.dg/asan/symbolize-callback-1.C -O2 -flto execution test
=== g++ Summary ===
# of expected passes 259
# of unexpected failures 111
# of unsupported tests 132
/sw/src/fink.build/gcc49-4.9.0-1000/darwin_objdir/gcc/testsuite/g++/../../xg++
version 4.9.0 20131101 (experimental) (GCC)
=== gcc tests ===
Running target unix/-m64
FAIL: c-c++-common/asan/global-overflow-1.c -O0 execution test
FAIL: c-c++-common/asan/global-overflow-1.c -O1 execution test
FAIL: c-c++-common/asan/global-overflow-1.c -O2 execution test
FAIL: c-c++-common/asan/global-overflow-1.c -O3 -fomit-frame-pointer
execution test
FAIL: c-c++-common/asan/global-overflow-1.c -O3 -g execution test
FAIL: c-c++-common/asan/global-overflow-1.c -Os execution test
FAIL: c-c++-common/asan/global-overflow-1.c -O2 -flto -flto-partition=none
execution test
FAIL: c-c++-common/asan/global-overflow-1.c -O2 -flto execution test
FAIL: c-c++-common/asan/heap-overflow-1.c -O0 execution test
FAIL: c-c++-common/asan/heap-overflow-1.c -O1 execution test
FAIL: c-c++-common/asan/heap-overflow-1.c -O2 execution test
FAIL: c-c++-common/asan/heap-overflow-1.c -O3 -fomit-frame-pointer execution
test
FAIL: c-c++-common/asan/heap-overflow-1.c -O3 -g execution test
FAIL: c-c++-common/asan/heap-overflow-1.c -Os execution test
FAIL: c-c++-common/asan/heap-overflow-1.c -O2 -flto -flto-partition=none
execution test
FAIL: c-c++-common/asan/heap-overflow-1.c -O2 -flto execution test
FAIL: c-c++-common/asan/memcmp-1.c -O0 execution test
FAIL: c-c++-common/asan/memcmp-1.c -O1 execution test
FAIL: c-c++-common/asan/memcmp-1.c -O2 execution test
FAIL: c-c++-common/asan/memcmp-1.c -O3 -fomit-frame-pointer execution test
FAIL: c-c++-common/asan/memcmp-1.c -O3 -g execution test
FAIL: c-c++-common/asan/memcmp-1.c -Os execution test
FAIL: c-c++-common/asan/memcmp-1.c -O2 -flto -flto-partition=none execution
test
FAIL: c-c++-common/asan/memcmp-1.c -O2 -flto execution test
FAIL: c-c++-common/asan/null-deref-1.c -O0 execution test
FAIL: c-c++-common/asan/null-deref-1.c -O1 execution test
FAIL: c-c++-common/asan/null-deref-1.c -O2 execution test
FAIL: c-c++-common/asan/null-deref-1.c -O3 -fomit-frame-pointer execution test
FAIL: c-c++-common/asan/null-deref-1.c -O3 -g execution test
FAIL: c-c++-common/asan/null-deref-1.c -Os execution test
FAIL: c-c++-common/asan/null-deref-1.c -O2 -flto -flto-partition=none
execution test
FAIL: c-c++-common/asan/null-deref-1.c -O2 -flto execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c -O0 execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c -O1 execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c -O2 execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c -O3 -fomit-frame-pointer
execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c -O3 -g execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c -Os execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c -O2 -flto -flto-partition=none
execution test
FAIL: c-c++-common/asan/sanity-check-pure-c-1.c -O2 -flto execution test
FAIL: c-c++-common/asan/sleep-before-dying-1.c -O2 execution test
FAIL: c-c++-common/asan/sleep-before-dying-1.c -O2 -flto -flto-partition=none
execution test
FAIL: c-c++-common/asan/sleep-before-dying-1.c -O2 -flto execution test
FAIL: c-c++-common/asan/stack-overflow-1.c -O0 execution test
FAIL: c-c++-common/asan/stack-overflow-1.c -O1 execution test
FAIL: c-c++-common/asan/stack-overflow-1.c -O2 execution test
FAIL: c-c++-common/asan/stack-overflow-1.c -O3 -fomit-frame-pointer execution
test
FAIL: c-c++-common/asan/stack-overflow-1.c -O3 -g execution test
FAIL: c-c++-common/asan/stack-overflow-1.c -Os execution test
FAIL: c-c++-common/asan/stack-overflow-1.c -O2 -flto -flto-partition=none
execution test
FAIL: c-c++-common/asan/stack-overflow-1.c -O2 -flto execution test
FAIL: c-c++-common/asan/strip-path-prefix-1.c -O2 execution test
FAIL: c-c++-common/asan/strip-path-prefix-1.c -O2 -flto -flto-partition=none
execution test
FAIL: c-c++-common/asan/strip-path-prefix-1.c -O2 -flto execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c -O0 execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c -O1 execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c -O2 execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c -O3 -fomit-frame-pointer
execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c -O3 -g execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c -Os execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c -O2 -flto -flto-partition=none
execution test
FAIL: c-c++-common/asan/strncpy-overflow-1.c -O2 -flto execution test
FAIL: c-c++-common/asan/use-after-free-1.c -O0 execution test
FAIL: c-c++-common/asan/use-after-free-1.c -O1 execution test
FAIL: c-c++-common/asan/use-after-free-1.c -O2 execution test
FAIL: c-c++-common/asan/use-after-free-1.c -O3 -fomit-frame-pointer execution
test
FAIL: c-c++-common/asan/use-after-free-1.c -O3 -g execution test
FAIL: c-c++-common/asan/use-after-free-1.c -Os execution test
FAIL: c-c++-common/asan/use-after-free-1.c -O2 -flto -flto-partition=none
execution test
FAIL: c-c++-common/asan/use-after-free-1.c -O2 -flto execution test
=== gcc Summary ===
# of expected passes 178
# of unexpected failures 70
# of unsupported tests 101
/sw/src/fink.build/gcc49-4.9.0-1000/darwin_objdir/gcc/xgcc version 4.9.0
20131101 (experimental) (GCC)
/sw/src/fink.build/gcc49-4.9.0-1000/darwin_objdir/gcc/xgcc version 4.9.0
20131101 (experimental) (GCC)
Compiler version: 4.9.0 20131101 (experimental) (GCC)
Platform: x86_64-apple-darwin12.5.0
configure flags: --prefix=/sw --prefix=/sw/lib/gcc4.9 --mandir=/sw/share/man
--infodir=/sw/lib/gcc4.9/info
--enable-languages=c,c++,fortran,lto,objc,obj-c++,java --with-gmp=/sw
--with-libiconv-prefix=/sw --with-isl=/sw --with-cloog=/sw --with-mpc=/sw
--with-system-zlib --enable-checking=yes --x-includes=/usr/X11R6/include
--x-libraries=/usr/X11R6/lib --program-suffix=-fsf-4.9
Oddly executing...
make -k check RUNTESTFLAGS="asan.exp --target_board=unix'{-m32}'"
results in no regressions on x86_64-apple-darwin12.
Native configuration is x86_64-apple-darwin12.5.0
=== g++ tests ===
Running target unix/-m32
=== g++ Summary ===
# of expected passes 473
# of unsupported tests 132
/sw/src/fink.build/gcc49-4.9.0-1000/darwin_objdir/gcc/testsuite/g++/../../xg++
version 4.9.0 20131101 (experimental) (GCC)
=== gcc tests ===
Running target unix/-m32
=== gcc Summary ===
# of expected passes 318
# of unsupported tests 101
/sw/src/fink.build/gcc49-4.9.0-1000/darwin_objdir/gcc/xgcc version 4.9.0
20131101 (experimental) (GCC)
=== gfortran tests ===
Compiler version: 4.9.0 20131101 (experimental) (GCC)
Platform: x86_64-apple-darwin12.5.0
configure flags: --prefix=/sw --prefix=/sw/lib/gcc4.9 --mandir=/sw/share/man
--infodir=/sw/lib/gcc4.9/info
--enable-languages=c,c++,fortran,lto,objc,obj-c++,java --with-gmp=/sw
--with-libiconv-prefix=/sw --with-isl=/sw --with-cloog=/sw --with-mpc=/sw
--with-system-zlib --enable-checking=yes --x-includes=/usr/X11R6/include
--x-libraries=/usr/X11R6/lib --program-suffix=-fsf-4.9
Has this patch been test on any darwin targets?
Jack
ps The failures all appear to be of the form...
Executing on host: /sw/src/fink.build/gcc49-4.9.0-1000/darwin_objdir/gcc/xgcc
-B/sw/src/fink.build/gcc49-4.9.0-1000/darwin_objdir/gcc/
/sw/src/fink.build/gcc49-4.9.0-1000/gcc-4.9-20131101/gcc/testsuite/c-c++-common/asan/memcmp-1.c
-B/sw/src/fink.build/gcc49-4.9.0-1000/darwin_objdir/x86_64-apple-darwin12.5.0/./libsanitizer/asan/
-L/sw/src/fink.build/gcc49-4.9.0-1000/darwin_objdir/x86_64-apple-darwin12.5.0/./libsanitizer/asan/.libs
-fsanitize=address -g -fno-diagnostics-show-caret -fdiagnostics-color=never
-O0 -fno-builtin-memcmp -lm -m64 -o ./memcmp-1.exe (timeout = 300)
spawn /sw/src/fink.build/gcc49-4.9.0-1000/darwin_objdir/gcc/xgcc
-B/sw/src/fink.build/gcc49-4.9.0-1000/darwin_objdir/gcc/
/sw/src/fink.build/gcc49-4.9.0-1000/gcc-4.9-20131101/gcc/testsuite/c-c++-common/asan/memcmp-1.c
-B/sw/src/fink.build/gcc49-4.9.0-1000/darwin_objdir/x86_64-apple-darwin12.5.0/./libsanitizer/asan/
-L/sw/src/fink.build/gcc49-4.9.0-1000/darwin_objdir/x86_64-apple-darwin12.5.0/./libsanitizer/asan/.libs
-fsanitize=address -g -fno-diagnostics-show-caret -fdiagnostics-color=never
-O0 -fno-builtin-memcmp -lm -m64 -o ./memcmp-1.exe^M
PASS: c-c++-common/asan/memcmp-1.c -O0 (test for excess errors)
Setting LD_LIBRARY_PATH to
:/sw/src/fink.build/gcc49-4.9.0-1000/darwin_objdir/gcc:/sw/src/fink.build/gcc49-4.9.0-1000/darwin_objdir/x86_64-apple-darwin12.5.0/./libsanitizer/asan/.libs::/sw/src/fink.build/gcc49-4.9.0-1000/darwin_objdir/gcc:/sw/src/fink.build/gcc49-4.9.0-1000/darwin_objdir/x86_64-apple-darwin12.5.0/./libsanitizer/asan/.libs
spawn [open ...]^M
==23392==AddressSanitizer CHECK failed:
../../../../gcc-4.9-20131101/libsanitizer/sanitizer_common/sanitizer_mac.cc:146
"((env_ptr)) != (0)" (0x0, 0x0)
FAIL: c-c++-common/asan/memcmp-1.c -O0 execution test
>
> Tested:
> make -C gcc check-g{cc,++}
> RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} asan.exp'
> make check -C gcc RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} ubsan.exp'
>
> =========== gcc/testsuite/ChangeLog
>
> 2013-10-XX Kostya Serebryany <[email protected]>
>
> * g++.dg/asan/asan_test.cc: Update the test
> to match the fresh asan run-time.
> * c-c++-common/asan/stack-overflow-1.c: Ditto.
>
> =========== gcc/ChangeLog
>
> 2013-10-XX Kostya Serebryany <[email protected]>
>
> Update to match the changed asan API.
> * asan.c:
> (asan_function_start): New function.
> (asan_emit_stack_protection): Update the string stored in the
> stack red zone to match new API. Store the PC of the current
> function in the red zone.
> (asan_global_struct): Update the __asan_global definition to match
> the new API.
> (asan_add_global): Ditto.
> * asan.h: Declare asan_function_start.
> * final.c:
> (final_start_function): Call asan_function_start.
> * sanitizer.def: Rename __asan_init_v1 to __asan_init_v3.
>
> =========== libsanitizer/ChangeLog
>
> 2013-10-XX Kostya Serebryany <[email protected]>
>
> * All source files: Merge from upstream r191666.
> * merge.sh: Added lsan.
> * configure.ac: Added lsan.
> * Makefile.am: Added lsan.
> * sanitizer_common/Makefile.am: Added lsan.
> * asan/Makefile.am: Added dependency on lsan.
> * lsan/Makefile.am: New file.
> * asan/Makefile.in: Regenerate.
> * lsan/Makefile.in: Regenerate.
> * Makefile.in: Regenerate.
> * configure: Regenerate.
> * sanitizer_common/Makefile.in: Regenerate.
>
> On Wed, Oct 30, 2013 at 12:03 AM, Jakub Jelinek <[email protected]> wrote:
> > On Tue, Oct 29, 2013 at 05:15:24PM -0700, Konstantin Serebryany wrote:
> >> Actually, I guessed the flags:
> >
> > You don't have to guess them, if you look into
> > testsuite/g++/g++.log (or testsuite/gcc/gcc.log etc.), you can find them
> > there.
> >
> >> % ../gcc-inst/bin/g++ -g -fsanitize=address -static-libasan -O2 -flto
> >> -fno-use-linker-plugin -flto-partition=none
> >> ../gcc/gcc/testsuite/c-c++-common/asan/stack-overflow-1.c; ./a.out
> >> 2>&1
> >>
> >> /tmp/ccgSw6NI.lto.o: In function `main':
> >> ../gcc/gcc/testsuite/c-c++-common/asan/stack-overflow-1.c:13:
> >> undefined reference to `.LASANPC0.2585'
> >> collect2: error: ld returned 1 exit status
> >>
> >> Looks like this patch is not friendly to -flto
> >
> > I guess if you do:
> > ...
> > - tree str_cst;
> > + tree str_cst, decl, id;
> > ...
> > + ASM_GENERATE_INTERNAL_LABEL (buf, "LASANPC",
> > current_function_funcdef_no);
> > + id = get_identifier (buf);
> > + decl = build_decl (DECL_SOURCE_LOCATION (current_function_decl),
> > + VAR_DECL, id, char_type_node);
> > + SET_DECL_ASSEMBLER_NAME (decl, id);
> > + TREE_ADDRESSABLE (decl) = 1;
> > ...
> >
> > it might work even for -flto. The problem with -flto is that the default
> > set_decl_assembler_name langhook for -flto appends dot and some number to
> > the non-exported names, which is undesirable here, because we already make
> > sure those first numbers are unique for the whole compilation unit.
> >
> > Jakub