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

Bug#694112: marked as done (gcc-4.6: please apply fixes, m68k patches, MiNT support)



Your message dated Mon, 14 Jan 2013 20:48:35 +0000
with message-id <E1TuqxP-0002zk-68@franck.debian.org>
and subject line Bug#694112: fixed in gcc-4.6 4.6.3-15
has caused the Debian Bug report #694112,
regarding gcc-4.6: please apply fixes, m68k patches, MiNT support
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
694112: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=694112
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Source: gcc-4.6
Version: 4.6.3-13
Severity: wishlist
Tags: patch

Hi,

I’ve put together a collection of GCC patches made while working
on m68k again. They’re mostly independent of each other, but I’d
like to see them all applied eventually. I used this:

gcc-4.6 (4.6.3-13+m68k.3) unreleased; urgency=low

  * Update the libffi-m68k patch from upstream.

  * Backport atomic builtin backend code for Linux/m68k from trunk.
  * Add t-slibgcc-libgcc for m68k-linux (PR40134).

  * Re-enable building runtime packages normally built by gcc-4.7
    on cross toolchains, to keep them self-contained.

  * Add the FreeMiNT patches from Vincent Rivière to support the
    Debian architecture mint-m68k (only DEB_STAGE=stage1 for now).
    Note that adding support for unset DEB_STAGE would be challenging
    as there are currently no shared libraries at all on FreeMiNT.
  * Fix bug in debian/patches/gcc-multiarch-upstream.diff preventing
    us from disabling Multi-Arch when targetting m68k-mint.

 -- Thorsten Glaser <tg@mirbsd.de>  Sat, 24 Nov 2012 00:13:39 +0100

The patches are:

*** fix-autoconf.diff

Unbreak --disable-multiarch (and --enable-multiarch too, probably)
by checking the correct variable. (As announced in IRC.)

*** make-crossbuilds-complete.diff

When doing cross compilers, do build the “common and library packages”
and “gccxbase” to make them complete, so one doesn’t need to build two
cross toolchains just to get libgcc2. Touches common code but should
be unproblematic; in fact, help people.

*** update-libffi-diff.diff

Update the patch for libffi for m68k by another hunk upstream committed
to GCC. Unproblematic.

*** backport-atomics.diff

Backport code from then-trunk to add __sync_* atomic builtins, adjusted
to work within the GCC 4.6 framework. This also fixes PR40134 which
would have reappeared otherwise.

*** mint.diff

Depends on at least fix-autoconf and make-crossbuilds-complete.
Adds support for FreeMiNT (an unixoid Atari kernel which uses that
platform’s native TOS binaries) as a DEB_STAGE=stage1 platform.
We’ll need to https://wiki.debian.org/BuildingCrossCompilers to
that platform in order to be able to build several m68k bootloaders
from source (the Debian source packages usually ship the precompiled
binaries uuencoded, but they have to be generated somehow, and I’d
rather have the process be ⓐ documented and ⓑ use as much unmodified
Debian stuff as possible).

Compiling applications that run on FreeMiNT or even TOS works with
this given “mintlib”, its libc equivalent. Fleshing out FreeMiNT
support would be possible, but not easy inside the gcc-4.6 Debian
source package as mintlib doesn’t do dynamic linking. The author
of these patches wants to get them into GCC though and collaborates
on them with me (is interested what we do to them).

Did I submit the companion patch to binutils already? If not, prod me.

This patch touches debian/rules.d/binary-gcc.mk because even
binutils-multiarch with FreeMiNT enabled cannot handle stripping
libgcc.a with m68k-tos objects inside because detection is not
unambiguous, hence we just skip stripping them for cross-builds
targetting FreeMiNT. (The cross support of debhelper actually
works, it’s just that it isn’t suitable or even intended to
operate on packages that contain a cross-compiler native binary
as well as binaries for the target platform.)

It also changes several conditionals for m68k to operate on the
CPU macro (the dpkg architecture name is mint-m68k, so this works).


The patches need not be applied now (except the first), I can
easily carry a local version in d-p.org/unreleased until after
the unfreeze.

Thanks in advance,
//mirabilos
-- 
Darwinism never[…]applied to wizardkind. There's a more than fair amount of[…]
stupidity in its gene-pool[…]never eradicated[…]magic evens the odds that way.
It's[…]harder to die for us than[…]muggles[…]wonder if, as technology[…]better
[…]same will[…]happen there too. Dursleys' continued existence indicates so.
--- gcc-4.6-4.6.3/debian/rules.patch
+++ gcc-4.6-4.6.3/debian/rules.patch
@@ -96,6 +96,7 @@
 	arm-no-va_list-warn \
 	pr47955 \
 	m68k-fp-cmp-zero \
+	m68k-atomic \
 	gcc-gengtype-fix1 \
 	gcc-gengtype-fix2 \
 
