https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109927
Bug ID: 109927 Summary: Bootstrap fails for m68k in stage2 compilation of gimple-match.cc Product: gcc Version: 13.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: bootstrap Assignee: unassigned at gcc dot gnu.org Reporter: userm57 at yahoo dot com Target Milestone: --- Hello, Bootstrap of gcc 13.1.0 fails during compilation of gimple-match.cc. The error message is "virtual memory exhausted: Cannot allocate memory", possibly from the assembler. However, virtual memory is not really exhausted. A slightly different version of (possibly) the same error occurs during stage3 compilation of gimple-match.cc (see below). Setup: 1) Install QEMU. I'm using QEMU version 7.2.1 on an HP Z2 workstation (32 GiB, eight i7 CPUs) running Debian SID. 2) Install Gentoo to a disk image or a separate disk (using whatever your usual procedure is for installing Gentoo). I used the latest Gentoo stage3 for m68k for the first procedure below, and a fully installed Gentoo for the second procedure. For swap space, I tried many options, ending up with two 512 MiB swap partitions. Regardless of how much swap space is used, compilation of gimple-match.cc will fail with the same error. To generate the error in stage2 gcc bootstrap, the following steps can be used: 1) Create a QEMU virtual machine (VM) configured as q800 (e.g. "-M q800 -m 1004M") or as virt (e.g. "-M virt -m 3399672K"). Using q800, you can use the latest default Debian kernel for m68k; otherwise, you'll need a virt kernel. They will have the same error. 2) It's not necessary to configure the network, users, etc. in the Gentoo QEMU VM (instead use the chroot environment). After installation of the Gentoo stage3 as per the Gentoo installation instructions, you can run "emerge-webrsync" then "emerge gcc" from the chroot. Compilation will fail in gcc stage2. To generate the error in a manual gcc compilation, the following steps can be used: 1) If you have a completed installation of Gentoo or Debian, you can download the latest gcc. I used Gentoo's configure options (but not their patches): "../gcc-13.1.0/configure --host=m68k-unknown-linux-gnu --build=m68k-unknown-linux-gnu --prefix=/usr --bindir=/usr/m68k-unknown-linux-gnu/gcc-bin/13 --includedir=/usr/lib/gcc/m68k-unknown-linux-gnu/13/include --datadir=/usr/share/gcc-data/m68k-unknown-linux-gnu/13 --mandir=/usr/share/gcc-data/m68k-unknown-linux-gnu/13/man --infodir=/usr/share/gcc-data/m68k-unknown-linux-gnu/13/info --with-gxx-include-dir=/usr/lib/gcc/m68k-unknown-linux-gnu/13/include/g++-v13 --with-python-dir=/share/gcc-data/m68k-unknown-linux-gnu/13/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --disable-nls --disable-libunwind-exceptions --with-gcc-major-version-only --disable-esp --enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --disable-multilib --disable-fixed-point --enable-libgomp --disable-libssp --disable-libada --disable-cet --disable-systemtap --disable-valgrind-annotations --disable-vtable-verify --disable-libvtv --without-zstd --without-isl --disable-libsanitizer --enable-default-pie --enable-default-ssp" followed by "make bootstrap". 2) The compilation should eventually fail in stage3 gcc bootstrap while compiling gimple-match.cc. I'll be happy to provide any additional details or clarifications that you may require. Thank you for your help. -Stan Johnson