https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81495
Bug ID: 81495 Summary: Building Ada on Linux m68k natively fails with obscure linker errors Product: gcc Version: 7.1.0 URL: https://people.debian.org/~glaubitz/gcc-7_7.1.0-9+b2_m 68k.build Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: glaubitz at physik dot fu-berlin.de CC: ebotcazou at gcc dot gnu.org, jrtc27 at jrtc27 dot com, schwab at gcc dot gnu.org Target Milestone: --- Target: m68k-*-* After fixing #81446, I was able to successfully cross-compile a native gnat-7 compiler for Linux m68k. This compiler also seems to work, at least in basic tests. However, using that compiler to build gcc-7 with gnat-7 natively fails with some rather obscure linker errors for which I was unable to track down the reasons [1]: /usr/lib/gcc/m68k-linux-gnu/7/../../../m68k-linux-gnu/crt1.o: In function `_start': (.text+0x1c): undefined reference to `main' ./xtreeprs.o: In function `_ada_xtreeprs': xtreeprs.adb:(.text+0x4a6): undefined reference to `xtreeprs__TnamesBIP.1929' xtreeprs.adb:(.text+0x4cc): undefined reference to `xtreeprs__TnamesBDI.1932' xtreeprs.adb:(.text+0x168c): undefined reference to `xtreeprs__put_line__2.2465' xtreeprs.adb:(.text+0x16b0): undefined reference to `xtreeprs__put_line__2.2465' xtreeprs.adb:(.text+0x17d0): undefined reference to `xtreeprs__put_line__2.2465' xtreeprs.adb:(.text+0x1802): undefined reference to `xtreeprs__put_line.2461' xtreeprs.adb:(.text+0x23f4): undefined reference to `xtreeprs__put_line__2.2465' xtreeprs.adb:(.text+0x26ae): undefined reference to `xtreeprs__put_line__2.2465' xtreeprs.adb:(.text+0x28de): undefined reference to `xtreeprs__put_line__2.2465' xtreeprs.adb:(.text+0x29a8): undefined reference to `xtreeprs__put_line.2461' xtreeprs.adb:(.text+0x29d8): undefined reference to `xtreeprs__put_line.2461' xtreeprs.adb:(.text+0x2a08): undefined reference to `xtreeprs__put_line.2461' xtreeprs.adb:(.text+0x2a38): undefined reference to `xtreeprs__put_line.2461' xtreeprs.adb:(.text+0x2cb2): undefined reference to `xtreeprs__put_line__2.2465' xtreeprs.adb:(.text+0x2fca): undefined reference to `xtreeprs__put_line__2.2465' xtreeprs.adb:(.text+0x309e): undefined reference to `xtreeprs__put_line.2461' xtreeprs.adb:(.text+0x30ce): undefined reference to `xtreeprs__put_line.2461' xtreeprs.adb:(.text+0x30ea): undefined reference to `xtreeprs___finalizer.1652' xtreeprs.adb:(.text+0x314e): undefined reference to `xtreeprs__TnamesBDF.1940' collect2: error: ld returned 1 exit status gnatlink-7: error when calling /usr/bin/gcc-7 gnatmake: *** link failed. /bin/bash: ./xtreeprs: No such file or directory ../../src/gcc/ada/Make-generated.in:28: recipe for target 'ada/treeprs.ads' failed make[5]: *** [ada/treeprs.ads] Error 127 make[5]: *** Waiting for unfinished jobs.... /usr/lib/gcc/m68k-linux-gnu/7/../../../m68k-linux-gnu/crt1.o: In function `_start': (.text+0x1c): undefined reference to `main' collect2: error: ld returned 1 exit status gnatlink-7: error when calling /usr/bin/gcc-7 gnatmake: *** link failed. /bin/bash: ./xsnamest: No such file or directory ../../src/gcc/ada/Make-generated.in:50: recipe for target 'ada/stamp-snames' failed make[5]: *** [ada/stamp-snames] Error 127 ../../src/gcc/doc/cpp.texi: warning: document without nodes /usr/lib/gcc/m68k-linux-gnu/7/../../../m68k-linux-gnu/crt1.o: In function `_start': (.text+0x1c): undefined reference to `main' ./csinfo.o: In function `_ada_csinfo': csinfo.adb:(.text+0x3350): undefined reference to `csinfo__next_line.2855' csinfo.adb:(.text+0x418a): undefined reference to `csinfo__next_line.2855' csinfo.adb:(.text+0x443c): undefined reference to `csinfo__next_line.2855' csinfo.adb:(.text+0x4b04): undefined reference to `csinfo__next_line.2855' csinfo.adb:(.text+0x4dfa): undefined reference to `csinfo__next_line.2855' ./csinfo.o:csinfo.adb:(.text+0x54b6): more undefined references to `csinfo__next_line.2855' follow ./csinfo.o: In function `_ada_csinfo': csinfo.adb:(.text+0x633a): undefined reference to `csinfo__vstringaIP.2881' csinfo.adb:(.text+0x637e): undefined reference to `csinfo__vstringaDI.2884' csinfo.adb:(.text+0x653e): undefined reference to `csinfo__sort.2907' csinfo.adb:(.text+0x6550): undefined reference to `csinfo__next_line.2855' csinfo.adb:(.text+0x6560): undefined reference to `csinfo__next_line.2855' csinfo.adb:(.text+0x6570): undefined reference to `csinfo__next_line.2855' csinfo.adb:(.text+0x65a0): undefined reference to `csinfo__next_line.2855' csinfo.adb:(.text+0x69d8): undefined reference to `csinfo__next_line.2855' ./csinfo.o:csinfo.adb:(.text+0x7200): more undefined references to `csinfo__next_line.2855' follow ./csinfo.o: In function `_ada_csinfo': csinfo.adb:(.text+0x7654): undefined reference to `csinfo__vstringaIP.2881' csinfo.adb:(.text+0x7692): undefined reference to `csinfo__vstringaDI.2884' csinfo.adb:(.text+0x784c): undefined reference to `csinfo__sort.2907' csinfo.adb:(.text+0x785e): undefined reference to `csinfo__next_line.2855' csinfo.adb:(.text+0x786e): undefined reference to `csinfo__next_line.2855' csinfo.adb:(.text+0x787e): undefined reference to `csinfo__next_line.2855' csinfo.adb:(.text+0x78ae): undefined reference to `csinfo__next_line.2855' csinfo.adb:(.text+0x7b02): undefined reference to `csinfo__next_line.2855' csinfo.adb:(.text+0x8336): undefined reference to `csinfo___finalizer.1652' csinfo.adb:(.text+0xb482): undefined reference to `csinfo__vstringaDF.2892' csinfo.adb:(.text+0xbdc2): undefined reference to `csinfo__vstringaDF.2892' ./csinfo.o: In function `csinfo__B_12___finalizer.4194': csinfo.adb:(.text+0xe4e4): undefined reference to `csinfo__vstringaDF.2892' ./csinfo.o: In function `csinfo__B_17___finalizer.4562': csinfo.adb:(.text+0xf188): undefined reference to `csinfo__vstringaDF.2892' collect2: error: ld returned 1 exit status gnatlink-7: error when calling /usr/bin/gcc-7 gnatmake: *** link failed. /bin/bash: ./xsinfo: No such file or directory ../../src/gcc/ada/Make-generated.in:42: recipe for target 'ada/sinfo.h' failed make[5]: *** [ada/sinfo.h] Error 127 /usr/lib/gcc/m68k-linux-gnu/7/../../../m68k-linux-gnu/crt1.o: In function `_start': (.text+0x1c): undefined reference to `main' collect2: error: ld returned 1 exit status gnatlink-7: error when calling /usr/bin/gcc-7 gnatmake: *** link failed. /bin/bash: ./xeinfo: No such file or directory ../../src/gcc/ada/Make-generated.in:35: recipe for target 'ada/einfo.h' failed make[5]: *** [ada/einfo.h] Error 127 Since I have checked the Linux/m68k-specific code for issues and couldn't find anything, I'm filing a bug report here. > [1] https://people.debian.org/~glaubitz/gcc-7_7.1.0-9+b2_m68k.build