Port-amiga archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Patches to fix building m68k with CPUFLAGS



After further testing, I found that GCC 8.4.0 generates bigger, and
very buggy code, for m68k. I've seen no freezes, uvm errors, or panics
on illegal instructions with the NetBSD-current build I made with
"-m68040" and my previous patch, minus the part to change HAVE_GCC
from 7 to 8.

So I would definitely recommend not taking the part of the patch in my
earlier email that changes the GCC version, but to increase the
binutils version to 2.34 (no reason not to), and apply this part of my
earlier patch to gcc.old (I forgot the whitespace fix there). Here's
an alternate style of the patch that saves a byte or two within the
string (it's a matter of style; I wrote it the other way originally
because I thought having a space at the beginning of each line would
be less error prone than putting them before the continuation
backlash):

diff -ur gcc-10.1.0/gcc/config/m68k/m68k.h dist/gcc/config/m68k/m68k.h
--- gcc-10.1.0/gcc/config/m68k/m68k.h    2020-05-07 03:49:59.000000000 -0700
+++ dist/gcc/config/m68k/m68k.h    2020-07-19 19:24:59.866321322 -0700
@@ -36,9 +36,9 @@
    and .arch directives.  */

 #define ASM_CPU_SPEC "\
-%{m68851}%{mno-68851} %{m68881}%{mno-68881} %{msoft-float:-mno-float} \
-%{m68020-40:-m68040}%{m68020-60:-m68040}\
-%{mcpu=*:-mcpu=%*}%{march=*:-march=%*}\
+%{m68851} %{mno-68851} %{m68881} %{mno-68881} %{msoft-float:-mno-float} \
+%{m68020-40:-m68040} %{m68020-60:-m68040} \
+%{mcpu=*:-mcpu=%*} %{march=*:-march=%*}\
 "
 #define ASM_PCREL_SPEC "%{" FPIE_OR_FPIC_SPEC ":--pcrel} \
  %{mpcrel:%{" NO_FPIE_AND_FPIC_SPEC ":--pcrel}} \
diff -ur gcc-10.1.0/libgcc/config/m68k/lb1sf68.S
dist/libgcc/config/m68k/lb1sf68.S
--- gcc-10.1.0/libgcc/config/m68k/lb1sf68.S    2020-05-07
03:50:02.000000000 -0700
+++ dist/libgcc/config/m68k/lb1sf68.S    2020-07-19 19:21:57.547883754 -0700
@@ -211,7 +211,7 @@
     /* ISA C has no bra.l instruction, and since this assembly file
        gets assembled into multiple object files, we avoid the
        bra instruction entirely.  */
-#if defined (__mcoldfire__) && !defined (__mcfisab__)
+#if defined (__ELF__) || (defined (__mcoldfire__) && !defined (__mcfisab__))
     lea    \addr-.-8,a0
     jmp    pc@(a0)
 #else


Home | Main Index | Thread Index | Old Index