[PATCH] [compiler-rt] Use @rpath as LC_ID_DYLIB for ASan dylib on OS X

Kuba Brecka kuba.brecka at gmail.com
Thu Oct 30 17:46:37 PDT 2014


> DarwinStaticLib name makes no sense at this point. Consider fixing this in a preliminary commit.
Fixed in r220939, http://reviews.llvm.org/D6040.

> Can you instead fix the existing test for linking ASan runtime on Darwin (if there is any)?
Done.

> I'm not a clang driver guy, but it would probably be cleaner to leave AddLinkRuntimeLib() as is, and instead add the CmdArgs.push_back()s inside the if (Sanitize.needsAsanRt()).
You're right that this currently applies only to ASan, but we might want to reuse this rpath logic for other future compiler-rt sanitizer (tsan, ubsan) dylibs. Leaving it for now, but if you strongly feel that we shouldn't touch AddLinkRuntimeLib, let me know and I'll change the patch.

> It looks like the clang driver will always add two rpath entries when building for ASan? Is there anyway to suppress that if Xcode knows better? That is, Xcode knows a better location for the runtime lib?
I think Xcode would have to use install_name_tool to change the rpath entries manually. We could add another flag to disable adding these rpaths in the driver. Alexander, what do you think? Either way, if we agree on adding these rpaths by default, let's start with this patch and then consider adding that flag in a separate patch.

http://reviews.llvm.org/D6018

Files:
  projects/compiler-rt/lib/asan/CMakeLists.txt
  projects/compiler-rt/test/asan/TestCases/Darwin/interface_symbols_darwin.c
  tools/clang/lib/Driver/ToolChains.cpp
  tools/clang/lib/Driver/ToolChains.h
  tools/clang/test/Driver/darwin-sanitizer-ld.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6018.15596.patch
Type: text/x-patch
Size: 6519 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141031/5a104f7e/attachment.bin>


More information about the llvm-commits mailing list