[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! llvm-svn: 247634
This commit is contained in:
parent
8ef7a5b4b7
commit
fe71f3887c
|
@ -4572,6 +4572,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
||||||
if (!Args.hasFlag(options::OPT_fuse_cxa_atexit,
|
if (!Args.hasFlag(options::OPT_fuse_cxa_atexit,
|
||||||
options::OPT_fno_use_cxa_atexit,
|
options::OPT_fno_use_cxa_atexit,
|
||||||
!IsWindowsCygnus && !IsWindowsGNU &&
|
!IsWindowsCygnus && !IsWindowsGNU &&
|
||||||
|
getToolChain().getTriple().getOS() != llvm::Triple::Solaris &&
|
||||||
getToolChain().getArch() != llvm::Triple::hexagon &&
|
getToolChain().getArch() != llvm::Triple::hexagon &&
|
||||||
getToolChain().getArch() != llvm::Triple::xcore) ||
|
getToolChain().getArch() != llvm::Triple::xcore) ||
|
||||||
KernelOrKext)
|
KernelOrKext)
|
||||||
|
@ -6942,10 +6943,6 @@ void solaris::Linker::ConstructJob(Compilation &C, const JobAction &JA,
|
||||||
Args.MakeArgString(getToolChain().GetFilePath("values-Xa.o")));
|
Args.MakeArgString(getToolChain().GetFilePath("values-Xa.o")));
|
||||||
CmdArgs.push_back(
|
CmdArgs.push_back(
|
||||||
Args.MakeArgString(getToolChain().GetFilePath("crtbegin.o")));
|
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();
|
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