Skip to content

Commit 5cb041e

Browse files
Andrew LeonardPaul Hohensee
authored andcommitted
8317340: Windows builds are not reproducible if MS VS compiler install path differs
Backport-of: 353d139682d530b74795cdca4753afba6766b2e3
1 parent 32987b7 commit 5cb041e

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

make/autoconf/flags-cflags.m4

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,17 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
850850
FILE_MACRO_CFLAGS=
851851
]
852852
)
853+
if test "x$FILE_MACRO_CFLAGS" != x; then
854+
# Add -pathmap for all VS system include paths using Windows
855+
# full Long path name that is generated by the compiler
856+
for ipath in ${$3SYSROOT_CFLAGS}; do
857+
if test "x${ipath:0:2}" == "x-I"; then
858+
ipath_path=${ipath#"-I"}
859+
UTIL_FIXUP_WIN_LONG_PATH(ipath_path)
860+
FILE_MACRO_CFLAGS="$FILE_MACRO_CFLAGS -pathmap:\"$ipath_path\"=vsi"
861+
fi
862+
done
863+
fi
853864
fi
854865
855866
AC_MSG_CHECKING([how to prevent absolute paths in output])

make/autoconf/util_paths.m4

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,23 @@ AC_DEFUN([UTIL_FIXUP_PATH],
118118
fi
119119
])
120120

121+
##############################################################################
122+
# Fixup path to be a Windows full long path
123+
AC_DEFUN([UTIL_FIXUP_WIN_LONG_PATH],
124+
[
125+
# Only process if variable expands to non-empty
126+
path="[$]$1"
127+
if test "x$path" != x; then
128+
if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
129+
win_path=$($PATHTOOL -wl "$path")
130+
if test "x$win_path" != "x$path"; then
131+
$1="$win_path"
132+
fi
133+
fi
134+
fi
135+
])
136+
137+
121138
###############################################################################
122139
# Check if the given file is a unix-style or windows-style executable, that is,
123140
# if it expects paths in unix-style or windows-style.

0 commit comments

Comments
 (0)