[PATCH] D56047: [Driver] Disable -faddrsig on Gentoo by default

Michał Górny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Dec 22 01:21:10 PST 2018


mgorny created this revision.
mgorny added reviewers: pcc, dyung, phosek.

Gentoo supports combining clang toolchain with GNU binutils, and many
users actually do that.  As -faddrsig is not supported by GNU strip,
this results in a lot of warnings.  Disable it by default and let users
enable it explicitly if they want it; with the intent of reevaluating
when the underlying feature becomes standarized.


Repository:
  rC Clang

https://reviews.llvm.org/D56047

Files:
  lib/Driver/ToolChains/Clang.cpp
  test/Driver/addrsig.c
  test/lit.cfg.py


Index: test/lit.cfg.py
===================================================================
--- test/lit.cfg.py
+++ test/lit.cfg.py
@@ -190,3 +190,6 @@
 macOSSDKVersion = lit.util.findPlatformSdkVersionOnMacOS(config, lit_config)
 if macOSSDKVersion is not None:
     config.available_features.add('macos-sdk-' + macOSSDKVersion)
+
+if os.path.exists('/etc/gentoo-release'):
+    config.available_features.add('gentoo')
Index: test/Driver/addrsig.c
===================================================================
--- test/Driver/addrsig.c
+++ test/Driver/addrsig.c
@@ -1,3 +1,6 @@
+// Gentoo disables -faddrsig by default
+// XFAIL: gentoo
+
 // RUN: %clang -### -target x86_64-unknown-linux -c %s 2>&1 | FileCheck -check-prefix=ADDRSIG %s
 // RUN: %clang -### -target x86_64-pc-win32 -c %s 2>&1 | FileCheck -check-prefix=ADDRSIG %s
 // RUN: %clang -### -target x86_64-unknown-linux -fno-integrated-as -c %s 2>&1 | FileCheck -check-prefix=NO-ADDRSIG %s
Index: lib/Driver/ToolChains/Clang.cpp
===================================================================
--- lib/Driver/ToolChains/Clang.cpp
+++ lib/Driver/ToolChains/Clang.cpp
@@ -25,6 +25,7 @@
 #include "clang/Basic/LangOptions.h"
 #include "clang/Basic/ObjCRuntime.h"
 #include "clang/Basic/Version.h"
+#include "clang/Driver/Distro.h"
 #include "clang/Driver/DriverDiagnostic.h"
 #include "clang/Driver/Options.h"
 #include "clang/Driver/SanitizerArgs.h"
@@ -5290,6 +5291,7 @@
                     TC.getTriple().isOSBinFormatCOFF()) &&
                       !TC.getTriple().isPS4() &&
                       !TC.getTriple().isOSNetBSD() &&
+                      !Distro(D.getVFS()).IsGentoo() &&
                        TC.useIntegratedAs()))
     CmdArgs.push_back("-faddrsig");
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56047.179415.patch
Type: text/x-patch
Size: 1747 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181222/e07734a7/attachment.bin>


More information about the cfe-commits mailing list