https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110384
Bug ID: 110384 Summary: Build of MinGW g++ 13.1.0 fails due to \r in --print-multi-lib output. Product: gcc Version: 13.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: kclifford at tranaptic dot ca Target Milestone: --- I had built the compiler for arm-eabi, m68k-elf, and powerpc-eabi successfully. Then I built newlib then completed the build of g++ by running make all. The build failed because of '\r' in the output from the built compilers with the --print-multi-lib command. Build system: CYGWIN_NT-10.0-19045 Keith-PC 3.4.6-1.x86_64 2023-02-14 13:23 UTC x86_64 Cygwin Target: arm-eabi, m68k-elf, and powerpc-eabi Using built-in specs. COLLECT_GCC=arm-eabi-gcc COLLECT_LTO_WRAPPER=C:/gcc/MinGW-arm-eabi-13.1.0/bin/../libexec/gcc/arm-eabi/13.1.0/lto-wrapper.exe Target: arm-eabi Configured with: /home/cross-gcc/gcc/configure --build=i686-w64-mingw32 --host=i686-w64-mingw32 --target=arm-eabi --enable-__cxa_atexit --with-pkgversion=Tranaptic-2023/06/16-04:39:28 --with-bugurl=none --enable-languages=c,c++ --enable-interwork --enable-multilib --with-gcc --with-gnu-ld --with-gnu-as --with-stabs --disable-shared --disable-threads --disable-win32-registry --disable-nls --with-newlib --with-gmp=/home/cross-gcc/13.1.0/cross-local --with-mpfr=/home/cross-gcc/13.1.0/cross-local --with-mpc=/home/cross-gcc/13.1.0/cross-local --with-isl=/home/cross-gcc/13.1.0/cross-local --prefix=/home/cross-gcc/13.1.0/arm-eabi -v Thread model: single Supported LTO compression algorithms: zlib gcc version 13.1.0 (Tranaptic-2023/06/16-04:39:28) Interesting, I encountered exactly the same problem when I built newlib. A patch of what I did to fix the problem and build successfully: diff --git a/config-ml.in b/config-ml.in index 68854a4f16c..1efe48fe3b4 100644 --- a/config-ml.in +++ b/config-ml.in @@ -513,7 +513,7 @@ multi-do: true; \ else \ if [ -d ../$${dir}/$${lib} ]; then \ - flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \ + flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g' -e 's/\r//g'`; \ if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) \ CFLAGS="$(CFLAGS) $${flags}" \ CCASFLAGS="$(CCASFLAGS) $${flags}" \ @@ -751,7 +751,7 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do dir=`echo $i | sed -e 's/;.*$//'` if [ "${dir}" = "${ml_dir}" ]; then - flags=`echo $i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'` + flags=`echo $i | sed -e 's/^[^;]*;//' -e 's/@/ -/g' -e 's/\r//g'` break fi done