-
Notifications
You must be signed in to change notification settings - Fork 75
SWDEV-561590 - hipcc/ld.lld unable to link separable compilation when… #437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: amd-staging
Are you sure you want to change the base?
Conversation
… dynamic library is fully specified
|
Should we move this PR upstream? Looks like the PSDB passed |
| } else if (isGPUBinHandleSymbol && (!isHidden) ) { | ||
| DefinedGPUBinHandleSymbols.insert(Name.str()); | ||
| GPUBinHandleSymbols.erase(Name.str()); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- if (!isUndefined) {
+ if (!isUndefined && !isHidden) {
if (isFatBinSymbol) {
DefinedFatBinSymbols.insert(Name.str());
FatBinSymbols.erase(Name.str());
- } else if (isGPUBinHandleSymbol && (!isHidden) ) {
+ } else if (isGPUBinHandleSymbol) {
DefinedGPUBinHandleSymbols.insert(Name.str());
GPUBinHandleSymbols.erase(Name.str());
}I don't recall if I've specifically seen that __hip_fatbin symbols have the same issue, but it's probably best to avoid that issue as well if it crops up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @omor1. You're right. Sam suggested we just remove the code to add these symbols if they are already defined. I've added a new commit. And the change is for both of the _hip symbols.
4bd0cf7 to
c275297
Compare
| DefinedFatBinSymbols.insert(Name.str()); | ||
| FatBinSymbols.erase(Name.str()); | ||
| } else if (isGPUBinHandleSymbol) { | ||
| DefinedGPUBinHandleSymbols.insert(Name.str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this mean that DefinedFatBinSymbols and DefinedGPUBinHandleSymbols are always empty? Therefore, the DefinedFatBinSymbols.find(Name) == DefinedFatBinSymbols.end() check below is always true, so that the code becomes:
// Handling for defined symbols
if (!isUndefined) {
if (isFatBinSymbol) {
FatBinSymbols.erase(Name.str());
} else if (isGPUBinHandleSymbol) {
GPUBinHandleSymbols.erase(Name.str());
}
continue;
}
// Add undefined symbols if they are not in the defined sets
if (isFatBinSymbol)
FatBinSymbols.insert(Name.str());
else if (isGPUBinHandleSymbol)
GPUBinHandleSymbols.insert(Name.str());I think then there's an issue where the order in which files are processed impacts whether a symbol is stored in FatBinSymbols and GPUBinHandleSymbols: hipcc -o output defined_use.o undefined_use.o will probably result in multiple-definition errors.
This reverts commit c275297.
… dynamic library is fully specified