--- gcc-4.6-4.6.3.orig/debian/patches/m68k-atomic.diff
+++ gcc-4.6-4.6.3/debian/patches/m68k-atomic.diff
@@ -0,0 +1,255 @@
+# DP: backport atomic builtin backend code for m68k from trunk
+# DP: and add t-slibgcc-libgcc to m68k configuration by advice
+# DP: of Mikel Pettersson to avoid running into PR40134 again
+
+--- a/src/libgcc/config.host
++++ b/src/libgcc/config.host
+@@ -383,9 +383,10 @@ m68k*-*-openbsd*)
+ 	;;
+ m68k-*-uclinux*)		# Motorola m68k/ColdFire running uClinux with uClibc
+ 	;;
+-m68k-*-linux*)		# Motorola m68k's running GNU/Linux
++m68k-*-linux*)			# Motorola m68k's running GNU/Linux
+ 				# with ELF format using glibc 2
+ 				# aka the GNU/Linux C library 6.
++	tmake_file="$tmake_file m68k/t-linux"
+ 	;;
+ m68k-*-rtems*)
+ 	;;
+--- /dev/null
++++ b/src/libgcc/config/m68k/linux-atomic.c
+@@ -0,0 +1,211 @@
++/* Linux-specific atomic operations for m68k Linux.
++   Copyright (C) 2011 Free Software Foundation, Inc.
++   Based on code contributed by CodeSourcery for ARM EABI Linux.
++
++This file is part of GCC.
++
++GCC is free software; you can redistribute it and/or modify it under
++the terms of the GNU General Public License as published by the Free
++Software Foundation; either version 3, or (at your option) any later
++version.
++
++GCC is distributed in the hope that it will be useful, but WITHOUT ANY
++WARRANTY; without even the implied warranty of MERCHANTABILITY or
++FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++for more details.
++
++Under Section 7 of GPL version 3, you are granted additional
++permissions described in the GCC Runtime Library Exception, version
++3.1, as published by the Free Software Foundation.
++
++You should have received a copy of the GNU General Public License and
++a copy of the GCC Runtime Library Exception along with this program;
++see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
++<http://www.gnu.org/licenses/>.  */
++
++/* Coldfire dropped the CAS instruction from the base M68K ISA.
++
++   GCC automatically issues a asm memory barrier when it encounters
++   a __sync_synchronize builtin.  Thus, we do not need to define this
++   builtin.
++
++   We implement byte, short and int versions of each atomic operation
++   using the kernel helper defined below.  There is no support for
++   64-bit operations yet.  */
++
++#include <asm/unistd.h>
++#include <stdbool.h>
++
++#ifndef __NR_atomic_cmpxchg_32
++#define __NR_atomic_cmpxchg_32  335
++#endif
++
++/* Kernel helper for compare-and-exchange a 32-bit value.  */
++static inline unsigned
++__kernel_cmpxchg (unsigned *mem, unsigned oldval, unsigned newval)
++{
++  register unsigned *a0 asm("a0") = mem;
++  register unsigned d2 asm("d2") = oldval;
++  register unsigned d1 asm("d1") = newval;
++  register unsigned d0 asm("d0") = __NR_atomic_cmpxchg_32;
++
++  asm volatile ("trap #0"
++		: "=r"(d0), "=r"(d1), "=r"(a0)
++		: "r"(d0), "r"(d1), "r"(d2), "r"(a0)
++		: "memory", "a1");
++
++  return d0;
++}
++
++#define HIDDEN __attribute__ ((visibility ("hidden")))
++
++/* Big endian masks  */
++#define INVERT_MASK_1 24
++#define INVERT_MASK_2 16
++
++#define MASK_1 0xffu
++#define MASK_2 0xffffu
++
++#define NAME_oldval(OP, WIDTH) __sync_fetch_and_##OP##_##WIDTH
++#define NAME_newval(OP, WIDTH) __sync_##OP##_and_fetch_##WIDTH
++
++#define WORD_SYNC_OP(OP, PFX_OP, INF_OP, RETURN)			\
++  unsigned HIDDEN							\
++  NAME##_##RETURN (OP, 4) (unsigned *ptr, unsigned val)			\
++  {									\
++    unsigned oldval, newval, cmpval = *ptr;				\
++									\
++    do {								\
++      oldval = cmpval;							\
++      newval = PFX_OP (oldval INF_OP val);				\
++      cmpval = __kernel_cmpxchg (ptr, oldval, newval);			\
++    } while (__builtin_expect (oldval != cmpval, 0));			\
++									\
++    return RETURN;							\
++  }
++
++#define SUBWORD_SYNC_OP(OP, PFX_OP, INF_OP, TYPE, WIDTH, RETURN)	\
++  TYPE HIDDEN								\
++  NAME##_##RETURN (OP, WIDTH) (TYPE *ptr, TYPE sval)			\
++  {									\
++    unsigned *wordptr = (unsigned *) ((unsigned long) ptr & ~3);	\
++    unsigned int mask, shift, oldval, newval, cmpval, wval;		\
++									\
++    shift = (((unsigned long) ptr & 3) << 3) ^ INVERT_MASK_##WIDTH;	\
++    mask = MASK_##WIDTH << shift;					\
++    wval = (sval & MASK_##WIDTH) << shift;				\
++									\
++    cmpval = *wordptr;							\
++    do {								\
++      oldval = cmpval;							\
++      newval = PFX_OP (oldval INF_OP wval);				\
++      newval = (newval & mask) | (oldval & ~mask);			\
++      cmpval = __kernel_cmpxchg (wordptr, oldval, newval);		\
++    } while (__builtin_expect (oldval != cmpval, 0));			\
++									\
++    return (RETURN >> shift) & MASK_##WIDTH;				\
++  }
++
++WORD_SYNC_OP (add,   , +, oldval)
++WORD_SYNC_OP (sub,   , -, oldval)
++WORD_SYNC_OP (or,    , |, oldval)
++WORD_SYNC_OP (and,   , &, oldval)
++WORD_SYNC_OP (xor,   , ^, oldval)
++WORD_SYNC_OP (nand, ~, &, oldval)
++
++SUBWORD_SYNC_OP (add,   , +, unsigned short, 2, oldval)
++SUBWORD_SYNC_OP (sub,   , -, unsigned short, 2, oldval)
++SUBWORD_SYNC_OP (or,    , |, unsigned short, 2, oldval)
++SUBWORD_SYNC_OP (and,   , &, unsigned short, 2, oldval)
++SUBWORD_SYNC_OP (xor,   , ^, unsigned short, 2, oldval)
++SUBWORD_SYNC_OP (nand, ~, &, unsigned short, 2, oldval)
++
++SUBWORD_SYNC_OP (add,   , +, unsigned char, 1, oldval)
++SUBWORD_SYNC_OP (sub,   , -, unsigned char, 1, oldval)
++SUBWORD_SYNC_OP (or,    , |, unsigned char, 1, oldval)
++SUBWORD_SYNC_OP (and,   , &, unsigned char, 1, oldval)
++SUBWORD_SYNC_OP (xor,   , ^, unsigned char, 1, oldval)
++SUBWORD_SYNC_OP (nand, ~, &, unsigned char, 1, oldval)
++
++WORD_SYNC_OP (add,   , +, newval)
++WORD_SYNC_OP (sub,   , -, newval)
++WORD_SYNC_OP (or,    , |, newval)
++WORD_SYNC_OP (and,   , &, newval)
++WORD_SYNC_OP (xor,   , ^, newval)
++WORD_SYNC_OP (nand, ~, &, newval)
++
++SUBWORD_SYNC_OP (add,   , +, unsigned short, 2, newval)
++SUBWORD_SYNC_OP (sub,   , -, unsigned short, 2, newval)
++SUBWORD_SYNC_OP (or,    , |, unsigned short, 2, newval)
++SUBWORD_SYNC_OP (and,   , &, unsigned short, 2, newval)
++SUBWORD_SYNC_OP (xor,   , ^, unsigned short, 2, newval)
++SUBWORD_SYNC_OP (nand, ~, &, unsigned short, 2, newval)
++
++SUBWORD_SYNC_OP (add,   , +, unsigned char, 1, newval)
++SUBWORD_SYNC_OP (sub,   , -, unsigned char, 1, newval)
++SUBWORD_SYNC_OP (or,    , |, unsigned char, 1, newval)
++SUBWORD_SYNC_OP (and,   , &, unsigned char, 1, newval)
++SUBWORD_SYNC_OP (xor,   , ^, unsigned char, 1, newval)
++SUBWORD_SYNC_OP (nand, ~, &, unsigned char, 1, newval)
++
++unsigned HIDDEN
++__sync_val_compare_and_swap_4 (unsigned *ptr, unsigned oldval, unsigned newval)
++{
++  return __kernel_cmpxchg (ptr, oldval, newval);
++}
++
++bool HIDDEN
++__sync_bool_compare_and_swap_4 (unsigned *ptr, unsigned oldval,
++				unsigned newval)
++{
++  return __kernel_cmpxchg (ptr, oldval, newval) == oldval;
++}
++
++#define SUBWORD_VAL_CAS(TYPE, WIDTH)					\
++  TYPE HIDDEN								\
++  __sync_val_compare_and_swap_##WIDTH (TYPE *ptr, TYPE soldval,		\
++				       TYPE snewval)			\
++  {									\
++    unsigned *wordptr = (unsigned *)((unsigned long) ptr & ~3);		\
++    unsigned int mask, shift, woldval, wnewval;				\
++    unsigned oldval, newval, cmpval;					\
++									\
++    shift = (((unsigned long) ptr & 3) << 3) ^ INVERT_MASK_##WIDTH;	\
++    mask = MASK_##WIDTH << shift;					\
++    woldval = (soldval & MASK_##WIDTH) << shift;			\
++    wnewval = (snewval & MASK_##WIDTH) << shift;			\
++    cmpval = *wordptr;							\
++									\
++    do {								\
++      oldval = cmpval;							\
++      if ((oldval & mask) != woldval)					\
++	break;								\
++      newval = (oldval & ~mask) | wnewval;				\
++      cmpval = __kernel_cmpxchg (wordptr, oldval, newval);		\
++    } while (__builtin_expect (oldval != cmpval, 0));			\
++									\
++    return (oldval >> shift) & MASK_##WIDTH;				\
++  }
++
++SUBWORD_VAL_CAS (unsigned short, 2)
++SUBWORD_VAL_CAS (unsigned char,  1)
++
++#define SUBWORD_BOOL_CAS(TYPE, WIDTH)					\
++  bool HIDDEN								\
++  __sync_bool_compare_and_swap_##WIDTH (TYPE *ptr, TYPE oldval,		\
++					TYPE newval)			\
++  {									\
++    return (__sync_val_compare_and_swap_##WIDTH (ptr, oldval, newval)	\
++	    == oldval);							\
++  }
++
++SUBWORD_BOOL_CAS (unsigned short, 2)
++SUBWORD_BOOL_CAS (unsigned char,  1)
++
++#undef NAME_oldval
++#define NAME_oldval(OP, WIDTH) __sync_lock_##OP##_##WIDTH
++#define COMMA ,
++
++WORD_SYNC_OP (test_and_set, , COMMA, oldval)
++SUBWORD_SYNC_OP (test_and_set, , COMMA, unsigned short, 1, oldval)
++SUBWORD_SYNC_OP (test_and_set, , COMMA, unsigned short, 2, oldval)
+--- /dev/null
++++ b/src/libgcc/config/m68k/t-linux
+@@ -0,0 +1 @@
++LIB2ADD_ST = $(srcdir)/config/m68k/linux-atomic.c
+--- a/src/gcc/config.gcc
++++ b/src/gcc/config.gcc
+@@ -1792,7 +1792,7 @@ m68k-*-uclinux*)		# Motorola m68k/ColdFi
+  	tm_defines="${tm_defines} MOTOROLA=1"
+ 	tmake_file="m68k/t-floatlib m68k/t-uclinux m68k/t-mlibs"
+ 	;;
+-m68k-*-linux*)		# Motorola m68k's running GNU/Linux
++m68k-*-linux*)			# Motorola m68k's running GNU/Linux
+ 				# with ELF format using glibc 2
+ 				# aka the GNU/Linux C library 6.
+ 	default_m68k_cpu=68020
+@@ -1807,6 +1807,7 @@ m68k-*-linux*)		# Motorola m68k's runnin
+ 	if test x$sjlj != x1; then
+ 	    tmake_file="$tmake_file m68k/t-slibgcc-elf-ver"
+ 	fi
++	tmake_file="$tmake_file t-slibgcc-libgcc"
+ 	;;
+ m68k-*-rtems*)
+ 	default_m68k_cpu=68020
--- gcc-4.6-4.6.3/debian/patches/gcc-multiarch-upstream.diff
+++ gcc-4.6-4.6.3/debian/patches/gcc-multiarch-upstream.diff
@@ -396,9 +396,9 @@
 +# Determine whether or not multiarch is enabled.
 +# Check whether --enable-multiarch was given.
 +if test "${enable_multiarch+set}" = set; then :
-+  enableval=$enable_multiarch; case "${withval}" in
-+yes|no|auto) enable_multiarch=$withval;;
-+*) as_fn_error "bad value ${withval} given for --enable-multiarch option" "$LINENO" 5 ;;
++  enableval=$enable_multiarch; case "${enableval}" in
++yes|no|auto) enable_multiarch=$enableval;;
++*) as_fn_error "bad value ${enableval} given for --enable-multiarch option" "$LINENO" 5 ;;
 +esac
 +else
 +  enable_multiarch=auto
@@ -547,9 +547,9 @@
 +AC_ARG_ENABLE(multiarch,
 +[AS_HELP_STRING([--enable-multiarch],
 +		[enable support for multiarch paths])],
-+[case "${withval}" in
-+yes|no|auto) enable_multiarch=$withval;;
-+*) AC_MSG_ERROR(bad value ${withval} given for --enable-multiarch option) ;;
++[case "${enableval}" in
++yes|no|auto) enable_multiarch=$enableval;;
++*) AC_MSG_ERROR(bad value ${enableval} given for --enable-multiarch option) ;;
 +esac], [enable_multiarch=auto])
 +if test x${enable_multiarch} = xauto; then
 +  if test x$host != x$target && test "x$with_sysroot" = x; then
--- gcc-4.6-4.6.3/debian/rules.defs
+++ gcc-4.6-4.6.3/debian/rules.defs
@@ -310,6 +310,12 @@
 # XXX: should with_common_libs be "yes" only if this is the default compiler
 # version on the targeted arch?
 
+ifeq ($(DEB_CROSS),yes)
+# re-enable common and library packages for cross builds
+with_common_pkgs := yes
+with_common_libs := yes
+endif
+
 # is this a multiarch-enabled build?
 ifeq (,$(filter $(distrelease),lenny etch squeeze dapper hardy jaunty karmic lucid maverick))
   with_multiarch_lib := yes
@@ -344,6 +350,11 @@
   else
     with_gccxbase := yes
   endif
+else
+  ifeq ($(DEB_TARGET_ARCH_OS),mint)
+    # hack to make cross-compiler self-hosted
+    with_gccxbase := yes
+  endif
 endif
 
 # build dev packages.
--- gcc-4.6-4.6.3/debian/rules.defs
+++ gcc-4.6-4.6.3/debian/rules.defs
@@ -662,6 +673,9 @@
 ifeq ($(fortran_no_cross)-$(DEB_CROSS),yes-yes)
   with_fortran := diasbled for cross compiler package
 endif
+ifeq ($(DEB_TARGET_ARCH),mint-m68k)
+  with_fortran := not for FreeMiNT target from Debian packaging
+endif
 with_fortran := $(call envfilt, fortran, , , $(with_fortran))
 
 # Build all packages needed for Fortran development
@@ -697,6 +711,9 @@
 ifeq ($(objc_no_cross)-$(DEB_CROSS),yes-yes)
   with_objc := diasbled for cross compiler package
 endif
+ifeq ($(DEB_TARGET_ARCH),mint-m68k)
+  with_objc := not for FreeMiNT target from Debian packaging
+endif
 with_objc := $(call envfilt, objc, obj-c++, , $(with_objc))
 
 ifeq ($(with_objc),yes)
@@ -736,6 +753,9 @@
 ifeq ($(objcxx_no_cross)-$(DEB_CROSS),yes-yes)
   with_objcxx := diasbled for cross compiler package
 endif
+ifeq ($(DEB_TARGET_ARCH),mint-m68k)
+  with_objcxx := not for FreeMiNT target from Debian packaging
+endif
 with_objcxx := $(call envfilt, obj-c++, , c++ objc, $(with_objcxx))
 
 ifeq ($(with_objcxx),yes)
@@ -790,6 +810,9 @@
 ifeq ($(trunk_build),yes)
   with_nls := no
 endif
+ifeq ($(DEB_TARGET_ARCH),mint-m68k)
+  with_nls := disabled for FreeMiNT
+endif
 with_nls := $(call envfilt, nls, , , $(with_nls))
 
 # powerpc nof libraries -----
@@ -1249,6 +1272,9 @@
 ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(locale_no_systems)))
   force_gnu_locales := disabled for system $(DEB_TARGET_GNU_SYSTEM)
 endif
+ifeq ($(DEB_TARGET_ARCH),mint-m68k)
+  force_gnu_locales := disabled for FreeMiNT
+endif
 
 gcc_tarpath		:= $(firstword $(wildcard gcc-*.tar.* /usr/src/gcc-$(BASE_VERSION)/gcc-*.tar.*))
 gcc_tarball		:= $(notdir $(gcc_tarpath))
