[PATCH] Fix hotspot-ide-project target on WSL

Andrew Luo andrewluotechnologies at outlook.com
Sat Jan 5 04:41:07 UTC 2019


Subject line is self-explanatory, and patch is attached :)

Basically, I changed the makefiles to add support for wslpath to convert paths (when in WSL, of course.  Otherwise it's cygpath).  For executables we call %windir%\Sysnative\wsl.exe ... (We have to use Sysnative because of WoW64 redirection of System32).

Thanks,

-Andrew
-------------- next part --------------
diff --git a/make/autoconf/spec.gmk.in b/make/autoconf/spec.gmk.in
--- a/make/autoconf/spec.gmk.in
+++ b/make/autoconf/spec.gmk.in
@@ -729,6 +729,7 @@
 RC:=@FIXPATH@ @RC@
 DUMPBIN:=@FIXPATH@ @DUMPBIN@
 CYGPATH:=@CYGPATH@
+WSLPATH:=@WSLPATH@
 LDD:=@LDD@
 OTOOL:=@OTOOL@
 READELF:=@READELF@
diff --git a/make/hotspot/ide/CreateVSProject.gmk b/make/hotspot/ide/CreateVSProject.gmk
--- a/make/hotspot/ide/CreateVSProject.gmk
+++ b/make/hotspot/ide/CreateVSProject.gmk
@@ -46,8 +46,17 @@
 
   # Helper macro to convert a unix path to a Windows path, suitable for
   # inclusion in a command line.
-  FixPath = \
-    $(strip $(subst \,\\,$(shell $(CYGPATH) -w $1)))
+  ifeq ($(OPENJDK_BUILD_OS_ENV), windows.cygwin)
+    FixPath = \
+      $(strip $(subst \,\\,$(shell $(CYGPATH) -w $1)))
+    FixLinuxExecutable = \
+      $(strip $(subst \,\\,$(shell $(CYGPATH) -w $1)))
+  else ifeq ($(OPENJDK_BUILD_OS_ENV), windows.wsl)
+    FixPath = \
+      $(strip $(subst \,\\,$(shell $(WSLPATH) -w $1)))
+    FixLinuxExecutable = \
+      "%windir%\Sysnative\wsl.exe $1"
+  endif
 
   JVM_DEFINES_client := $(patsubst -D%,%, $(filter -D%, $(JVM_CFLAGS)))
   EXTRACTED_DEFINES_client := $(addprefix -define , $(JVM_DEFINES_client))
@@ -121,7 +130,7 @@
       -platformName x64 \
       -buildBase $(call FixPath, $(IDE_OUTPUTDIR)/vs-output) \
       -buildSpace $(call FixPath, $(IDE_OUTPUTDIR)) \
-      -makeBinary $(call FixPath, $(MAKE)) \
+      -makeBinary $(call FixLinuxExecutable, $(MAKE)) \
       -makeOutput $(call FixPath, $(JDK_OUTPUTDIR)/bin/server) \
       -absoluteInclude $(call FixPath, $(HOTSPOT_OUTPUTDIR)/variant-server/gensrc) \
       -absoluteSrcInclude $(call FixPath, $(HOTSPOT_OUTPUTDIR)/variant-server/gensrc) \


More information about the build-dev mailing list