[Bug other/126875] New: [17 regression] Parallel make compare breaks bootstrap

"ro at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126875

            Bug ID: 126875
           Summary: [17 regression] Parallel make compare breaks bootstrap
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: build
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ro at gcc dot gnu.org
                CC: iains at gcc dot gnu.org, ktkachov at gcc dot gnu.org
  Target Milestone: ---
            Target: *-apple-darwin17, *-*-solaris2.11

The new parallel make compare breaks bootstrap on Mac OS X 10.13 (Darwin 17):

Comparing stages 2 and 3
compare.42895.mk:5: *** missing separator.  Stop.
make[2]: *** [Makefile:30524: compare] Error 2

When one keeps the generated compare.<id>.mk, one finds that it starts with

.PHONY: all FORCE
FORCE:
compare/%: FORCE ; @f1=$$r/stage2-$*; f2=$$r/stage3-$*; /usr/local/bin/bash
/vol/gcc/src/hg/master/local-slow/contrib/compare-debug $$f1 $$f2
 > /dev/null 2>&1; st=$$?; if test $$st -eq 1; then case $* in
gcc/cc*-checksum.o | gcc/ada/*tools/* | gcc/m2/gm2-compiler-boot/M2Version* |
gcc/m2/gm2-compiler-boot/SYSTEM* | gcc/m2/gm2version* | gcc/cobol/parse.o) echo
warning: $* differs ;; *) echo $* differs >> "$$bad_compare.$$$$" ;; esac; elif
test $$st -ne 0; then echo "$* compare: error status $$st" >>
"$$bad_compare.$$$$"; fi

I.e. a newline before '>'.

The issue can be reproduces as easily as

$ echo -n '$$' | sed -e 's,/\$,$$,g' | cat -e
$$$

i.e. sed adds a trailing newline.  GNU sed in comparison does not:

$ echo -n '$$' | sed -e 's,/\$,$$,g' | cat -e
$$

Things would be even worse with Solaris /usr/bin/sed which produces no output
at all.

I haven't yet checked if the autoconf docs suggest an alternative/solution.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.