You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The JIT knows how to honor linkages, but it does not know about comdats yet except in limited circumstances, so it sees these as conflicting definitions.
Adding support for comdats will be non-trivial as their selection rules are more complex than the selection rules for linkage types.
"""
Actually it's worse than I thought: The IR model for COMDATs (see [1]) isn't quite the same as the COFF model for COMDATs (see [2]), but we would need something that can encapsulate both. I think COFF COMDATs are the most general and could cover IR COMDATs, but we should check this with a COFF expert.
Whatever model we settle on, I think we would need to implement it by generalizing SymbolFlagsMap as this is our current vehicle for describing MaterializationUnit interfaces to ORC Core. Once we can describe COMDAT symbols the JITDylib::defineImpl method can be updated to apply COMDAT selection criteria to choose which definitions are kept and which are discarded for any given MaterializationUnit.
Extended Description
From the llvm-dev mailing list thread "[llvm-dev] C++ JIT Compiler with LLVM on Windows 10 - part 5":
"""
$"??_7exception@std@@6b@" = comdat largest
The JIT knows how to honor linkages, but it does not know about comdats yet except in limited circumstances, so it sees these as conflicting definitions.
Adding support for comdats will be non-trivial as their selection rules are more complex than the selection rules for linkage types.
"""
Actually it's worse than I thought: The IR model for COMDATs (see [1]) isn't quite the same as the COFF model for COMDATs (see [2]), but we would need something that can encapsulate both. I think COFF COMDATs are the most general and could cover IR COMDATs, but we should check this with a COFF expert.
Whatever model we settle on, I think we would need to implement it by generalizing SymbolFlagsMap as this is our current vehicle for describing MaterializationUnit interfaces to ORC Core. Once we can describe COMDAT symbols the JITDylib::defineImpl method can be updated to apply COMDAT selection criteria to choose which definitions are kept and which are discarded for any given MaterializationUnit.
[1] https://llvm.org/docs/LangRef.html#comdats
[2] https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#comdat-sections-object-only
The text was updated successfully, but these errors were encountered: