]> granicus.if.org Git - clang/commitdiff
[Driver] Disable -faddrsig by default on NetBSD
authorMichal Gorny <mgorny@gentoo.org>
Wed, 19 Dec 2018 17:25:46 +0000 (17:25 +0000)
committerMichal Gorny <mgorny@gentoo.org>
Wed, 19 Dec 2018 17:25:46 +0000 (17:25 +0000)
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

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

lib/Driver/ToolChains/Clang.cpp

index 1f267e68f174cc7fab96dd5f2fec7196470d7dd3..18a43a695d37f98ca025b1dfdf42da8be53da95d 100644 (file)
@@ -5273,7 +5273,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
   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.