[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
This commit is contained in:
Michal Gorny 2018-12-23 15:07:26 +00:00
parent f241228a02
commit dae01c352b
3 changed files with 8 additions and 0 deletions

View File

@ -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");

View File

@ -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

View File

@ -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')