[clang] 9c504ec - [VE] Disable -fsigaddr option for VE
Kazushi Marukawa via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 12 13:22:21 PST 2020
Author: Kazushi (Jam) Marukawa
Date: 2020-11-13T06:22:12+09:00
New Revision: 9c504ec06da636832d03e98581eade3d8f81eb24
URL: https://github.com/llvm/llvm-project/commit/9c504ec06da636832d03e98581eade3d8f81eb24
DIFF: https://github.com/llvm/llvm-project/commit/9c504ec06da636832d03e98581eade3d8f81eb24.diff
LOG: [VE] Disable -fsigaddr option for VE
VE needs to support integrated assembler and "nas". This "nas"
doesn't recognize ".sigaddr" pseudo mnemonics, so need to disable
it. This patch disable it on VE by default. Also add a regression
test for that.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D91350
Added:
Modified:
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/ve-toolchain.c
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 1db47088c959..c8d58f0a5b9a 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -6365,11 +6365,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
if (Args.hasFlag(options::OPT_faddrsig, options::OPT_fno_addrsig,
(TC.getTriple().isOSBinFormatELF() ||
TC.getTriple().isOSBinFormatCOFF()) &&
- !TC.getTriple().isPS4() &&
- !TC.getTriple().isOSNetBSD() &&
- !Distro(D.getVFS(), TC.getTriple()).IsGentoo() &&
- !TC.getTriple().isAndroid() &&
- TC.useIntegratedAs()))
+ !TC.getTriple().isPS4() && !TC.getTriple().isVE() &&
+ !TC.getTriple().isOSNetBSD() &&
+ !Distro(D.getVFS(), TC.getTriple()).IsGentoo() &&
+ !TC.getTriple().isAndroid() && TC.useIntegratedAs()))
CmdArgs.push_back("-faddrsig");
if (Arg *A = Args.getLastArg(options::OPT_fsymbol_partition_EQ)) {
diff --git a/clang/test/Driver/ve-toolchain.c b/clang/test/Driver/ve-toolchain.c
index 3e1600cb8034..261b3efcc4f0 100644
--- a/clang/test/Driver/ve-toolchain.c
+++ b/clang/test/Driver/ve-toolchain.c
@@ -60,6 +60,23 @@
// NOTINITARRAY: clang{{.*}} "-cc1"
// NOTINITARRAY: "-fno-use-init-array"
+///-----------------------------------------------------------------------------
+/// Checking -faddrsig
+
+// RUN: %clang -### -target ve %s 2>&1 | FileCheck -check-prefix=DEFADDESIG %s
+// DEFADDESIG: clang{{.*}} "-cc1"
+// DEFADDESIG-NOT: "-faddrsig"
+
+// RUN: %clang -### -target ve %s -faddrsig 2>&1 | \
+// RUN: FileCheck -check-prefix=ADDRSIG %s
+// ADDRSIG: clang{{.*}} "-cc1"
+// ADDRSIG: "-faddrsig"
+
+// RUN: %clang -### -target ve %s -fno-addrsig 2>&1 | \
+// RUN: FileCheck -check-prefix=NOADDRSIG %s
+// NOADDRSIG: clang{{.*}} "-cc1"
+// NOADDRSIG-NOT: "-faddrsig"
+
///-----------------------------------------------------------------------------
/// Checking exceptions
More information about the cfe-commits
mailing list