From bcc986b9d142af8d84da316750ca4da256fad6e2 Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Mon, 9 Oct 2023 07:41:31 +0000 Subject: [PATCH] 8317601: Windows build on WSL broken after JDK-8317340 Reviewed-by: djelinski, erikj --- make/autoconf/flags-cflags.m4 | 9 +++++++-- make/autoconf/util_paths.m4 | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4 index b13b210165f..db31cb35816 100644 --- a/make/autoconf/flags-cflags.m4 +++ b/make/autoconf/flags-cflags.m4 @@ -844,8 +844,12 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP], ] ) if test "x$FILE_MACRO_CFLAGS" != x; then - # Add -pathmap for all VS system include paths using Windows - # full Long path name that is generated by the compiler + # Add -pathmap for all VS system include paths using Windows + # full Long path name that is generated by the compiler + # Not enabled under WSL as there is no easy way to obtain the + # Windows full long paths, thus reproducible WSL builds will + # depend on building with the same VS toolchain install location. + if test "x$OPENJDK_BUILD_OS_ENV" != "xwindows.wsl1" && test "x$OPENJDK_BUILD_OS_ENV" != "xwindows.wsl2"; then for ipath in ${$3SYSROOT_CFLAGS}; do if test "x${ipath:0:2}" == "x-I"; then ipath_path=${ipath#"-I"} @@ -853,6 +857,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP], FILE_MACRO_CFLAGS="$FILE_MACRO_CFLAGS -pathmap:\"$ipath_path\"=vsi" fi done + fi fi fi diff --git a/make/autoconf/util_paths.m4 b/make/autoconf/util_paths.m4 index 902eb6707e1..8b2c776397b 100644 --- a/make/autoconf/util_paths.m4 +++ b/make/autoconf/util_paths.m4 @@ -120,6 +120,7 @@ AC_DEFUN([UTIL_FIXUP_PATH], ############################################################################## # Fixup path to be a Windows full long path +# Note: Only supported with cygwin/msys2 (cygpath tool) AC_DEFUN([UTIL_FIXUP_WIN_LONG_PATH], [ # Only process if variable expands to non-empty