--- gcc-4.6-4.6.3/debian/rules.patch
+++ gcc-4.6-4.6.3/debian/rules.patch
@@ -199,10 +200,11 @@
   debian_patches += libjava-armel-unwind
 endif
 
-ifeq ($(DEB_TARGET_ARCH),m68k)
+ifeq ($(DEB_TARGET_ARCH_CPU),m68k)
   debian_patches += pr47612
   debian_patches += m68k-revert-pr45144
   debian_patches += m68k-ada
+  debian_patches += m68k-mint
 endif
 
 ifeq ($(DEB_TARGET_ARCH),powerpcspe)
--- gcc-4.6-4.6.3/debian/rules.conf
+++ gcc-4.6-4.6.3/debian/rules.conf
@@ -173,6 +173,13 @@
   endif
 endif
 LIBC_DEV_DEP = $(LIBC_DEP)-dev
+ifeq ($(DEB_TARGET_ARCH_OS),mint)
+  # no shared C library
+  LIBC_DEP =
+  # mintlib is the libc6-dev equivalent
+  LIBC_DEV_DEP = mintlib
+  libc_dev_ver = 0~
+endif
 # for cross
 ifeq ($(DEB_CROSS),yes)
   LIBC_DEP ?= $(LIBC_DEP)$(LS)
@@ -416,7 +423,14 @@
 
 else
 # build cross compiler
+ifeq ($(DEB_TARGET_ARCH_OS),mint)
+  #XXX for now; we can only do DEB_STAGE=stage1 because otherwise, gcc
+  # wants to use shared libraries, which FreeMiNT does not have; the
+  # correct value to use here is 'mintlib' possibly with some cross-foo
+  CROSS_BUILD_DEP :=
+else
   CROSS_BUILD_DEP := libc6-dev$(cross_lib_arch),
+endif
 ifeq ($(REVERSE_CROSS),yes)
   CROSS_BUILD_DEP += zlib1g-dev$(cross_lib_arch), libmpfr-dev$(cross_lib_arch),
 endif
@@ -589,6 +603,12 @@
   ifeq ($(DEB_STAGE),stage2)
     addons += libgcc gccxbase
   endif
+  ifeq ($(DEB_STAGE),stage1)
+    ifeq ($(DEB_TARGET_ARCH_OS),mint)
+      # hack to make cross-compiler self-hosted
+      addons += gccxbase
+    endif
+  endif
 else
 languages = c c++ fortran objc objpp
 ifeq ($(DEB_CROSS),yes)
--- gcc-4.6-4.6.3/debian/rules2
+++ gcc-4.6-4.6.3/debian/rules2
@@ -382,7 +382,7 @@
   endif
 endif
 
-ifeq ($(DEB_TARGET_GNU_CPU),$(findstring $(DEB_TARGET_GNU_CPU),m68k))
+ifeq ($(DEB_TARGET_ARCH_CPU),m68k)
   CONFARGS += --disable-werror
 endif
 # FIXME: correct fix-warnings.dpatch
@@ -410,7 +410,7 @@
   CONFARGS += --with-multilib-list=m4,m4-nofpu --with-cpu=sh4
 endif
 
-ifneq (,$(findstring m68k-linux,$(DEB_TARGET_GNU_TYPE)))
+ifeq ($(DEB_TARGET_ARCH_CPU),m68k)
   CONFARGS += --disable-multilib
 endif
 
@@ -516,6 +516,17 @@
   endif
 endif
 
+ifeq ($(DEB_TARGET_ARCH),mint-m68k)
+  # only DEB_STAGE=stage1 since mintlib is not packaged in Debian
+  # and does not support shared libraries either, which the gcc
+  # cross-package framework assumes
+  CONFARGS += --disable-multilib
+  CONFARGS += --disable-shared
+  CONFARGS += --disable-linker-build-id
+  CONFARGS += --disable-threads
+  CONFARGS += --disable-gnu-unique-object
+endif
+
 ifeq ($(with_bootstrap),off)
   bootstrap_target =
 else ifeq ($(with_bootstrap),)
--- gcc-4.6-4.6.3/debian/rules.d/binary-gcc.mk
+++ gcc-4.6-4.6.3/debian/rules.d/binary-gcc.mk
@@ -16,6 +16,16 @@
   endif
 endif
 
+ifeq ($(DEB_CROSS),yes)
+  ifeq ($(DEB_TARGET_ARCH),mint-m68k)
+    # even binutils-multiarch's strip fails these
+    # and dh_strip is too unflexible to allow mixing
+    # strip calls for building cross-compilers, as
+    # opposed to cross-building packages
+    p_gcc_dhstrip_opts := -X libgcc.a -X libgcov.a
+  endif
+endif
+
 # gcc must be moved after g77 and g++
 # not all files $(PF)/include/*.h are part of gcc,
 # but it becomes difficult to name all these files ...
@@ -76,7 +86,7 @@
     files_gcc += $(gcc_lib_dir)/include/ia64intrin.h
 endif
 
-ifeq ($(DEB_TARGET_ARCH),m68k)
+ifeq ($(DEB_TARGET_ARCH_CPU),m68k)
     files_gcc += $(gcc_lib_dir)/include/math-68881.h
 endif
 
@@ -212,7 +222,7 @@
 	  true; \
 	fi
 	debian/dh_rmemptydirs -p$(p_gcc)
-	dh_strip -p$(p_gcc)
+	dh_strip -p$(p_gcc) $(p_gcc_dhstrip_opts)
 	dh_compress -p$(p_gcc) -X README.Bugs
 	dh_fixperms -p$(p_gcc)
 	dh_shlibdeps -p$(p_gcc)
