In arguments.cpp, could you use a new JVMFlag to declare options that came from this resource as RESOURCE?
- jint result = parse_each_vm_init_arg(vm_options_args, &patch_mod_javabase, JVMFlag::INTERNAL); + jint result = parse_each_vm_init_arg(vm_options_args, &patch_mod_javabase, JVMFlag::RESOURCE); This will require some minor changes to jvmFlags.hpp 34 struct JVMFlag { 35 enum Flags { 36 // latest value origin 37 DEFAULT = 0, 38 COMMAND_LINE = 1, 39 ENVIRON_VAR = 2, 40 CONFIG_FILE = 3, 41 MANAGEMENT = 4, 42 ERGONOMIC = 5, 43 ATTACH_ON_DEMAND = 6, 44 INTERNAL = 7, + 45 RESOURCE = 8, 46 - 47 LAST_VALUE_ORIGIN = INTERNAL, + 47 LAST_VALUE_ORIGIN = RESOURCE, Bob. > On Oct 21, 2019, at 11:22 PM, mark.reinh...@oracle.com wrote: > > RFE: https://bugs.openjdk.java.net/browse/JDK-8232080 > CSR: https://bugs.openjdk.java.net/browse/JDK-8232753 > Webrev: https://cr.openjdk.java.net/~mr/rev/8232080/ > > This change implements jlink plugins, and associated changes in the VM > and libraries, to support the following new jlink options: > > - --vendor-bug-url=<vendor-bug-url> overrides the vendor bug URL baked > into the build. The value of the system property "java.vendor.url.bug" > will be <vendor-bug-url>. > > - --vendor-vm-bug-url=<vendor-vm-bug-url> overrides the vendor VM bug > URL baked into the build. This value will be displayed in VM error > logs. > > - --vendor-version=<vendor-version> overrides the vendor version string > baked into the build, if any. The value of the system property > "java.vendor.version" will be <vendor-version>. This value will be > displayed in the output of java --version. > > - --add-options=<options> prepends the specified <options> string, > which may include whitespace, before any other options when invoking > the VM in the resulting image. > > The vendor-information plugins work by using the JDK’s internal ASM > library to redefine static fields in the java.lang.VersionProps class. > The VM reads the vendor-version and vendor-vm-bug-url strings from that > class during startup. > > The add-options plugin works by storing the requested options in an > internal resource, /java.base/jdk/internal/vm/options. The VM loads that > resource from the lib/modules jimage file during startup and prepends any > options found there to those given on the command line. > > Passes tier1-3 and JCK on {linux,macos,windows}-x64. > > Thanks, > - Mark