This is an archive of the discontinued LLVM Phabricator instance.

[gn build] build libclang_rt.ubsan_osx_dynamic.dylib on mac
ClosedPublic

Authored by thakis on Aug 16 2022, 8:00 AM.

Diff Detail

Event Timeline

thakis created this revision.Aug 16 2022, 8:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 16 2022, 8:00 AM
Herald added a subscriber: Enna1. · View Herald Transcript
thakis requested review of this revision.Aug 16 2022, 8:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 16 2022, 8:00 AM
aeubanks accepted this revision.Aug 16 2022, 9:08 AM

compiler-rt/lib/ubsan/CMakeLists.txt says there's also a static library on mac, but if this works with -fsanitize=undefined then I guess this is good enough

This revision is now accepted and ready to land.Aug 16 2022, 9:08 AM

We only ship the dynamic one in the chromium clang package, and it's enough to make things work.

...oh, looks like there's -static-libsan to pick the static lib, but the default is the dynamic one on mac (and fuchsia, and android): http://llvm-cs.pcc.me.uk/tools/clang/lib/Driver/SanitizerArgs.cpp#737 So we should probably try to get the shared version building on android too at least. And -static-libsan won't work in the GN build on mac until the static lib is built too.

And it looks like http://llvm-cs.pcc.me.uk/tools/clang/lib/Driver/SanitizerArgs.cpp#267 , http://llvm-cs.pcc.me.uk/tools/clang/lib/Driver/ToolChains/Darwin.cpp#1187 mean that fsanitize-minimal-runtime won't work for now either.

I'll update the patch description with this.

This revision was landed with ongoing or failed builds.Aug 17 2022, 12:37 PM
This revision was automatically updated to reflect the committed changes.