]> granicus.if.org Git - clang/commitdiff
[sanitizer] Don't add --export-dynamic for Myriad
authorWalter Lee <waltl@google.com>
Thu, 17 May 2018 18:04:39 +0000 (18:04 +0000)
committerWalter Lee <waltl@google.com>
Thu, 17 May 2018 18:04:39 +0000 (18:04 +0000)
This is to work around a bug in some versions of gnu ld, where
--export-dynamic implies -shared even if -static is explicitly given.
Myriad supports static linking only, so --export-dynamic is never
needed.

Differential Revision: https://reviews.llvm.org/D46452

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332635 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains/CommonArgs.cpp

index 854d5e15ff0fe398d33bd428600ab525e56e128b..9a3ab8d4b2fd725e361a2b07b88ab40a63fe2e23 100644 (file)
@@ -538,6 +538,11 @@ static bool addSanitizerDynamicList(const ToolChain &TC, const ArgList &Args,
   // the option, so don't try to pass it.
   if (TC.getTriple().getOS() == llvm::Triple::Solaris)
     return true;
+  // Myriad is static linking only.  Furthermore, some versions of its
+  // linker have the bug where --export-dynamic overrides -static, so
+  // don't use --export-dynamic on that platform.
+  if (TC.getTriple().getVendor() == llvm::Triple::Myriad)
+    return true;
   SmallString<128> SanRT(TC.getCompilerRT(Args, Sanitizer));
   if (llvm::sys::fs::exists(SanRT + ".syms")) {
     CmdArgs.push_back(Args.MakeArgString("--dynamic-list=" + SanRT + ".syms"));