[PATCH] D35165: [sanitizer] Support compiler-rt builtins

Kamil Rytarowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 8 06:56:28 PDT 2018


krytarowski added a comment.
Herald added a subscriber: delcypher.

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?


Repository:
  rL LLVM

https://reviews.llvm.org/D35165





More information about the llvm-commits mailing list