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

Re: [MiNT] Cross Compiler



Le Wed, 16 Mar 2005 01:22:26 -0600
"Evan K. Langlois" <Evan@CoolRunningConcepts.com> a écrit:

> So, I went ahead and started with binutils - tried two different patch
> sets I found on the net.  One almost worked with some minor fixes, but
> bfd_link_info structure seems to have changed, so I started over with
> the patch set on the freemint site and it gave so many failures during
> patching that I quickly gave up and tried that patch set on the
> sources that were in the same directory - not much older.  Well, it
> patches just fine, but I quickly get a nasty error as soon as it tries
> to compile. Argh!

I made a first patch for binutils 2.15, but atm, using ld (the linker)
produces errors.

> I've done cross compilers before, but not in awhile, and not for the
> ST. Could someone whos got more experience in this shed some light on
> this? Also, what are the chances of actually getting GCC 3.4 to work,
> and why not (ie: what has changed)?

I also made a patch for gcc 3.4.3, but only the C compiler works. I need
help for C++.

I know Frank want to keep with current binutils 2.13 and gcc 2.95 for
MiNT. But cross-compilers users must be able to use the more recent
versions.

-- 
Patrice Mandin
WWW: http://membres.lycos.fr/pmandin/
Programmeur Linux, Atari
Spécialité: Développement, jeux

Attachment: binutils-2.15-mint.diff.gz
Description: Binary data

