r350028 - [Driver] Disable -faddrsig on Gentoo by default
Michal Gorny via cfe-commits
cfe-commits at lists.llvm.org
Sun Dec 23 07:07:26 PST 2018
Author: mgorny
Date: Sun Dec 23 07:07:26 2018
New Revision: 350028
URL: http://llvm.org/viewvc/llvm-project?rev=350028&view=rev
Log:
[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
Modified:
cfe/trunk/lib/Driver/ToolChains/Clang.cpp
cfe/trunk/test/Driver/addrsig.c
cfe/trunk/test/lit.cfg.py
Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Clang.cpp?rev=350028&r1=350027&r2=350028&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Clang.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp Sun Dec 23 07:07:26 2018
@@ -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,
TC.getTriple().isOSBinFormatCOFF()) &&
!TC.getTriple().isPS4() &&
!TC.getTriple().isOSNetBSD() &&
+ !Distro(D.getVFS()).IsGentoo() &&
TC.useIntegratedAs()))
CmdArgs.push_back("-faddrsig");
Modified: cfe/trunk/test/Driver/addrsig.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/addrsig.c?rev=350028&r1=350027&r2=350028&view=diff
==============================================================================
--- cfe/trunk/test/Driver/addrsig.c (original)
+++ cfe/trunk/test/Driver/addrsig.c Sun Dec 23 07:07:26 2018
@@ -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
Modified: cfe/trunk/test/lit.cfg.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/lit.cfg.py?rev=350028&r1=350027&r2=350028&view=diff
==============================================================================
--- cfe/trunk/test/lit.cfg.py (original)
+++ cfe/trunk/test/lit.cfg.py Sun Dec 23 07:07:26 2018
@@ -190,3 +190,6 @@ lit.util.usePlatformSdkOnDarwin(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')
More information about the cfe-commits
mailing list