]> granicus.if.org Git - clang/commitdiff
[Driver] Enable __cxa_atexit on Solaris
authorRainer Orth <ro@gcc.gnu.org>
Wed, 17 Jul 2019 08:37:00 +0000 (08:37 +0000)
committerRainer Orth <ro@gcc.gnu.org>
Wed, 17 Jul 2019 08:37:00 +0000 (08:37 +0000)
Starting with Solaris 11.4 (which is now the required minimal version), Solaris does
support __cxa_atexit.  This patch reflects that.

One might consider removing the affected tests altogether instead of inverting them,
as is done on other targets.

Besides, this lets two ASan tests PASS:

  AddressSanitizer-i386-sunos :: TestCases/init-order-atexit.cc
  AddressSanitizer-i386-sunos-dynamic :: TestCases/init-order-atexit.cc

Tested on x86_64-pc-solaris2.11 and sparcv9-sun-solaris2.11.

Differential Revision: https://reviews.llvm.org/D64491

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366305 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains/Clang.cpp
test/Driver/cxa-atexit.cpp
test/Driver/solaris-opts.c

index edc64581172ff8dc45d82a20e1c2433e0ba0f885..cb861f27aedabc1912baeef3f20361e03a8d6c9b 100644 (file)
@@ -4749,7 +4749,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
   if (!Args.hasFlag(
           options::OPT_fuse_cxa_atexit, options::OPT_fno_use_cxa_atexit,
           !RawTriple.isOSWindows() &&
-              RawTriple.getOS() != llvm::Triple::Solaris &&
               TC.getArch() != llvm::Triple::xcore &&
               ((RawTriple.getVendor() != llvm::Triple::MipsTechnologies) ||
                RawTriple.hasEnvironment())) ||
index ae955ea5a7dfc9ebbe42a7e19a24029a41018236..336756dedcecdddeec510ba25be7258da0b6a579 100644 (file)
@@ -19,7 +19,7 @@
 // RUN: %clang -### -target sparc-sun-solaris -c %s -o /dev/null 2>&1 | FileCheck %s -check-prefix CHECK-SOLARIS
 
 // CHECK-WINDOWS: "-fno-use-cxa-atexit"
-// CHECK-SOLARIS: "-fno-use-cxa-atexit"
+// CHECK-SOLARIS-NOT: "-fno-use-cxa-atexit"
 // CHECK-HEXAGON-NOT: "-fno-use-cxa-atexit"
 // CHECK-XCORE: "-fno-use-cxa-atexit"
 // CHECK-MTI: "-fno-use-cxa-atexit"
index 8c54ae0a628d2327ca0ebf13aa68a54718ea267e..33d769efaa179856aec8a26e34f58653a69b4144 100644 (file)
@@ -1,4 +1,4 @@
 // RUN: %clang %s --target=sparc-sun-solaris2.11 -### -o %t.o 2>&1 | FileCheck %s
 
-// CHECK: "-fno-use-cxa-atexit"
+// CHECK-NOT: "-fno-use-cxa-atexit"