-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Description
| Bugzilla Link | 40074 |
| Resolution | FIXED |
| Resolved on | Jan 22, 2020 15:03 |
| Version | trunk |
| OS | Windows NT |
| CC | @AlexDenisov,@lhames,@vchuravy |
Extended Description
It happens when the same literal is defined twice, each in a different module and after the second module has been added to the RTDyldObjectLinkingLayer.
So for example in some module:
define float @someFunction() {
entry:
ret float 2.000000e+00
}
In some other module:
define float @someOtherFunction() {
entry:
ret float 2.000000e+00
}
When materializing the second function, you will get this error:
JIT session error: Duplicate definition of symbol '__real@40000000'
The symbol names come from comdat symbols that are created in TargetLoweringObjectFileImpl.cpp TargetLoweringObjectFileCOFF::getSectionForConstant
For COFF, I have the OverrideObjectFlagsWithResponsibilityFlags and AutoClaimResponsibilityForObjectSymbols set to true on the RTDyldObjectLinkingLayer or my function symbols are not found at all.
The same code compiles and runs just fine on Linux/Elf, even with the COFF workarounds enabled there as well.
A workaround I found is to set HasCOFFComdatConstants to false in MCAsmInfoCOFF.cpp