[libc++] Add hack to allow ubsan to work w/o compiler-rt (__muloti4 is undefined)
authorEric Fiselier <eric@efcs.ca>
Thu, 26 Jul 2018 00:34:50 +0000 (00:34 +0000)
committerEric Fiselier <eric@efcs.ca>
Thu, 26 Jul 2018 00:34:50 +0000 (00:34 +0000)
commit1e1f8ece3b3c290ed0a67e21367f0a8805ee67d4
tree1899e2300eb27b444d2edbfc87a2361a137ca39c
parent5c1e23b2e315458b8f079f543bccddff0fc09cf9
[libc++] Add hack to allow ubsan to work w/o compiler-rt (__muloti4 is undefined)

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

Reviewers: mclow.lists, ldionne, rsmith, jyknight, echristo

Reviewed By: echristo

Subscribers: dberris, cfe-commits

Differential Revision: https://reviews.llvm.org/D49828

llvm-svn: 337990
libcxx/src/experimental/filesystem/int128_builtins.cpp [new file with mode: 0644]