On Wed, Jun 19, 2013 at 10:45:28AM +0200, Richard Biener wrote: > Btw, how to handle the issue with LTO and different -fsanitize options > at compile vs. link-time? Can TUs without -fsanitize options be LTO > linked with -fsanitize? Then lto-wrapper should union -fsanitize > options from all TUs to the final link. I hope all -fsanitize options can > be mixed freely and will properly combine.
You can mix the options at compile time, you can't mix -fsanitize=thread with -fsanitize=address linking, because libasan.* and libtsan.* are runtime incompatible, each one uses different incompatible virtual memory layout. But of course, if you compile something with -fsanitize=thread, something else -fsanitize=address, then link, either with -fsanitize=thread or -fsanitize=address, it will most likely not link (because the other library will not be there). The undefined stuff (lots of options) Marek is working on are orthogonal to this, that library just contains tons of fancy printfs and aborts to complain about various issues, but can coexist with libasan or libtsan. Jakub