This change adds support for compiler-rt builtins as an alternative compiler runtime to libgcc.
Details
- Reviewers
eugenis kcc alekseyshl mcgrathr - Commits
- rG2bbb6ad21735: Support compiler-rt builtins
rGb1305ce038f1: [sanitizer] Support compiler-rt builtins
rCRT309361: Support compiler-rt builtins
rCRT309060: [sanitizer] Support compiler-rt builtins
rL309361: Support compiler-rt builtins
rL309060: [sanitizer] Support compiler-rt builtins
Diff Detail
- Repository
- rL LLVM
Event Timeline
CMakeLists.txt | ||
---|---|---|
96 | I agree it's not be best name, but it's consistent with the name we use in other runtimes (libc++, libc++abi, libunwind) which will hopefully allow us to set <runtime>_USE_COMPILER_RT=ON reducing some of the boilerplate. |
I'm not yet sure it is caused by this change, but I see that ASan runtime library built for Android now depends on __extendsftf2 among other symbols, and nothing on Android exports that.
This regression was caused this change, not D34501, but I'm still trying to pinpoint the issue.
I think that this is broken for multilib (-m32 + -m64 builds, the default one for NetBSD, Linux, FreeBSD and maybe others):
-- Found compiler-rt builtins library: /usr/local/lib/clang/7.0.0/lib/netbsd/libclang_rt.builtins-x86_64.a
This ends up in a build failure:
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/local/lib/clang/7.0.0/lib/netbsd/libclang_rt.builtins-x86_64.a(udivdi3.c.o)' is incompatible with i386 output /usr/bin/ld: i386:x86-64 architecture of input file `/usr/local/lib/clang/7.0.0/lib/netbsd/libclang_rt.builtins-x86_64.a(udivmoddi4.c.o)' is incompatible with i386 output
Executed command with make VERBOSE=1:
http://netbsd.org/~kamil/llvm/rtlib-32.txt
Everything seems fine except hardcoding libclang_rt.builtins-x86_64.a as noted in CMakeCache.txt:
//Dependencies for the target clang_rt.asan-dynamic-i386_LIB_DEPENDS:STATIC=general;/usr/local/lib/clang/7.0.0/lib/netbsd/libclang_rt.builtins-x86_64.a;general;c;general;execinfo;general;rt;general;m;general;pthread; //Dependencies for the target clang_rt.asan-dynamic-x86_64_LIB_DEPENDS:STATIC=general;/usr/local/lib/clang/7.0.0/lib/netbsd/libclang_rt.builtins-x86_64.a;general;c;general;execinfo;general;rt;general;m;general;pthread;
How to fix this?
Maybe a bit more specific name and comment, SANITIZER_USE_COMPILER_RT_BUILTINS