forked from OSchip/llvm-project
Allow hbd to be bugpointable on darwin by fixing common and linkonce codegen
llvm-svn: 17637
This commit is contained in:
parent
1df8148b01
commit
1164955bf1
|
@ -411,7 +411,6 @@ int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType,
|
||||||
#elif (defined(__POWERPC__) || defined(__ppc__)) && defined(__APPLE__)
|
#elif (defined(__POWERPC__) || defined(__ppc__)) && defined(__APPLE__)
|
||||||
"-single_module", // link all source files into a single module
|
"-single_module", // link all source files into a single module
|
||||||
"-dynamiclib", // `-dynamiclib' for MacOS X/PowerPC
|
"-dynamiclib", // `-dynamiclib' for MacOS X/PowerPC
|
||||||
"-fno-common", // allow global vars w/o initializers to live
|
|
||||||
"-undefined", // in data segment, rather than generating
|
"-undefined", // in data segment, rather than generating
|
||||||
"dynamic_lookup", // blocks. dynamic_lookup requires that you set
|
"dynamic_lookup", // blocks. dynamic_lookup requires that you set
|
||||||
// MACOSX_DEPLOYMENT_TARGET=10.3 in your env.
|
// MACOSX_DEPLOYMENT_TARGET=10.3 in your env.
|
||||||
|
|
|
@ -367,8 +367,8 @@ void PowerPCAsmPrinter::printOp(const MachineOperand &MO,
|
||||||
}
|
}
|
||||||
|
|
||||||
// External or weakly linked global variables need non-lazily-resolved stubs
|
// External or weakly linked global variables need non-lazily-resolved stubs
|
||||||
if ((GV->isExternal() || GV->hasWeakLinkage()) &&
|
if ((GV->isExternal() || GV->hasWeakLinkage() || GV->hasLinkOnceLinkage())
|
||||||
getTM().AddressTaken.count(GV)) {
|
&& getTM().AddressTaken.count(GV)) {
|
||||||
GVStubs.insert(Name);
|
GVStubs.insert(Name);
|
||||||
O << "L" << Name << "$non_lazy_ptr";
|
O << "L" << Name << "$non_lazy_ptr";
|
||||||
return;
|
return;
|
||||||
|
@ -472,7 +472,8 @@ bool DarwinAsmPrinter::doFinalization(Module &M) {
|
||||||
unsigned Align = TD.getTypeAlignmentShift(C->getType());
|
unsigned Align = TD.getTypeAlignmentShift(C->getType());
|
||||||
|
|
||||||
if (C->isNullValue() && /* FIXME: Verify correct */
|
if (C->isNullValue() && /* FIXME: Verify correct */
|
||||||
(I->hasInternalLinkage() || I->hasWeakLinkage())) {
|
(I->hasInternalLinkage() || I->hasWeakLinkage() ||
|
||||||
|
I->hasLinkOnceLinkage())) {
|
||||||
SwitchSection(O, CurSection, ".data");
|
SwitchSection(O, CurSection, ".data");
|
||||||
if (I->hasInternalLinkage())
|
if (I->hasInternalLinkage())
|
||||||
O << ".lcomm " << name << "," << TD.getTypeSize(C->getType())
|
O << ".lcomm " << name << "," << TD.getTypeSize(C->getType())
|
||||||
|
|
Loading…
Reference in New Issue