r349647 - [Driver] Disable -faddrsig by default on NetBSD

Michal Gorny via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 19 09:25:46 PST 2018


Author: mgorny
Date: Wed Dec 19 09:25:46 2018
New Revision: 349647

URL: http://llvm.org/viewvc/llvm-project?rev=349647&view=rev
Log:
[Driver] Disable -faddrsig by default on NetBSD

Avoid passing -faddrsig by default on NetBSD.  This platform is still
using old GNU binutils that crashes on executables containing those
sections.

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

Modified:
    cfe/trunk/lib/Driver/ToolChains/Clang.cpp

Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Clang.cpp?rev=349647&r1=349646&r2=349647&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Clang.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp Wed Dec 19 09:25:46 2018
@@ -5273,7 +5273,8 @@ void Clang::ConstructJob(Compilation &C,
   if (Args.hasFlag(options::OPT_faddrsig, options::OPT_fno_addrsig,
                    (TC.getTriple().isOSBinFormatELF() ||
                     TC.getTriple().isOSBinFormatCOFF()) &&
-                       TC.useIntegratedAs()))
+                       TC.useIntegratedAs() &&
+                       RawTriple.getOS() != llvm::Triple::NetBSD))
     CmdArgs.push_back("-faddrsig");
 
   // Finally add the compile command to the compilation.




More information about the cfe-commits mailing list