diff -Naur gcc-3.4.3-orig/config/mt-mint gcc-3.4.3/config/mt-mint
--- gcc-3.4.3-orig/config/mt-mint	1970-01-01 01:00:00.000000000 +0100
+++ gcc-3.4.3/config/mt-mint	2001-05-22 03:17:23.000000000 +0200
@@ -0,0 +1 @@
+CXXFLAGS_FOR_TARGET = $(CXXFLAGS) -D_GNU_SOURCE
diff -Naur gcc-3.4.3-orig/gcc/config/m68k/mint.h gcc-3.4.3/gcc/config/m68k/mint.h
--- gcc-3.4.3-orig/gcc/config/m68k/mint.h	1970-01-01 01:00:00.000000000 +0100
+++ gcc-3.4.3/gcc/config/m68k/mint.h	2005-02-18 20:38:14.000000000 +0100
@@ -0,0 +1,224 @@
+/* Definitions of target machine for GNU compiler.
+   Atari ST TOS/MiNT.
+   Copyright (C) 1994, 1995 Free Software Foundation, Inc.
+
+This file is part of GNU CC.
+
+GNU CC 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 1, or (at your option)
+any later version.
+
+GNU CC 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 GNU CC; see the file COPYING.  If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#define TARGET_OS_CPP_BUILTINS()	\
+	do	\
+	{	\
+		builtin_define_std ("atarist");	\
+		builtin_define ("__MINT__");	\
+		builtin_assert ("machine=atari");	\
+		builtin_assert ("system=mint");	\
+	}						\
+	while (0)
+
+#define TARGET_DEFAULT	0
+
+/* Pass the architecture flags to the assembler. */ 
+#define COMMON_ASM_SPEC	\
+  "%{mc68000:-m68000}"	\
+  "%{m68000}"	\
+  "%{mc68020:-m68020}"	\
+  "%{m68020*:-m68020}"	\
+  "%{m68030}"	\
+  "%{m68040}"	\
+  "%{m68060}"	\
+  "%{m68881}%{mno-68881}"	\
+  "%{m68851}%{mno-68851}"	\
+  "%{m68302}%{mno-68302}"	\
+  "%{m68332}%{mno-68332}"
+
+#define ASM_SPEC COMMON_ASM_SPEC "%{!m680*:%{!mc680*:-m68000}}"
+
+#undef SUBTARGET_SWITCHES
+#define SUBTARGET_SWITCHES	\
+  { "int", 010000},	\
+  { "noint", -010000},
+
+#define COMMON_CPP_SPEC \
+  "%{mshort:-D__MSHORT__}"
+
+#define CPP_SPEC \
+  "%{m68000:-D__M68000__ -D__mc68000__ %{!ansi:-Dmc68000}} " \
+  "%{mc68020:-D__M68020__ -D__mc68020__ %{!ansi:-Dmc68020}} " \
+  "%{m68020:-D__M68020__ -D__mc68020__ %{!ansi:-Dmc68020}} " \
+  "%{m68030:-D__M68020__ -D__mc68020__ %{!ansi:-Dmc68020}} " \
+  "%{m68040:-D__M68020__ -D__mc68020__ %{!ansi:-Dmc68020}} " \
+  "%{m68060:-D__M68020__ -D__mc68020__ %{!ansi:-Dmc68020}} " \
+  "%{m68020-40:-D__M68020__ -D__mc68020__ %{!ansi:-Dmc68020}} " \
+  "%{m68020-60:-D__M68020__ -D__mc68020__ %{!ansi:-Dmc68020}} " \
+  "%{!m680*:%{!mc680*:-D__M68000__ -D__mc68000__ %{!ansi:-Dmc68000}}} " \
+  "%{m68881:-D__M68881__} " \
+  COMMON_CPP_SPEC
+
+#define __LIBC_MULTILIB ""
+
+#define STARTFILE_SPEC	"%{pg:g}crt0.o%s"
+#define LIB_SPEC	"-lc%{g:_g}%{pg:_p}"__LIBC_MULTILIB
+#define LIBGCC_SPEC	"-lgcc"
+#define LINK_SPEC	""
+#define LINKER_NAME	"ld"
+
+#define MULTILIB_DEFAULTS { "m68000" }
+
+#define HAVE_ATEXIT
+
+#undef PTRDIFF_TYPE
+#define PTRDIFF_TYPE	"long int"
+
+#undef SIZE_TYPE
+#define SIZE_TYPE	"long unsigned int"
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE	"short unsigned int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE	16
+
+/* Every structure or union's size must be a multiple of 2 bytes.  */
+#define STRUCTURE_SIZE_BOUNDARY 16
+
+/*
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
+*/
+
+#define DBX_DEBUGGING_INFO 1
+
+/*
+#ifdef abort
+#undef abort
+#define abort fancy_abort
+#endif
+*/
+
+/* Allow folding division by zero.  */
+#define REAL_INFINITY
+
+/* Generate calls to memcpy, memcmp and memset.  */
+#define TARGET_MEM_FUNCTIONS
+
+/* The value of `EDOM' on the target machine.  */
+/*
+#define TARGET_EDOM 89
+*/
+
+/* This is how to create a rtl expression that refers to the global
+   "variable" `errno'.  */
+/*
+#define GEN_ERRNO_RTX \
+  gen_rtx (MEM, TARGET_SHORT ? HImode : SImode, \
+	   gen_rtx (SYMBOL_REF, Pmode, "errno"))
+*/
+
+#define FUNCTION_VALUEX(MODE)					\
+  gen_rtx (REG, (MODE), (TARGET_68881 && FLOAT_MODE_P (MODE) ? 16 : 0))
+
+/*
+#undef FUNCTION_VALUE
+#define FUNCTION_VALUE(VALTYPE,FUNC) FUNCTION_VALUEX (TYPE_MODE (VALTYPE))
+*/
+/*
+#undef LIBCALL_VALUE
+#define LIBCALL_VALUE(MODE) FUNCTION_VALUEX (MODE)
+*/
+
+/* 1 if N is a possible register number for a function value.  */
+
+#undef FUNCTION_VALUE_REGNO_P
+#define FUNCTION_VALUE_REGNO_P(N) ((N) == 0 || (TARGET_68881 && (N) == 16))
+
+/* Define this to be true when FUNCTION_VALUE_REGNO_P is true for
+   more than one register.  */
+
+#undef NEEDS_UNTYPED_CALL
+#define NEEDS_UNTYPED_CALL (TARGET_68881)
+
+/* Output a float value (represented as a C double) as an immediate operand.
+   This macro is a 68k-specific macro.  */
+  
+#if 0
+#undef ASM_OUTPUT_FLOAT_OPERAND
+#ifdef AS_BUG_FLOATING_CONSTANT
+#define ASM_OUTPUT_FLOAT_OPERAND(CODE,FILE,VALUE)		\
+ do { long l;							\
+      REAL_VALUE_TO_TARGET_SINGLE (VALUE, l);			\
+      fprintf ((FILE), "&0x%lx", l);				\
+     } while (0)
+#else
+#define ASM_OUTPUT_FLOAT_OPERAND(CODE,FILE,VALUE)		\
+ do {								\
+      if (CODE == 'f')						\
+        {							\
+          char dstr[30];					\
+      	  real_to_decimal (dstr, &(VALUE), sizeof (dstr), 9, 0); \
+          fprintf ((FILE), "&0f%s", dstr);			\
+        }							\
+      else							\
+        {							\
+          long l;						\
+          REAL_VALUE_TO_TARGET_SINGLE (VALUE, l);		\
+          fprintf ((FILE), "&0x%lx", l);			\
+        }							\
+     } while (0)
+#endif /* AS_BUG_FLOATING_CONSTANT */
+#endif
+
+/* Output a double value (represented as a C double) as an immediate operand.
+   This macro is a 68k-specific macro.  */
+/*
+#undef ASM_OUTPUT_DOUBLE_OPERAND
+#define ASM_OUTPUT_DOUBLE_OPERAND(FILE,VALUE)				\
+ do { char dstr[30];							\
+      real_to_decimal (dstr, &(VALUE), sizeof (dstr), 0, 1);		\
+      fprintf (FILE, "&0f%s", dstr);					\
+    } while (0)
+*/
+
+/*
+#define ASM_OUTPUT_EXTERNAL_LIBCALL(asm_out_file,fun)
+*/
+
+/* This is the assembler directive to equate two values.  */
+/*
+#undef SET_ASM_OP
+#define SET_ASM_OP    ".set"
+*/
+
+/* 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.  */
+#undef PCC_STATIC_STRUCT_RETURN
+#define DEFAULT_PCC_STRUCT_RETURN 0
+
+/* Define this macro if the system header files support C++ as well
+   as C.  This macro inhibits the usual method of using system header
+   files in C++, which is to pretend that the file's contents are
+   enclosed in `extern "C" {...}'.  */
+/*
+#define NO_IMPLICIT_EXTERN_C
+*/
diff -Naur gcc-3.4.3-orig/gcc/config/m68k/t-mint gcc-3.4.3/gcc/config/m68k/t-mint
--- gcc-3.4.3-orig/gcc/config/m68k/t-mint	1970-01-01 01:00:00.000000000 +0100
+++ gcc-3.4.3/gcc/config/m68k/t-mint	2005-02-18 17:09:35.000000000 +0100
@@ -0,0 +1,21 @@
+LIB1ASMSRC = m68k/lb1sf68.asm
+LIB1ASMFUNCS = _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \
+   _double _float _floatex \
+   _eqdf2 _nedf2 _gtdf2 _gedf2 _ltdf2 _ledf2 \
+   _eqsf2 _nesf2 _gtsf2 _gesf2 _ltsf2 _lesf2
+
+LIB2FUNCS_EXTRA = fpgnulib.c xfgnulib.c
+
+fpgnulib.c: $(srcdir)/config/m68k/fpgnulib.c
+	cp $(srcdir)/config/m68k/fpgnulib.c fpgnulib.c
+xfgnulib.c: $(srcdir)/config/m68k/fpgnulib.c
+	echo '#define EXTFLOAT' > xfgnulib.c
+	cat $(srcdir)/config/m68k/fpgnulib.c >> xfgnulib.c
+
+MULTILIB_OPTIONS = m68000/m68020/m68020-60 mshort
+MULTILIB_DIRNAMES =
+MULTILIB_MATCHES = m68000=mc68000 m68020=mc68020 m68020=mc68030 m68020-60=m68881 m68020-60=m68020-40 m68020-60=m68040 m68020-60=m68060
+MULTILIB_EXCEPTIONS =
+
+LIBGCC = stmp-multilib
+INSTALL_LIBGCC = install-multilib
diff -Naur gcc-3.4.3-orig/gcc/config.gcc gcc-3.4.3/gcc/config.gcc
--- gcc-3.4.3-orig/gcc/config.gcc	2004-09-08 17:16:10.000000000 +0200
+++ gcc-3.4.3/gcc/config.gcc	2005-03-08 17:28:08.000000000 +0100
@@ -1349,6 +1349,10 @@
 	use_collect2=yes
 	use_fixproto=yes
 	;;
