config: fix issues in weak symbol support - #7919
Merged
Merged
Conversation
There was an issue with icx support of weak symbols using #pragma weak. While the compile works, it will not properly honor the visibility attribute on the weak symbols. It does support weak symbols via attributes thoush. Potentially this is due to #pragma weak is separate from attributes in icx. Coincidentally, icx will raise error if the weak function is used within the compilation unit. Assumably, it treats the pragma weak declaration as an unresolved duplicate at compile time so it won't compile the function call within the unit. Anyway, that's how our previous release worked with icx, by accidentally prefer weak attribute against pragma weak. This commit restores the previous behavior as a work around for icx's bad support of #pragma weak.
colleeneb
approved these changes
Aug 3, 2026
colleeneb
left a comment
Collaborator
There was a problem hiding this comment.
I built and tested on Sunspot and it built fine with intel. I confirmed the MPI symbols produced are global weak symbols. The macros defined in mpichconf.h match the older commit indeed: #define HAVE_ATTR_WEAK_ALIAS 1, /* #undef HAVE_MULTIPLE_PRAGMA_WEAK */, and /* #undef HAVE_PRAGMA_WEAK_ALIAS */.
For the record that I think the root cause of #pragma weak MPI_Foo = PMPI_Foo not working as expected is an Intel or clang bug and we reported it to Intel (argonne-lcf/AuroraBugTracking#153). So this could be reverted in the future once that is fixed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Description
There was an issue with icx support of weak symbols using #pragma weak. While the compile works, it will not properly honor the visibility attribute on the weak symbols. It does support weak symbols via attributes thoush. Potentially this is due to #pragma weak is separate from attributes in icx.
Coincidentally, icx will raise error if the weak function is used within the compilation unit. Assumably, it treats the pragma weak declaration as an unresolved duplicate at compile time so it won't compile the function call within the unit.
Anyway, that's how our previous releas worked with icx, by accidentally prefer weak attribute against pragma weak.
This commit restors the previous behavior as a work around for icx's bad support of #pragma weak.
Credit to @colleeneb for bisecting releases and identifying key differences.
Fixes #7913
Author Checklist
Particularly focus on why, not what. Reference background, issues, test failures, xfail entries, etc.
Commits are self-contained and do not do two things at once.
Commit message is of the form:
module: short descriptionCommit message explains what's in the commit.
Whitespace checker. Warnings test. Additional tests via comments.
For non-Argonne authors, check contribution agreement.
If necessary, request an explicit comment from your companies PR approval manager.