mirror of https://github.com/microsoft/clang.git
[Solaris] Default to -fno-cxa-finalize.
There is no __cxa_finalize symbol available on recent Solaris OS versions, so we need this flag to make non trivial C++ programs run. Also stop looking for cxa_finalize.o, since it won't be there. Patch by Xan López! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247634 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5e332fd14a
commit
7d8d0667a1
|
@ -4572,8 +4572,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
if (!Args.hasFlag(options::OPT_fuse_cxa_atexit,
|
||||
options::OPT_fno_use_cxa_atexit,
|
||||
!IsWindowsCygnus && !IsWindowsGNU &&
|
||||
getToolChain().getArch() != llvm::Triple::hexagon &&
|
||||
getToolChain().getArch() != llvm::Triple::xcore) ||
|
||||
getToolChain().getTriple().getOS() != llvm::Triple::Solaris &&
|
||||
getToolChain().getArch() != llvm::Triple::hexagon &&
|
||||
getToolChain().getArch() != llvm::Triple::xcore) ||
|
||||
KernelOrKext)
|
||||
CmdArgs.push_back("-fno-use-cxa-atexit");
|
||||
|
||||
|
@ -6942,10 +6943,6 @@ void solaris::Linker::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
Args.MakeArgString(getToolChain().GetFilePath("values-Xa.o")));
|
||||
CmdArgs.push_back(
|
||||
Args.MakeArgString(getToolChain().GetFilePath("crtbegin.o")));
|
||||
|
||||
if (getToolChain().getDriver().CCCIsCXX())
|
||||
CmdArgs.push_back(
|
||||
Args.MakeArgString(getToolChain().GetFilePath("cxa_finalize.o")));
|
||||
}
|
||||
|
||||
const ToolChain::path_list &Paths = getToolChain().getFilePaths();
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
// RUN: %clang %s --target=sparc-sun-solaris2.11 -### -o %t.o 2>&1 | FileCheck %s
|
||||
|
||||
// CHECK: "-fno-use-cxa-atexit"
|
||||
|
Loading…
Reference in New Issue