This is an archive of the discontinued LLVM Phabricator instance.

[UBSan] Embed UBSan into ASan runtime (Clang part).
ClosedPublic

Authored by samsonov on Mar 26 2015, 2:40 PM.

Details

Summary

Change the way we use ASan and UBSan together. Instead of keeping two
separate runtimes (libclang_rt.asan and libclang_rt.ubsan), embed UBSan
into ASan and get rid of libclang_rt.ubsan. If UBSan is not supported on
a platform, all UBSan sources are just compiled into dummy empty object
files. UBSan initialization code (e.g. flag parsing) is directly called
from ASan initialization, so we are able to enforce correct
initialization order.

This mirrors the approach we already use for ASan+LSan.

This change doesn't modify the way we use standalone UBSan.

Diff Detail

Event Timeline

samsonov updated this revision to Diff 22756.Mar 26 2015, 2:40 PM
samsonov retitled this revision from to [UBSan] Embed UBSan into ASan runtime (Clang part)..
samsonov updated this object.
samsonov edited the test plan for this revision. (Show Details)
samsonov added reviewers: kubamracek, zaks.anna, kcc, rsmith.
samsonov added a subscriber: Unknown Object (MLST).
This revision was automatically updated to reflect the committed changes.