# HG changeset patch # User erikj # Date 1545209405 28800 # Node ID a558443237274f3babd4ee626c9649cbe9bdd795 # Parent 168830ded68af3f5df087c2fac4f26322a95253a Applying diff3.txt from Andrew Luo diff -r 168830ded68a -r a55844323727 doc/building.html --- a/doc/building.html Mon Dec 17 09:35:15 2018 -0800 +++ b/doc/building.html Wed Dec 19 00:50:05 2018 -0800 @@ -206,6 +206,7 @@

Windows Subsystem for Linux (WSL)

Only Windows 10 1803 or newer is supported due to a dependency on the wslpath utility and support for environment variable sharing through WSLENV.

You may build both Windows and Linux binaries from WSL. To build Windows binaries, you must use a Windows boot JDK (located in a Windows-accessible directory). To build Linux binaries, you must use a Linux boot JDK. The default behavior is to build for Windows. To build for Linux, pass --build=x86_64-unknown-linux-gnu and --host=x86_64-unknown-linux-gnu to configure.

+

If building Windows binaries, you must also have synced down the OpenJDK source code from Windows. This is because Windows executables (such as Visual Studio and the boot JDK) must be able to access the source code. Also, the directory where the OpenJDK source code is stored must be case-insensitive (either by setting the individual directory as case insensitive using fsutil, changing /etc/fstab to mount the drive as case-insensitive, or editing /etc/wsl.conf to mark all mounted Windows drives as case-insensitive).

Cygwin

A functioning Cygwin environment is thus required for building the JDK on Windows. If you have a 64-bit OS, we strongly recommend using the 64-bit version of Cygwin.

Note: Cygwin has a model of continuously updating all packages without any easy way to install or revert to a specific version of a package. This means that whenever you add or update a package in Cygwin, you might (inadvertently) update tools that are used by the JDK build process, and that can cause unexpected build problems.

