-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
8331541: [i386] linking with libjvm.so fails after JDK-8283326 #19048
Conversation
👋 Welcome back vpetko! A progress list of the required criteria for merging this PR into |
@vpa1977 This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 88 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@djelinski, @magicus) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
/label build |
@magicus |
I'm not sure why we have |
Hi, Thank you for looking at the issue!!! Removing the setting should just prevent typos like this from getting into code base. Maybe there was some historical issue that was addressed by it. I did a rebuild on all arches I had access to validate that master does not have any more undefined symbols. |
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.
Looks good to me. Mach5 and GHA agree that we don't need explicit allow-shlib-undefined
anymore.
On a side note, our use of .type
appears to serve no purpose other than introducing errors. Perhaps we could remove all the useless .type
lines in a follow up PR.
Ok, I think I'm understanding this better now. The error occurs since the The Instead, we should have a common macro, something like this:
in a shared file, and include and use it for all symbols in our hotspot assembly files. I was thinking somewhat along those lines last time I was poking around there (when introducing .hidden for the removal of the hotspot map files), but never really got around to it. This bug really shows why we should do that. |
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.
So, after sleeping on this, here is my analysis/verdict:
-
The fix on renaming the
.type
directive looks good. This is the actual bug fix. -
We can remove
--allow-shlib-undefined
. That just overrides--no-allow-shlib- undefined
, which has been the default for years and years, and there is no good reason to have it. It is not strictly related to the bug fix per se, but we can do that in this PR as well to keep things simpler. -
The reason this could happen was since we used assembler code. A similar problem in C++ code would not have been allowed by the compiler.
-
If we introduce a common macro as I suggest, we can avoid this ever happening again. So while the linker cannot guarantee the consistency when linking libjvm.so (which I really would have liked), by using a stricter scheme when defining symbols in assembly code, we can make sure to avoid it.
I created https://bugs.openjdk.org/browse/JDK-8331921 to track setting up proper assembly functions consistently. |
/integrate |
/sponsor |
Going to push as commit 2d62215.
Your commit was automatically rebased without conflicts. |
Hi,
The
.type _SafeFetch32_impl,@function
symbol declaration contains a spurious underscore causing an undefined symbol in libjvm.so.I am not sure about change in default flags. I have removed the flag that allows linking with undefined symbols
because having the flag on might cause bugs like this one or https://bugs.openjdk.org/browse/JDK-8329983 as the build succeeds even if some symbols are not defined.
Openjdk builds successfully without it on amd64, i386, armhf, arm64, s390, ppc64el and riscv64 with this change[1]. riscv64 build was done locally inside vm:
Unfortunately I do not know why it was introduced, so I might be missing something.
I am happy to drop it from this one or move it to a separate issue/pr.
[1] https://launchpad.net/~vpa1977/+archive/ubuntu/october-21/+sourcepub/16076564/+listing-archive-extra
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/19048/head:pull/19048
$ git checkout pull/19048
Update a local copy of the PR:
$ git checkout pull/19048
$ git pull https://git.openjdk.org/jdk.git pull/19048/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 19048
View PR using the GUI difftool:
$ git pr show -t 19048
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/19048.diff
Webrev
Link to Webrev Comment