Re: Patches to fix building m68k with CPUFLAGS
Jake Hamby <[email protected]> Mon, 20 Jul 2020 17:14:02 -0700
| Newsgroups | gmane.os.netbsd.ports.amiga,gmane.os.netbsd.ports.m68k |
|---|---|
| Message-ID | <CABfdNnQN1wLcyEMD6xh=vfdgB86zdiHFcMWqhJYe+YDeN_9N8w@mail.gmail.com> |
In addition to Martin's explanation, I've noticed that all of the NetBSD ports except for m68k are currently on GCC 8, and that GCC 8 generates larger code on m68k. But I've also noticed that there's a lot of active work being done to improve the GCC backend for m68k in 10.1 / trunk, so if there's work in progress to move NetBSD to GCC 10, it may be possible to make m68k one of the initial ports to use it, and make GCC 8 then new "gcc.old". Keeping three versions of GCC in the tree (7, 8, and 10) seems awkward, but if m68k is the only one using the current "gcc.old", that's also awkward. I'm worried in particular about the CC0 logic, and how the m68k backend only just recently switched away from it, thanks to some patches contributed by Bernd Schmidt that I'm trying to figure out how they work: https://gcc.gnu.org/legacy-ml/gcc-patches/2019-11/msg01028.html More info on the CC0 to MODE_CC transition and the reasons and importance for doing so (VAX is another backend still using CC0, and hasn't yet been fixed upstream): https://gcc.gnu.org/wiki/CC0Transition GCC 10 has one annoying compatibility issue that can be worked around with a compiler flag (the default is "-fno-common" instead of "-fcommon", which causes some multiple definition link errors in code that doesn't properly use "extern"), but otherwise, it seems like it'd make sense for NetBSD to jump from GCC 8 to 10 for the version in "gcc", make GCC 8.4 the new "gcc.old" while all of the ports are tested, and then make m68k be one of the testing targets for GCC 10.x. I'm also wondering if the Amiga NetBSD kernel instabilities (on both real and emulated hardware) with GCC 8 are the fault of GCC or of bad code in some Amiga-specific NetBSD assembly or C code. If it's only affecting the Amiga port and not X68000 or Mac68k or Atari ST builds when built with GCC 8.4, that's a big clue. Best regards, Jake On Mon, Jul 20, 2020 at 1:20 AM Martin Husemann <[email protected]> wrote: > > On Mon, Jul 20, 2020 at 09:40:43AM +0200, John Paul Adrian Glaubitz wrote: > > Is there anything that prevents NetBSD from jumping to GCC-10? > > Not in particular for m68k, but in general. We use a common gcc for all > architectures, and during periods of transition have provisions for one > old and one new version. Other setups are possible but cause more churn. > It is especially possible to build the whole system with an external > toolchain (e.g. a gcc 10 installed from pkgsrc), but this does not work for > the automatic official builds. > > Moving from new ="gcc 8" to new="gcc 9" is in preparation, but it takes > quite some time usually. We have not yet switched all architectures over > to 8, since there still is fallout. > > The "unssuported" argument does not buy us much, as support from upstream > is mostly zero unless a bug can be reproduced on linux with a current > gcc anyway (which is perfectly understandable from upstream's PoV, and also > usually still works great when there really is a code gen bug). > > Martin