+m68k-atari-mint*)
+	tmake_file=m68k/t-mint
+	tm_file="m68k/m68k.h m68k/mint.h"
+	;;
 m68k-hp-hpux7*)	# HP 9000 series 300 running HPUX version 7.
 	tm_file="m68k/hp320base.h m68k/m68k.h m68k/hp320.h"
 	if test x$gas = xyes
diff -Naur gcc-3.4.3-orig/libstdc++-v3/config/os/mint/ctype_base.h gcc-3.4.3/libstdc++-v3/config/os/mint/ctype_base.h
--- gcc-3.4.3-orig/libstdc++-v3/config/os/mint/ctype_base.h	1970-01-01 01:00:00.000000000 +0100
+++ gcc-3.4.3/libstdc++-v3/config/os/mint/ctype_base.h	2005-02-24 23:24:08.000000000 +0100
@@ -0,0 +1,55 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 1997-1999 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 2, 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.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+  
+// Mint C types, taken from mintlib-0.56/include/ctype.h
+  
+  struct ctype_base
+  {
+    // Non-standard typedefs.
+    typedef const unsigned char	*__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 ;
+  };
diff -Naur gcc-3.4.3-orig/libstdc++-v3/config/os/mint/ctype_inline.h gcc-3.4.3/libstdc++-v3/config/os/mint/ctype_inline.h
--- gcc-3.4.3-orig/libstdc++-v3/config/os/mint/ctype_inline.h	1970-01-01 01:00:00.000000000 +0100
+++ gcc-3.4.3/libstdc++-v3/config/os/mint/ctype_inline.h	2005-02-23 16:22:50.000000000 +0100
@@ -0,0 +1,72 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2000 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 2, 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.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+  
+// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
+// functions go in ctype.cc
+  
+// The following definitions are portable, but insanely slow. If one
+// cares at all about performance, then specialized ctype
+// functionality should be added for the native os in question: see
+// the config/os/bits/ctype_*.h files.
+
+  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;
+  }
diff -Naur gcc-3.4.3-orig/libstdc++-v3/config/os/mint/ctype_noninline.h gcc-3.4.3/libstdc++-v3/config/os/mint/ctype_noninline.h
--- gcc-3.4.3-orig/libstdc++-v3/config/os/mint/ctype_noninline.h	1970-01-01 01:00:00.000000000 +0100
+++ gcc-3.4.3/libstdc++-v3/config/os/mint/ctype_noninline.h	2005-02-24 21:53:06.000000000 +0100
@@ -0,0 +1,97 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2000, 2001, 2002 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 2, 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.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+  
+// Information as gleaned from /usr/include/ctype.h
+ 
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return _ctype; }
+
+  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
+  { 
+    int __x = __c;
+    return (this->is(ctype_base::lower, __c) ? (__x - 'a' + 'A') : __x);
+  }
+
+  const char*
+  ctype<char>::do_toupper(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = this->do_toupper(*__low);
+	++__low;
+      }
+    return __high;
+  }
+
+  char
+  ctype<char>::do_tolower(char __c) const
+  { 
+    int __x = __c;
+    return (this->is(ctype_base::upper, __c) ? (__x - 'A' + 'a') : __x);
+  }
+
+  const char* 
+  ctype<char>::do_tolower(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = this->do_tolower(*__low);
+	++__low;
+      }
+    return __high;
+  }
diff -Naur gcc-3.4.3-orig/libstdc++-v3/config/os/mint/os_defines.h gcc-3.4.3/libstdc++-v3/config/os/mint/os_defines.h
--- gcc-3.4.3-orig/libstdc++-v3/config/os/mint/os_defines.h	1970-01-01 01:00:00.000000000 +0100
+++ gcc-3.4.3/libstdc++-v3/config/os/mint/os_defines.h	2005-02-23 16:22:50.000000000 +0100
@@ -0,0 +1,43 @@
+// Specific definitions for generic platforms  -*- C++ -*-
+
+// Copyright (C) 2000 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 2, 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.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+
+#ifndef _GLIBCPP_OS_DEFINES
+#  define _GLIBCPP_OS_DEFINES
+
+// System-specific #define, typedefs, corrections, etc, go here.  This
+// file will come before all others.
+
+// These taken from mintlib-0.56/include/unistd.h
+
+#define __off_t off_t
+#define __off64_t off64_t
+#define __ssize_t ssize_t
+
+#endif
diff -Naur gcc-3.4.3-orig/libstdc++-v3/configure.host gcc-3.4.3/libstdc++-v3/configure.host
--- gcc-3.4.3-orig/libstdc++-v3/configure.host	2004-10-05 18:32:49.000000000 +0200
+++ gcc-3.4.3/libstdc++-v3/configure.host	2005-02-23 16:24:29.000000000 +0100
@@ -181,6 +181,9 @@
   mingw32*)
     os_include_dir="os/mingw32"
     ;;
+  mint*)
+    os_include_dir="os/mint"
+    ;;
   netbsd*)
     os_include_dir="os/bsd/netbsd"
     ;;
diff -Naur gcc-3.4.3-orig/libstdc++-v3/crossconfig.m4 gcc-3.4.3/libstdc++-v3/crossconfig.m4
--- gcc-3.4.3-orig/libstdc++-v3/crossconfig.m4	2004-07-07 03:23:49.000000000 +0200
+++ gcc-3.4.3/libstdc++-v3/crossconfig.m4	2005-03-08 17:37:34.000000000 +0100
@@ -235,6 +235,12 @@
     GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
     GLIBCXX_CHECK_WCHAR_T_SUPPORT
     ;;
+  *-mint*)
+    AC_CHECK_HEADERS([sys/types.h locale.h float.h])
+    GLIBCXX_CHECK_LINKER_FEATURES
+    GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
+    GLIBCXX_CHECK_WCHAR_T_SUPPORT
+    ;;
   *-netbsd*)
     AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
       machine/endian.h machine/param.h sys/machine.h sys/types.h \