RFR: 8257679: Improved unix compatibility layer in Windows build (winenv) [v2]

Magnus Ihse Bursie ihse at openjdk.java.net
Thu Dec 3 22:52:00 UTC 2020


On Thu, 3 Dec 2020 20:04:44 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

>> Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Missed my last bugfix for fixpath.sh...
>
> make/autoconf/util_paths.m4 line 401:
> 
>> 399:             if test "x$4" != xNOFIXPATH; then
>> 400:               [ if [[ $FIXPATH != "" && $result =~ ^"$FIXPATH " ]]; then ]
>> 401:                 result="\$FIXPATH ${result#"$FIXPATH "}"
> 
> Maybe I'm missing something, but is this unconditionally adding fixpath to any executable based just on if FIXPATH is set? Shouldn't there be a conditional on if the executable is Windows or Unix type?

I agree it is a bit hairy. Perhaps not ideal; even though this is a rewrite it has suffered some legacy "lava flow" itself, being in development for so long.

The idea here is. that NOFIXPATH (or not) as $4 is passed to UTIL_FIXUP_EXECUTABLE. If it is set, then UTIL_FIXUP_EXECUTABLE will never prepend FIXPATH. Otherwise, UTIL_FIXUP_EXECUTABLE will do the check you are requesting, and see if we are on Windows and it is a non-unix-aware executable, and if so, prepend FIXPATH.

So when we come back to UTIL_LOOKUP_PROGS, if we don't have NOFIXPATH, and we are on Windows (FIXPATH is non-empty) and the path we got from UTIL_FIXUP_EXECUTABLE starts with FIXPATH, then we remove all instances of FIXPATH, and prepend a single FIXPATH instance.

While seems like unneccessary work. I ran into situations where I got a double FIXPATH prefix. It might have been the result of some other bug that is fixed by now, but costs very little to keep this as a safeguard. It should get a comment, though, describing what it does.

-------------

PR: https://git.openjdk.java.net/jdk/pull/1597


More information about the hotspot-compiler-dev mailing list