[VE] Disable -fsigaddr option for VE
authorKazushi (Jam) Marukawa <marukawa@nec.com>
Thu, 12 Nov 2020 11:41:04 +0000 (20:41 +0900)
committerKazushi (Jam) Marukawa <marukawa@nec.com>
Thu, 12 Nov 2020 21:22:12 +0000 (06:22 +0900)
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

clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/ve-toolchain.c

index 1db4708..c8d58f0 100644 (file)
@@ -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)) {
index 3e1600c..261b3ef 100644 (file)
 // 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
 
 // RUN: %clang -### -target ve %s 2>&1 | FileCheck -check-prefix=DEFEXCEPTION %s