aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/Driver.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-03-23 00:30:08 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-03-23 00:30:08 +0000
commit76e6e1377ff837047fb8e03a199c7f286c53897b (patch)
treeb92060a34a05a42069c381376162f3864e987878 /lib/Driver/Driver.cpp
parent984f2783ad8319aa0cbfca1c4a719688b1ecfd5e (diff)
If a .syms file is available alongside a sanitizer runtime, pass it to the
linker via --dynamic-list instead of using --export-dynamic. This reduces the size of the dynamic symbol table, and thus of the binary (in some cases by up to ~30%). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177783 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Driver.cpp')
-rw-r--r--lib/Driver/Driver.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
index cc5b016b03..3167e03ca4 100644
--- a/lib/Driver/Driver.cpp
+++ b/lib/Driver/Driver.cpp
@@ -287,7 +287,9 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
// ccc-install-dir) can change 'Dir'.
StringRef ClangResourceDir(CLANG_RESOURCE_DIR);
SmallString<128> P(Dir);
- if (!ClangResourceDir.empty())
+ if (const Arg *A = Args->getLastArg(options::OPT_resource_dir))
+ P = A->getValue();
+ else if (!ClangResourceDir.empty())
llvm::sys::path::append(P, ClangResourceDir);
else
llvm::sys::path::append(P, "..", "lib", "clang", CLANG_VERSION_STRING);