RFR: 8303884: jlink --add-options plugin does not allow GNU style options to be provided
Yasumasa Suenaga
ysuenaga at openjdk.org
Mon Jul 15 04:12:56 UTC 2024
On Sun, 14 Jul 2024 14:38:39 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:
> Hello @YaSuenag, I haven't had a chance to build your change locally and try it myself, but I suspect this change isn't enough to address the issue. Does this change allow for:
>
> ```
> jlink ... --add-options --add-exports java.base/jdk.internal.misc=ALL-UNNAMED
> ```
It would not work.
`--add-exports java.base/jdk.internal.misc=ALL-UNNAMED` should be an one option for `--add-options`, so it should be quoted.
`"--add-exports java.base/jdk.internal.misc=ALL-UNNAMED"` would NOT be worked, but `--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED` would be worked because option parsar is different between `java` and jlink'ed app. In `java`, `--add-options` would be parsed in `src/java.base/share/native/libjli/java.c`, but in jlink'ed app, it would be parsed in `src/hotspot/hotspot/share/runtime/arguments.cpp` because command line options are pick-upped from `vmoptions` in `modules` file. Then only `--add-exports=` would be handled in HotSpot - so you cannot specify `--add-exports [module]` for jlink'ed app. You have to specify `--add-exports=[module]`.
> Additionally, do the current tests pass with your proposed change?
I tested this patch with `test/jdk/tools/jlink` jtreg tests, and all of tests were passed on my Linux x64 of course.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/19987#issuecomment-2227669198
More information about the core-libs-dev
mailing list