This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Add hack to allow ubsan to work w/o compiler-rt (__muloti4 is undefined)
ClosedPublic

Authored by EricWF on Jul 25 2018, 5:00 PM.

Details

Summary

Using int128_t with UBSAN causes link errors unless compiler-rt is providing the runtime library.
Specifically ubsan generates calls to __muloti4 but libgcc doesn't provide a definition.

In order to avoid this, and allow users to continue using sanitized versions of libc++, this patch introduces a hack.
It adds a cribbed version of the compiler-rt builtin to the libc++ filesystem sources.

I don't think this approach will work in the long run, but it seems OK for now.

Also see:

https://bugs.llvm.org/show_bug.cgi?id=30643
https://bugs.llvm.org/show_bug.cgi?id=16404

Diff Detail

Repository
rCXX libc++

Event Timeline

EricWF created this revision.Jul 25 2018, 5:00 PM
EricWF edited the summary of this revision. (Show Details)Jul 25 2018, 5:00 PM
echristo accepted this revision.Jul 25 2018, 5:28 PM

Bit of a hack, but I'm ok with it.

This revision is now accepted and ready to land.Jul 25 2018, 5:28 PM
This revision was automatically updated to reflect the committed changes.