summaryrefslogtreecommitdiffstats
path: root/clang/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
commitf3e624ca73b007552554b31358f4abde9eb2d3b7 (patch)
tree1618984211e75dd0a0431f04265e52736f23618c /clang/lib/Driver/Driver.cpp
parentc30d9cc67810dfd74146ec9e45743bf5fc7215b2 (diff)
downloadbcm5719-llvm-f3e624ca73b007552554b31358f4abde9eb2d3b7.tar.gz
bcm5719-llvm-f3e624ca73b007552554b31358f4abde9eb2d3b7.zip
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%). llvm-svn: 177783
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r--clang/lib/Driver/Driver.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index cc5b016b03b..3167e03ca44 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud