summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Gorny <mgorny@gentoo.org>2018-12-23 15:07:26 +0000
committerMichal Gorny <mgorny@gentoo.org>2018-12-23 15:07:26 +0000
commitdae01c352b98022dddbf1aec8a25c919d3389d9e (patch)
tree24d78759387745bbd4b1df6d0ed16a4c5c665043
parentf241228a0201cc6eb623370b214cc7921daf67b5 (diff)
downloadbcm5719-llvm-dae01c352b98022dddbf1aec8a25c919d3389d9e.tar.gz
bcm5719-llvm-dae01c352b98022dddbf1aec8a25c919d3389d9e.zip
[Driver] Disable -faddrsig on Gentoo by default
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. See also: https://bugs.gentoo.org/667854 Differential Revision: https://reviews.llvm.org/D56047 llvm-svn: 350028
-rw-r--r--clang/lib/Driver/ToolChains/Clang.cpp2
-rw-r--r--clang/test/Driver/addrsig.c3
-rw-r--r--clang/test/lit.cfg.py3
3 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index ec4fdd2e6d7..10487a6d450 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/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 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
TC.getTriple().isOSBinFormatCOFF()) &&
!TC.getTriple().isPS4() &&
!TC.getTriple().isOSNetBSD() &&
+ !Distro(D.getVFS()).IsGentoo() &&
TC.useIntegratedAs()))
CmdArgs.push_back("-faddrsig");
diff --git a/clang/test/Driver/addrsig.c b/clang/test/Driver/addrsig.c
index 739dcc35ffc..556a908e30b 100644
--- a/clang/test/Driver/addrsig.c
+++ b/clang/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
diff --git a/clang/test/lit.cfg.py b/clang/test/lit.cfg.py
index d105f8d7e13..e61b4bb1048 100644
--- a/clang/test/lit.cfg.py
+++ b/clang/test/lit.cfg.py
@@ -190,3 +190,6 @@ lit.util.usePlatformSdkOnDarwin(config, lit_config)
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')
OpenPOWER on IntegriCloud