Open thesamesam opened 5 days ago
The issue is very "fun". gcc inserts a link to libasan.so, while clang inlines the instrumentation code but only for main binaries, not libraries.
What would be really nice is if the linker knew not to worry about specific symbols, but automatically skipping b_lundef seems reasonable given it's effectively a sanity lint and people can just use GCC if they want that (or don't build instrumented test binaries and expect production checks).
We currently just warn when users use
b_sanitize
with Clang and the defaultb_lundef
, but this is easy to miss and it's also not very Mesony to require a workaround on the user's part for an issue we can diagnose and handle.We should override
b_lundef
to default tofalse
if the user didn't specify it, where Clang is being used withb_sanitize
.It was added in https://github.com/mesonbuild/meson/commit/bde99eb6c40a9c7bc4055b0dc84a31021b7623d2 for https://github.com/mesonbuild/meson/issues/764.
At the time, @jpakkane gave https://github.com/mesonbuild/meson/issues/764#issuecomment-250994349 for why we can't fix the default. Maybe things have got better since? If not, given he's working on option refactoring right now...