On Tue, Mar 25, 2014 at 08:57:21PM +0100, Jakub Jelinek wrote: > It works fine for ubsan, and your fix is not the right thing to do, > e.g. bootstrap-ubsan reveals some bugs in libiberty which would be otherwise > unnoticed if you always filter away the sanitizing options from libiberty. > > So, I think my patch is the right thing to do for ubsan bootstraps, and for > asan bootstraps we'll need something different (build libiberty twice, or > build selected libiberty objects inside lto-plugin/ directory again, or > something similar). You do want the libiberty parts in cc1, cc1plus, xgcc > etc. instrumented.
Seems libiberty builds (optionally) everything also into pic/ subdirectory, I think best would be if it in case it found -fsanitize=address in CFLAGS also built everything into noasan/ subdirectory with additional -fno-sanitize=address, and filter out -fsanitize=address just in lto-plugin Makefile and use noasan/libiberty.a preferrably over pic/libiberty.a over libiberty.a. I guess I can cook up a patch tomorrow for that, though probably won't have cycles to fully test that. Jakub