https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109460

            Bug ID: 109460
           Summary: Build gcc for win32 failed in gcc13 master branch
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fanghuaqi at vip dot qq.com
  Target Milestone: ---

Hi there, I tried to build gcc 13 for windows host using mingw gcc in linux.
But I am facing the following issue.

i686-w64-mingw32-g++  -fno-PIE -c /work/gcc/gcc/config/i386/sym-mingw32.cc
sym-mingw32.o
i686-w64-mingw32-g++: error: sym-mingw32.o: No such file or directory
echo timestamp > s-bversion

It seems the sym-mingw32.o is not generated via this command, and I thought it
should be like gcc -c hello.c -o hello.o, so I changed
gcc/config/i386/x-mingw32-utf8

diff --git a/gcc/config/i386/x-mingw32-utf8 b/gcc/config/i386/x-mingw32-utf8
index 2783dd259a6..b008497ca0b 100644
--- a/gcc/config/i386/x-mingw32-utf8
+++ b/gcc/config/i386/x-mingw32-utf8
@@ -34,7 +34,7 @@ utf8rc-mingw32.o : $(srcdir)/config/i386/utf8-mingw32.rc \
 # Create an object file that just exports the global symbol
 # HOST_EXTRA_OBJS_SYMBOL
 sym-mingw32.o : $(srcdir)/config/i386/sym-mingw32.cc
-       $(COMPILER) -c $< $@
+       $(COMPILER) -c $< -o $@

This issue disappeared, but other issue like this happened, I didn't have ideas
to  how to fix it.

utf8-mingw32.o: In function `WinMainCRTStartup':
./mingw-w64-crt/crt/crtexe.c:171: multiple definition of `WinMainCRTStartup'
/usr/lib/gcc/i686-w64-mingw32/7.3-win32/../../../../i686-w64-mingw32/lib/../lib/crt2.o:./mingw-w64-crt/crt/crtexe.c:171:
first defined here
utf8-mingw32.o: In function `mainCRTStartup':
./mingw-w64-crt/crt/crtexe.c:199: multiple definition of `mainCRTStartup'
/usr/lib/gcc/i686-w64-mingw32/7.3-win32/../../../../i686-w64-mingw32/lib/../lib/crt2.o:./mingw-w64-crt/crt/crtexe.c:199:
first defined here
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 101.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (7496040) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1684826487) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1685024119) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (7496040) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (6644847) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1414356820) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1230261845) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1599555406) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 117.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1599555406) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 101.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1230261845) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1414356820) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 97.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 101.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (6644847) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 110.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (7496040) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 101.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1685024119) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 110.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1684826487) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (7496040) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 101.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 110.
utf8-mingw32.o:cygming-crtbegin.c:(.text+0x500): multiple definition of
`__gcc_register_frame'
/usr/lib/gcc/i686-w64-mingw32/7.3-win32/crtbegin.o:cygming-crtbegin.c:(.text+0x0):
first defined here
utf8-mingw32.o:cygming-crtbegin.c:(.text+0x520): multiple definition of
`__gcc_deregister_frame'
/usr/lib/gcc/i686-w64-mingw32/7.3-win32/crtbegin.o:cygming-crtbegin.c:(.text+0x20):
first defined here
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1599555406) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 101.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1230261845) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1414356820) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 97.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 101.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (6644847) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 110.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (7496040) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 101.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1685024119) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 110.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1684826487) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (7496040) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 101.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 110.
utf8-mingw32.o:crtexe.c:(.CRT$XIAA+0x0): multiple definition of `mingw_pcinit'
/usr/lib/gcc/i686-w64-mingw32/7.3-win32/../../../../i686-w64-mingw32/lib/../lib/crt2.o:crtexe.c:(.CRT$XIAA+0x0):
first defined here
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1599555406) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 101.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1230261845) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1414356820) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 97.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 101.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (6644847) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 110.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (7496040) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 101.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1685024119) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 110.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1684826487) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (7496040) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 101.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 110.
utf8-mingw32.o:crtexe.c:(.data+0x0): multiple definition of
`__mingw_winmain_nShowCmd'
/usr/lib/gcc/i686-w64-mingw32/7.3-win32/../../../../i686-w64-mingw32/lib/../lib/crt2.o:crtexe.c:(.data+0x0):
first defined here
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1599555406) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 101.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1230261845) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1414356820) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 97.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 101.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (6644847) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 110.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (7496040) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 101.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1685024119) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 110.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1684826487) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (7496040) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 101.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 110.
utf8-mingw32.o:crtexe.c:(.CRT$XCAA+0x0): multiple definition of
`mingw_pcppinit'
/usr/lib/gcc/i686-w64-mingw32/7.3-win32/../../../../i686-w64-mingw32/lib/../lib/crt2.o:crtexe.c:(.CRT$XCAA+0x0):
first defined here
main.o: In function `main':
/work/gcc/gcc/main.cc:35: multiple definition of `main'
utf8-mingw32.o:./mingw-w64-crt/crt/crtexe.c:118: first defined here
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 101.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (7496040) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1684826487) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1685024119) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (7496040) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (6644847) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1414356820) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1230261845) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1599555406) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 117.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1599555406) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 101.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1230261845) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1414356820) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 97.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 101.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (6644847) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 110.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (7496040) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 101.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1685024119) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 110.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (1684826487) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Offset (7496040) greater than or
equal to .debug_line size (9993).
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 101.
/usr/bin/i686-w64-mingw32-ld: Dwarf Error: Could not find abbrev number 110.
utf8-mingw32.o:crtexe.c:(.text.startup+0x39): undefined reference to
`WinMain@16'
collect2: error: ld returned 1 exit status
/work/gcc/gcc/c/Make-lang.in:86: recipe for target 'cc1.exe' failed
make[2]: *** [cc1.exe] Error 1
make[2]: Leaving directory
'/work/LocalBuilds/2023.04.06_20230407_013756/build-gcc-newlib-stage1/gcc'
Makefile:4642: recipe for target 'all-gcc' failed
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory
'/work/LocalBuilds/2023.04.06_20230407_013756/build-gcc-newlib-stage1'
Makefile:1057: recipe for target 'all' failed
make: *** [all] Error 2

Is there any guidance about how to fix it, thanks.

Thanks

Reply via email to