Bug#632380: gcc-4.6: please add m68k support
Source: gcc-4.6
Version: 4.6.1-1
Severity: wishlist
Tags: patch
Hi,
as promised I’ve ported what was still in src:gcc-4.4 regarding
m68k support and related fixes to gcc-4.6. The package with this
patch applied builds on amd64 both natively¹ and as a crosscompiler,
the m68k native build will take a few days as usual. The multiarch
selection² has been fixed upstream³, and all but one of the pr*.diff
are also merged already.
I’ve done some rudimentary testing: cross-built mksh (statically
and dynamically linked) and ran its own testsuite on an m68k sy-
stem, which passed with 0 errors each. So this is at least not
worse than the current state, and please include it in the next
upload.
bye,
//mirabilos
① Package build aborted though due to running out of disc space
in the testsuite… but then, none of the changes should touch
the amd64 native build parts.
② Although I wonder why we build the multilib stuff at all, you
told me to not disable it, but I can’t find the 68040/68060
optimised target libraries in the .deb packages… so they just
take up compile time at the moment.
③ Turns out my old m68k-multilib patch was indeed correct, and
the cpu32 and fidoa targets were incorrectly marked as having
an MMU in gcc-4.4 (they fixed that instead so the selection
was fine again).
--
08:05⎜<XTaran:#grml> mika: Does grml have an tool to read Apple
⎜ System Log (asl) files? :)
08:08⎜<ft:#grml> yeah. /bin/rm. ;) 08:09⎜<mrud:#grml> hexdump -C
08:31⎜<XTaran:#grml> ft, mrud: *g*
Changes to generated files (d/r control) omitted.
--- gcc-4.6-4.6.1/debian/rules.patch
+++ gcc-4.6-4.6.1/debian/rules.patch
@@ -64,7 +64,6 @@
alpha-no-ev4-directive \
boehm-gc-getnprocs \
note-gnu-stack \
- m68k-allow-gnu99 \
libgomp-omp_h-multilib \
sparc-force-cpu \
pr24619 \
@@ -76,6 +75,7 @@
$(if $(with_linaro_branch),,gcc-dw2-loc-tracking) \
mudflap-varargs \
pr45078 \
+ pr43804 \
# libstdc++-nothumb-check \
# TODO: update
--- gcc-4.6-4.6.1/debian/rules.defs
+++ gcc-4.6-4.6.1/debian/rules.defs
@@ -1176,7 +1176,7 @@
# GNU locales
force_gnu_locales := yes
-locale_no_cpus := m68k
+locale_no_cpus :=
locale_no_systems := knetbsd-gnu
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(locale_no_systems)))
force_gnu_locales := disabled for system $(DEB_TARGET_GNU_SYSTEM)
--- gcc-4.6-4.6.1/debian/changelog
+++ gcc-4.6-4.6.1/debian/changelog
@@ -1,3 +1,15 @@
+gcc-4.6 (4.6.1-1+m68k.1) unreleased; urgency=low
+
+ [ Thorsten Glaser ]
+ * Apply changes from src:gcc-4.4 for m68k support:
+ - debian/rules.defs: Remove m68k from locale_no_cpus.
+ - debian/patches/gcc-multiarch.diff: Add m68k multiarch_mappings.
+ - debian/patches/m68k-allow-gnu99.diff: Drop, we have eglibc now.
+ - debian/patches/pr43804.diff: Fix backported from SVN.
+ - debian/rules.patch: Add pr43804 and drop m68k-allow-gnu99.
+
+ -- Thorsten Glaser <tg@mirbsd.de> Fri, 01 Jul 2011 18:39:11 +0000
+
gcc-4.6 (4.6.1-1) unstable; urgency=low
* GCC 4.6.1 release.
--- gcc-4.6-4.6.1/debian/patches/gcc-multiarch.diff
+++ gcc-4.6-4.6.1/debian/patches/gcc-multiarch.diff
@@ -7,6 +7,9 @@
# DP: /usr/lib/<arch>-linux-gnu
# DP: to the system paths.
+2011-07-01 Thorsten Glaser <tg@debian.org>
+ * Add m68k multiarch_mappings
+
2011-03-08 Steve Langasek <steve.langasek@linaro.org>
* Canonicalize x86 to i386 everywhere, not i486/i686
@@ -262,7 +265,7 @@
this architecture. */
--- a/src/gcc/multiarch.h
+++ b/src/gcc/multiarch.h
-@@ -0,0 +1,95 @@
+@@ -0,0 +1,101 @@
+/* Header for multiarch handling (include directories, libraries path).
+ Copyright (C) 2009 Free Software Foundation, Inc.
+ Contributed by Arthur Loiret <aloiret@debian.org>
@@ -336,6 +339,12 @@
+ { "m4", "sh4-linux-gnu" },
+ { "m4-nofpu", "sh4_nofpu-linux-gnu" },
+# endif
++# if defined(__m68k_linux_gnu__)
++ { "m68040", "m68040-linux-gnu" },
++ { "m68060", "m68060-linux-gnu" },
++ { "mcpu32", "m68360-linux-gnu" },
++ { "mfidoa", "fido-linux-gnu" },
++# endif
+#endif /* ENABLE_MULTIARCH */
+ { 0, 0 }
+};
reverted:
--- gcc-4.6-4.6.1/debian/patches/m68k-allow-gnu99.diff
+++ gcc-4.6-4.6.1.orig/debian/patches/m68k-allow-gnu99.diff
@@ -1,30 +0,0 @@
-# DP: patch to allow gnu99 mode on m68k
-
-On m68k, gnu99 mode doesn't work correctly out of the box due to our
-woefully outdated glibc (we're currently stuck at 2.5-1). This is
-because the inline schematics changed between glibc 2.5 and 2.7, and
-gcc 4.2 to 4.3. This patch configures the built in spec file to pass
--fgnu89-inline, and thus allowing proper compilation and linking with
-the older glibc on m68k. This patch should not be merged upstream, and
-it should be removed once a newer glibc is available for our
-architecture.
-
----
- gcc/config/m68k/linux.h | 6 ++++++
- 1 files changed, 6 insertions(+), 0 deletions(-)
-
---- a/src/gcc/config/m68k/linux.h
-+++ b/src/gcc/config/m68k/linux.h
-@@ -36,6 +36,12 @@
- #undef M68K_HONOR_TARGET_STRICT_ALIGNMENT
- #define M68K_HONOR_TARGET_STRICT_ALIGNMENT 0
-
-+/* on m68k, we always need to use gnu89 inlining because we're
-+ still limited to glibc 2.5. This should be removed after
-+ a newer glibc is available */
-+#undef CC1_SPEC
-+#define CC1_SPEC "%{profile:-p} %{std=gnu99:-fgnu89-inline}"
-+
- /* Here are four prefixes that are used by asm_fprintf to
- facilitate customization for alternate assembler syntaxes.
- Machines with no likelihood of an alternate syntax need not
--- gcc-4.6-4.6.1.orig/debian/patches/pr43804.diff
+++ gcc-4.6-4.6.1/debian/patches/pr43804.diff
@@ -0,0 +1,22 @@
+# DP: Fix for PR target/43804 backported from SVN
+
+2011-04-24 Richard Sandiford <richard.sandiford@linaro.org>
+
+ PR target/43804
+ * config/m68k/constraints.md (T): Allow PIC operands that satisfy
+ LEGITIMATE_PIC_OPERAND_P.
+
+Index: gcc/config/m68k/constraints.md
+===================================================================
+--- a/src/gcc/config/m68k/constraints.md (revision 172919)
++++ b/src/gcc/config/m68k/constraints.md (revision 172920)
+@@ -94,7 +94,8 @@
+ (define_constraint "T"
+ "Used for operands that satisfy 's' when -mpcrel is not in effect."
+ (and (match_code "symbol_ref,label_ref,const")
+- (match_test "!flag_pic")))
++ (match_test "!TARGET_PCREL")
++ (match_test "!flag_pic || LEGITIMATE_PIC_OPERAND_P (op)")))
+
+ (define_memory_constraint "Q"
+ "Means address register indirect addressing mode."
Reply to: