[PATCH] Detect WSL2 as WSL
Erik Joelsson
erik.joelsson at oracle.com
Wed Jun 19 22:06:16 UTC 2019
Looks good to me. Do you need a sponsor for this?
/Erik
On 2019-06-19 14:45, Andrew Luo wrote:
> Hi Everyone,
>
> Now that a preview of WSL2 is available for testing (https://devblogs.microsoft.com/commandline/wsl-2-is-now-available-in-windows-insiders/), I decided to experiment a little bit and tried compiling OpenJDK with WSL2. To correctly detect WSL2, however, I had to make a minor change in config.guess to account for that fact that "Microsoft" in the output of "uname -r" has changed to lowercase:
>
> WSL1: 4.4.0-17763-Microsoft
> WSL2: 4.19.43-microsoft-standard
>
> Patch is inline. One thing to note, however, is that WSL2 does not fully work yet due to a bug. I have investigated the issue and filed the bug with Microsoft (https://github.com/microsoft/WSL/issues/4161).
>
> Thanks,
>
> -Andrew
>
> diff -r 5eeee2cc94f5 make/autoconf/build-aux/config.guess
> --- a/make/autoconf/build-aux/config.guess Fri Jun 14 20:30:10 2019 -0700
> +++ b/make/autoconf/build-aux/config.guess Mon Jun 17 23:14:56 2019 -0700
> @@ -63,7 +63,7 @@
> # Test and fix wsl
> echo $OUT | grep x86_64-unknown-linux-gnu > /dev/null 2> /dev/null
> if test $? = 0; then
> - uname -r | grep Microsoft > /dev/null 2> /dev/null
> + uname -r | grep -i microsoft > /dev/null 2> /dev/null
> if test $? = 0; then
> OUT="x86_64-pc-wsl"
> fi
More information about the build-dev
mailing list