r332635 - [sanitizer] Don't add --export-dynamic for Myriad
Walter Lee via cfe-commits
cfe-commits at lists.llvm.org
Thu May 17 11:04:40 PDT 2018
Author: waltl
Date: Thu May 17 11:04:39 2018
New Revision: 332635
URL: http://llvm.org/viewvc/llvm-project?rev=332635&view=rev
Log:
[sanitizer] Don't add --export-dynamic for Myriad
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
Modified:
cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp
Modified: cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp?rev=332635&r1=332634&r2=332635&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp Thu May 17 11:04:39 2018
@@ -538,6 +538,11 @@ static bool addSanitizerDynamicList(cons
// 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"));
More information about the cfe-commits
mailing list