From 58da30d441fcda1a51bd8a2185fecda827c01dda Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 21 Jun 2018 15:30:04 -0400 Subject: [PATCH] add m68k support patches for all currently supported gcc versions these are not complete/correct in that they do not account for ABI variants (softfloat and coldfire fpu) in the dynamic linker name, but I was unable to get gcc's configure to accept --with-float=soft on m68k to test softfloat and begin figuring out how to do the spec logic. at some point this needs to be figured out and completed, but at least the default ABI is available in mcm now. --- patches/gcc-5.2.0/0011-m68k.dff | 36 ++++++++++++++++++++++++++++++++ patches/gcc-5.3.0/0011-m68k.dff | 36 ++++++++++++++++++++++++++++++++ patches/gcc-6.2.0/0015-m68k.dff | 36 ++++++++++++++++++++++++++++++++ patches/gcc-6.3.0/0015-m68k.dff | 36 ++++++++++++++++++++++++++++++++ patches/gcc-6.4.0/0014-m68k.dff | 36 ++++++++++++++++++++++++++++++++ patches/gcc-7.2.0/0014-m68k.diff | 25 ++++++++++++++++++++++ 6 files changed, 205 insertions(+) create mode 100644 patches/gcc-5.2.0/0011-m68k.dff create mode 100644 patches/gcc-5.3.0/0011-m68k.dff create mode 100644 patches/gcc-6.2.0/0015-m68k.dff create mode 100644 patches/gcc-6.3.0/0015-m68k.dff create mode 100644 patches/gcc-6.4.0/0014-m68k.dff create mode 100644 patches/gcc-7.2.0/0014-m68k.diff diff --git a/patches/gcc-5.2.0/0011-m68k.dff b/patches/gcc-5.2.0/0011-m68k.dff new file mode 100644 index 0000000..b3765bf --- /dev/null +++ b/patches/gcc-5.2.0/0011-m68k.dff @@ -0,0 +1,36 @@ +diff -ur gcc-6.4.0/gcc/config/m68k/linux.h gcc-6.4.0.new/gcc/config/m68k/linux.h +--- gcc-6.4.0/gcc/config/m68k/linux.h 2016-01-04 09:30:50.000000000 -0500 ++++ gcc-6.4.0.new/gcc/config/m68k/linux.h 2018-06-12 20:03:47.047502695 -0400 +@@ -73,6 +73,9 @@ + + #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" + ++#undef MUSL_DYNAMIC_LINKER ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-m68k.so.1" ++ + #undef LINK_SPEC + #define LINK_SPEC "-m m68kelf %{shared} \ + %{!shared: \ +diff -ur gcc-6.4.0/libgcc/config/m68k/linux-atomic.c gcc-6.4.0.new/libgcc/config/m68k/linux-atomic.c +--- gcc-6.4.0/libgcc/config/m68k/linux-atomic.c 2016-01-04 09:30:50.000000000 -0500 ++++ gcc-6.4.0.new/libgcc/config/m68k/linux-atomic.c 2018-06-07 16:15:11.610163418 -0400 +@@ -33,7 +33,6 @@ + using the kernel helper defined below. There is no support for + 64-bit operations yet. */ + +-#include + #include + + #ifndef __NR_atomic_cmpxchg_32 +diff -ur gcc-6.4.0/libgcc/config/m68k/linux-unwind.h gcc-6.4.0.new/libgcc/config/m68k/linux-unwind.h +--- gcc-6.4.0/libgcc/config/m68k/linux-unwind.h 2016-01-04 09:30:50.000000000 -0500 ++++ gcc-6.4.0.new/libgcc/config/m68k/linux-unwind.h 2018-06-07 16:17:16.964591108 -0400 +@@ -37,7 +37,7 @@ + stack_t uc_stack; + mcontext_t uc_mcontext; + unsigned long uc_filler[80]; +- __sigset_t uc_sigmask; ++ sigset_t uc_sigmask; + }; + + #define MD_FALLBACK_FRAME_STATE_FOR m68k_fallback_frame_state diff --git a/patches/gcc-5.3.0/0011-m68k.dff b/patches/gcc-5.3.0/0011-m68k.dff new file mode 100644 index 0000000..b3765bf --- /dev/null +++ b/patches/gcc-5.3.0/0011-m68k.dff @@ -0,0 +1,36 @@ +diff -ur gcc-6.4.0/gcc/config/m68k/linux.h gcc-6.4.0.new/gcc/config/m68k/linux.h +--- gcc-6.4.0/gcc/config/m68k/linux.h 2016-01-04 09:30:50.000000000 -0500 ++++ gcc-6.4.0.new/gcc/config/m68k/linux.h 2018-06-12 20:03:47.047502695 -0400 +@@ -73,6 +73,9 @@ + + #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" + ++#undef MUSL_DYNAMIC_LINKER ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-m68k.so.1" ++ + #undef LINK_SPEC + #define LINK_SPEC "-m m68kelf %{shared} \ + %{!shared: \ +diff -ur gcc-6.4.0/libgcc/config/m68k/linux-atomic.c gcc-6.4.0.new/libgcc/config/m68k/linux-atomic.c +--- gcc-6.4.0/libgcc/config/m68k/linux-atomic.c 2016-01-04 09:30:50.000000000 -0500 ++++ gcc-6.4.0.new/libgcc/config/m68k/linux-atomic.c 2018-06-07 16:15:11.610163418 -0400 +@@ -33,7 +33,6 @@ + using the kernel helper defined below. There is no support for + 64-bit operations yet. */ + +-#include + #include + + #ifndef __NR_atomic_cmpxchg_32 +diff -ur gcc-6.4.0/libgcc/config/m68k/linux-unwind.h gcc-6.4.0.new/libgcc/config/m68k/linux-unwind.h +--- gcc-6.4.0/libgcc/config/m68k/linux-unwind.h 2016-01-04 09:30:50.000000000 -0500 ++++ gcc-6.4.0.new/libgcc/config/m68k/linux-unwind.h 2018-06-07 16:17:16.964591108 -0400 +@@ -37,7 +37,7 @@ + stack_t uc_stack; + mcontext_t uc_mcontext; + unsigned long uc_filler[80]; +- __sigset_t uc_sigmask; ++ sigset_t uc_sigmask; + }; + + #define MD_FALLBACK_FRAME_STATE_FOR m68k_fallback_frame_state diff --git a/patches/gcc-6.2.0/0015-m68k.dff b/patches/gcc-6.2.0/0015-m68k.dff new file mode 100644 index 0000000..b3765bf --- /dev/null +++ b/patches/gcc-6.2.0/0015-m68k.dff @@ -0,0 +1,36 @@ +diff -ur gcc-6.4.0/gcc/config/m68k/linux.h gcc-6.4.0.new/gcc/config/m68k/linux.h +--- gcc-6.4.0/gcc/config/m68k/linux.h 2016-01-04 09:30:50.000000000 -0500 ++++ gcc-6.4.0.new/gcc/config/m68k/linux.h 2018-06-12 20:03:47.047502695 -0400 +@@ -73,6 +73,9 @@ + + #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" + ++#undef MUSL_DYNAMIC_LINKER ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-m68k.so.1" ++ + #undef LINK_SPEC + #define LINK_SPEC "-m m68kelf %{shared} \ + %{!shared: \ +diff -ur gcc-6.4.0/libgcc/config/m68k/linux-atomic.c gcc-6.4.0.new/libgcc/config/m68k/linux-atomic.c +--- gcc-6.4.0/libgcc/config/m68k/linux-atomic.c 2016-01-04 09:30:50.000000000 -0500 ++++ gcc-6.4.0.new/libgcc/config/m68k/linux-atomic.c 2018-06-07 16:15:11.610163418 -0400 +@@ -33,7 +33,6 @@ + using the kernel helper defined below. There is no support for + 64-bit operations yet. */ + +-#include + #include + + #ifndef __NR_atomic_cmpxchg_32 +diff -ur gcc-6.4.0/libgcc/config/m68k/linux-unwind.h gcc-6.4.0.new/libgcc/config/m68k/linux-unwind.h +--- gcc-6.4.0/libgcc/config/m68k/linux-unwind.h 2016-01-04 09:30:50.000000000 -0500 ++++ gcc-6.4.0.new/libgcc/config/m68k/linux-unwind.h 2018-06-07 16:17:16.964591108 -0400 +@@ -37,7 +37,7 @@ + stack_t uc_stack; + mcontext_t uc_mcontext; + unsigned long uc_filler[80]; +- __sigset_t uc_sigmask; ++ sigset_t uc_sigmask; + }; + + #define MD_FALLBACK_FRAME_STATE_FOR m68k_fallback_frame_state diff --git a/patches/gcc-6.3.0/0015-m68k.dff b/patches/gcc-6.3.0/0015-m68k.dff new file mode 100644 index 0000000..b3765bf --- /dev/null +++ b/patches/gcc-6.3.0/0015-m68k.dff @@ -0,0 +1,36 @@ +diff -ur gcc-6.4.0/gcc/config/m68k/linux.h gcc-6.4.0.new/gcc/config/m68k/linux.h +--- gcc-6.4.0/gcc/config/m68k/linux.h 2016-01-04 09:30:50.000000000 -0500 ++++ gcc-6.4.0.new/gcc/config/m68k/linux.h 2018-06-12 20:03:47.047502695 -0400 +@@ -73,6 +73,9 @@ + + #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" + ++#undef MUSL_DYNAMIC_LINKER ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-m68k.so.1" ++ + #undef LINK_SPEC + #define LINK_SPEC "-m m68kelf %{shared} \ + %{!shared: \ +diff -ur gcc-6.4.0/libgcc/config/m68k/linux-atomic.c gcc-6.4.0.new/libgcc/config/m68k/linux-atomic.c +--- gcc-6.4.0/libgcc/config/m68k/linux-atomic.c 2016-01-04 09:30:50.000000000 -0500 ++++ gcc-6.4.0.new/libgcc/config/m68k/linux-atomic.c 2018-06-07 16:15:11.610163418 -0400 +@@ -33,7 +33,6 @@ + using the kernel helper defined below. There is no support for + 64-bit operations yet. */ + +-#include + #include + + #ifndef __NR_atomic_cmpxchg_32 +diff -ur gcc-6.4.0/libgcc/config/m68k/linux-unwind.h gcc-6.4.0.new/libgcc/config/m68k/linux-unwind.h +--- gcc-6.4.0/libgcc/config/m68k/linux-unwind.h 2016-01-04 09:30:50.000000000 -0500 ++++ gcc-6.4.0.new/libgcc/config/m68k/linux-unwind.h 2018-06-07 16:17:16.964591108 -0400 +@@ -37,7 +37,7 @@ + stack_t uc_stack; + mcontext_t uc_mcontext; + unsigned long uc_filler[80]; +- __sigset_t uc_sigmask; ++ sigset_t uc_sigmask; + }; + + #define MD_FALLBACK_FRAME_STATE_FOR m68k_fallback_frame_state diff --git a/patches/gcc-6.4.0/0014-m68k.dff b/patches/gcc-6.4.0/0014-m68k.dff new file mode 100644 index 0000000..b3765bf --- /dev/null +++ b/patches/gcc-6.4.0/0014-m68k.dff @@ -0,0 +1,36 @@ +diff -ur gcc-6.4.0/gcc/config/m68k/linux.h gcc-6.4.0.new/gcc/config/m68k/linux.h +--- gcc-6.4.0/gcc/config/m68k/linux.h 2016-01-04 09:30:50.000000000 -0500 ++++ gcc-6.4.0.new/gcc/config/m68k/linux.h 2018-06-12 20:03:47.047502695 -0400 +@@ -73,6 +73,9 @@ + + #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" + ++#undef MUSL_DYNAMIC_LINKER ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-m68k.so.1" ++ + #undef LINK_SPEC + #define LINK_SPEC "-m m68kelf %{shared} \ + %{!shared: \ +diff -ur gcc-6.4.0/libgcc/config/m68k/linux-atomic.c gcc-6.4.0.new/libgcc/config/m68k/linux-atomic.c +--- gcc-6.4.0/libgcc/config/m68k/linux-atomic.c 2016-01-04 09:30:50.000000000 -0500 ++++ gcc-6.4.0.new/libgcc/config/m68k/linux-atomic.c 2018-06-07 16:15:11.610163418 -0400 +@@ -33,7 +33,6 @@ + using the kernel helper defined below. There is no support for + 64-bit operations yet. */ + +-#include + #include + + #ifndef __NR_atomic_cmpxchg_32 +diff -ur gcc-6.4.0/libgcc/config/m68k/linux-unwind.h gcc-6.4.0.new/libgcc/config/m68k/linux-unwind.h +--- gcc-6.4.0/libgcc/config/m68k/linux-unwind.h 2016-01-04 09:30:50.000000000 -0500 ++++ gcc-6.4.0.new/libgcc/config/m68k/linux-unwind.h 2018-06-07 16:17:16.964591108 -0400 +@@ -37,7 +37,7 @@ + stack_t uc_stack; + mcontext_t uc_mcontext; + unsigned long uc_filler[80]; +- __sigset_t uc_sigmask; ++ sigset_t uc_sigmask; + }; + + #define MD_FALLBACK_FRAME_STATE_FOR m68k_fallback_frame_state diff --git a/patches/gcc-7.2.0/0014-m68k.diff b/patches/gcc-7.2.0/0014-m68k.diff new file mode 100644 index 0000000..f2c502d --- /dev/null +++ b/patches/gcc-7.2.0/0014-m68k.diff @@ -0,0 +1,25 @@ +diff -ur gcc-6.4.0/gcc/config/m68k/linux.h gcc-6.4.0.new/gcc/config/m68k/linux.h +--- gcc-6.4.0/gcc/config/m68k/linux.h 2016-01-04 09:30:50.000000000 -0500 ++++ gcc-6.4.0.new/gcc/config/m68k/linux.h 2018-06-12 20:03:47.047502695 -0400 +@@ -73,6 +73,9 @@ + + #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" + ++#undef MUSL_DYNAMIC_LINKER ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-m68k.so.1" ++ + #undef LINK_SPEC + #define LINK_SPEC "-m m68kelf %{shared} \ + %{!shared: \ +diff -ur gcc-6.4.0/libgcc/config/m68k/linux-unwind.h gcc-6.4.0.new/libgcc/config/m68k/linux-unwind.h +--- gcc-6.4.0/libgcc/config/m68k/linux-unwind.h 2016-01-04 09:30:50.000000000 -0500 ++++ gcc-6.4.0.new/libgcc/config/m68k/linux-unwind.h 2018-06-07 16:17:16.964591108 -0400 +@@ -37,7 +37,7 @@ + stack_t uc_stack; + mcontext_t uc_mcontext; + unsigned long uc_filler[80]; +- __sigset_t uc_sigmask; ++ sigset_t uc_sigmask; + }; + + #define MD_FALLBACK_FRAME_STATE_FOR m68k_fallback_frame_state