[lld] [LLD] [Build Issue] Ubuntu24 build failure due to LLD's COFF regression (PR #98447)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 11 01:39:47 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lld-coff
Author: Vikash Gupta (vg0204)
<details>
<summary>Changes</summary>
It happened due to lld's COFF linker multiple regression tests failure. The bug found can be identified as a Heisenbug, which appears only in Release mode, not in Debug mode. It also vanishes when BUG is being tried to be outputed out or isolated. This behaviour cannot be seen at all in OS below Ubuntu24.
Eventually, the bug was about not handling exported symbols properly, when dealing with defining undefined symbols for COFF linker. Its specifically about improper forwarding of isUsedinRegObject boolean while invoking replaceSymbol() API, so hence explicitly doing it resolved issue.
---
Full diff: https://github.com/llvm/llvm-project/pull/98447.diff
1 Files Affected:
- (modified) lld/COFF/Symbols.h (+2)
``````````diff
diff --git a/lld/COFF/Symbols.h b/lld/COFF/Symbols.h
index 5ef46f5af6a6c..d33989841c501 100644
--- a/lld/COFF/Symbols.h
+++ b/lld/COFF/Symbols.h
@@ -499,8 +499,10 @@ void replaceSymbol(Symbol *s, ArgT &&... arg) {
assert(static_cast<Symbol *>(static_cast<T *>(nullptr)) == nullptr &&
"Not a Symbol");
bool canInline = s->canInline;
+ bool isUsedInRegularObj = s->isUsedInRegularObj;
new (s) T(std::forward<ArgT>(arg)...);
s->canInline = canInline;
+ s->isUsedInRegularObj = isUsedInRegularObj;
}
} // namespace coff
``````````
</details>
https://github.com/llvm/llvm-project/pull/98447
More information about the llvm-commits
mailing list