Skip to content

Commit 353d139

Browse files
author
Andrew Leonard
committed
8317340: Windows builds are not reproducible if MS VS compiler install path differs
Reviewed-by: erikj
1 parent 3bcfac1 commit 353d139

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
@@ -843,6 +843,17 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
843843
FILE_MACRO_CFLAGS=
844844
]
845845
)
846+
if test "x$FILE_MACRO_CFLAGS" != x; then
847+
# Add -pathmap for all VS system include paths using Windows
848+
# full Long path name that is generated by the compiler
849+
for ipath in ${$3SYSROOT_CFLAGS}; do
850+
if test "x${ipath:0:2}" == "x-I"; then
851+
ipath_path=${ipath#"-I"}
852+
UTIL_FIXUP_WIN_LONG_PATH(ipath_path)
853+
FILE_MACRO_CFLAGS="$FILE_MACRO_CFLAGS -pathmap:\"$ipath_path\"=vsi"
854+
fi
855+
done
856+
fi
846857
fi
847858
848859
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)