On Tue, Oct 31, 2017 at 02:53:26PM +0100, Kamil Rytarowski wrote: > >> http://netbsd.org/~kamil/gcc/test_summary.log.8-20171022.txt > > > > That seems that asan pretty much doesn't work at all in GCC for netbsd. > > A few FAILs might be acceptable, but so many FAILs certainly aren't. > > The testsuite doesn't use python, at least not for *san testing nor > > test_summary, so that shouldn't be the problem. If it is asan/ubsan tests > > that are hanging, that is something that needs to be debugged and understood > > why it hangs. > > > > It is similar in LLVM, where it works against statically linked .a files > with sanitizers. For .so, I can observe similar information about > DEADLYSIGNAL without detailed information.
But dynamic linking of libasan or libubsan is the default in gcc, so it needs to work out of the box. Note gcc/config/gnu-user.h has: /* Link -lasan early on the command line. For -static-libasan, don't link it for -shared link, the executable should be compiled with -static-libasan in that case, and for executable link with --{,no-}whole-archive around it to force everything into the executable. And similarly for -ltsan and -llsan. */ #if defined(HAVE_LD_STATIC_DYNAMIC) #undef LIBASAN_EARLY_SPEC #define LIBASAN_EARLY_SPEC "%{!shared:libasan_preinit%O%s} " \ "%{static-libasan:%{!shared:" \ LD_STATIC_OPTION " --whole-archive -lasan --no-whole-archive " \ LD_DYNAMIC_OPTION "}}%{!static-libasan:-lasan}" #undef LIBTSAN_EARLY_SPEC #define LIBTSAN_EARLY_SPEC "%{!shared:libtsan_preinit%O%s} " \ "%{static-libtsan:%{!shared:" \ LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \ LD_DYNAMIC_OPTION "}}%{!static-libtsan:-ltsan}" #undef LIBLSAN_EARLY_SPEC #define LIBLSAN_EARLY_SPEC "%{!shared:liblsan_preinit%O%s} " \ "%{static-liblsan:%{!shared:" \ LD_STATIC_OPTION " --whole-archive -llsan --no-whole-archive " \ LD_DYNAMIC_OPTION "}}%{!static-liblsan:-llsan}" #endif which might need to be duplicated into gcc/config/netbsd-elf.h. Jakub