Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8352437

-XX:+AOTClassLinking is not compatible with --add-export

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • 25
    • None
    • hotspot

      When --add-exports is specified with "java -XX:AOTMode=create", AOTClassLinking is disabled:

      =================================
      $ java -cp HelloWorld.jar -XX:AOTMode=record \
             -XX:AOTConfiguration=hw.aotconfig HelloWorld
      Hello World
      AOTConfiguration recorded: hw.aotconfig

      $ java -Xlog:cds -XX:+AOTClassLinking --add-exports java.base/jdk.internal.misc=ALL-UNNAMED \
             -cp HelloWorld.jar -XX:AOTMode=create -XX:AOTCache=hw.aot \
             -XX:AOTConfiguration=hw.aotconfig
      [...]
      [0.000s][info][cds] optimized module handling: disabled due to incompatible property: jdk.module.addexports=java.base/jdk.internal.misc=ALL-UNNAMED
      [...]
      [0.456s][info][cds] Number of classes 1043
      [0.456s][info][cds] instance classes = 891, aot-linked = 0, inited = 0
      =================================

      Proposal:

      We should support --add-exports for AOT cache, and allow the AOT cache to be used as long as the exact same set of options --add-exports are used during assembly phase and production run.

            iklam Ioi Lam
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: