summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2012-12-31 17:32:33 +0100
committerAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2012-12-31 17:32:33 +0100
commit38ca14051576a21e015aa7a5a9a7f1d3ccff4ab8 (patch)
tree1efc8d8214c4f6e0155cb16e43eb0ee6e46ae354
parentce031f044ce44c8ad0277d69f70fecdbc32f077b (diff)
downloadclang-38ca14051576a21e015aa7a5a9a7f1d3ccff4ab8.tar.gz
clang-38ca14051576a21e015aa7a5a9a7f1d3ccff4ab8.tar.bz2
clang-38ca14051576a21e015aa7a5a9a7f1d3ccff4ab8.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.cpp29
1 files changed, 22 insertions, 7 deletions
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index 7d70cd50de..ef8b4888ff 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -2088,13 +2088,28 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
// ABI requires a mapping between the GOT and the symbol table.
// Android loader does not support .gnu.hash.
if (!isMipsArch(Arch) && !IsAndroid) {
- if (IsRedhat(Distro) || IsOpenSuse(Distro) ||
- (IsUbuntu(Distro) && Distro >= UbuntuMaverick))
- ExtraOpts.push_back("--hash-style=gnu");
-
- if (IsDebian(Distro) || IsOpenSuse(Distro) || Distro == UbuntuLucid ||
- Distro == UbuntuJaunty || Distro == UbuntuKarmic)
- ExtraOpts.push_back("--hash-style=both");
+ std::string DefaultHashStyle;
+#ifdef DEFAULT_TARGET_HASHSTYLE
+ bool useDefaultHashStyle = true;
+ DefaultHashStyle = std::string(DEFAULT_TARGET_HASHSTYLE);
+#else
+ bool useDefaultHashStyle = false;
+#endif
+ if (useDefaultHashStyle) {
+ 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");
+ } else if (IsRedhat(Distro) || IsOpenSuse(Distro) ||
+ (IsUbuntu(Distro) && Distro >= UbuntuMaverick)) {
+ ExtraOpts.push_back("--hash-style=gnu");
+ } else if (IsDebian(Distro) || IsOpenSuse(Distro) ||
+ Distro == UbuntuLucid || Distro == UbuntuJaunty ||
+ Distro == UbuntuKarmic) {
+ ExtraOpts.push_back("--hash-style=both");
+ }
}
if (IsRedhat(Distro))