mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
Disable lto on modules with dll exports (lld-link bug)
This commit is contained in:
parent
0c3f9a139d
commit
1b5f85615a
2 changed files with 6 additions and 0 deletions
|
@ -352,6 +352,7 @@ BfIRCodeGen::BfIRCodeGen()
|
||||||
mLLVMContext = new llvm::LLVMContext();
|
mLLVMContext = new llvm::LLVMContext();
|
||||||
mLLVMModule = NULL;
|
mLLVMModule = NULL;
|
||||||
mIsCodeView = false;
|
mIsCodeView = false;
|
||||||
|
mHadDLLExport = false;
|
||||||
mConstValIdx = 0;
|
mConstValIdx = 0;
|
||||||
mCmdCount = 0;
|
mCmdCount = 0;
|
||||||
|
|
||||||
|
@ -3794,6 +3795,7 @@ void BfIRCodeGen::HandleNextCmd()
|
||||||
else if (attribute == BFIRAttribute_DllExport)
|
else if (attribute == BFIRAttribute_DllExport)
|
||||||
{
|
{
|
||||||
func->setDLLStorageClass(llvm::GlobalValue::DLLExportStorageClass);
|
func->setDLLStorageClass(llvm::GlobalValue::DLLExportStorageClass);
|
||||||
|
mHadDLLExport = true;
|
||||||
}
|
}
|
||||||
else if (attribute == BFIRAttribute_NoFramePointerElim)
|
else if (attribute == BFIRAttribute_NoFramePointerElim)
|
||||||
{
|
{
|
||||||
|
@ -5314,6 +5316,9 @@ bool BfIRCodeGen::WriteObjectFile(const StringImpl& outFileName)
|
||||||
{
|
{
|
||||||
enableLTO = false;
|
enableLTO = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mHadDLLExport) // LTO bug in LLVM-link?
|
||||||
|
enableLTO = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::error_code EC;
|
std::error_code EC;
|
||||||
|
|
|
@ -106,6 +106,7 @@ public:
|
||||||
BfCodeGenOptions mCodeGenOptions;
|
BfCodeGenOptions mCodeGenOptions;
|
||||||
bool mHasDebugLoc;
|
bool mHasDebugLoc;
|
||||||
bool mIsCodeView;
|
bool mIsCodeView;
|
||||||
|
bool mHadDLLExport;
|
||||||
int mConstValIdx;
|
int mConstValIdx;
|
||||||
|
|
||||||
int mCmdCount;
|
int mCmdCount;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue