Explicitly load libcrypto for JITServer #21085
Open
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.
When libssl3 (or higher) is bundled with the JDK, we want to load that version in preference over the one present on the system.
dlopen
will do that because the RUNPATH for the JIT dll (from whichdlopen
is invoked) includes the "JDK/lib" path where libssl is bundled. However, as part of loading libssl3,dlopen
will also attempt to load libcrypto3 (because it is a dependency). This is searched in the RPATH of the jitserver executable for a server, or in the RPATH of the java executable for a client. Currently, the jitserver executable does not include an RPATH, so libcrypto3 is searched on the system and this may fail on systems that do not have version 3 installed. This problem can be circumvented by performing an explicitdlopen
for the crypto library, in which case the RUNPATH for the JIT is going to be used as search path.Fixes: #21066