diff options
author | Petr Hosek <phosek@chromium.org> | 2016-12-14 16:46:50 +0000 |
---|---|---|
committer | Petr Hosek <phosek@chromium.org> | 2016-12-14 16:46:50 +0000 |
commit | 5b22d87412550a73573eca16c906ea247ce405d1 (patch) | |
tree | bbef53b5d98f0702620cfd175384e759d311d427 /include | |
parent | f1038cc843398f971c4939388bca684c2f5fad36 (diff) |
[Driver] Allow setting the default linker during build
This change allows setting the default linker used by the Clang
driver when configuring the build.
Differential Revision: https://reviews.llvm.org/D25263
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289668 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/Config/config.h.cmake | 3 | ||||
-rw-r--r-- | include/clang/Driver/ToolChain.h | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/include/clang/Config/config.h.cmake b/include/clang/Config/config.h.cmake index 9bf9ea5d8a..55f0ca94de 100644 --- a/include/clang/Config/config.h.cmake +++ b/include/clang/Config/config.h.cmake @@ -8,6 +8,9 @@ /* Bug report URL. */ #define BUG_REPORT_URL "${BUG_REPORT_URL}" +/* Default linker to use. */ +#define CLANG_DEFAULT_LINKER "${CLANG_DEFAULT_LINKER}" + /* Default C++ stdlib to use. */ #define CLANG_DEFAULT_CXX_STDLIB "${CLANG_DEFAULT_CXX_STDLIB}" diff --git a/include/clang/Driver/ToolChain.h b/include/clang/Driver/ToolChain.h index 53b8fbcdaf..cca239c4be 100644 --- a/include/clang/Driver/ToolChain.h +++ b/include/clang/Driver/ToolChain.h @@ -105,7 +105,6 @@ private: protected: MultilibSet Multilibs; - const char *DefaultLinker = "ld"; ToolChain(const Driver &D, const llvm::Triple &T, const llvm::opt::ArgList &Args); @@ -272,6 +271,11 @@ public: return 0; } + /// GetDefaultLinker - Get the default linker to use. + virtual const char *getDefaultLinker() const { + return "ld"; + } + /// GetDefaultRuntimeLibType - Get the default runtime library variant to use. virtual RuntimeLibType GetDefaultRuntimeLibType() const { return ToolChain::RLT_Libgcc; |