diff -r 168830ded68a -r a55844323727 doc/building.md --- a/doc/building.md Mon Dec 17 09:35:15 2018 -0800 +++ b/doc/building.md Wed Dec 19 00:50:05 2018 -0800 @@ -197,6 +197,14 @@ Windows. To build for Linux, pass `--build=x86_64-unknown-linux-gnu` and `--host=x86_64-unknown-linux-gnu` to `configure`. +If building Windows binaries, you must also have synced down the OpenJDK source code +from Windows. This is because Windows executables (such as Visual Studio and the boot +JDK) must be able to access the source code. Also, the directory where the OpenJDK +source code is stored must be case-insensitive (either by setting the individual +directory as case insensitive using fsutil, changing /etc/fstab to mount the drive as +case-insensitive, or editing /etc/wsl.conf to mark all mounted Windows drives as +case-insensitive). + #### Cygwin A functioning [Cygwin](http://www.cygwin.com/) environment is thus required for diff -r 168830ded68a -r a55844323727 make/autoconf/spec.gmk.in --- a/make/autoconf/spec.gmk.in Mon Dec 17 09:35:15 2018 -0800 +++ b/make/autoconf/spec.gmk.in Wed Dec 19 00:50:05 2018 -0800 @@ -123,7 +123,8 @@ # On Windows, the Visual Studio toolchain needs the PATH to be adjusted # to include Visual Studio tools (this needs to be in cygwin/msys style). ifeq ($(OPENJDK_TARGET_OS_ENV), windows.wsl) - export FIXPATH_WSL:=@FIXPATH_WSL@ + export FIXPATH_PATH:=@VS_PATH_WINDOWS@ + export WSLENV:=$(WSLENV):FIXPATH_PATH:DEBUG_FIXPATH else export PATH:=@VS_PATH@ endif diff -r 168830ded68a -r a55844323727 make/autoconf/toolchain_windows.m4 --- a/make/autoconf/toolchain_windows.m4 Mon Dec 17 09:35:15 2018 -0800 +++ b/make/autoconf/toolchain_windows.m4 Wed Dec 19 00:50:05 2018 -0800 @@ -389,24 +389,43 @@ # In some cases, the VS_ENV_CMD will change directory, change back so # the set-vs-env.sh ends up in the right place. $ECHO 'cd %~dp0' >> $EXTRACT_VC_ENV_BAT_FILE - # These will end up something like: - # C:/CygWin/bin/bash -c 'echo VS_PATH=\"$PATH\" > localdevenv.sh - # The trailing space for everyone except PATH is no typo, but is needed due - # to trailing \ in the Windows paths. These will be stripped later. - # Trying pure CMD extract. This results in windows paths that need to - # be converted post extraction, but a simpler script. - $ECHO 'echo VS_PATH="%PATH%" > set-vs-env.sh' \ - >> $EXTRACT_VC_ENV_BAT_FILE - $ECHO 'echo VS_INCLUDE="%INCLUDE% " >> set-vs-env.sh' \ - >> $EXTRACT_VC_ENV_BAT_FILE - $ECHO 'echo VS_LIB="%LIB% " >> set-vs-env.sh' \ - >> $EXTRACT_VC_ENV_BAT_FILE - $ECHO 'echo VCINSTALLDIR="%VCINSTALLDIR% " >> set-vs-env.sh' \ - >> $EXTRACT_VC_ENV_BAT_FILE - $ECHO 'echo WindowsSdkDir="%WindowsSdkDir% " >> set-vs-env.sh' \ - >> $EXTRACT_VC_ENV_BAT_FILE - $ECHO 'echo WINDOWSSDKDIR="%WINDOWSSDKDIR% " >> set-vs-env.sh' \ - >> $EXTRACT_VC_ENV_BAT_FILE + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl"; then + # These will end up something like: + # echo VS_PATH=\"$PATH\" > set-vs-env.sh + # The trailing space for everyone except PATH is no typo, but is needed due + # to trailing \ in the Windows paths. These will be stripped later. + # Trying pure CMD extract. This results in windows paths that need to + # be converted post extraction, but a simpler script. + $ECHO 'echo VS_PATH="%PATH%" > set-vs-env.sh' \ + >> $EXTRACT_VC_ENV_BAT_FILE + $ECHO 'echo VS_INCLUDE="%INCLUDE% " >> set-vs-env.sh' \ + >> $EXTRACT_VC_ENV_BAT_FILE + $ECHO 'echo VS_LIB="%LIB% " >> set-vs-env.sh' \ + >> $EXTRACT_VC_ENV_BAT_FILE + $ECHO 'echo VCINSTALLDIR="%VCINSTALLDIR% " >> set-vs-env.sh' \ + >> $EXTRACT_VC_ENV_BAT_FILE + $ECHO 'echo WindowsSdkDir="%WindowsSdkDir% " >> set-vs-env.sh' \ + >> $EXTRACT_VC_ENV_BAT_FILE + $ECHO 'echo WINDOWSSDKDIR="%WINDOWSSDKDIR% " >> set-vs-env.sh' \ + >> $EXTRACT_VC_ENV_BAT_FILE + else + # These will end up something like: + # C:/CygWin/bin/bash -c 'echo VS_PATH=\"$PATH\" > localdevenv.sh + # The trailing space for everyone except PATH is no typo, but is needed due + # to trailing \ in the Windows paths. These will be stripped later. + $ECHO "$WINPATH_BASH -c 'echo VS_PATH="'\"$PATH\" > set-vs-env.sh' \ + >> $EXTRACT_VC_ENV_BAT_FILE + $ECHO "$WINPATH_BASH -c 'echo VS_INCLUDE="'\"$INCLUDE\;$include \" >> set-vs-env.sh' \ + >> $EXTRACT_VC_ENV_BAT_FILE + $ECHO "$WINPATH_BASH -c 'echo VS_LIB="'\"$LIB\;$lib \" >> set-vs-env.sh' \ + >> $EXTRACT_VC_ENV_BAT_FILE + $ECHO "$WINPATH_BASH -c 'echo VCINSTALLDIR="'\"$VCINSTALLDIR \" >> set-vs-env.sh' \ + >> $EXTRACT_VC_ENV_BAT_FILE + $ECHO "$WINPATH_BASH -c 'echo WindowsSdkDir="'\"$WindowsSdkDir \" >> set-vs-env.sh' \ + >> $EXTRACT_VC_ENV_BAT_FILE + $ECHO "$WINPATH_BASH -c 'echo WINDOWSSDKDIR="'\"$WINDOWSSDKDIR \" >> set-vs-env.sh' \ + >> $EXTRACT_VC_ENV_BAT_FILE + fi # Now execute the newly created bat file. # The | cat is to stop SetEnv.Cmd to mess with system colors on msys.