Problems in Dist.gmk with --enable-new-hotspot-build
Volker Simonis
volker.simonis at gmail.com
Wed Apr 29 17:07:27 UTC 2015
Hi,
I'm currently trying to adopt the new HotSpot make system to ppc64.
Linux/ppc64 seems quite simple and I get up to the COPY_INCLUDE step in
Dist.gmk where it fails with:
SetupCopyFiles COPY_INCLUDE
[2] SRC := /usr/work/d046063/OpenJDK/jdk9-build
[3] DEST :=
/priv/d046063/OpenJDK/output-jdk9-build-dbg/hotspot/dist/include
[4] FLATTEN := true
[5] FILES :=
/usr/work/d046063/OpenJDK/jdk9-build/hotspot/src/share/vm/prims/jni.h
/priv/d046063/OpenJDK/output-jdk9-build-dbg/hotspot/gensrc/jvmtifiles/jvmti.h
/usr/work/d046063/OpenJDK/jdk9-build/hotspot/src/share/vm/code/jvmticmlr.h
/usr/work/d046063/OpenJDK/jdk9-build/hotspot/src/share/vm/services/jmm.h
gmake[4]: Entering directory
`/net/usr.work/d046063/OpenJDK/jdk9-build/hotspot/makefiles'
/bin/echo Copying files to dist directory
Copying files to dist directory
gmake[4]: *** No rule to make target
`/usr/work/d046063/OpenJDK/jdk9-build//priv/d046063/OpenJDK/output-jdk9-build-dbg/hotspot/gensrc/jvmtifiles/jvmti.h',
needed by
`/priv/d046063/OpenJDK/output-jdk9-build-dbg/hotspot/dist/include/jvmti.h'.
Stop.
But this also fails in the same way if I build on Linux/amd64.
The problem seems to be in Dist.gmk:
$(eval $(call SetupCopyFiles, COPY_INCLUDE, \
SRC := $(SRC_ROOT), \
DEST := $(DIST_OUTPUTDIR)/include, \
FLATTEN := true, \
FILES := $(HOTSPOT_TOPDIR)/src/share/vm/prims/jni.h \
$(HOTSPOT_OUTPUTDIR)/gensrc/jvmtifiles/jvmti.h \
$(HOTSPOT_TOPDIR)/src/share/vm/code/jvmticmlr.h \
$(HOTSPOT_TOPDIR)/src/share/vm/services/jmm.h))
where we mix files from the source directory (e.g.
$(HOTSPOT_TOPDIR)/src/share/vm/prims/jni.h) with files from the output
directory ($(HOTSPOT_OUTPUTDIR)/gensrc/jvmtifiles/jvmti.h) which doesn't
seem to work.
SetupCopyFiles has the following comment:
# FILES : List of files to copy with absolute paths, or path relative
to SRC.
# Must be in SRC.
And looking at the implementation of SetupCopyFiles I can see that first
SRC is substituted from every FILES argument and later on the remaining
file part is appended to SRC again. However if a file in FILES isn't
located under SRC this can not work and results in a non-existing path like
"/usr/work/d046063/OpenJDK/jdk9-build//priv/d046063/OpenJDK/output-jdk9-build-dbg/hotspot/gensrc/jvmtifiles/jvmti.h"
in my example which is a concatenation of SRC with the complete absolute
file path from FILES.
Maybe you haven't seen this because you always build into a subdirectory of
the source tree?
Nevertheless I think this should be fixed.
The easiest fix I can come up is to just divide the COPY_INCLUDE step into
two steps like:
$(eval $(call SetupCopyFiles, COPY_INCLUDE, \
SRC := $(SRC_ROOT), \
DEST := $(DIST_OUTPUTDIR)/include, \
FLATTEN := true, \
FILES := $(HOTSPOT_TOPDIR)/src/share/vm/prims/jni.h \
$(HOTSPOT_TOPDIR)/src/share/vm/code/jvmticmlr.h \
$(HOTSPOT_TOPDIR)/src/share/vm/services/jmm.h))
TARGETS += $(COPY_INCLUDE)
$(eval $(call SetupCopyFiles, COPY_GENERATED_INCLUDE, \
DEST := $(DIST_OUTPUTDIR)/include, \
FLATTEN := true, \
FILES := $(HOTSPOT_OUTPUTDIR)/gensrc/jvmtifiles/jvmti.h))
TARGETS += $(COPY_GENERATED_INCLUDE)
With this change I could successfully build HotSpot with the new build
system on Linux/amd64 (and with my other ppc-related changes also on
Linux/ppc64).
My configure line is:
/priv/d046063/OpenJDK/output-jdk9-build-dbg$ bash
/usr/work/d046063/OpenJDK/jdk9-build/configure
--with-boot-jdk=/usr/work/openjdk/nb/linuxppc64/last_known_good/output-jdk8/images/j2sdk-image
--with-jvm-variants=server --with-target-bits=64
--with-debug-level=slowdebug --disable-zip-debug-info
--enable-new-hotspot-build
Notice that the build and the source directory have no common root!
My build command is:
make hotspot-only LOG=debug
If you'd make me a committer of the build-infr project I'd be happy to
submit this fix along with the up-coming ppc fixes right into the
build-infr repo :)
Regards,
Volker
More information about the build-infra-dev
mailing list