--- gcc-4.6-4.6.3.orig/debian/patches/m68k-mint.diff
+++ gcc-4.6-4.6.3/debian/patches/m68k-mint.diff
@@ -0,0 +1,1180 @@
+Description: Add support for the m68k-atari-mint target
+ http://vincent.riviere.free.fr/soft/m68k-atari-mint/ contains a
+ collection of patches for a FreeMiNT cross and native toolchain.
+ This patch applies gcc-4.6.2-mint-20111028.patch.bz2 except the
+ not FreeMiNT-specific parts, which are already applied. It has
+ been reviewed, whitespace-sanitised, and some changes previously
+ globally applied are now only enabled for a FreeMiNT target.
+Origin: http://vincent.riviere.free.fr/soft/m68k-atari-mint/archives/gcc-4.6.2-mint-20111028.patch.bz2
+Author: Vincent Rivière <vincent.riviere@freesbee.fr>
+Reviewed-by: Thorsten Glaser <tg@debian.org>
+Last-Update: 2012-04-22
+
+--- a/src/config-ml.in
++++ b/src/config-ml.in
+@@ -351,6 +351,23 @@ m68*-*-*)
+ 	    esac
+ 	  done
+ 	fi
++	case "${host}" in
++	  *-*-mint*)
++	    case "${srcdir}" in
++	      */libgcc ) : ;;
++	      *)
++		old_multidirs="${multidirs}"
++		multidirs=""
++		for x in ${old_multidirs}; do
++		  case "$x" in
++		    *mshort ) : ;;
++		    *) multidirs="${multidirs} ${x}" ;;
++		  esac
++		done
++		;;
++	    esac
++	    ;;
++	esac
+ 	;;
+ mips*-*-*)
+ 	if [ x$enable_single_float = xno ]
+--- a/src/configure.ac
++++ b/src/configure.ac
+@@ -523,6 +523,9 @@ if test x$enable_libmudflap = x ; then
+     *-*-freebsd*)
+         # Enable libmudflap by default in FreeBSD.
+ 	;;
++    *-*-mint*)
++	# Enable libmudflap by default in MiNT.
++	;;
+     *)
+         # Disable it by default everywhere else.
+ 	noconfigdirs="$noconfigdirs target-libmudflap"
+@@ -895,6 +898,9 @@ case "${target}" in
+   m68k-*-coff*)
+     noconfigdirs="$noconfigdirs ${libgcj}"
+     ;;
++  m68k-*-mint*)
++    noconfigdirs="$noconfigdirs target-libiberty ${libgcj}"
++    ;;
+   m68*-*-* | fido-*-*)
+     libgloss_dir=m68k
+     ;;
+--- a/src/gcc/config/m68k/lb1sf68.asm
++++ b/src/gcc/config/m68k/lb1sf68.asm
+@@ -666,7 +666,9 @@ ROUND_TO_MINUS    = 3 | round result tow
+ 	.globl SYM (__negdf2)
+ 	.globl SYM (__cmpdf2)
+ 	.globl SYM (__cmpdf2_internal)
++#ifdef __ELF__
+ 	.hidden SYM (__cmpdf2_internal)
++#endif
+ 
+ 	.text
+ 	.even
+@@ -2581,7 +2583,9 @@ ROUND_TO_MINUS    = 3 | round result tow
+ 	.globl SYM (__negsf2)
+ 	.globl SYM (__cmpsf2)
+ 	.globl SYM (__cmpsf2_internal)
++#ifdef __ELF__
+ 	.hidden SYM (__cmpsf2_internal)
++#endif
+ 
+ | These are common routines to return and signal exceptions.	
+ 
+--- a/src/gcc/config/m68k/math-68881.h
++++ b/src/gcc/config/m68k/math-68881.h
+@@ -42,6 +42,15 @@
+ #ifndef __math_68881
+ #define __math_68881
+ 
++#undef __math_68881_inline
++#if defined(__GNUC_GNU_INLINE__) || defined(__GNUC_STDC_INLINE__)
++#define __math_68881_inline	extern __inline__ __attribute__((__gnu_inline__))
++#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
++#define __math_68881_inline	static inline
++#else
++#define __math_68881_inline	extern __inline__
++#endif
++
+ #include <errno.h>
+ 
+ #undef HUGE_VAL
+@@ -64,7 +73,7 @@
+ })
+ #endif
+ 
+-__inline extern double
++__math_68881_inline double
+ sin (double x)
+ {
+   double value;
+@@ -75,7 +84,7 @@ sin (double x)
+   return value;
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ cos (double x)
+ {
+   double value;
+@@ -86,7 +95,7 @@ cos (double x)
+   return value;
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ tan (double x)
+ {
+   double value;
+@@ -97,7 +106,7 @@ tan (double x)
+   return value;
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ asin (double x)
+ {
+   double value;
+@@ -108,7 +117,7 @@ asin (double x)
+   return value;
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ acos (double x)
+ {
+   double value;
+@@ -119,7 +128,7 @@ acos (double x)
+   return value;
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ atan (double x)
+ {
+   double value;
+@@ -130,7 +139,7 @@ atan (double x)
+   return value;
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ atan2 (double y, double x)
+ {
+   double pi, pi_over_2;
+@@ -187,7 +196,7 @@ atan2 (double y, double x)
+     }
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ sinh (double x)
+ {
+   double value;
+@@ -198,7 +207,7 @@ sinh (double x)
+   return value;
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ cosh (double x)
+ {
+   double value;
+@@ -209,7 +218,7 @@ cosh (double x)
+   return value;
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ tanh (double x)
+ {
+   double value;
+@@ -220,7 +229,7 @@ tanh (double x)
+   return value;
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ atanh (double x)
+ {
+   double value;
+@@ -231,7 +240,7 @@ atanh (double x)
+   return value;
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ exp (double x)
+ {
+   double value;
+@@ -242,7 +251,7 @@ exp (double x)
+   return value;
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ expm1 (double x)
+ {
+   double value;
+@@ -253,7 +262,7 @@ expm1 (double x)
+   return value;
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ log (double x)
+ {
+   double value;
+@@ -264,7 +273,7 @@ log (double x)
+   return value;
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ log1p (double x)
+ {
+   double value;
+@@ -275,7 +284,7 @@ log1p (double x)
+   return value;
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ log10 (double x)
+ {
+   double value;
+@@ -286,7 +295,7 @@ log10 (double x)
+   return value;
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ sqrt (double x)
+ {
+   double value;
+@@ -297,13 +306,13 @@ sqrt (double x)
+   return value;
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ hypot (double x, double y)
+ {
+   return sqrt (x*x + y*y);
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ pow (double x, double y)
+ {
+   if (x > 0)
+@@ -352,7 +361,7 @@ pow (double x, double y)
+     }
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ fabs (double x)
+ {
+   double value;
+@@ -363,7 +372,7 @@ fabs (double x)
+   return value;
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ ceil (double x)
+ {
+   int rounding_mode, round_up;
+@@ -385,7 +394,7 @@ ceil (double x)
+   return value;
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ floor (double x)
+ {
+   int rounding_mode, round_down;
+@@ -408,7 +417,7 @@ floor (double x)
+   return value;
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ rint (double x)
+ {
+   int rounding_mode, round_nearest;
+@@ -430,7 +439,7 @@ rint (double x)
+   return value;
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ fmod (double x, double y)
+ {
+   double value;
+@@ -442,7 +451,7 @@ fmod (double x, double y)
+   return value;
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ drem (double x, double y)
+ {
+   double value;
+@@ -454,7 +463,7 @@ drem (double x, double y)
+   return value;
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ scalb (double x, int n)
+ {
+   double value;
+@@ -466,7 +475,7 @@ scalb (double x, int n)
+   return value;
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ logb (double x)
+ {
+   double exponent;
+@@ -477,7 +486,7 @@ logb (double x)
+   return exponent;
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ ldexp (double x, int n)
+ {
+   double value;
+@@ -489,7 +498,7 @@ ldexp (double x, int n)
+   return value;
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ frexp (double x, int *exp)
+ {
+   double float_exponent;
+@@ -514,7 +523,7 @@ frexp (double x, int *exp)
+   return mantissa;
+ }
+ 
+-__inline extern double
++__math_68881_inline double
+ modf (double x, double *ip)
+ {
+   double temp;
+--- /dev/null
++++ b/src/gcc/config/m68k/mint.h
+@@ -0,0 +1,179 @@
++/* Definitions of target machine for GNU compiler.
++   Atari ST TOS/MiNT.
++   Copyright (C) 1994, 1995, 2007, 2008, 2009, 2010, 2011, 2012
++   Free Software Foundation, Inc.
++
++This file is part of GCC.
++
++GCC is free software; you can redistribute it and/or modify
++it under the terms of the GNU General Public License as published by
++the Free Software Foundation; either version 3, or (at your option)
++any later version.
++
++GCC is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with GCC; see the file COPYING3.  If not see
++<http://www.gnu.org/licenses/>.  */
++
++/* 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
++   define these and need not use asm_fprintf.  */
++
++/* The prefix for register names.  Note that REGISTER_NAMES
++   is supposed to include this prefix. Also note that this is NOT an
++   fprintf format string, it is a literal string */
++
++#undef REGISTER_PREFIX
++#define REGISTER_PREFIX "%"
++
++/* The prefix for local (compiler generated) labels.
++   These labels will not appear in the symbol table.  */
++
++#undef LOCAL_LABEL_PREFIX
++#define LOCAL_LABEL_PREFIX "."
++
++#undef ASM_COMMENT_START
++#define ASM_COMMENT_START "|"
++
++#undef WCHAR_TYPE
++#define WCHAR_TYPE "short unsigned int"
++
++#undef WCHAR_TYPE_SIZE
++#define WCHAR_TYPE_SIZE SHORT_TYPE_SIZE
++
++#undef TARGET_OS_CPP_BUILTINS
++#define TARGET_OS_CPP_BUILTINS()		\
++  do						\
++    {						\
++      builtin_define ("__MINT__");		\
++      builtin_define_std ("atarist");		\
++      builtin_assert ("machine=atari");		\
++      builtin_assert ("system=mint");		\
++      if (TARGET_68881)				\
++	/* non-standard */			\
++	builtin_define ("__M68881__");		\
++    }						\
++  while (0)
++
++/* The following defines are nonstandard
++   and are kept only for compatibility
++   with older versions of GCC for MiNT.  */
++
++#undef CPP_SPEC
++#define CPP_SPEC			\
++  "%{m68000:-D__M68000__} "		\
++  "%{mc68020:-D__M68020__} "		\
++  "%{m68020:-D__M68020__} "		\
++  "%{m68030:-D__M68020__} "		\
++  "%{m68040:-D__M68020__} "		\
++  "%{m68060:-D__M68020__} "		\
++  "%{m68020-40:-D__M68020__} "		\
++  "%{m68020-60:-D__M68020__} "		\
++  "%{!m680*:%{!mc680*:-D__M68000__}} "	\
++  "%{mshort:-D__MSHORT__}"
++
++#define STARTFILE_SPEC	"%{pg|p|profile:gcrt0.o%s;:crt0.o%s}"
++#define LIB_SPEC	"-lc"
++
++/* Every structure or union's size must be a multiple of 2 bytes.  */
++#define STRUCTURE_SIZE_BOUNDARY 16
++
++/* The -g option generates stabs debug information.  */
++#define DBX_DEBUGGING_INFO 1
++
++/* This is the assembler directive to equate two values.  */
++#undef SET_ASM_OP
++#define SET_ASM_OP		"\t.set\t"
++
++/* This is how we tell the assembler that a symbol is weak.  */
++#undef ASM_WEAKEN_LABEL
++#define ASM_WEAKEN_LABEL(FILE,NAME) \
++  do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
++       fputc ('\n', FILE); } while (0)
++
++/* Don't default to pcc-struct-return, because gcc is the only compiler, and
++   we want to retain compatibility with older gcc versions.  */
++#define DEFAULT_PCC_STRUCT_RETURN 0
++
++/* The system headers are C++-aware.  */
++#define NO_IMPLICIT_EXTERN_C
++
++/* By default, the vtable entries are void pointers, the so the alignment
++   is the same as pointer alignment.  The value of this macro specifies
++   the alignment of the vtable entry in bits.  It should be defined only
++   when special alignment is necessary.
++
++   MiNT: The default value of 32 is too much and unsupported by a.out-mintprg.
++*/
++#define TARGET_VTABLE_ENTRY_ALIGN 16
++
++/* If we have a definition of INCOMING_RETURN_ADDR_RTX, assume that
++   the rest of the DWARF 2 frame unwind support is also provided.
++
++   MiNT: DWARF 2 frame unwind is not supported by a.out-mint.
++*/
++#define DWARF2_UNWIND_INFO 0
++
++/* config/m68k.md has an explicit reference to the program counter,
++   prefix this by the register prefix.  */
++
++#define ASM_RETURN_CASE_JUMP				\
++  do {							\
++    if (TARGET_COLDFIRE)				\
++      {							\
++	if (ADDRESS_REG_P (operands[0]))		\
++	  return "jmp %%pc@(2,%0:l)";			\
++	else						\
++	  return "ext%.l %0\n\tjmp %%pc@(2,%0:l)";	\
++      }							\
++    else						\
++      return "jmp %%pc@(2,%0:w)";			\
++  } while (0)
++
++/* The ADDR_DIFF_VEC must exactly follow the previous instruction.  */
++
++#undef ADDR_VEC_ALIGN
++#define ADDR_VEC_ALIGN(ADDR_VEC) 0
++
++/* If defined, a C expression whose value is a string containing the
++   assembler operation to identify the following data as uninitialized global
++   data.  */
++
++#define BSS_SECTION_ASM_OP "\t.bss"
++
++/* A C statement (sans semicolon) to output to the stdio stream
++   FILE the assembler definition of uninitialized global DECL named
++   NAME whose size is SIZE bytes and alignment is ALIGN bytes.
++   Try to use asm_output_aligned_bss to implement this macro.  */
++
++#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
++  asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
++
++/* Disable -fpic and -fPIC since bsr.l _label@PLTPC
++   is unsupported by the assembler.  */
++
++#undef  SUBTARGET_OVERRIDE_OPTIONS
++#define SUBTARGET_OVERRIDE_OPTIONS					\
++do {									\
++  if (flag_pic && !TARGET_PCREL)					\
++      error ("-f%s is not supported on this target",			\
++	     (flag_pic > 1) ? "PIC" : "pic");				\
++} while (0)
++
++
++/* Workaround for GCC bug #35067 about multiple thunks.  */
++
++#undef MAKE_DECL_ONE_ONLY
++#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
++
++/* Avoid requiring -static with -fmudflap like in config/bfin/uclinux.h */
++#define MFWRAP_SPEC " %{fmudflap|fmudflapth: \
++ --wrap=malloc --wrap=free --wrap=calloc --wrap=realloc\
++ --wrap=mmap --wrap=munmap --wrap=alloca\
++ %{fmudflapth: --wrap=pthread_create\
++}} %{fmudflap|fmudflapth: --wrap=main}"
+--- /dev/null
++++ b/src/gcc/config/m68k/t-mint
+@@ -0,0 +1,41 @@
++#
++# Use multiple libraries
++#
++
++MULTILIB_OPTIONS = m68020-60/mcpu=5475 mshort
++
++MULTILIB_DIRNAMES = m68020-60 m5475 mshort
++
++MULTILIB_MATCHES = \
++	m68020-60=m68881 \
++	m68020-60=m68020 \
++	m68020-60=m68020-40 \
++	m68020-60=mc68020 \
++	m68020-60=m68030 \
++	m68020-60=m68040 \
++	m68020-60=m68060 \
++	m68020-60=mcpu?68020 \
++	m68020-60=mcpu?68030 \
++	m68020-60=mcpu?68040 \
++	m68020-60=mcpu?68060 \
++	m68020-60=march?68020 \
++	m68020-60=march?68030 \
++	m68020-60=march?68040 \
++	m68020-60=march?68060 \
++	mcpu?5475=mcfv4e \
++	mcpu?5475=mcpu?5470 \
++	mcpu?5475=mcpu?5471 \
++	mcpu?5475=mcpu?5472 \
++	mcpu?5475=mcpu?5473 \
++	mcpu?5475=mcpu?5474 \
++	mcpu?5475=mcpu?547x \
++	mcpu?5475=mcpu?5480 \
++	mcpu?5475=mcpu?5481 \
++	mcpu?5475=mcpu?5482 \
++	mcpu?5475=mcpu?5483 \
++	mcpu?5475=mcpu?5484 \
++	mcpu?5475=mcpu?5485 \
++	mcpu?5475=mcpu?548x
++
++LIBGCC = stmp-multilib
++INSTALL_LIBGCC = install-multilib
+--- a/src/gcc/config.gcc
++++ b/src/gcc/config.gcc
+@@ -1809,6 +1809,15 @@ m68k-*-linux*)			# Motorola m68k's runni
+ 	fi
+ 	tmake_file="$tmake_file t-slibgcc-libgcc"
+ 	;;
++m68k-*-mint*)
++	default_m68k_cpu=68000
++	default_cf_cpu=5475
++	tm_file="${tm_file} m68k/mint.h"
++	tm_defines="${tm_defines} MOTOROLA=1"
++	tmake_file="m68k/t-floatlib m68k/t-mint"
++	gas=yes
++	gnu_ld=yes
++	;;
+ m68k-*-rtems*)
+ 	default_m68k_cpu=68020
+ 	default_cf_cpu=5206
+--- a/src/libdecnumber/decNumberLocal.h
++++ b/src/libdecnumber/decNumberLocal.h
+@@ -188,7 +188,8 @@ see the files COPYING3 and COPYING.RUNTI
+   #if (DECNUMMAXE != DEC_MAX_EMAX)
+     #error Maximum exponent mismatch
+   #endif
+-  #if (DECNUMMINE != DEC_MIN_EMIN)
++  /* gcc 2.95.3 has bug in "!=" operator for negative constants */
++  #if !(DECNUMMINE == DEC_MIN_EMIN)
+     #error Minimum exponent mismatch
+   #endif
+ 
+--- a/src/libgcc/config.host
++++ b/src/libgcc/config.host
+@@ -388,6 +388,8 @@ m68k-*-linux*)			# Motorola m68k's runni
+ 				# aka the GNU/Linux C library 6.
+ 	tmake_file="$tmake_file m68k/t-linux"
+ 	;;
++m68k-*-mint*)
++	;;
+ m68k-*-rtems*)
+ 	;;
+ mcore-*-elf)
+--- a/src/libiberty/configure.ac
++++ b/src/libiberty/configure.ac
+@@ -201,6 +201,7 @@ esac
+ if [[ "${shared}" = "yes" ]]; then
+   case "${host}" in
+     *-*-cygwin*)	;;
++    *-*-mint*)		;;
+     alpha*-*-linux*)	PICFLAG=-fPIC ;;
+     arm*-*-*)		PICFLAG=-fPIC ;;
+     hppa*-*-*)		PICFLAG=-fPIC ;;
+--- a/src/libiberty/hex.c
++++ b/src/libiberty/hex.c
+@@ -24,7 +24,8 @@ Boston, MA 02110-1301, USA.  */
+ #include "libiberty.h"
+ #include "safe-ctype.h" /* for HOST_CHARSET_ASCII */
+ 
+-#if EOF != -1
++/* gcc 2.95.3 has bug in "!=" operator for negative constants */
++#if !(EOF == -1)
+  #error "hex.c requires EOF == -1"
+ #endif
+ 
+--- a/src/libiberty/safe-ctype.c
++++ b/src/libiberty/safe-ctype.c
+@@ -119,7 +119,8 @@ sets of characters:
+ #include <safe-ctype.h>
+ #include <stdio.h>  /* for EOF */
+ 
+-#if EOF != -1
++/* gcc 2.95.3 has bug in "!=" operator for negative constants */
++#if !(EOF == -1)
+  #error "<safe-ctype.h> requires EOF == -1"
+ #endif
+ 
+--- a/src/libmudflap/mf-hooks2.c
++++ b/src/libmudflap/mf-hooks2.c
+@@ -1667,6 +1667,7 @@ WRAPPER2(int, system, const char *string
+   return system (string);
+ }
+ 
++#ifdef HAVE_DLFCN_H
+ 
+ WRAPPER2(void *, dlopen, const char *path, int flags)
+ {
+@@ -1737,6 +1738,7 @@ WRAPPER2(void *, dlsym, void *handle, ch
+   return p;
+ }
+ 
++#endif /* HAVE_DLFCN_H */
+ 
+ #if defined (HAVE_SYS_IPC_H) && defined (HAVE_SYS_SEM_H) && defined (HAVE_SYS_SHM_H)
+ 
+--- a/src/libmudflap/mf-runtime.h
++++ b/src/libmudflap/mf-runtime.h
+@@ -97,6 +97,7 @@ extern int __mf_set_options (const char
+    instrumented modules are meant to be affected.  */
+ 
+ #ifdef _MUDFLAP
++#ifndef __USER_LABEL_PREFIX__
+ #pragma redefine_extname memcpy __mfwrap_memcpy
+ #pragma redefine_extname memmove __mfwrap_memmove
+ #pragma redefine_extname memset __mfwrap_memset
+@@ -230,6 +231,141 @@ extern int __mf_set_options (const char
+ #pragma redefine_extname getprotoent __mfwrap_getprotoent
+ #pragma redefine_extname getprotobyname __mfwrap_getprotobyname
+ #pragma redefine_extname getprotobynumber __mfwrap_getprotobynumber
++#else
++#pragma redefine_extname memcpy ___mfwrap_memcpy
++#pragma redefine_extname memmove ___mfwrap_memmove
++#pragma redefine_extname memset ___mfwrap_memset
++#pragma redefine_extname memcmp ___mfwrap_memcmp
++#pragma redefine_extname memchr ___mfwrap_memchr
++#pragma redefine_extname memrchr ___mfwrap_memrchr
++#pragma redefine_extname strcpy ___mfwrap_strcpy
++#pragma redefine_extname strncpy ___mfwrap_strncpy
++#pragma redefine_extname strcat ___mfwrap_strcat
++#pragma redefine_extname strncat ___mfwrap_strncat
++#pragma redefine_extname strcmp ___mfwrap_strcmp
++#pragma redefine_extname strcasecmp ___mfwrap_strcasecmp
++#pragma redefine_extname strncmp ___mfwrap_strncmp
++#pragma redefine_extname strncasecmp ___mfwrap_strncasecmp
++#pragma redefine_extname strdup ___mfwrap_strdup
++#pragma redefine_extname strndup ___mfwrap_strndup
++#pragma redefine_extname strchr ___mfwrap_strchr
++#pragma redefine_extname strrchr ___mfwrap_strrchr
++#pragma redefine_extname strstr ___mfwrap_strstr
++#pragma redefine_extname memmem ___mfwrap_memmem
++#pragma redefine_extname strlen ___mfwrap_strlen
++#pragma redefine_extname strnlen ___mfwrap_strnlen
++#pragma redefine_extname bzero ___mfwrap_bzero
++#pragma redefine_extname bcopy ___mfwrap_bcopy
++#pragma redefine_extname bcmp ___mfwrap_bcmp
++#pragma redefine_extname index ___mfwrap_index
++#pragma redefine_extname rindex ___mfwrap_rindex
++#pragma redefine_extname asctime ___mfwrap_asctime
++#pragma redefine_extname ctime ___mfwrap_ctime
++#pragma redefine_extname gmtime ___mfwrap_gmtime
++#pragma redefine_extname localtime ___mfwrap_localtime
++#pragma redefine_extname time ___mfwrap_time
++#pragma redefine_extname strerror ___mfwrap_strerror
++#pragma redefine_extname fopen ___mfwrap_fopen
++#pragma redefine_extname fdopen ___mfwrap_fdopen
++#pragma redefine_extname freopen ___mfwrap_freopen
++#pragma redefine_extname fclose ___mfwrap_fclose
++#pragma redefine_extname fread ___mfwrap_fread
++#pragma redefine_extname fwrite ___mfwrap_fwrite
++#pragma redefine_extname fgetc ___mfwrap_fgetc
++#pragma redefine_extname fgets ___mfwrap_fgets
++#pragma redefine_extname getc ___mfwrap_getc
++#pragma redefine_extname gets ___mfwrap_gets
++#pragma redefine_extname ungetc ___mfwrap_ungetc
++#pragma redefine_extname fputc ___mfwrap_fputc
++#pragma redefine_extname fputs ___mfwrap_fputs
++#pragma redefine_extname putc ___mfwrap_putc
++#pragma redefine_extname puts ___mfwrap_puts
++#pragma redefine_extname clearerr ___mfwrap_clearerr
++#pragma redefine_extname feof ___mfwrap_feof
++#pragma redefine_extname ferror ___mfwrap_ferror
++#pragma redefine_extname fileno ___mfwrap_fileno
++#pragma redefine_extname printf ___mfwrap_printf
++#pragma redefine_extname fprintf ___mfwrap_fprintf
++#pragma redefine_extname sprintf ___mfwrap_sprintf
++#pragma redefine_extname snprintf ___mfwrap_snprintf
++#pragma redefine_extname vprintf ___mfwrap_vprintf
++#pragma redefine_extname vfprintf ___mfwrap_vfprintf
++#pragma redefine_extname vsprintf ___mfwrap_vsprintf
++#pragma redefine_extname vsnprintf ___mfwrap_vsnprintf
++#pragma redefine_extname access ___mfwrap_access
++#pragma redefine_extname remove ___mfwrap_remove
++#pragma redefine_extname fflush ___mfwrap_fflush
++#pragma redefine_extname fseek ___mfwrap_fseek
++#pragma redefine_extname ftell ___mfwrap_ftell
++#pragma redefine_extname rewind ___mfwrap_rewind
++#pragma redefine_extname fgetpos ___mfwrap_fgetpos
++#pragma redefine_extname fsetpos ___mfwrap_fsetpos
++#pragma redefine_extname stat ___mfwrap_stat
++#pragma redefine_extname fstat ___mfwrap_fstat
++#pragma redefine_extname lstat ___mfwrap_lstat
++#pragma redefine_extname mkfifo ___mfwrap_mkfifo
++#pragma redefine_extname setvbuf ___mfwrap_setvbuf
++#pragma redefine_extname setbuf ___mfwrap_setbuf
++#pragma redefine_extname setbuffer ___mfwrap_setbuffer
++#pragma redefine_extname setlinebuf ___mfwrap_setlinebuf
++#pragma redefine_extname opendir ___mfwrap_opendir
++#pragma redefine_extname closedir ___mfwrap_closedir
++#pragma redefine_extname readdir ___mfwrap_readdir
++#pragma redefine_extname recv ___mfwrap_recv
++#pragma redefine_extname recvfrom ___mfwrap_recvfrom
++#pragma redefine_extname recvmsg ___mfwrap_recvmsg
++#pragma redefine_extname send ___mfwrap_send
++#pragma redefine_extname sendto ___mfwrap_sendto
++#pragma redefine_extname sendmsg ___mfwrap_sendmsg
++#pragma redefine_extname setsockopt ___mfwrap_setsockopt
++#pragma redefine_extname getsockopt ___mfwrap_getsockopt
++#pragma redefine_extname accept ___mfwrap_accept
++#pragma redefine_extname bind ___mfwrap_bind
++#pragma redefine_extname connect ___mfwrap_connect
++#pragma redefine_extname gethostname ___mfwrap_gethostname
++#pragma redefine_extname sethostname ___mfwrap_sethostname
++#pragma redefine_extname gethostbyname ___mfwrap_gethostbyname
++#pragma redefine_extname wait ___mfwrap_wait
++#pragma redefine_extname waitpid ___mfwrap_waitpid
++#pragma redefine_extname popen ___mfwrap_popen
++#pragma redefine_extname pclose ___mfwrap_pclose
++#pragma redefine_extname execve ___mfwrap_execve
++#pragma redefine_extname execv ___mfwrap_execv
++#pragma redefine_extname execvp ___mfwrap_execvp
++#pragma redefine_extname system ___mfwrap_system
++#pragma redefine_extname dlopen ___mfwrap_dlopen
++#pragma redefine_extname dlerror ___mfwrap_dlerror
++#pragma redefine_extname dlsym ___mfwrap_dlsym
++#pragma redefine_extname dlclose ___mfwrap_dlclose
++#pragma redefine_extname fopen64 ___mfwrap_fopen64
++#pragma redefine_extname freopen64 ___mfwrap_freopen64
++#pragma redefine_extname stat64 ___mfwrap_stat64
++#pragma redefine_extname fseeko64 ___mfwrap_fseeko64
++#pragma redefine_extname ftello64 ___mfwrap_ftello64
++#pragma redefine_extname semop ___mfwrap_semop
++#pragma redefine_extname semctl ___mfwrap_semctl
++#pragma redefine_extname shmctl ___mfwrap_shmctl
++#pragma redefine_extname shmat ___mfwrap_shmat
++#pragma redefine_extname shmdt ___mfwrap_shmdt
++#pragma redefine_extname __ctype_b_loc ___mfwrap___ctype_b_loc
++#pragma redefine_extname __ctype_toupper_loc ___mfwrap___ctype_toupper_loc
++#pragma redefine_extname __ctype_tolower_loc ___mfwrap___ctype_tolower_loc
++#pragma redefine_extname getlogin ___mfwrap_getlogin
++#pragma redefine_extname cuserid ___mfwrap_cuserid
++#pragma redefine_extname getpwnam ___mfwrap_getpwnam
++#pragma redefine_extname getpwuid ___mfwrap_getpwuid
++#pragma redefine_extname getgrnam ___mfwrap_getgrnam
++#pragma redefine_extname getgrgid ___mfwrap_getgrgid
++#pragma redefine_extname getservent ___mfwrap_getservent
++#pragma redefine_extname getservbyname ___mfwrap_getservbyname
++#pragma redefine_extname getservbyport ___mfwrap_getservbyport
++#pragma redefine_extname gai_strerror ___mfwrap_gai_strerror
++#pragma redefine_extname getmntent ___mfwrap_getmntent
++#pragma redefine_extname inet_ntoa ___mfwrap_inet_ntoa
++#pragma redefine_extname getprotoent ___mfwrap_getprotoent
++#pragma redefine_extname getprotobyname ___mfwrap_getprotobyname
++#pragma redefine_extname getprotobynumber ___mfwrap_getprotobynumber
++#endif /* __USER_LABEL_PREFIX__ */
+ 
+ /* Disable glibc macros.  */
+ #define __NO_STRING_INLINES
+--- a/src/libssp/ssp.c
++++ b/src/libssp/ssp.c
+@@ -63,6 +63,9 @@ see the files COPYING3 and COPYING.RUNTI
+ #ifdef HAVE_SYSLOG_H
+ # include <syslog.h>
+ #endif
++#ifdef __MINT__
++#include <mint/osbind.h>
++#endif
+ 
+ void *__stack_chk_guard = 0;
+ 
+@@ -96,7 +99,10 @@ __guard_setup (void)
+ static void
+ fail (const char *msg1, size_t msg1len, const char *msg3)
+ {
+-#ifdef __GNU_LIBRARY__
++#if defined(__MINT__)
++#define __progname program_invocation_short_name
++#endif
++#if defined(__GNU_LIBRARY__) || defined(__MINT__)
+   extern char * __progname;
+ #else
+   static const char __progname[] = "";
+@@ -139,6 +145,9 @@ fail (const char *msg1, size_t msg1len,
+     syslog (LOG_CRIT, msg3);
+ #endif /* HAVE_SYSLOG_H */
+ 
++#ifdef __MINT__
++  Pterm(127);
++#else
+   /* Try very hard to exit.  Note that signals may be blocked preventing
+      the first two options from working.  The use of volatile is here to
+      prevent optimizers from "knowing" that __builtin_trap is called first,
+@@ -160,6 +169,7 @@ fail (const char *msg1, size_t msg1len,
+           break;
+         }
+   }
++#endif
+ }
+ 
+ void
+--- /dev/null
++++ b/src/libstdc++-v3/config/os/mint/ctype_base.h
+@@ -0,0 +1,59 @@
++// Locale support -*- C++ -*-
++
++// Copyright (C) 1997, 1998, 1999, 2003, 2009, 2010
++// Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 3, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++// GNU General Public License for more details.
++
++// Under Section 7 of GPL version 3, you are granted additional
++// permissions described in the GCC Runtime Library Exception, version
++// 3.1, as published by the Free Software Foundation.
++
++// You should have received a copy of the GNU General Public License and
++// a copy of the GCC Runtime Library Exception along with this program;
++// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
++// <http://www.gnu.org/licenses/>.
++
++//
++// ISO C++ 14882: 22.1  Locales
++//
++
++// Mint C types, taken from mintlib-0.57.3/include/ctype.h
++
++namespace std _GLIBCXX_VISIBILITY(default)
++{
++_GLIBCXX_BEGIN_NAMESPACE_VERSION
++
++  /// @brief  Base class for ctype.
++  struct ctype_base
++  {
++    // Non-standard typedefs.
++    typedef const int* 		__to_type;
++
++    // NB: Offsets into ctype<char>::_M_table force a particular size
++    // on the mask type. Because of this, we don't use an enum.
++    typedef unsigned int 	mask;
++    static const mask upper    	= _CTu;
++    static const mask lower 	= _CTl;
++    static const mask alpha 	= _CTu | _CTl;
++    static const mask digit 	= _CTd;
++    static const mask xdigit 	= _CTx;
++    static const mask space 	= _CTs;
++    static const mask print 	= _CTP;
++    static const mask graph 	= _CTg;
++    static const mask cntrl 	= _CTc;
++    static const mask punct 	= _CTp;
++    static const mask alnum 	= _CTd | _CTu | _CTl ;
++  };
++
++_GLIBCXX_END_NAMESPACE_VERSION
++} // namespace
+--- /dev/null
++++ b/src/libstdc++-v3/config/os/mint/ctype_inline.h
+@@ -0,0 +1,76 @@
++// Locale support -*- C++ -*-
++
++// Copyright (C) 2000, 2003, 2009, 2010 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 3, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++// GNU General Public License for more details.
++
++// Under Section 7 of GPL version 3, you are granted additional
++// permissions described in the GCC Runtime Library Exception, version
++// 3.1, as published by the Free Software Foundation.
++
++// You should have received a copy of the GNU General Public License and
++// a copy of the GCC Runtime Library Exception along with this program;
++// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
++// <http://www.gnu.org/licenses/>.
++
++/** @file bits/ctype_inline.h
++ *  This is an internal header file, included by other library headers.
++ *  Do not attempt to use it directly. @headername{locale}
++ */
++
++//
++// ISO C++ 14882: 22.1  Locales
++//
++
++// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
++// functions go in ctype.cc
++
++// Mint C types, taken from mintlib-0.57.3/include/ctype.h
++
++namespace std _GLIBCXX_VISIBILITY(default)
++{
++_GLIBCXX_BEGIN_NAMESPACE_VERSION
++
++  bool
++  ctype<char>::
++  is(mask __m, char __c) const
++  { return _ctype[(unsigned char)((__c) + 1)] & __m; }
++
++  const char*
++  ctype<char>::
++  is(const char* __low, const char* __high, mask* __vec) const
++  {
++    while (__low < __high)
++      *__vec++ = _ctype[(*__low++) + 1] ;
++    return __high;
++  }
++
++  const char*
++  ctype<char>::
++  scan_is(mask __m, const char* __low, const char* __high) const
++  {
++    while (__low < __high && !this->is(__m, *__low))
++      ++__low;
++    return __low;
++  }
++
++  const char*
++  ctype<char>::
++  scan_not(mask __m, const char* __low, const char* __high) const
++  {
++    while (__low < __high && this->is(__m, *__low) != 0)
++      ++__low;
++    return __low;
++  }
++
++_GLIBCXX_END_NAMESPACE_VERSION
++} // namespace
+--- /dev/null
++++ b/src/libstdc++-v3/config/os/mint/ctype_noninline.h
+@@ -0,0 +1,92 @@
++// Locale support -*- C++ -*-
++
++// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2009, 2010
++//  Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 3, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++// GNU General Public License for more details.
++
++// Under Section 7 of GPL version 3, you are granted additional
++// permissions described in the GCC Runtime Library Exception, version
++// 3.1, as published by the Free Software Foundation.
++
++// You should have received a copy of the GNU General Public License and
++// a copy of the GCC Runtime Library Exception along with this program;
++// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
++// <http://www.gnu.org/licenses/>.
++
++/** @file bits/ctype_noninline.h
++ *  This is an internal header file, included by other library headers.
++ *  Do not attempt to use it directly. @headername{locale}
++ */
++
++//
++// ISO C++ 14882: 22.1  Locales
++//
++
++// Information as gleaned from /usr/include/ctype.h
++
++  const ctype_base::mask*
++  ctype<char>::classic_table() throw()
++  { return 0; }
++
++  ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
++		     size_t __refs)
++  : facet(__refs), _M_del(__table != 0 && __del),
++  _M_toupper(NULL), _M_tolower(NULL),
++  _M_table(__table ? __table : classic_table())
++  {
++    memset(_M_widen, 0, sizeof(_M_widen));
++    _M_widen_ok = 0;
++    memset(_M_narrow, 0, sizeof(_M_narrow));
++    _M_narrow_ok = 0;
++  }
++
++  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
++  : facet(__refs), _M_del(__table != 0 && __del),
++  _M_toupper(NULL), _M_tolower(NULL),
++  _M_table(__table ? __table : classic_table())
++  {
++    memset(_M_widen, 0, sizeof(_M_widen));
++    _M_widen_ok = 0;
++    memset(_M_narrow, 0, sizeof(_M_narrow));
++    _M_narrow_ok = 0;
++  }
++
++  char
++  ctype<char>::do_toupper(char __c) const
++  { return ::toupper((int) __c); }
++
++  const char*
++  ctype<char>::do_toupper(char* __low, const char* __high) const
++  {
++    while (__low < __high)
++      {
++	*__low = ::toupper((int) *__low);
++	++__low;
++      }
++    return __high;
++  }
++
++  char
++  ctype<char>::do_tolower(char __c) const
++  { return ::tolower((int) __c); }
++
++  const char*
++  ctype<char>::do_tolower(char* __low, const char* __high) const
++  {
++    while (__low < __high)
++      {
++	*__low = ::tolower((int) *__low);
++	++__low;
++      }
++    return __high;
++  }
+--- /dev/null
++++ b/src/libstdc++-v3/config/os/mint/os_defines.h
+@@ -0,0 +1,36 @@
++// Specific definitions for generic platforms  -*- C++ -*-
++
++// Copyright (C) 2000, 2009, 2010 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 3, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++// GNU General Public License for more details.
++
++// Under Section 7 of GPL version 3, you are granted additional
++// permissions described in the GCC Runtime Library Exception, version
++// 3.1, as published by the Free Software Foundation.
++
++// You should have received a copy of the GNU General Public License and
++// a copy of the GCC Runtime Library Exception along with this program;
++// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
++// <http://www.gnu.org/licenses/>.
++
++/** @file bits/os_defines.h
++ *  This is an internal header file, included by other library headers.
++ *  Do not attempt to use it directly. @headername{iosfwd}
++ */
++
++#ifndef _GLIBCXX_OS_DEFINES
++#define _GLIBCXX_OS_DEFINES 1
++
++// System-specific #define, typedefs, corrections, etc, go here.  This
++// file will come before all others.
++
++#endif
+--- a/src/libstdc++-v3/configure.host
++++ b/src/libstdc++-v3/configure.host
+@@ -258,6 +258,10 @@ case "${host_os}" in
+     error_constants_dir="os/mingw32"
+     OPT_LDFLAGS="${OPT_LDFLAGS} \$(lt_host_flags)"
+     ;;
++  mint*)
++    SECTION_FLAGS="${SECTION_FLAGS} -D_GNU_SOURCE"
++    os_include_dir="os/mint"
++    ;;
+   netbsd*)
+     os_include_dir="os/bsd/netbsd"
+     ;;
+--- a/src/libstdc++-v3/crossconfig.m4
++++ b/src/libstdc++-v3/crossconfig.m4
+@@ -141,7 +141,7 @@ case "${host}" in
+ 	;;
+     esac
+     ;;
+-  *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
++  *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu | *-mint*)
+     GLIBCXX_CHECK_COMPILER_FEATURES
+     GLIBCXX_CHECK_LINKER_FEATURES
+     GLIBCXX_CHECK_MATH_SUPPORT
--- gcc-4.6-4.6.3/debian/patches/libffi-m68k.diff
+++ gcc-4.6-4.6.3/debian/patches/libffi-m68k.diff
@@ -1,5 +1,16 @@
+# DP: Apply #660525 fix to in-tree libffi
+
 --- a/src/libffi/src/m68k/sysv.S
 +++ b/src/libffi/src/m68k/sysv.S
+@@ -87,7 +87,7 @@
+ 
+ 	| If the return value pointer is NULL, assume no return value.
+ 	| NOTE: On the mc68000, tst on an address register is not supported.
+-#if defined(__mc68000__) && !defined(__mcoldfire__)
++#if !defined(__mc68020__) && !defined(__mc68030__) && !defined(__mc68040__) && !defined(__mc68060__) && !defined(__mcoldfire__)
+ 	cmp.w	#0, %a1
+ #else
+ 	tst.l	%a1
 @@ -109,7 +109,7 @@
  retfloat:
  	btst	#2,%d2

--- End Message ---
--- Begin Message ---
Source: gcc-4.6
Source-Version: 4.6.3-15

We believe that the bug you reported is fixed in the latest version of
gcc-4.6, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 694112@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Matthias Klose <doko@debian.org> (supplier of updated gcc-4.6 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Mon, 14 Jan 2013 19:37:53 +0100
Source: gcc-4.6
Binary: gcc-4.6-base gcc-4.6 gcc-4.6-multilib gcc-4.6-plugin-dev gcc-4.6-hppa64 gcc-4.6-spu g++-4.6-spu gfortran-4.6-spu cpp-4.6 gcc-4.6-locales g++-4.6 g++-4.6-multilib libmudflap0-4.6-dev gobjc++-4.6 gobjc++-4.6-multilib gobjc-4.6 gobjc-4.6-multilib libobjc3 libobjc3-dbg lib64objc3 lib64objc3-dbg lib32objc3 lib32objc3-dbg libn32objc3 libn32objc3-dbg gfortran-4.6 gfortran-4.6-multilib libstdc++6-4.6-dev libstdc++6-4.6-pic libstdc++6-4.6-dbg lib32stdc++6-4.6-dbg lib64stdc++6-4.6-dbg libn32stdc++6-4.6-dbg libstdc++6-4.6-doc gcc-4.6-soft-float gcc-4.6-source
Architecture: source all amd64
Version: 4.6.3-15
Distribution: unstable
Urgency: low
Maintainer: Debian GCC Maintainers <debian-gcc@lists.debian.org>
Changed-By: Matthias Klose <doko@debian.org>
Description: 
 cpp-4.6    - GNU C preprocessor
 g++-4.6    - GNU C++ compiler
 g++-4.6-multilib - GNU C++ compiler (multilib files)
 g++-4.6-spu - SPU cross-compiler (C++ compiler)
 gcc-4.6    - GNU C compiler
 gcc-4.6-base - GCC, the GNU Compiler Collection (base package)
 gcc-4.6-hppa64 - GNU C compiler (cross compiler for hppa64)
 gcc-4.6-locales - GCC, the GNU compiler collection (native language support files)
 gcc-4.6-multilib - GNU C compiler (multilib files)
 gcc-4.6-plugin-dev - Files for GNU GCC plugin development.
 gcc-4.6-soft-float - GCC soft-floating-point gcc libraries (ARM)
 gcc-4.6-source - Source of the GNU Compiler Collection
 gcc-4.6-spu - SPU cross-compiler (preprocessor and C compiler)
 gfortran-4.6 - GNU Fortran compiler
 gfortran-4.6-multilib - GNU Fortran compiler (multilib files)
 gfortran-4.6-spu - SPU cross-compiler (Fortran compiler)
 gobjc++-4.6 - GNU Objective-C++ compiler
 gobjc++-4.6-multilib - GNU Objective-C++ compiler (multilib files)
 gobjc-4.6  - GNU Objective-C compiler
 gobjc-4.6-multilib - GNU Objective-C compiler (multilib files)
 lib32objc3 - Runtime library for GNU Objective-C applications (32bit)
 lib32objc3-dbg - Runtime library for GNU Objective-C applications (32 bit debug sy
 lib32stdc++6-4.6-dbg - GNU Standard C++ Library v3 (debugging files)
 lib64objc3 - Runtime library for GNU Objective-C applications (64bit)
 lib64objc3-dbg - Runtime library for GNU Objective-C applications (64 bit debug sy
 lib64stdc++6-4.6-dbg - GNU Standard C++ Library v3 (debugging files)
 libmudflap0-4.6-dev - GCC mudflap support libraries (development files)
 libn32objc3 - Runtime library for GNU Objective-C applications (n32)
 libn32objc3-dbg - Runtime library for GNU Objective-C applications (n32 debug symbo
 libn32stdc++6-4.6-dbg - GNU Standard C++ Library v3 (debugging files)
 libobjc3   - Runtime library for GNU Objective-C applications
 libobjc3-dbg - Runtime library for GNU Objective-C applications (debug symbols)
 libstdc++6-4.6-dbg - GNU Standard C++ Library v3 (debugging files)
 libstdc++6-4.6-dev - GNU Standard C++ Library v3 (development files)
 libstdc++6-4.6-doc - GNU Standard C++ Library v3 (documentation files)
 libstdc++6-4.6-pic - GNU Standard C++ Library v3 (shared library subset kit)
Closes: 659556 694112 695654
Changes: 
 gcc-4.6 (4.6.3-15) unstable; urgency=low
 .
   * Update to SVN 20130114 (r195168) from the gcc-4_6-branch.
     - Fix PR bootstrap/55571, PR target/53789, PR c++/55804,
       PR tree-optimization/55355, PR target/54121 (sparc), PR c++/55032,
       PR middle-end/50283, PR target/55195, PR libgcc/48076, PR c++/55877,
       PR c++/55032, PR c++/55245, PR c++/54883, PR c++/55249, PR c++/53862,
       PR c++/51662, PR target/53912 (mingw), PR ada/54614, PR fortran/42769,
       PR fortran/45836, PR fortran/45900, PR fortran/55827, PR fortran/55618.
     - Backport multiarch patches, including powerpcspu fix. Closes: #695654.
 .
   [ Matthias Klose ]
   * For cross builds, fix libc6 dependencies for non-default multilib packages.
   * Don't ship libiberty.a in gcc-4.6-hppa64. Closes: #659556.
 .
   [ Thorsten Glaser ]
   * libffi: Update the libffi-m68k patch from upstream and apply
     further fixes from upstream as well as upstreamed from #660525.
   * Ada: debian/patches/ada-libgnatprj.diff: Add missing wildcard
     to the m68k-*-linux* target (fixes building shared libraries).
   * Ada: Enable on m68k Linux.
   * Backport: trunk r187181, r187234, r187714 to speed up genattrtab,
     apply for m68k only.
   * Backport: atomic builtin backend code for Linux/m68k from trunk.
   * PR52714: Add proposed fix (use gcc-4.5 version of PR45695 fix),
     apply for m68k only.
   * m68k: PR40134: Add t-slibgcc-libgcc for m68k-linux.
   * Cross: When building a cross-compiler, re-enable building the
     runtime packages that were disabled because gcc-4.7 provides
     them for the main archive to keep them self-contained.
   * mint-m68k: Add the FreeMiNT patches from Vincent Rivière to
     enable building DEB_STAGE=stage1 cross-compilers, which are
     needed for developing bootloaders on m68k.
   * Closes: #694112.
Checksums-Sha1: 
 f3e6a0b9a2460817b2346d3e20b09f2292a897d0 4496 gcc-4.6_4.6.3-15.dsc
 41e325817a8f8ab5f2ae18d91c4dabaa2f7dfde6 1172547 gcc-4.6_4.6.3-15.diff.gz
 639e79bceeaa55493849a74b9d7500b523be021e 58187772 gcc-4.6-source_4.6.3-15_all.deb
 329067fe975a67dad05752d89ad7dc263b873dda 22165396 libstdc++6-4.6-doc_4.6.3-15_all.deb
 03b22704a6cbce452e0e78615f4b62c477fcd1ae 2633354 gcc-4.6-locales_4.6.3-15_all.deb
 1b2042b57c94ab3cc6c58d23eda2fd9142f0f96f 142686 gcc-4.6-base_4.6.3-15_amd64.deb
 0e0753a13cdd0bc7d133d00e08b5c6cf1a1ba669 4827416 cpp-4.6_4.6.3-15_amd64.deb
 a93697b45b3da7cbb2cd40fd50c134d296baea91 126278 libmudflap0-4.6-dev_4.6.3-15_amd64.deb
 333cf574966b0baf3c9c4ea6e43689de65d3fe82 868 gobjc++-4.6-multilib_4.6.3-15_amd64.deb
 eec11054793f9d476745138322bae24b6c2fafb9 5177648 gobjc++-4.6_4.6.3-15_amd64.deb
 d5a5345391af236ed1324a37f312cbcc5531f284 200394 gobjc-4.6-multilib_4.6.3-15_amd64.deb
 2e8dbdc49456b3fd7e41e90d2378a4c0e4b3f20e 5033086 gobjc-4.6_4.6.3-15_amd64.deb
 4544ad9a55dddc3ba92c35933b2e0d87291a285f 184314 libobjc3_4.6.3-15_amd64.deb
 e686c8cf471bee1642401395ce9dddcb9f7c0c6f 362434 libobjc3-dbg_4.6.3-15_amd64.deb
 a241545681a86305db417c26c0fe317b2a28d446 182974 lib32objc3_4.6.3-15_amd64.deb
 871ac31be6c6aea360c3f4d3c5797de0cecdee01 331792 lib32objc3-dbg_4.6.3-15_amd64.deb
 8386d3decb4e2f06d1b3c4e5d6de059774c1770f 1011486 g++-4.6-multilib_4.6.3-15_amd64.deb
 5fc02898fe6b63eda1067409ffde96d8115ce88f 6942710 g++-4.6_4.6.3-15_amd64.deb
 9ce3241763593cc3152c4a4e263c5d1f20c8c74d 5360078 lib32stdc++6-4.6-dbg_4.6.3-15_amd64.deb
 0772f216fd301a529884e23ef94f87e982bfa01f 1663198 libstdc++6-4.6-dev_4.6.3-15_amd64.deb
 7deaabc4edaaa424ca21a4f3e07d63b6fc689392 503068 libstdc++6-4.6-pic_4.6.3-15_amd64.deb
 911e3af34bb326f2ac0036c29298007dfc076285 5587912 libstdc++6-4.6-dbg_4.6.3-15_amd64.deb
 12b8c3b499783cee0c75a3716b9ac55052ff3b19 405656 gfortran-4.6-multilib_4.6.3-15_amd64.deb
 04f8ea75b18b8e181348cde4a05d6ea2fa19f7a7 5566420 gfortran-4.6_4.6.3-15_amd64.deb
 29c0dd5a7166e5e33e792ffee6dad17aa79535d3 2531546 gcc-4.6-multilib_4.6.3-15_amd64.deb
 74157b225a709f7c2d60ad6aab8e010035de9716 842612 gcc-4.6-plugin-dev_4.6.3-15_amd64.deb
 4d38497119ab7b509491bd90c3e430e40e3db3ab 7334000 gcc-4.6_4.6.3-15_amd64.deb
Checksums-Sha256: 
 eb7a87883d253e2bf7dd71cb609c1a66ce17ca8bc2ec6622861279183df490a4 4496 gcc-4.6_4.6.3-15.dsc
 7086a6bad3c75c1e01fdacbed04883a2762f9d1e282405416628a5bd131a56d2 1172547 gcc-4.6_4.6.3-15.diff.gz
 a59ad9a1297a99d2006364145d2bf357ddcbce72bbf85e523593b9b5d4712002 58187772 gcc-4.6-source_4.6.3-15_all.deb
 b7372dc93b7d6e716e657a3138cb06ab9534c76688e34c9039060eeb69ccd83d 22165396 libstdc++6-4.6-doc_4.6.3-15_all.deb
 1285bf3baf630c9d11aca182ad857d891729370f9b7c8fdacec1610cbabe36d2 2633354 gcc-4.6-locales_4.6.3-15_all.deb
 e8da4d71939c50a40c6f4cf07b09347e191dddf749273b60ce396800e7ba39fb 142686 gcc-4.6-base_4.6.3-15_amd64.deb
 1ef30cbad69872a6c1e904bfee8f75665eb6c7f4b7ae124ba4cd20b43e42b76d 4827416 cpp-4.6_4.6.3-15_amd64.deb
 aebaed3424444119f1051c507e1917b294d94e55c2dcea4bcaffce5daefb4a04 126278 libmudflap0-4.6-dev_4.6.3-15_amd64.deb
 c327ac563df174658a3fa5327d62965deb8dc70786529c4b6bea6e23bd868e1a 868 gobjc++-4.6-multilib_4.6.3-15_amd64.deb
 6cffcf3c0a666e7e7ec0fcc8e803a6fe4c085917cae3f92d4f95dff56be0f9d5 5177648 gobjc++-4.6_4.6.3-15_amd64.deb
 b3296d4f9f230368bbe5964d03ed0d4500114e6c25f999a966dbc975a5846dfb 200394 gobjc-4.6-multilib_4.6.3-15_amd64.deb
 7dd93df1df5651d54e497e39cdea06e921a6b316a35a9b29b085673876faba47 5033086 gobjc-4.6_4.6.3-15_amd64.deb
 74adb6cbbfd09d9329f797f0c2f69914e66d93c6909aa9efe6a528321d46883b 184314 libobjc3_4.6.3-15_amd64.deb
 c7b430edf6d68ab9faaaa1f708a46dd33f4b0705c75ddf049d9b25c249ddcaaa 362434 libobjc3-dbg_4.6.3-15_amd64.deb
 2e62aa3409d988e74d3412f70527d40725b972ed61649f29175fdc7be6a15a6f 182974 lib32objc3_4.6.3-15_amd64.deb
 248ae451bc4e8e937417ec46d7076af3565e7a41a8502f9c9f8315507347f446 331792 lib32objc3-dbg_4.6.3-15_amd64.deb
 6d424a8431db098c4bd5386fa0d62c7618b23580d1c3c0357a58a6e15fb7c17f 1011486 g++-4.6-multilib_4.6.3-15_amd64.deb
 6e2c51d47d610850982611dd0c3c8e15f17d6904498ff703a49b3202ac53d9f0 6942710 g++-4.6_4.6.3-15_amd64.deb
 d818434b6763588a4b41c2f95cc0dbb917acc9dc2d47c95dce991c4f8f843ed4 5360078 lib32stdc++6-4.6-dbg_4.6.3-15_amd64.deb
 c126a0773a11f989dd67b4f872f3fcc21a841eddd321798467a133129f7c6ab7 1663198 libstdc++6-4.6-dev_4.6.3-15_amd64.deb
 0c903c841013952e14a66d4d9d5f55c40c70033f0856e29a7754de22e7734248 503068 libstdc++6-4.6-pic_4.6.3-15_amd64.deb
 4615cd9360b11ee2a885535c76432785ec09271759c3dd2ea5a796d41eecf9f6 5587912 libstdc++6-4.6-dbg_4.6.3-15_amd64.deb
 c25d4334a53f56f7d1718cc7ca3b29d4dce27bcca899134c76ff58b423a4fb71 405656 gfortran-4.6-multilib_4.6.3-15_amd64.deb
 9b19a072281759177b0e9db4eb02fd48214b2617e38d553259bf135b7d64fbec 5566420 gfortran-4.6_4.6.3-15_amd64.deb
 ed3c5108f1e8f88f3ef1ca604981ba5351fc56b45297d27abdef5ab69d6622fa 2531546 gcc-4.6-multilib_4.6.3-15_amd64.deb
 8c338c9c3f90f0c1948b42283fc3c28519637e17569f0658b15d34f3ca8acba6 842612 gcc-4.6-plugin-dev_4.6.3-15_amd64.deb
 ef734eed59d8fb065fb2670ec875a2213496673419a7e2b21ab82955feb66b9f 7334000 gcc-4.6_4.6.3-15_amd64.deb
Files: 
 a7b4b50b8d29c2b5c15b5bdaec1925c1 4496 devel optional gcc-4.6_4.6.3-15.dsc
 7561688b91100f4a8725399c297db6b8 1172547 devel optional gcc-4.6_4.6.3-15.diff.gz
 fa0c9248db47fdc95d0d0c08c90d8c0e 58187772 devel optional gcc-4.6-source_4.6.3-15_all.deb
 4741376a6c0a4628a6ff73b363da42b8 22165396 doc optional libstdc++6-4.6-doc_4.6.3-15_all.deb
 da2714b80d9ccc1fe451eb6079b3ce1e 2633354 devel optional gcc-4.6-locales_4.6.3-15_all.deb
 fd0cc18567f4b47af736b94e2091f36c 142686 libs required gcc-4.6-base_4.6.3-15_amd64.deb
 23e072c623495711d7d21a5737ca529f 4827416 interpreters optional cpp-4.6_4.6.3-15_amd64.deb
 5903d1a4a52778f2565676d5caa4b6e7 126278 libdevel optional libmudflap0-4.6-dev_4.6.3-15_amd64.deb
 df0428c7a48082625699d1c40cac7b32 868 devel optional gobjc++-4.6-multilib_4.6.3-15_amd64.deb
 4380e7fe1e9f36e5540e99d2c0d1369a 5177648 devel optional gobjc++-4.6_4.6.3-15_amd64.deb
 747e14d1b9a22bf77613edf8ec8fa164 200394 devel optional gobjc-4.6-multilib_4.6.3-15_amd64.deb
 b205fa0c8e6ea4f3513699884d68ade8 5033086 devel optional gobjc-4.6_4.6.3-15_amd64.deb
 e1e722b2e08ae2a8b7127ad5b6151c07 184314 libs optional libobjc3_4.6.3-15_amd64.deb
 49f2f0f8987d5e1f5ac5058ca64890c3 362434 debug extra libobjc3-dbg_4.6.3-15_amd64.deb
 098071cb8ceda70b9b13632af48c3891 182974 libs optional lib32objc3_4.6.3-15_amd64.deb
 78c39766c279e22123f34cc4233bdb6c 331792 debug extra lib32objc3-dbg_4.6.3-15_amd64.deb
 5d7407ae27deb4974a99ae8214441cd1 1011486 devel optional g++-4.6-multilib_4.6.3-15_amd64.deb
 a27b83f4fc52688ae66f509886904723 6942710 devel optional g++-4.6_4.6.3-15_amd64.deb
 e236f39694916eff797f45072fb8a5e3 5360078 debug extra lib32stdc++6-4.6-dbg_4.6.3-15_amd64.deb
 ba32a1f113c499e77d931e39e7fe4620 1663198 libdevel optional libstdc++6-4.6-dev_4.6.3-15_amd64.deb
 98ce42fa1753b2e42d20d8bce7797ce7 503068 libdevel extra libstdc++6-4.6-pic_4.6.3-15_amd64.deb
 620989d01ea9a523b56de16b39f2184c 5587912 debug extra libstdc++6-4.6-dbg_4.6.3-15_amd64.deb
 ac2b4858319afed26c62201f62163f15 405656 devel optional gfortran-4.6-multilib_4.6.3-15_amd64.deb
 525ac357836e2468baf683c5ab0d4604 5566420 devel optional gfortran-4.6_4.6.3-15_amd64.deb
 adff0234919b65c73b1a8ac7eb1ca9ad 2531546 devel optional gcc-4.6-multilib_4.6.3-15_amd64.deb
 1d578bb05d5f2185be78853464d69e24 842612 devel optional gcc-4.6-plugin-dev_4.6.3-15_amd64.deb
 02ac7dc1df14c6356679edff9f99caa9 7334000 devel optional gcc-4.6_4.6.3-15_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAlD0XDQACgkQStlRaw+TLJyXEgCgpBKyMdpF6qpcVZQulSo6XRbR
+Q4AoJTCEnhkluZDK2nEIhs4d8tUNwBa
=6HkE
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: