summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2014-04-04 14:48:01 +0200
committerAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2014-05-09 23:20:48 +0200
commita95b0740dc1e321a4480951fc507e5ee7ad8bd4b (patch)
tree568bec4b7cffe916163bcfd43d4b9b68719c80ba
parent9a438c9f9196c5598436b671355d2b3accee21ed (diff)
downloadclang-a95b0740dc1e321a4480951fc507e5ee7ad8bd4b.tar.gz
clang-a95b0740dc1e321a4480951fc507e5ee7ad8bd4b.tar.bz2
clang-a95b0740dc1e321a4480951fc507e5ee7ad8bd4b.tar.xz
[Embtk] linux toolchains: use default linker hash-style when it was set at configure time
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
-rw-r--r--lib/Driver/ToolChains.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index 46883357e2..8ecb97c2dd 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -25,6 +25,7 @@
#include "llvm/Option/Option.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/Host.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
@@ -2422,6 +2423,16 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
if (IsDebian(Distro) || IsOpenSUSE(Distro) || Distro == UbuntuLucid ||
Distro == UbuntuJaunty || Distro == UbuntuKarmic)
ExtraOpts.push_back("--hash-style=both");
+
+ if (llvm::sys::hasDefaultTargetHashStyle()) {
+ std::string DefaultHashStyle = llvm::sys::getDefaultTargetHashStyle();
+ if (DefaultHashStyle == "sysv")
+ ExtraOpts.push_back("--hash-style=sysv");
+ else if (DefaultHashStyle == "gnu")
+ ExtraOpts.push_back("--hash-style=gnu");
+ else
+ ExtraOpts.push_back("--hash-style=both");
+ }
}
if (IsRedhat(Distro))