[PATCH] D55828: [clang] [Driver] Disable -faddrsig by default on NetBSD

Michał Górny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 18 08:35:54 PST 2018


mgorny created this revision.
mgorny added reviewers: krytarowski, pcc.

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


Repository:
  rC Clang

https://reviews.llvm.org/D55828

Files:
  lib/Driver/ToolChains/Clang.cpp


Index: lib/Driver/ToolChains/Clang.cpp
===================================================================
--- lib/Driver/ToolChains/Clang.cpp
+++ lib/Driver/ToolChains/Clang.cpp
@@ -5272,7 +5272,8 @@
   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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55828.178691.patch
Type: text/x-patch
Size: 648 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181218/71fb06a2/attachment-0001.bin>


More information about the cfe-commits mailing list