Hello! Older glibcs (CentOS 2.5) have specialized extern inline functions defined in stdlib.h that interfere with ASANs testcases in g++.dg/asan:
#ifdef __USE_EXTERN_INLINES /* Define inline functions which call the internal entry points. */ ... These cause many strtol, strtoll and atoi runtime failures with asan_test.C and interception-malloc-test-1.C, and build failures (redefinition of strtol) for the other interception tests. Patch avoids this unwanted inlining ba declaring __NO_INLINE__ for linux targets. 2013-02-09 Uros Bizjak <ubiz...@gmail.com> * g++.dg/asan/asan_test.C: Compile with -D__NO_INLINE__ for *-*-linux* targets. * g++.dg/asan/interception-test-1.c: Ditto. * g++.dg/asan/interception-failure-test-1.C: Ditto. * g++.dg/asan/interception-malloc-test-1.C: Ditto. Patch was tested on x86_64-pc-linux-gnu {,-m32} CentOS 5.9 (where it fixes several runtime and build failures) and Fedora 17. OK for mainline? Uros.
Index: g++.dg/asan/interception-failure-test-1.C =================================================================== --- g++.dg/asan/interception-failure-test-1.C (revision 195912) +++ g++.dg/asan/interception-failure-test-1.C (working copy) @@ -3,6 +3,7 @@ // { dg-do run } // { dg-options "-fno-builtin-malloc -fno-builtin-free" } +// { dg-additional-options "-D__NO_INLINE__" { target { *-*-linux* } } } #include <stdlib.h> #include <stdio.h> Index: g++.dg/asan/interception-test-1.C =================================================================== --- g++.dg/asan/interception-test-1.C (revision 195912) +++ g++.dg/asan/interception-test-1.C (working copy) @@ -2,6 +2,7 @@ // { dg-do run } // { dg-options "-fno-builtin-malloc -fno-builtin-free" } +// { dg-additional-options "-D__NO_INLINE__" { target { *-*-linux* } } } // { dg-shouldfail "asan" } // { dg-skip-if "Darwin uses mac function interposition" { *-*-darwin* } } Index: g++.dg/asan/asan_test.C =================================================================== --- g++.dg/asan/asan_test.C (revision 195912) +++ g++.dg/asan/asan_test.C (working copy) @@ -7,6 +7,7 @@ // { dg-additional-options "-DASAN_LOW_MEMORY=1 -DASAN_NEEDS_SEGV=0" { target arm*-*-* } } // { dg-additional-options "-DASAN_AVOID_EXPENSIVE_TESTS=1" { target { ! run_expensive_tests } } } // { dg-additional-options "-msse2" { target { i?86-*-linux* x86_64-*-linux* } } } +// { dg-additional-options "-D__NO_INLINE__" { target { *-*-linux* } } } // { dg-final { asan-gtest } } #include "asan_test.cc" Index: g++.dg/asan/interception-malloc-test-1.C =================================================================== --- g++.dg/asan/interception-malloc-test-1.C (revision 195912) +++ g++.dg/asan/interception-malloc-test-1.C (working copy) @@ -2,6 +2,7 @@ // { dg-do run { target *-*-linux* } } // { dg-options "-fno-builtin-free" } +// { dg-additional-options "-D__NO_INLINE__" { target { *-*-linux* } } } // { dg-shouldfail "asan" } #include <stdlib.h>