Building JDK with mawk on windows fails due to regular expression. I use WSL 
Debian. Debian has mawk as the default awk implementation.

$ awk
Usage: mawk [Options] [Program] [file ...]

$ make images
Building target 'images' in configuration 'windows-x86_64-server-fastdebug'
...
nawk: line 1: regular expression compile failed (missing operand)
??_7.*@@6B@

The meta character '?' is not escaped, so the error occurs. I added an escape 
sequence prefix to it. Incidentally, this doesn't happen if we use gawk instead 
of mawk. Gawk works fine with or without the prefix.

### Check
I've built JDK with both awk and they are successful. Additionally, I checked 
the result of both awk executions. I saved each result to a file during the 
build.

$(JVM_OUTPUTDIR)/symbols-objects: $(BUILD_LIBJVM_ALL_OBJS)
        $(call LogInfo, Generating symbol list from object files)
        $(CD) $(JVM_OUTPUTDIR)/objs && \
          $(DUMP_SYMBOLS_CMD) | $(AWK) $(FILTER_SYMBOLS_AWK_SCRIPT) | $(SORT) 
-u > [FILE]

The file from gawk before applying this PR, the file from mawk after applying 
this PR and the file from gawk after applying this PR were the same.

### Note

Only the windows build uses this regular expression. I also tried to look for 
non-escaped meta characters in the make directory, but there were none.

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

Commit messages:
 - Update copyright
 - Escape the meta character

Changes: https://git.openjdk.org/jdk/pull/15357/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15357&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8314555
  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/15357.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15357/head:pull/15357

PR: https://git.openjdk.org/jdk/pull/15357

Reply via email to