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

Make importing sa-jdi.jar optional on its existance

XMLWordPrintable

    • b41
    • 9
    • b43
    • other, itanium
    • generic

        In jigsaw M2, the logic used for importing hotspot files into the jdk build changed. A side effect of this change is that the build will fail if sa-jdi.jar is not present in the hotspot output directory. As noted in the following mail to build-dev, there are valid hotspot configurations where sa-jdi.jar is not built:

        Hi Chris!

        The build changes introduced a new dependency that sa-jdi.jar is always built.

        The sa-jdi.jar do not get built for Zero and Itanium builds.
        Zero is built using the --with-jvm-interpreter=cpp --with-jvm-variants=zero configure options.

        The sa-jdi.jar also do not exist if you use the --with-import-hotspot= to import alternative OpenJDK JVM such as
        a pre-compiled CACAO JVM or JamVM libjvm.so .

        I would suggest to change the jdk/make/Import.gmk and jdk/make/gensrc/Gensrc-jdk.jdi.gmk to first check if sa-jdi.jar
        exist before adding it to the SA_TARGETS and GENSRC_JDK_JDI something like this:

        Index: openjdk-jdk9-b38/jdk/make/Import.gmk
        ===================================================================
        --- openjdk-jdk9-b38.orig/jdk/make/Import.gmk 2014-11-17 17:34:13.830175424 +0100
        +++ openjdk-jdk9-b38/jdk/make/Import.gmk 2014-11-18 09:10:25.420715300 +0100
        @@ -221,6 +221,8 @@
         # even if zip is already unpacked.
         $(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent/_the.sa.services: $(HOTSPOT_DIST)/lib/sa-jdi.jar
         
        +# sa-jdi.jar do not exist for Itanium and zero
        +if [ -a $(HOTSPOT_DIST)/lib/sa-jdi.jar ] ; \
         SA_TARGETS += $(JDK_OUTPUTDIR)/modules/jdk.hotspot.agent/_the.sa.jar.unpacked \
             $(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent/_the.sa.services
         
        Index: openjdk-jdk9-b38/jdk/make/gensrc/Gensrc-jdk.jdi.gmk
        ===================================================================
        --- openjdk-jdk9-b38.orig/jdk/make/gensrc/Gensrc-jdk.jdi.gmk 2014-11-18 08:57:26.504852865 +0100
        +++ openjdk-jdk9-b38/jdk/make/gensrc/Gensrc-jdk.jdi.gmk 2014-11-18 09:10:43.348804201 +0100
        @@ -78,12 +78,10 @@
             $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/META-INF/services/com.sun.jdi.connect.Connector
                $(install-file)
         
        +# sa-jdi.jar do not exist for Itanium and zero
        +if [ -a $(HOTSPOT_DIST)/lib/sa-jdi.jar ] ; \
         GENSRC_JDK_JDI += $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/META-INF/services/com.sun.jdi.connect.Connector \
             $(JDK_OUTPUTDIR)/modules/jdk.hotspot.agent/META-INF/services/com.sun.jdi.connect.Connector

         
        Cheers
        Xerxes

              simonis Volker Simonis
              erikj Erik Joelsson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: