diff -Nrcpad gcc-4.7.2-orig/config/acx.m4 gcc-4.7.2/config/acx.m4
*** gcc-4.7.2-orig/config/acx.m4	2012-08-06 10:34:27.000000000 -0400
--- gcc-4.7.2/config/acx.m4	2012-11-16 19:33:52.736833876 -0500
*************** dnl for the parameter format "cmp file1
*** 402,425 ****
  dnl accepted by cmp on some systems.
  AC_DEFUN([ACX_PROG_CMP_IGNORE_INITIAL],
  [AC_CACHE_CHECK([how to compare bootstrapped objects], gcc_cv_prog_cmp_skip,
! [ echo abfoo >t1
!   echo cdfoo >t2
!   gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2'
!   if cmp t1 t2 2 2 > /dev/null 2>&1; then
!     if cmp t1 t2 1 1 > /dev/null 2>&1; then
!       :
!     else
!       gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16'
      fi
!   fi
!   if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then
!     if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then
!       :
!     else
!       gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2'
      fi
    fi
-   rm t1 t2
  ])
  do_compare="$gcc_cv_prog_cmp_skip"
  AC_SUBST(do_compare)
--- 402,431 ----
  dnl accepted by cmp on some systems.
  AC_DEFUN([ACX_PROG_CMP_IGNORE_INITIAL],
  [AC_CACHE_CHECK([how to compare bootstrapped objects], gcc_cv_prog_cmp_skip,
! [# comparing object files via cmp doesn't work on haiku (files will seemingly
!   # always differ), so we disassemble both files and compare the results:
!   if uname -o | grep -iq haiku; then
!     gcc_cv_prog_cmp_skip='objdump -Dz $$f1 | tail +6 >tmp-foo1; objdump -Dz $$f2 | tail +6 >tmp-foo2; cmp tmp-foo1 tmp-foo2'
!   else 
!     gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2'
!     echo abfoo >t1
!     echo cdfoo >t2
!     if cmp t1 t2 2 2 > /dev/null 2>&1; then
!       if cmp t1 t2 1 1 > /dev/null 2>&1; then
!         :
!       else
!         gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16'
!       fi
      fi
!     if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then
!       if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then
!         :
!       else
!         gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2'
!       fi
      fi
+     rm t1 t2
    fi
  ])
  do_compare="$gcc_cv_prog_cmp_skip"
  AC_SUBST(do_compare)
diff -Nrcpad gcc-4.7.2-orig/config.rpath gcc-4.7.2/config.rpath
*** gcc-4.7.2-orig/config.rpath	2011-02-13 06:45:53.000000000 -0500
--- gcc-4.7.2/config.rpath	2012-11-16 19:33:52.736833876 -0500
*************** if test "$with_gnu_ld" = yes; then
*** 161,166 ****
--- 161,168 ----
        ;;
      netbsd*)
        ;;
+     haiku*)
+       ;;
      solaris* | sysv5*)
        if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
          ld_shlibs=no
diff -Nrcpad gcc-4.7.2-orig/configure gcc-4.7.2/configure
*** gcc-4.7.2-orig/configure	2012-09-05 08:19:47.000000000 -0400
--- gcc-4.7.2/configure	2012-11-17 01:53:05.332244630 -0500
*************** case "${host}" in
*** 2946,2951 ****
--- 2946,2954 ----
    i[3456789]86-*-msdosdjgpp*)
      noconfigdirs="$noconfigdirs tcl tk itcl"
      ;;
+   *-*-haiku*)
+     noconfigdirs="$noconfigdirs tk itcl libgui gdb"
+     ;;
  esac
  
  
*************** case "${target}" in
*** 3187,3192 ****
--- 3190,3198 ----
    *-*-darwin*)
      noconfigdirs="$noconfigdirs ${libgcj}"
      ;;
+   *-*-haiku*)
+     noconfigdirs="$noconfigdirs ${libgcj}"
+     ;;
    *-*-netware*)
      noconfigdirs="$noconfigdirs ${libgcj}"
      ;;
*************** case "${target}" in
*** 3350,3355 ****
--- 3356,3364 ----
    *-*-freebsd*)
      noconfigdirs="$noconfigdirs target-newlib target-libgloss"
      ;;
+   *-*-haiku*)
+     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+     ;;
    *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
      noconfigdirs="$noconfigdirs target-newlib target-libgloss"
      ;;
*************** case "${target}" in
*** 3403,3408 ****
--- 3412,3420 ----
        with_gmp=/usr/local
      fi
      ;;
+   *-*-haiku*)
+     noconfigdirs="$noconfigdirs gdb target-libiberty"
+     ;;
    *-*-kaos*)
      # Remove unsupported stuff on all kaOS configurations.
      noconfigdirs="$noconfigdirs target-libgloss"
*************** $as_echo_n "checking how to compare boot
*** 4991,5015 ****
  if test "${gcc_cv_prog_cmp_skip+set}" = set; then :
    $as_echo_n "(cached) " >&6
  else
!    echo abfoo >t1
!   echo cdfoo >t2
!   gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2'
!   if cmp t1 t2 2 2 > /dev/null 2>&1; then
!     if cmp t1 t2 1 1 > /dev/null 2>&1; then
!       :
!     else
!       gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16'
      fi
!   fi
!   if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then
!     if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then
!       :
!     else
!       gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2'
      fi
!   fi
!   rm t1 t2
  
  fi
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_prog_cmp_skip" >&5
  $as_echo "$gcc_cv_prog_cmp_skip" >&6; }
--- 5003,5033 ----
  if test "${gcc_cv_prog_cmp_skip+set}" = set; then :
    $as_echo_n "(cached) " >&6
  else
!   # comparing object files via cmp doesn't work on haiku (files will seemingly
!   # always differ), so we disassemble both files and compare the results:
!   if uname -o | grep -iq haiku; then
!     gcc_cv_prog_cmp_skip='objdump -Dz $$f1 | tail +6 >tmp-foo1; objdump -Dz $$f2 | tail +6 >tmp-foo2; cmp tmp-foo1 tmp-foo2'
!   else 
!     gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2'
!     echo abfoo >t1
!     echo cdfoo >t2
!     if cmp t1 t2 2 2 > /dev/null 2>&1; then
!       if cmp t1 t2 1 1 > /dev/null 2>&1; then
!         :
!       else
!         gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16'
!       fi
      fi
!     if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then
!       if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then
!         :
!       else
!         gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2'
!       fi
      fi
!     rm t1 t2
  
+   fi
  fi
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_prog_cmp_skip" >&5
  $as_echo "$gcc_cv_prog_cmp_skip" >&6; }
diff -Nrcpad gcc-4.7.2-orig/gcc/config/arm/haiku.h gcc-4.7.2/gcc/config/arm/haiku.h
*** gcc-4.7.2-orig/gcc/config/arm/haiku.h	1969-12-31 19:00:00.000000000 -0500
--- gcc-4.7.2/gcc/config/arm/haiku.h	2012-11-23 19:58:53.183687393 -0500
***************
*** 0 ****
--- 1,82 ----
+ /*	Definitions for ARM running Haiku systems using ELF
+ 	Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+ 	2005 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 2, 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 COPYING.  If not, write to
+ 	the Free Software Foundation, 59 Temple Place - Suite 330,
+ 	Boston, MA 02111-1307, USA.  */
+ 
+ #undef TARGET_VERSION
+ #define TARGET_VERSION fprintf (stderr, " (ARM Haiku/ELF)");
+ 
+ /* Unsigned chars produces much better code than signed.  */
+ #define DEFAULT_SIGNED_CHAR  0
+ 
+ #undef  TARGET_DEFAULT_FLOAT_ABI
+ #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT
+ 
+ /* We default to the "aapcs-linux" ABI so that enums are int-sized by
+    default.  */
+ #undef  ARM_DEFAULT_ABI
+ #define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX
+ 
+ /* bpabi.h sets FPUTYPE_DEFAULT to VFP */
+ 
+ #undef  MULTILIB_DEFAULTS
+ #define MULTILIB_DEFAULTS \
+   { "marm", "mlittle-endian", "msoft-float", "mno-thumb-interwork" }
+ 
+ /* Default is set by bpabi.h */
+ /*
+ #undef TARGET_DEFAULT
+ */
+ 
+ #undef SUBTARGET_CPU_DEFAULT
+ #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
+ 
+ /* Now we define the strings used to build the spec file.  */
+ /* interestingly, bpabi defines __GXX_TYPEINFO_EQUALITY_INLINE=0 too as we do. */
+ 
+ #undef TARGET_OS_CPP_BUILTINS
+ #define TARGET_OS_CPP_BUILTINS()		\
+   do									\
+     {									\
+       builtin_define ("__HAIKU__");					\
+       builtin_define ("__ARM__");					\
+       builtin_define ("__arm__");					\
+       builtin_define ("__stdcall=__attribute__((__stdcall__))");	\
+       builtin_define ("__cdecl=__attribute__((__cdecl__))");		\
+       builtin_define ("__STDC_ISO_10646__=201103L"); \
+       builtin_assert ("system=haiku");					\
+       /* Haiku apparently doesn't support merging of symbols across shared \
+ 		 object boundaries. Hence we need to explicitly specify that \
+          type_infos are not merged, so that they get compared by name \
+          instead of by pointer. */ \
+       builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \
+       /*builtin_define ("__GXX_TYPEINFO_EQUALITY_INLINE=0"); done in bpabi: */\
+       TARGET_BPABI_CPP_BUILTINS();					\
+     }									\
+   while (0)
+ 
+ /* Use the default LIBGCC_SPEC, not the empty version in haiku.h, as we
+    do not use multilib (needed ??).  */
+ #undef LIBGCC_SPEC
+ 
+ /* If ELF is the default format, we should not use /lib/elf.  */
+ 
+ #undef	LINK_SPEC
+ #define LINK_SPEC "%{!o*:-o %b} -m armelf -shared -no-undefined %{nostart:-e 0} \
+   %{mbig-endian:-EB} %{mlittle-endian:-EL} -X"
diff -Nrcpad gcc-4.7.2-orig/gcc/config/arm/t-haiku gcc-4.7.2/gcc/config/arm/t-haiku
*** gcc-4.7.2-orig/gcc/config/arm/t-haiku	1969-12-31 19:00:00.000000000 -0500
--- gcc-4.7.2/gcc/config/arm/t-haiku	2012-11-16 19:33:52.740833876 -0500
***************
*** 0 ****
--- 1,21 ----
+ # build multilib for soft float and VFP 
+ # (unsure about how it should be done...)
+ # mix from t-symbian & t-wince-pe
+ 
+ #LIB1ASMSRC = arm/lib1funcs.asm
+ #LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _call_via_rX _interwork_call_via_rX
+ 
+ 
+ #MULTILIB_OPTIONS    += mhard-float
+ #MULTILIB_DIRNAMES   += fpu
+ 
+ MULTILIB_OPTIONS    += msoft-float
+ MULTILIB_DIRNAMES   += fpu soft
+ MULTILIB_EXCEPTIONS += *mthumb/*mhard-float*
+ 
+ MULTILIB_OPTIONS    += mfloat-abi=softfp
+ MULTILIB_DIRNAMES   += softfp
+ 
+ #LIBGCC = stmp-multilib
+ #INSTALL_LIBGCC = install-multilib
+ #TARGET_LIBGCC2_CFLAGS = 
diff -Nrcpad gcc-4.7.2-orig/gcc/config/haiku.h gcc-4.7.2/gcc/config/haiku.h
*** gcc-4.7.2-orig/gcc/config/haiku.h	1969-12-31 19:00:00.000000000 -0500
--- gcc-4.7.2/gcc/config/haiku.h	2012-11-24 22:04:51.000000000 -0500
***************
*** 0 ****
--- 1,185 ----
+ /* Definitions of target machine for GCC.
+    Common Haiku definitions for all architectures.
+    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005
+    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 2, 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 COPYING.  If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.  */
+ 
+ 
+ /* Change debugging to Dwarf2.  */
+ #undef PREFERRED_DEBUGGING_TYPE
+ #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
+ 
+ #undef MCOUNT_NAME
+ #define MCOUNT_NAME "_mcount"
+ 
+ #define TARGET_DECLSPEC 1
+ 
+ #undef SIZE_TYPE
+ #define SIZE_TYPE "long unsigned int"
+ 
+ #undef PTRDIFF_TYPE
+ #define PTRDIFF_TYPE "long int"
+ 
+ #undef WCHAR_TYPE
+ #define WCHAR_TYPE "int"
+ 
+ #undef WCHAR_TYPE_SIZE
+ #define WCHAR_TYPE_SIZE 32
+ 
+ /* Haiku uses lots of multichars, so don't warn about them unless the
+    user explicitly asks for the warnings with -Wmultichar.  Note that
+    CC1_SPEC is used for both cc1 and cc1plus.  */
+ #undef CC1_SPEC
+ #define CC1_SPEC "%{!no-fpic:%{!fno-pic:%{!fno-pie:%{!fpie:%{!fPIC:%{!fPIE:-fpic}}}}}} %{!Wmultichar: -Wno-multichar} %(cc1_cpu) %{profile:-p}"
+ 
+ #undef CC1PLUS_SPEC
+ #define CC1PLUS_SPEC "%{!Wctor-dtor-privacy:-Wno-ctor-dtor-privacy}"
+ 
+ /* LIB_SPEC for Haiku */
+ #undef LIB_SPEC
+ #define LIB_SPEC "-lroot"
+ 
+ /* gcc runtime lib is built into libroot.so on Haiku */
+ /* ??? This is gonna be lovely when the next release of gcc has
+    some new symbol in, so that links start failing.  */
+ #undef LIBGCC_SPEC
+ #define LIBGCC_SPEC ""
+ 
+ 
+ #undef  STARTFILE_SPEC
+ #define STARTFILE_SPEC "crti.o%s crtbegin.o%s %{!shared:%{!nostart:start_dyn.o%s}} init_term_dyn.o%s"
+ 
+ #undef  ENDFILE_SPEC
+ #define ENDFILE_SPEC "crtend.o%s crtn.o%s"
+ 
+ /* For native compiler, use standard Haiku include file search paths
+    rooted in /boot/develop/headers.  For a cross compiler, don't
+    expect the host to use the Haiku directory scheme, and instead look
+    for the Haiku include files relative to TOOL_INCLUDE_DIR.  Yes, we
+    use ANSI string concatenation here (FIXME) */
+ 
+ #ifndef CROSS_DIRECTORY_STRUCTURE
+ #undef INCLUDE_DEFAULTS
+ #define INCLUDE_DEFAULTS \
+     { \
+     { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \
+     { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \
+     { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \
+     { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \
+     { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \
+     { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 }, \
+     { "/boot/common/include", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/os", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/os/app", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/os/device", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/os/drivers", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/os/game", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/os/interface", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/os/kernel", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/os/locale", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/os/mail", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/os/media", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/os/midi", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/os/midi2", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/os/net", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/os/opengl", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/os/storage", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/os/support", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/os/translation", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/os/add-ons/graphics", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/os/add-ons/input_server", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/os/add-ons/screen_saver", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/os/add-ons/tracker", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/os/be_apps/Deskbar", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/os/be_apps/NetPositive", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/os/be_apps/Tracker", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/cpp", 0, 1, 1, 0, 0 }, \
+     { "/boot/develop/headers/3rdparty", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/bsd", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/glibc", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/gnu", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers/posix", 0, 0, 0, 0, 0 }, \
+     { "/boot/develop/headers", 0, 0, 0, 0, 0 }, \
+     { 0, 0, 0, 0, 0, 0 } \
+     }
+ #else /* CROSS_DIRECTORY_STRUCTURE */
+ #undef	INCLUDE_DEFAULTS
+ #define INCLUDE_DEFAULTS				\
+     { \
+     { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 1, 0 }, \
+     { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 1, 0 }, \
+     { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 1, 0 }, \
+     { GCC_INCLUDE_DIR, "GCC", 0, 0, 1, 0 }, \
+     { FIXED_INCLUDE_DIR, "GCC", 0, 0, 1, 0 }, \
+     { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/os", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/os/app", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/os/device", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/os/drivers", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/os/game", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/os/interface", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/os/kernel", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/os/locale", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/os/mail", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/os/media", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/os/midi", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/os/midi2", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/os/net", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/os/opengl", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/os/storage", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/os/support", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/os/translation", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/os/add-ons/graphics", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/os/add-ons/input_server", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/os/add-ons/screen_saver", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/os/add-ons/tracker", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/os/be_apps/Deskbar", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/os/be_apps/NetPositive", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/os/be_apps/Tracker", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/cpp", 0, 1, 1, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/3rdparty", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/bsd", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/glibc", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/gnu", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR "/posix", 0, 0, 0, 1, 0 }, \
+     { CROSS_INCLUDE_DIR , 0, 0, 0, 1, 0 }, \
+     { 0, 0, 0, 0, 0, 0 } \
+     }
+ #endif /* CROSS_DIRECTORY_STRUCTURE */
+ 
+ /* Whee.  LIBRARY_PATH is Be's LD_LIBRARY_PATH, which of course will
+    cause nasty problems if we override it.  */
+ #define LIBRARY_PATH_ENV "BELIBRARIES"
+ 
+ /* Haiku doesn't have a separate math library.  */
+ #define MATH_LIBRARY ""
+ 
+ /* Haiku headers are C++-aware (and often use C++).  */
+ #define NO_IMPLICIT_EXTERN_C
+ 
+ /* Only allow -lssp for SSP, as -lssp_nonshared is problematic in Haiku */
+ #ifndef TARGET_LIBC_PROVIDES_SSP
+ #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp}"
+ #endif
+ 
+ /* Do not desire to have _Jv_RegisterClasses in crtbegin.o for Haiku */
+ #define TARGET_USE_JCR_SECTION 0
+ 
+ /* Do not use TM clone registry in Haiku for now */
+ #define USE_TM_CLONE_REGISTRY 0
diff -Nrcpad gcc-4.7.2-orig/gcc/config/i386/haiku64.h gcc-4.7.2/gcc/config/i386/haiku64.h
*** gcc-4.7.2-orig/gcc/config/i386/haiku64.h	1969-12-31 19:00:00.000000000 -0500
--- gcc-4.7.2/gcc/config/i386/haiku64.h	2012-11-17 02:01:05.884232184 -0500
***************
*** 0 ****
--- 1,133 ----
+ /* Definitions for AMD x86_64 running Haiku with ELF format.
+    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004
+    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 2, 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 COPYING.  If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.  */
+ 
+ 
+ #undef ASM_COMMENT_START
+ #define ASM_COMMENT_START " #"
+ 
+ /* The SVR4 ABI for the i386 says that records and unions are returned
+  * in memory. For 64-bit compilation this definition is ignored, however
+  * it is necessary for correct 32-bit code generation.
+  */
+ #undef DEFAULT_PCC_STRUCT_RETURN
+ #define DEFAULT_PCC_STRUCT_RETURN 1
+ 
+ #undef DBX_REGISTER_NUMBER
+ #define DBX_REGISTER_NUMBER(n) \
+   (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
+ 
+ #define TARGET_OS_CPP_BUILTINS()					\
+   do									\
+     {									\
+       builtin_define ("__HAIKU__");					\
+       if (!TARGET_64BIT)						\
+         {								\
+           builtin_define ("__INTEL__");					\
+           builtin_define ("__X86__");					\
+         }								\
+       builtin_define ("__stdcall=__attribute__((__stdcall__))");	\
+       builtin_define ("__cdecl=__attribute__((__cdecl__))");		\
+       builtin_define ("__STDC_ISO_10646__=201103L");			\
+       builtin_assert ("system=haiku");					\
+     }									\
+   while (0)
+ 
+ /* Provide a LINK_SPEC appropriate for Haiku.  Here we provide support
+    for the special GCC options -static and -shared, which allow us to
+    link things in one of these three modes by applying the appropriate
+    combinations of options at link-time.  */
+ 
+ #if TARGET_64BIT_DEFAULT
+ #define SPEC_32 "m32"
+ #define SPEC_64 "!m32"
+ #else
+ #define SPEC_32 "!m64"
+ #define SPEC_64 "m64"
+ #endif
+ 
+ #undef	LINK_SPEC
+ #define LINK_SPEC "%{" SPEC_64 ":-m elf_x86_64} %{" SPEC_32 ":-m elf_i386_haiku} \
+ 	-shared %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}"
+ 
+ /* 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 x86_output_aligned_bss to implement this macro.  */
+ 
+ #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
+   x86_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
+ 
+ /* This is used to align code labels according to Intel recommendations.  */
+ 
+ #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
+ #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP)			\
+   do {									\
+     if ((LOG) != 0) {							\
+       if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG));	\
+       else {								\
+         fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));	\
+         /* Make sure that we have at least 8 byte alignment if > 8 byte	\
+            alignment is preferred.  */					\
+         if ((LOG) > 3							\
+             && (1 << (LOG)) > ((MAX_SKIP) + 1)				\
+             && (MAX_SKIP) >= 7)						\
+           fputs ("\t.p2align 3\n", (FILE));				\
+       }									\
+     }									\
+   } while (0)
+ #undef  ASM_OUTPUT_MAX_SKIP_PAD
+ #define ASM_OUTPUT_MAX_SKIP_PAD(FILE, LOG, MAX_SKIP)			\
+   if ((LOG) != 0)							\
+     {									\
+       if ((MAX_SKIP) == 0)						\
+         fprintf ((FILE), "\t.p2align %d\n", (LOG));			\
+       else								\
+         fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));	\
+     }
+ #endif
+ 
+ 
+ /* Output assembler code to FILE to call the profiler.  */
+ #define NO_PROFILE_COUNTERS 1
+ 
+ #undef ASM_SPEC
+ #define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} \
+  %{Wa,*:%*} %{" SPEC_32 ":--32} %{" SPEC_64 ":--64}"
+ 
+ #undef  ASM_OUTPUT_ALIGNED_COMMON
+ #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN)		\
+   x86_elf_aligned_common (FILE, NAME, SIZE, ALIGN);
+ 
+ 
+ /* i386 System V Release 4 uses DWARF debugging info.
+    x86-64 ABI specifies DWARF2.  */
+ 
+ #define DWARF2_DEBUGGING_INFO 1
+ #define DWARF2_UNWIND_INFO 1
+ 
+ #undef PREFERRED_DEBUGGING_TYPE
+ #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
+ 
+ #undef TARGET_ASM_SELECT_SECTION
+ #define TARGET_ASM_SELECT_SECTION  x86_64_elf_select_section
+ 
+ #undef TARGET_ASM_UNIQUE_SECTION
+ #define TARGET_ASM_UNIQUE_SECTION  x86_64_elf_unique_section
diff -Nrcpad gcc-4.7.2-orig/gcc/config/i386/haiku.h gcc-4.7.2/gcc/config/i386/haiku.h
*** gcc-4.7.2-orig/gcc/config/i386/haiku.h	1969-12-31 19:00:00.000000000 -0500
--- gcc-4.7.2/gcc/config/i386/haiku.h	2012-11-17 02:00:25.112233240 -0500
***************
*** 0 ****
--- 1,77 ----
+ /* Definitions for Intel x86 running Haiku
+    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004
+    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 2, 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 COPYING.  If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.  */
+ 
+ 
+ #undef ASM_COMMENT_START
+ #define ASM_COMMENT_START " #"
+ 
+ /* The SVR4 ABI for the i386 says that records and unions are returned
+    in memory.  */
+ #undef DEFAULT_PCC_STRUCT_RETURN
+ #define DEFAULT_PCC_STRUCT_RETURN 1
+ 
+ #undef DBX_REGISTER_NUMBER
+ #define DBX_REGISTER_NUMBER(n) \
+   (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
+ 
+ #define TARGET_OS_CPP_BUILTINS()					\
+   do									\
+     {									\
+ 	builtin_define ("__HAIKU__");					\
+ 	builtin_define ("__INTEL__");					\
+ 	builtin_define ("_X86_");					\
+ 	builtin_define ("__stdcall=__attribute__((__stdcall__))");	\
+ 	builtin_define ("__cdecl=__attribute__((__cdecl__))");		\
+     builtin_define ("__STDC_ISO_10646__=201103L"); \
+ 	builtin_assert ("system=haiku");					\
+     }									\
+   while (0)
+ 
+ /* Provide a LINK_SPEC appropriate for Haiku.  Here we provide support
+    for the special GCC options -static and -shared, which allow us to
+    link things in one of these three modes by applying the appropriate
+    combinations of options at link-time.  */
+ 
+ /* If ELF is the default format, we should not use /lib/elf.  */
+ 
+ #undef	LINK_SPEC
+ #define LINK_SPEC "-m elf_i386_haiku -shared %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}"
+ 
+ /* 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)
+ 
+ /* A C statement to output to the stdio stream FILE an assembler
+    command to advance the location counter to a multiple of 1<<LOG
+    bytes if it is within MAX_SKIP bytes.
+ 
+    This is used to align code labels according to Intel recommendations.  */
+ 
+ #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
+ #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
+   if ((LOG)!=0) \
+     if ((MAX_SKIP)==0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
+     else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP))
+ #endif
diff -Nrcpad gcc-4.7.2-orig/gcc/config/i386/t-haiku64 gcc-4.7.2/gcc/config/i386/t-haiku64
*** gcc-4.7.2-orig/gcc/config/i386/t-haiku64	1969-12-31 19:00:00.000000000 -0500
--- gcc-4.7.2/gcc/config/i386/t-haiku64	2012-11-24 00:55:59.001223992 -0500
***************
*** 0 ****
--- 1,2 ----
+ MULTILIB_OPTIONS = m32 
+ MULTILIB_DIRNAMES = 32
diff -Nrcpad gcc-4.7.2-orig/gcc/config/m68k/haiku.h gcc-4.7.2/gcc/config/m68k/haiku.h
*** gcc-4.7.2-orig/gcc/config/m68k/haiku.h	1969-12-31 19:00:00.000000000 -0500
--- gcc-4.7.2/gcc/config/m68k/haiku.h	2012-11-17 02:02:27.996230058 -0500
***************
*** 0 ****
--- 1,268 ----
+ /* Definitions for Motorola 68k running Haiku
+    Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2007
+    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 2, 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 COPYING.  If not, write to
+ the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.  */
+ 
+ 
+ /* Default target comes from config.gcc.  */
+ 
+ #undef TARGET_DEFAULT
+ #ifdef TARGET_CPU_DEFAULT
+ #define TARGET_DEFAULT TARGET_CPU_DEFAULT
+ #else
+ #define TARGET_DEFAULT (MASK_BITFIELD|MASK_68881|MASK_68020)
+ #endif
+ 
+ /* for 68k machines this only needs to be TRUE for the 68000 */
+ 
+ #undef STRICT_ALIGNMENT
+ #define STRICT_ALIGNMENT 0
+ 
+ /* 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 "."
+ 
+ /* The prefix to add to user-visible assembler symbols.  */
+ 
+ #undef USER_LABEL_PREFIX
+ #define USER_LABEL_PREFIX ""
+ 
+ #undef ASM_COMMENT_START
+ #define ASM_COMMENT_START "|"
+ 
+ /* Target OS builtins.  */
+ 
+ #undef TARGET_OS_CPP_BUILTINS
+ #define TARGET_OS_CPP_BUILTINS()					\
+   do									\
+     {									\
+ 	builtin_define ("__HAIKU__");					\
+ 	builtin_define ("__M68K__");					\
+ 	builtin_define_std ("mc68000");					\
+ 	builtin_define_std ("mc68020");					\
+ 	builtin_define ("__stdcall=__attribute__((__stdcall__))");	\
+ 	builtin_define ("__cdecl=__attribute__((__cdecl__))");		\
+     builtin_define ("__STDC_ISO_10646__=201103L"); \
+ 	builtin_assert ("system=haiku");				\
+     }									\
+   while (0)
+ 
+ #define TARGET_OBJFMT_CPP_BUILTINS()		\
+   do						\
+     {						\
+ 	builtin_define ("__ELF__");		\
+     }						\
+   while (0)
+ 
+ #undef CPP_SPEC
+ #if TARGET_DEFAULT & MASK_68881
+ #define CPP_SPEC \
+   "%{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} %{!msoft-float:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
+ #else
+ #define CPP_SPEC \
+   "%{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} %{m68881:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
+ #endif
+ 
+ /* We override the ASM_SPEC from svr4.h because we must pass -m68040 down
+    to the assembler.  */
+ #undef ASM_SPEC
+ #define ASM_SPEC \
+   "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
+ %{m68040} %{m68060:-m68040}"
+ 
+ /* Provide a LINK_SPEC appropriate for Haiku.  Here we provide support
+    for the special GCC options -static and -shared, which allow us to
+    link things in one of these three modes by applying the appropriate
+    combinations of options at link-time.  */
+ 
+ /* If ELF is the default format, we should not use /lib/elf.  */
+ 
+ #undef	LINK_SPEC
+ /*#define LINK_SPEC "%{!o*:-o %b} -m elf_m68k_haiku -shared -no-undefined %{nostart:-e 0}"*/
+ #define LINK_SPEC "%{!o*:-o %b} -m m68kelf -shared -no-undefined %{nostart:-e 0}"
+ 
+ /* XXX: not sure for the rest there... */
+ 
+ /* Currently, JUMP_TABLES_IN_TEXT_SECTION must be defined in order to
+    keep switch tables in the text section.  */
+ 
+ #define JUMP_TABLES_IN_TEXT_SECTION 1
+ 
+ /* This is how to output an assembler line that says to advance the
+    location counter to a multiple of 2**LOG bytes.  */
+ 
+ /* Use the default action for outputting the case label.  */
+ #undef ASM_OUTPUT_CASE_LABEL
+ #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)
+ 
+ #undef ASM_OUTPUT_ALIGN
+ #define ASM_OUTPUT_ALIGN(FILE,LOG)				\
+   if ((LOG) > 0)						\
+     fprintf ((FILE), "%s%u\n", ALIGN_ASM_OP, 1 << (LOG));
+ 
+ /* 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.section\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)
+ 
+ /* Output assembler code to FILE to increment profiler label # LABELNO
+    for profiling a function entry.  */
+ 
+ #undef FUNCTION_PROFILER
+ #define FUNCTION_PROFILER(FILE, LABELNO) \
+ {									\
+   asm_fprintf (FILE, "\tlea (%LLP%d,%Rpc),%Ra1\n", (LABELNO));		\
+   if (flag_pic)								\
+     fprintf (FILE, "\tbsr.l _mcount@PLTPC\n");				\
+   else									\
+     fprintf (FILE, "\tjbsr _mcount\n");					\
+ }
+ 
+ /* How to renumber registers for dbx and gdb.
+    On the Sun-3, the floating point registers have numbers
+    18 to 25, not 16 to 23 as they do in the compiler.  */
+ 
+ #define DBX_REGISTER_NUMBER(REGNO) ((REGNO) < 16 ? (REGNO) : (REGNO) + 2)
+ 
+ /* Do not break .stabs pseudos into continuations.  */
+ 
+ #define DBX_CONTIN_LENGTH 0
+ 
+ /* 1 if N is a possible register number for a function value.  For
+    m68k/SVR4 allow d0, a0, or fp0 as return registers, for integral,
+    pointer, or floating types, respectively.  Reject fp0 if not using
+    a 68881 coprocessor.  */
+ 
+ #undef FUNCTION_VALUE_REGNO_P
+ #define FUNCTION_VALUE_REGNO_P(N) \
+   ((N) == 0 || (N) == 8 || (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 1
+ 
+ /* Define how to generate (in the callee) the output value of a
+    function and how to find (in the caller) the value returned by a
+    function.  VALTYPE is the data type of the value (as a tree).  If
+    the precise function being called is known, FUNC is its
+    FUNCTION_DECL; otherwise, FUNC is 0.  For m68k/SVR4 generate the
+    result in d0, a0, or fp0 as appropriate.  */
+ 
+ #undef FUNCTION_VALUE
+ #define FUNCTION_VALUE(VALTYPE, FUNC)					\
+   (TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_68881			\
+    ? gen_rtx_REG (TYPE_MODE (VALTYPE), 16)				\
+    : (POINTER_TYPE_P (VALTYPE)						\
+       ? gen_rtx_REG (TYPE_MODE (VALTYPE), 8)				\
+       : gen_rtx_REG (TYPE_MODE (VALTYPE), 0)))
+ 
+ /* For compatibility with the large body of existing code which does
+    not always properly declare external functions returning pointer
+    types, the m68k/SVR4 convention is to copy the value returned for
+    pointer functions from a0 to d0 in the function epilogue, so that
+    callers that have neglected to properly declare the callee can
+    still find the correct return value.  */
+ 
+ #define FUNCTION_EXTRA_EPILOGUE(FILE, SIZE)				\
+ do {									\
+   if (current_function_returns_pointer					\
+       && ! find_equiv_reg (0, get_last_insn (), 0, 0, 0, 8, Pmode))	\
+     asm_fprintf (FILE, "\tmove.l %Ra0,%Rd0\n");				\
+ } while (0);
+ 
+ /* Define how to find the value returned by a library function
+    assuming the value has mode MODE.
+    For m68k/SVR4 look for integer values in d0, pointer values in d0
+    (returned in both d0 and a0), and floating values in fp0.  */
+ 
+ #undef LIBCALL_VALUE
+ #define LIBCALL_VALUE(MODE)						\
+   ((((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode)		\
+     && TARGET_68881)							\
+    ? gen_rtx_REG ((MODE), 16)						\
+    : gen_rtx_REG ((MODE), 0))
+ 
+ /* For m68k SVR4, structures are returned using the reentrant
+    technique.  */
+ #undef PCC_STATIC_STRUCT_RETURN
+ #define DEFAULT_PCC_STRUCT_RETURN 0
+ 
+ /* Finalize the trampoline by flushing the insn cache.  */
+ 
+ #undef FINALIZE_TRAMPOLINE
+ #define FINALIZE_TRAMPOLINE(TRAMP)					\
+   emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"),	\
+ 		     0, VOIDmode, 2, TRAMP, Pmode,			\
+ 		     plus_constant (TRAMP, TRAMPOLINE_SIZE), Pmode);
+ 
+ /* Clear the instruction cache from `beg' to `end'.  This makes an
+    inline system call to SYS_cacheflush.  The arguments are as
+    follows:
+ 
+ 	cacheflush (addr, scope, cache, len)
+ 
+    addr	  - the start address for the flush
+    scope  - the scope of the flush (see the cpush insn)
+    cache  - which cache to flush (see the cpush insn)
+    len    - a factor relating to the number of flushes to perform:
+ 	    len/16 lines, or len/4096 pages.  */
+ 
+ #define CLEAR_INSN_CACHE(BEG, END)					\
+ {									\
+ extern void clear_caches(void *address, int length, unsigned long flags); \
+   void *ptr = BEG;							\
+   int len = (END - BEG + 32);						\
+   clear_caches(ptr, len, 0x0005);					\
+ }
diff -Nrcpad gcc-4.7.2-orig/gcc/config/mips/haiku.h gcc-4.7.2/gcc/config/mips/haiku.h
*** gcc-4.7.2-orig/gcc/config/mips/haiku.h	1969-12-31 19:00:00.000000000 -0500
--- gcc-4.7.2/gcc/config/mips/haiku.h	2012-11-17 02:13:30.244212907 -0500
***************
*** 0 ****
--- 1,43 ----
+ /* Definitions for MIPS running Haiku
+    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004
+    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 2, 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 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 ("__HAIKU__");					\
+ 	builtin_define ("__MIPS__");					\
+ 	builtin_define ("__MIPSEL__");					\
+ 	builtin_define ("_MIPSEL_");					\
+ 	builtin_define ("__stdcall=__attribute__((__stdcall__))");	\
+ 	builtin_define ("__cdecl=__attribute__((__cdecl__))");		\
+     builtin_define ("__STDC_ISO_10646__=201103L"); \
+ 	builtin_assert ("system=haiku");					\
+ 	if (flag_pic)							\
+ 	  {								\
+ 	    builtin_define ("__PIC__");					\
+ 	    builtin_define ("__pic__");					\
+ 	  }								\
+     }									\
+   while (0)
+ 
+ #undef	LINK_SPEC
+ #define LINK_SPEC "%{!o*:-o %b} -m elf_mipsel_haiku -shared %{nostart:-e 0}"
diff -Nrcpad gcc-4.7.2-orig/gcc/config/rs6000/haiku.h gcc-4.7.2/gcc/config/rs6000/haiku.h
*** gcc-4.7.2-orig/gcc/config/rs6000/haiku.h	1969-12-31 19:00:00.000000000 -0500
--- gcc-4.7.2/gcc/config/rs6000/haiku.h	2012-11-17 02:03:36.196228291 -0500
***************
*** 0 ****
--- 1,56 ----
+ /* Definitions for PowerPC running Haiku
+    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005
+    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 2, 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 COPYING.  If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.  */
+ 
+ 
+ /* long double is 128 bits wide; the documentation claims
+    LIBGCC2_LONG_DOUBLE_TYPE_SIZE to default to LONG_DOUBLE_TYPE_SIZE, but
+    it apparently does not */
+ /*#undef LONG_DOUBLE_TYPE_SIZE
+ #define LONG_DOUBLE_TYPE_SIZE 128
+ #undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE
+ #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128*/
+ 
+ #undef TARGET_OS_CPP_BUILTINS
+ #define TARGET_OS_CPP_BUILTINS()					\
+   do									\
+     {									\
+ 	builtin_define ("__HAIKU__");					\
+ 	builtin_define ("__POWERPC__");					\
+ 	builtin_define ("__powerpc__");					\
+ 	builtin_define ("__stdcall=__attribute__((__stdcall__))");	\
+ 	builtin_define ("__cdecl=__attribute__((__cdecl__))");		\
+     builtin_define ("__STDC_ISO_10646__=201103L"); \
+ 	builtin_assert ("system=haiku");					\
+ 	builtin_assert ("cpu=powerpc");					\
+ 	builtin_assert ("machine=powerpc");					\
+ 	TARGET_OS_SYSV_CPP_BUILTINS ();					\
+     }									\
+   while (0)
+ 
+ /* Provide a LINK_SPEC appropriate for Haiku.  Here we provide support
+    for the special GCC options -static and -shared, which allow us to
+    link things in one of these three modes by applying the appropriate
+    combinations of options at link-time.  */
+ 
+ /* If ELF is the default format, we should not use /lib/elf.  */
+ 
+ #undef	LINK_SPEC
+ #define LINK_SPEC "%{!o*:-o %b} -m elf_ppc_haiku -shared -no-undefined %{nostart:-e 0}"
diff -Nrcpad gcc-4.7.2-orig/gcc/config/t-haiku gcc-4.7.2/gcc/config/t-haiku
*** gcc-4.7.2-orig/gcc/config/t-haiku	1969-12-31 19:00:00.000000000 -0500
--- gcc-4.7.2/gcc/config/t-haiku	2012-11-24 20:11:59.000000000 -0500
***************
*** 0 ****
--- 1,4 ----
+ # There are system headers elsewhere, but these are the ones that
+ # we are most likely to want to apply any fixes to.
+ NATIVE_SYSTEM_HEADER_DIR = /boot/develop/headers
+ LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/posix/limits.h ]
diff -Nrcpad gcc-4.7.2-orig/gcc/config.gcc gcc-4.7.2/gcc/config.gcc
*** gcc-4.7.2-orig/gcc/config.gcc	2012-09-12 05:03:54.000000000 -0400
--- gcc-4.7.2/gcc/config.gcc	2012-11-24 20:55:57.464521652 -0500
*************** arm*-*-netbsdelf*)
*** 841,846 ****
--- 841,857 ----
  	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
  	tmake_file="${tmake_file} arm/t-arm"
  	;;
+ arm*-*-haiku*)
+ 	tmake_file="${tmake_file} t-haiku arm/t-arm arm/t-arm-elf arm/t-bpabi arm/t-haiku"
+ 	tm_file="dbxelf.h elfos.h haiku.h arm/elf.h arm/bpabi.h arm/haiku.h"
+ 	# The BPABI long long divmod functions return a 128-bit value in
+ 	# registers r0-r3.  Correctly modeling that requires the use of
+ 	# TImode.
+ 	need_64bit_hwint=yes
+ 	default_use_cxa_atexit=yes
+ 	native_system_header_dir=/boot/develop/headers
+ 	tm_file="${tm_file} arm/aout.h arm/arm.h"
+ 	;;
  arm*-*-linux*)			# ARM GNU/Linux with ELF
  	tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
  	case $target in
*************** i[34567]86-*-freebsd*)
*** 1214,1219 ****
--- 1225,1240 ----
  x86_64-*-freebsd*)
  	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h"
  	;;
+ i[34567]86-*-haiku*)
+ 	tmake_file="${tmake_file} t-haiku"
+ 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h haiku.h i386/haiku.h"
+ 	native_system_header_dir=/boot/develop/headers
+ 	;;
+ x86_64-*-haiku*)
+ 	tmake_file="${tmake_file} t-haiku i386/t-haiku64"
+ 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h haiku.h i386/haiku64.h"
+ 	native_system_header_dir=/boot/develop/headers
+ 	;;
  i[34567]86-*-netbsdelf*)
  	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h"
  	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
*************** m68k-*-rtems*)
*** 1702,1707 ****
--- 1723,1736 ----
  	tm_file="${tm_file} m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h m68k/rtemself.h rtems.h newlib-stdint.h"
  	tm_defines="${tm_defines} MOTOROLA=1"
  	;;
+ m68k-*-haiku*)
+ 	default_m68k_cpu=68020
+ 	default_cf_cpu=5206
+ 	tmake_file="m68k/t-m68kbare m68k/t-crtstuff t-haiku" #??
+ 	tm_file="${tm_file} dbxelf.h elfos.h haiku.h m68k/haiku.h"
+ 	tm_defines="${tm_defines} MOTOROLA=1"
+ 	native_system_header_dir=/boot/develop/headers
+ 	;;
  mcore-*-elf)
  	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file} mcore/mcore-elf.h"
  	tmake_file=mcore/t-mcore
*************** mips-*-elf* | mipsel-*-elf*)
*** 1887,1892 ****
--- 1916,1926 ----
  	tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
  	tmake_file="mips/t-elf"
  	;;
+ mipsel-*-haiku*)
+ 	tmake_file="mips/t-elf t-haiku"
+ 	tm_file="elfos.h ${tm_file} haiku.h mips/haiku.h"
+ 	native_system_header_dir=/boot/develop/headers
+ 	;;
  mips64-*-elf* | mips64el-*-elf*)
  	tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
  	tmake_file="mips/t-elf"
*************** powerpc-*-eabi*)
*** 2028,2033 ****
--- 2062,2073 ----
  	tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
  	use_gcc_stdint=wrap
  	;;
+ powerpc-*-haiku*)
+ 	tmake_file="rs6000/t-fprules rs6000/t-ppcos rs6000/t-ppccomm t-haiku"
+ 	tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h haiku.h rs6000/haiku.h"
+ 	extra_options="${extra_options} rs6000/sysv4.opt"
+ 	native_system_header_dir=/boot/develop/headers
+ 	;;
  powerpc-*-rtems*)
  	tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h rs6000/rtems.h rtems.h"
  	extra_options="${extra_options} rs6000/sysv4.opt"
diff -Nrcpad gcc-4.7.2-orig/gcc/configure gcc-4.7.2/gcc/configure
*** gcc-4.7.2-orig/gcc/configure	2012-09-13 09:32:31.000000000 -0400
--- gcc-4.7.2/gcc/configure	2012-11-16 19:33:38.520834244 -0500
*************** ac_includes_default="\
*** 599,604 ****
--- 599,605 ----
  #endif"
  
  ac_subst_vars='LTLIBOBJS
+ math_library
  LIBOBJS
  enable_plugin
  pluginlibs
*************** ac_compiler_gnu=$ac_cv_c_compiler_gnu
*** 8793,8798 ****
--- 8794,8809 ----
  # --------
  
  
+ # Configure -lm usage for host tools that need it
+ math_library="-lm"
+ case $host in
+   *-*-haiku*)
+     # no separate math library needed
+     math_library=
+     ;;
+ esac
+ 
+ 
  # These libraries may be used by collect2.
  # We may need a special search path to get them linked.
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for collect2 libraries" >&5
*************** case ${enable_threads} in
*** 11301,11307 ****
      # default
      target_thread_file='single'
      ;;
!   aix | dce | lynx | mipssde | posix | rtems | \
    single | tpf | vxworks | win32)
      target_thread_file=${enable_threads}
      ;;
--- 11312,11318 ----
      # default
      target_thread_file='single'
      ;;
!   aix | dce | haiku | lynx | mipssde | posix | rtems | \
    single | tpf | vxworks | win32)
      target_thread_file=${enable_threads}
      ;;
*************** haiku*)
*** 17213,17220 ****
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
    shlibpath_var=LIBRARY_PATH
!   shlibpath_overrides_runpath=yes
!   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
    hardcode_into_libs=yes
    ;;
  
--- 17224,17231 ----
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
    shlibpath_var=LIBRARY_PATH
!   shlibpath_overrides_runpath=no
!   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
    hardcode_into_libs=yes
    ;;
  
*************** haiku*)
*** 20872,20879 ****
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
    shlibpath_var=LIBRARY_PATH
!   shlibpath_overrides_runpath=yes
!   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
    hardcode_into_libs=yes
    ;;
  
--- 20883,20890 ----
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
    shlibpath_var=LIBRARY_PATH
!   shlibpath_overrides_runpath=no
!   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
    hardcode_into_libs=yes
    ;;
  
diff -Nrcpad gcc-4.7.2-orig/gcc/configure.ac gcc-4.7.2/gcc/configure.ac
*** gcc-4.7.2-orig/gcc/configure.ac	2012-09-13 09:32:31.000000000 -0400
--- gcc-4.7.2/gcc/configure.ac	2012-11-16 19:33:38.524834244 -0500
*************** AC_LANG_POP(C++)
*** 964,969 ****
--- 964,978 ----
  # UNSORTED
  # --------
  
+ # Configure -lm usage for host tools that need it
+ math_library="-lm"
+ case $host in
+   *-*-haiku*)
+     # no separate math library needed
+     math_library=
+     ;;
+ esac
+ 
  
  # These libraries may be used by collect2.
  # We may need a special search path to get them linked.
*************** case ${enable_threads} in
*** 1423,1429 ****
      # default
      target_thread_file='single'
      ;;
!   aix | dce | lynx | mipssde | posix | rtems | \
    single | tpf | vxworks | win32)
      target_thread_file=${enable_threads}
      ;;
--- 1432,1438 ----
      # default
      target_thread_file='single'
      ;;
!   aix | dce | haiku | lynx | mipssde | posix | rtems | \
    single | tpf | vxworks | win32)
      target_thread_file=${enable_threads}
      ;;
diff -Nrcpad gcc-4.7.2-orig/gcc/defaults.h gcc-4.7.2/gcc/defaults.h
*** gcc-4.7.2-orig/gcc/defaults.h	2012-08-14 09:59:04.000000000 -0400
--- gcc-4.7.2/gcc/defaults.h	2012-11-25 14:09:23.000000000 -0500
*************** see the files COPYING3 and COPYING.RUNTI
*** 402,409 ****
  #endif
  
  /* This decision to use a .jcr section can be overridden by defining
!    USE_JCR_SECTION to 0 in target file.  This is necessary if target
!    can define JCR_SECTION_NAME but does not have crtstuff or
     linker support for .jcr section.  */
  #ifndef TARGET_USE_JCR_SECTION
  #ifdef JCR_SECTION_NAME
--- 402,409 ----
  #endif
  
  /* This decision to use a .jcr section can be overridden by defining
!    TARGET_USE_JCR_SECTION to 0 in target file.  This is necessary if
!    target can define JCR_SECTION_NAME but does not have crtstuff or
     linker support for .jcr section.  */
  #ifndef TARGET_USE_JCR_SECTION
  #ifdef JCR_SECTION_NAME
*************** see the files COPYING3 and COPYING.RUNTI
*** 411,416 ****
--- 411,420 ----
  #else
  #define TARGET_USE_JCR_SECTION 0
  #endif
+ #else
+ #if !(TARGET_USE_JCR_SECTION)
+ #undef JCR_SECTION_NAME
+ #endif
  #endif
  
  /* Number of hardware registers that go into the DWARF-2 unwind info.
diff -Nrcpad gcc-4.7.2-orig/gcc/ginclude/stdarg.h gcc-4.7.2/gcc/ginclude/stdarg.h
*** gcc-4.7.2-orig/gcc/ginclude/stdarg.h	2009-04-09 11:00:19.000000000 -0400
--- gcc-4.7.2/gcc/ginclude/stdarg.h	2012-11-16 19:33:52.748833876 -0500
*************** typedef __gnuc_va_list va_list;
*** 97,103 ****
  #ifndef _VA_LIST
  /* The macro _VA_LIST_T_H is used in the Bull dpx2  */
  #ifndef _VA_LIST_T_H
! /* The macro __va_list__ is used by BeOS.  */
  #ifndef __va_list__
  typedef __gnuc_va_list va_list;
  #endif /* not __va_list__ */
--- 97,103 ----
  #ifndef _VA_LIST
  /* The macro _VA_LIST_T_H is used in the Bull dpx2  */
  #ifndef _VA_LIST_T_H
! /* The macro __va_list__ is used by BeOS and Haiku.  */
  #ifndef __va_list__
  typedef __gnuc_va_list va_list;
  #endif /* not __va_list__ */
diff -Nrcpad gcc-4.7.2-orig/gcc/ginclude/stddef.h gcc-4.7.2/gcc/ginclude/stddef.h
*** gcc-4.7.2-orig/gcc/ginclude/stddef.h	2012-02-11 20:06:04.000000000 -0500
--- gcc-4.7.2/gcc/ginclude/stddef.h	2012-11-16 19:33:52.748833876 -0500
*************** typedef __PTRDIFF_TYPE__ ptrdiff_t;
*** 167,173 ****
  /* Define this type if we are doing the whole job,
     or if we want this type in particular.  */
  #if defined (_STDDEF_H) || defined (__need_size_t)
! #ifndef __size_t__	/* BeOS */
  #ifndef __SIZE_T__	/* Cray Unicos/Mk */
  #ifndef _SIZE_T	/* in case <sys/types.h> has defined it. */
  #ifndef _SYS_SIZE_T_H
--- 167,173 ----
  /* Define this type if we are doing the whole job,
     or if we want this type in particular.  */
  #if defined (_STDDEF_H) || defined (__need_size_t)
! #ifndef __size_t__	/* BeOS, Haiku */
  #ifndef __SIZE_T__	/* Cray Unicos/Mk */
  #ifndef _SIZE_T	/* in case <sys/types.h> has defined it. */
  #ifndef _SYS_SIZE_T_H
*************** typedef __PTRDIFF_TYPE__ ptrdiff_t;
*** 184,190 ****
  #ifndef _GCC_SIZE_T
  #ifndef _SIZET_
  #ifndef __size_t
! #define __size_t__	/* BeOS */
  #define __SIZE_T__	/* Cray Unicos/Mk */
  #define _SIZE_T
  #define _SYS_SIZE_T_H
--- 184,190 ----
  #ifndef _GCC_SIZE_T
  #ifndef _SIZET_
  #ifndef __size_t
! #define __size_t__	/* BeOS, Haiku */
  #define __SIZE_T__	/* Cray Unicos/Mk */
  #define _SIZE_T
  #define _SYS_SIZE_T_H
*************** typedef long ssize_t;
*** 244,250 ****
  /* Define this type if we are doing the whole job,
     or if we want this type in particular.  */
  #if defined (_STDDEF_H) || defined (__need_wchar_t)
! #ifndef __wchar_t__	/* BeOS */
  #ifndef __WCHAR_T__	/* Cray Unicos/Mk */
  #ifndef _WCHAR_T
  #ifndef _T_WCHAR_
--- 244,250 ----
  /* Define this type if we are doing the whole job,
     or if we want this type in particular.  */
  #if defined (_STDDEF_H) || defined (__need_wchar_t)
! #ifndef __wchar_t__	/* BeOS, Haiku */
  #ifndef __WCHAR_T__	/* Cray Unicos/Mk */
  #ifndef _WCHAR_T
  #ifndef _T_WCHAR_
*************** typedef long ssize_t;
*** 261,267 ****
  #ifndef ___int_wchar_t_h
  #ifndef __INT_WCHAR_T_H
  #ifndef _GCC_WCHAR_T
! #define __wchar_t__	/* BeOS */
  #define __WCHAR_T__	/* Cray Unicos/Mk */
  #define _WCHAR_T
  #define _T_WCHAR_
--- 261,267 ----
  #ifndef ___int_wchar_t_h
  #ifndef __INT_WCHAR_T_H
  #ifndef _GCC_WCHAR_T
! #define __wchar_t__	/* BeOS, Haiku */
  #define __WCHAR_T__	/* Cray Unicos/Mk */
  #define _WCHAR_T
  #define _T_WCHAR_
diff -Nrcpad gcc-4.7.2-orig/gcc/Makefile.in gcc-4.7.2/gcc/Makefile.in
*** gcc-4.7.2-orig/gcc/Makefile.in	2012-08-06 10:34:27.000000000 -0400
--- gcc-4.7.2/gcc/Makefile.in	2012-11-24 21:03:23.428534783 -0500
*************** $(genprogerr:%=build/gen%$(build_exeext)
*** 3943,3949 ****
  genprog = $(genprogerr) check checksum condmd
  
  # These programs need libs over and above what they get from the above list.
! build/genautomata$(build_exeext) : BUILD_LIBS += -lm
  
  # These programs are not linked with the MD reader.
  build/gengtype$(build_exeext) : build/gengtype-lex.o build/gengtype-parse.o \
--- 3943,3949 ----
  genprog = $(genprogerr) check checksum condmd
  
  # These programs need libs over and above what they get from the above list.
! build/genautomata$(build_exeext) : BUILD_LIBS += @math_library@
  
  # These programs are not linked with the MD reader.
  build/gengtype$(build_exeext) : build/gengtype-lex.o build/gengtype-parse.o \
diff -Nrcpad gcc-4.7.2-orig/libcpp/configure gcc-4.7.2/libcpp/configure
*** gcc-4.7.2-orig/libcpp/configure	2012-09-20 03:23:55.000000000 -0400
--- gcc-4.7.2/libcpp/configure	2012-11-16 19:33:52.756833875 -0500
*************** fi
*** 7370,7375 ****
--- 7370,7376 ----
  case $target in
  	alpha*-*-* | \
  	arm*-*-*eabi* | \
+ 	arm*-*-haiku* | \
  	arm*-*-symbianelf* | \
  	x86_64-*-* | \
  	ia64-*-* | \
diff -Nrcpad gcc-4.7.2-orig/libcpp/configure.ac gcc-4.7.2/libcpp/configure.ac
*** gcc-4.7.2-orig/libcpp/configure.ac	2012-02-14 05:02:21.000000000 -0500
--- gcc-4.7.2/libcpp/configure.ac	2012-11-16 19:33:52.756833875 -0500
*************** m4_changequote(,)
*** 150,155 ****
--- 150,156 ----
  case $target in
  	alpha*-*-* | \
  	arm*-*-*eabi* | \
+ 	arm*-*-haiku* | \
  	arm*-*-symbianelf* | \
  	x86_64-*-* | \
  	ia64-*-* | \
diff -Nrcpad gcc-4.7.2-orig/libgcc/config.host gcc-4.7.2/libgcc/config.host
*** gcc-4.7.2-orig/libgcc/config.host	2012-09-05 08:19:47.000000000 -0400
--- gcc-4.7.2/libgcc/config.host	2012-11-24 00:55:16.725222746 -0500
*************** arm*-*-freebsd*)
*** 324,329 ****
--- 324,332 ----
  arm*-*-netbsdelf*)
  	tmake_file="$tmake_file arm/t-arm arm/t-netbsd t-slibgcc-gld-nover"
  	;;
+ arm-*-haiku*)
+ 	tm_file="${tm_file} arm/bpabi-lib.h"
+ 	;;
  arm*-*-linux*)			# ARM GNU/Linux with ELF
  	tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix"
  	case ${host} in
*************** i[34567]86-*-freebsd*)
*** 532,537 ****
--- 535,548 ----
  x86_64-*-freebsd*)
  	tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff"
  	;;
+ i[34567]86-*-haiku*)
+ 	tmake_file="${tmake_file} i386/t-crtstuff t-libgcc-pic"
+ 	extra_parts="crtbegin.o crtend.o"
+ 	;;
+ x86_64-*-haiku*)
+ 	tmake_file="${tmake_file} i386/t-crtstuff t-libgcc-pic"
+ 	extra_parts="crtbegin.o crtend.o"
+ 	;;
  i[34567]86-*-netbsdelf*)
  	;;
  x86_64-*-netbsd*)
*************** m32r-*-linux*)
*** 703,708 ****
--- 714,721 ----
  m32rle-*-linux*)
  	tmake_file="$tmake_file m32r/t-linux t-fdpbit"
  	;;
+ m68k-*-haiku*)
+ 	;;
  m68k-*-elf* | fido-*-elf)
  	tmake_file="$tmake_file m68k/t-floatlib"
  	;;
*************** mips*-*-linux*)				# Linux MIPS, either
*** 757,762 ****
--- 770,778 ----
  	;;
  mips*-*-openbsd*)
  	;;
+ mips*-*-haiku*)
+ 	extra_parts="crtbegin.o crtend.o"
+ 	;;
  mips*-sde-elf*)
  	tmake_file="$tmake_file mips/t-crtstuff mips/t-mips16"
  	case "${with_newlib}" in
*************** powerpc*-*-freebsd*)
*** 859,864 ****
--- 875,882 ----
  	  ;;
  	esac
  	;;
+ powerpc-*-haiku*)
+ 	;;
  powerpc-*-netbsd*)
  	tmake_file="$tmake_file rs6000/t-netbsd rs6000/t-crtstuff"
  	;;
diff -Nrcpad gcc-4.7.2-orig/libgcc/crtstuff.c gcc-4.7.2/libgcc/crtstuff.c
*** gcc-4.7.2-orig/libgcc/crtstuff.c	2011-12-06 16:35:41.000000000 -0500
--- gcc-4.7.2/libgcc/crtstuff.c	2012-11-25 11:45:45.000000000 -0500
*************** call_ ## FUNC (void)					\
*** 104,110 ****
--- 104,112 ----
      && defined(HAVE_LD_EH_FRAME_HDR) \
      && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
      && defined(__GLIBC__) && __GLIBC__ >= 2
+ #ifndef __HAIKU__
  #include <link.h>
+ #endif
  /* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h.
     But it doesn't use PT_GNU_EH_FRAME ELF segment currently.  */
  # if !defined(__UCLIBC__) \
diff -Nrcpad gcc-4.7.2-orig/libgomp/configure gcc-4.7.2/libgomp/configure
*** gcc-4.7.2-orig/libgomp/configure	2012-09-20 03:23:55.000000000 -0400
--- gcc-4.7.2/libgomp/configure	2012-11-16 19:33:52.764833875 -0500
*************** haiku*)
*** 10283,10290 ****
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
    shlibpath_var=LIBRARY_PATH
!   shlibpath_overrides_runpath=yes
!   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
    hardcode_into_libs=yes
    ;;
  
--- 10283,10290 ----
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
    shlibpath_var=LIBRARY_PATH
!   shlibpath_overrides_runpath=no
!   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
    hardcode_into_libs=yes
    ;;
  
*************** haiku*)
*** 13922,13929 ****
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
    shlibpath_var=LIBRARY_PATH
!   shlibpath_overrides_runpath=yes
!   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
    hardcode_into_libs=yes
    ;;
  
--- 13922,13929 ----
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
    shlibpath_var=LIBRARY_PATH
!   shlibpath_overrides_runpath=no
!   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
    hardcode_into_libs=yes
    ;;
  
diff -Nrcpad gcc-4.7.2-orig/libmudflap/configure gcc-4.7.2/libmudflap/configure
*** gcc-4.7.2-orig/libmudflap/configure	2012-08-06 10:34:27.000000000 -0400
--- gcc-4.7.2/libmudflap/configure	2012-11-16 19:33:52.768833875 -0500
*************** haiku*)
*** 9810,9817 ****
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
    shlibpath_var=LIBRARY_PATH
!   shlibpath_overrides_runpath=yes
!   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
    hardcode_into_libs=yes
    ;;
  
--- 9810,9817 ----
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
    shlibpath_var=LIBRARY_PATH
!   shlibpath_overrides_runpath=no
!   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
    hardcode_into_libs=yes
    ;;
  
diff -Nrcpad gcc-4.7.2-orig/libquadmath/configure gcc-4.7.2/libquadmath/configure
*** gcc-4.7.2-orig/libquadmath/configure	2012-05-31 14:57:56.000000000 -0400
--- gcc-4.7.2/libquadmath/configure	2012-11-16 19:33:52.776833875 -0500
*************** haiku*)
*** 9698,9705 ****
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
    shlibpath_var=LIBRARY_PATH
!   shlibpath_overrides_runpath=yes
!   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
    hardcode_into_libs=yes
    ;;
  
--- 9698,9705 ----
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
    shlibpath_var=LIBRARY_PATH
!   shlibpath_overrides_runpath=no
!   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
    hardcode_into_libs=yes
    ;;
  
diff -Nrcpad gcc-4.7.2-orig/libssp/configure gcc-4.7.2/libssp/configure
*** gcc-4.7.2-orig/libssp/configure	2012-08-06 10:34:27.000000000 -0400
--- gcc-4.7.2/libssp/configure	2012-11-16 19:33:52.780833875 -0500
*************** haiku*)
*** 9835,9842 ****
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
    shlibpath_var=LIBRARY_PATH
!   shlibpath_overrides_runpath=yes
!   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
    hardcode_into_libs=yes
    ;;
  
--- 9835,9842 ----
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
    shlibpath_var=LIBRARY_PATH
!   shlibpath_overrides_runpath=no
!   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
    hardcode_into_libs=yes
    ;;
  
diff -Nrcpad gcc-4.7.2-orig/libstdc++-v3/configure gcc-4.7.2/libstdc++-v3/configure
*** gcc-4.7.2-orig/libstdc++-v3/configure	2012-08-06 10:34:27.000000000 -0400
--- gcc-4.7.2/libstdc++-v3/configure	2012-11-16 19:33:52.804833874 -0500
*************** haiku*)
*** 10683,10690 ****
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
    shlibpath_var=LIBRARY_PATH
!   shlibpath_overrides_runpath=yes
!   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
    hardcode_into_libs=yes
    ;;
  
--- 10683,10690 ----
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
    shlibpath_var=LIBRARY_PATH
!   shlibpath_overrides_runpath=no
!   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
    hardcode_into_libs=yes
    ;;
  
*************** haiku*)
*** 14366,14373 ****
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
    shlibpath_var=LIBRARY_PATH
!   shlibpath_overrides_runpath=yes
!   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
    hardcode_into_libs=yes
    ;;
  
--- 14366,14373 ----
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
    shlibpath_var=LIBRARY_PATH
!   shlibpath_overrides_runpath=no
!   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
    hardcode_into_libs=yes
    ;;
  
*************** $as_echo "$ac_ld_relro" >&6; }
*** 45072,45077 ****
--- 45072,45649 ----
  
      fi
      ;;
+   *haiku*)
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h \
+       machine/endian.h machine/param.h sys/machine.h sys/types.h \
+       fp.h float.h endian.h inttypes.h locale.h float.h stdint.h
+ do
+ as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+   { echo "$as_me:$LINENO: checking for $ac_header" >&5
+ echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+ if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ fi
+ ac_res=`eval echo '${'$as_ac_Header'}'`
+ 	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+ echo "${ECHO_T}$ac_res" >&6; }
+ else
+   # Is the header compilable?
+ { echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
+ $ac_includes_default
+ #include <$ac_header>
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (ac_try="$ac_compile"
+ case "(($ac_try" in
+   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+   *) ac_try_echo=$ac_try;;
+ esac
+ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+   (eval "$ac_compile") 2>conftest.er1
+   ac_status=$?
+   grep -v '^ *+' conftest.er1 >conftest.err
+   rm -f conftest.er1
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } && {
+ 	 test -z "$ac_c_werror_flag" ||
+ 	 test ! -s conftest.err
+        } && test -s conftest.$ac_objext; then
+   ac_header_compiler=yes
+ else
+   echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ 	ac_header_compiler=no
+ fi
+ 
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6; }
+ 
+ # Is the header present?
+ { echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
+ #include <$ac_header>
+ _ACEOF
+ if { (ac_try="$ac_cpp conftest.$ac_ext"
+ case "(($ac_try" in
+   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+   *) ac_try_echo=$ac_try;;
+ esac
+ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+   ac_status=$?
+   grep -v '^ *+' conftest.er1 >conftest.err
+   rm -f conftest.er1
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } >/dev/null && {
+ 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ 	 test ! -s conftest.err
+        }; then
+   ac_header_preproc=yes
+ else
+   echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+   ac_header_preproc=no
+ fi
+ 
+ rm -f conftest.err conftest.$ac_ext
+ { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+ echo "${ECHO_T}$ac_header_preproc" >&6; }
+ 
+ # So?  What about this header?
+ case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+   yes:no: )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+     ac_header_preproc=yes
+     ;;
+   no:yes:* )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+     { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+ echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+     { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+ echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+     { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+ echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ 
+     ;;
+ esac
+ { echo "$as_me:$LINENO: checking for $ac_header" >&5
+ echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+ if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ ac_res=`eval echo '${'$as_ac_Header'}'`
+ 	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+ echo "${ECHO_T}$ac_res" >&6; }
+ 
+ fi
+ if test `eval echo '${'$as_ac_Header'}'` = yes; then
+   cat >>confdefs.h <<_ACEOF
+ #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+ _ACEOF
+ 
+ fi
+ 
+ done
+ 
+     SECTION_FLAGS='-ffunction-sections -fdata-sections'
+ 
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_INT64_T 1
+ _ACEOF
+ 
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_ACOSF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_ASINF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_ATANF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_ATAN2F 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_CEILF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_COPYSIGN 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_COPYSIGNF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_COSF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_COSHF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_EXPF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_FABSF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_FINITE 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_FINITEF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_FLOORF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_FMODF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_FREXPF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_HYPOT 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_HYPOTF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_ISINF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_ISINFF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_ISNAN 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_ISNANF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_LOGF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_LOG10F 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_MODFF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_SINF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_SINHF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_SQRTF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_TANF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_TANHF 1
+ _ACEOF
+ 
+     ;;
+   *haiku*)
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h \
+       machine/endian.h machine/param.h sys/machine.h sys/types.h \
+       fp.h float.h endian.h inttypes.h locale.h float.h stdint.h
+ do
+ as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+   { echo "$as_me:$LINENO: checking for $ac_header" >&5
+ echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+ if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ fi
+ ac_res=`eval echo '${'$as_ac_Header'}'`
+ 	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+ echo "${ECHO_T}$ac_res" >&6; }
+ else
+   # Is the header compilable?
+ { echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
+ $ac_includes_default
+ #include <$ac_header>
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (ac_try="$ac_compile"
+ case "(($ac_try" in
+   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+   *) ac_try_echo=$ac_try;;
+ esac
+ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+   (eval "$ac_compile") 2>conftest.er1
+   ac_status=$?
+   grep -v '^ *+' conftest.er1 >conftest.err
+   rm -f conftest.er1
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } && {
+ 	 test -z "$ac_c_werror_flag" ||
+ 	 test ! -s conftest.err
+        } && test -s conftest.$ac_objext; then
+   ac_header_compiler=yes
+ else
+   echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ 	ac_header_compiler=no
+ fi
+ 
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6; }
+ 
+ # Is the header present?
+ { echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
+ #include <$ac_header>
+ _ACEOF
+ if { (ac_try="$ac_cpp conftest.$ac_ext"
+ case "(($ac_try" in
+   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+   *) ac_try_echo=$ac_try;;
+ esac
+ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+   ac_status=$?
+   grep -v '^ *+' conftest.er1 >conftest.err
+   rm -f conftest.er1
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } >/dev/null && {
+ 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ 	 test ! -s conftest.err
+        }; then
+   ac_header_preproc=yes
+ else
+   echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+   ac_header_preproc=no
+ fi
+ 
+ rm -f conftest.err conftest.$ac_ext
+ { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+ echo "${ECHO_T}$ac_header_preproc" >&6; }
+ 
+ # So?  What about this header?
+ case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+   yes:no: )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+     ac_header_preproc=yes
+     ;;
+   no:yes:* )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+     { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+ echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+     { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+ echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+     { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+ echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ 
+     ;;
+ esac
+ { echo "$as_me:$LINENO: checking for $ac_header" >&5
+ echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+ if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ ac_res=`eval echo '${'$as_ac_Header'}'`
+ 	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+ echo "${ECHO_T}$ac_res" >&6; }
+ 
+ fi
+ if test `eval echo '${'$as_ac_Header'}'` = yes; then
+   cat >>confdefs.h <<_ACEOF
+ #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+ _ACEOF
+ 
+ fi
+ 
+ done
+ 
+     SECTION_FLAGS='-ffunction-sections -fdata-sections'
+ 
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_INT64_T 1
+ _ACEOF
+ 
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_ACOSF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_ASINF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_ATANF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_ATAN2F 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_CEILF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_COPYSIGN 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_COPYSIGNF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_COSF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_COSHF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_EXPF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_FABSF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_FINITE 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_FINITEF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_FLOORF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_FMODF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_FREXPF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_HYPOT 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_HYPOTF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_ISINF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_ISINFF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_ISNAN 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_ISNANF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_LOGF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_LOG10F 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_MODFF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_SINF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_SINHF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_SQRTF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_TANF 1
+ _ACEOF
+ 
+     cat >>confdefs.h <<\_ACEOF
+ #define HAVE_TANHF 1
+ _ACEOF
+ 
+     ;;
    *-hpux*)
      SECTION_FLAGS='-ffunction-sections -fdata-sections'
  
diff -Nrcpad gcc-4.7.2-orig/libstdc++-v3/crossconfig.m4 gcc-4.7.2/libstdc++-v3/crossconfig.m4
*** gcc-4.7.2-orig/libstdc++-v3/crossconfig.m4	2011-07-18 07:04:18.000000000 -0400
--- gcc-4.7.2/libstdc++-v3/crossconfig.m4	2012-11-16 19:33:52.804833874 -0500
*************** case "${host}" in
*** 99,104 ****
--- 99,146 ----
        AC_DEFINE(HAVE_ISNANL)
      fi
      ;;
+ 
+   *-haiku*)
+     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 \
+       fp.h float.h endian.h inttypes.h locale.h float.h stdint.h])
+     SECTION_FLAGS='-ffunction-sections -fdata-sections'
+     AC_SUBST(SECTION_FLAGS)
+ 
+     AC_DEFINE(HAVE_INT64_T)
+ 
+     AC_DEFINE(HAVE_ACOSF)
+     AC_DEFINE(HAVE_ASINF)
+     AC_DEFINE(HAVE_ATANF)
+     AC_DEFINE(HAVE_ATAN2F)
+     AC_DEFINE(HAVE_CEILF)
+     AC_DEFINE(HAVE_COPYSIGN)
+     AC_DEFINE(HAVE_COPYSIGNF)
+     AC_DEFINE(HAVE_COSF)
+     AC_DEFINE(HAVE_COSHF)
+     AC_DEFINE(HAVE_EXPF)
+     AC_DEFINE(HAVE_FABSF)
+     AC_DEFINE(HAVE_FINITE)
+     AC_DEFINE(HAVE_FINITEF)
+     AC_DEFINE(HAVE_FLOORF)
+     AC_DEFINE(HAVE_FMODF)
+     AC_DEFINE(HAVE_FREXPF)
+     AC_DEFINE(HAVE_HYPOT)
+     AC_DEFINE(HAVE_HYPOTF)
+     AC_DEFINE(HAVE_ISINF)
+     AC_DEFINE(HAVE_ISINFF)
+     AC_DEFINE(HAVE_ISNAN)
+     AC_DEFINE(HAVE_ISNANF)
+     AC_DEFINE(HAVE_LOGF)
+     AC_DEFINE(HAVE_LOG10F)
+     AC_DEFINE(HAVE_MODFF)
+     AC_DEFINE(HAVE_SINF)
+     AC_DEFINE(HAVE_SINHF)
+     AC_DEFINE(HAVE_SQRTF)
+     AC_DEFINE(HAVE_TANF)
+     AC_DEFINE(HAVE_TANHF)
+     ;;
+ 
    *-hpux*)
      SECTION_FLAGS='-ffunction-sections -fdata-sections'
      AC_SUBST(SECTION_FLAGS)
diff -Nrcpad gcc-4.7.2-orig/libstdc++-v3/libsupc++/tinfo.cc gcc-4.7.2/libstdc++-v3/libsupc++/tinfo.cc
*** gcc-4.7.2-orig/libstdc++-v3/libsupc++/tinfo.cc	2011-09-27 02:03:58.000000000 -0400
--- gcc-4.7.2/libstdc++-v3/libsupc++/tinfo.cc	2012-11-16 19:33:52.804833874 -0500
*************** std::type_info::
*** 32,37 ****
--- 32,46 ----
  ~type_info ()
  { }
  
+ #ifdef __HAIKU__
+ #ifndef __GXX_MERGED_TYPEINFO_NAMES
+ #define __GXX_MERGED_TYPEINFO_NAMES 0
+ #endif
+ #ifndef __GXX_TYPEINFO_EQUALITY_INLINE
+ #define __GXX_TYPEINFO_EQUALITY_INLINE 0
+ #endif
+ #endif
+ 
  #if !__GXX_TYPEINFO_EQUALITY_INLINE
  
  // We can't rely on common symbols being shared between shared objects.
diff -Nrcpad gcc-4.7.2-orig/libtool.m4 gcc-4.7.2/libtool.m4
*** gcc-4.7.2-orig/libtool.m4	2012-08-06 10:34:27.000000000 -0400
--- gcc-4.7.2/libtool.m4	2012-11-16 19:33:52.808833874 -0500
*************** haiku*)
*** 2328,2335 ****
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
    shlibpath_var=LIBRARY_PATH
!   shlibpath_overrides_runpath=yes
!   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
    hardcode_into_libs=yes
    ;;
  
--- 2328,2335 ----
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
    shlibpath_var=LIBRARY_PATH
!   shlibpath_overrides_runpath=no
!   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
    hardcode_into_libs=yes
    ;;
  
diff -Nrcpad gcc-4.7.2-orig/lto-plugin/configure gcc-4.7.2/lto-plugin/configure
*** gcc-4.7.2-orig/lto-plugin/configure	2011-12-20 11:54:12.000000000 -0500
--- gcc-4.7.2/lto-plugin/configure	2012-11-16 19:33:52.816833874 -0500
*************** haiku*)
*** 9747,9754 ****
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
    shlibpath_var=LIBRARY_PATH
!   shlibpath_overrides_runpath=yes
!   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
    hardcode_into_libs=yes
    ;;
  
--- 9747,9754 ----
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
    shlibpath_var=LIBRARY_PATH
!   shlibpath_overrides_runpath=no
!   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
    hardcode_into_libs=yes
    ;;
  
diff -Nrcpad gcc-4.7.2-orig/Makefile.in gcc-4.7.2/Makefile.in
*** gcc-4.7.2-orig/Makefile.in	2012-08-06 10:34:27.000000000 -0400
--- gcc-4.7.2/Makefile.in	2012-11-16 19:33:52.832833873 -0500
*************** configure-mpfr:
*** 11269,11274 ****
--- 11269,11275 ----
  	esac; \
  	srcdiroption="--srcdir=$${topdir}/mpfr"; \
  	libsrcdir="$$s/mpfr"; \
+ 	cp $(s)/gmp/gmp-impl.h $(s)/gmp/longlong.h ../gmp/ ; \
  	$(SHELL) $${libsrcdir}/configure \
  	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
  	  --target=${target_alias} $${srcdiroption} --disable-shared @extra_mpfr_configure_flags@ \
*************** configure-stage1-mpfr:
*** 11302,11307 ****
--- 11303,11309 ----
  	esac; \
  	srcdiroption="--srcdir=$${topdir}/mpfr"; \
  	libsrcdir="$$s/mpfr"; \
+ 	cp $(s)/gmp/gmp-impl.h $(s)/gmp/longlong.h ../gmp/ ; \
  	$(SHELL) $${libsrcdir}/configure \
  	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
  	  --target=${target_alias} $${srcdiroption} \
*************** configure-stage2-mpfr:
*** 11335,11340 ****
--- 11337,11343 ----
  	esac; \
  	srcdiroption="--srcdir=$${topdir}/mpfr"; \
  	libsrcdir="$$s/mpfr"; \
+ 	cp $(s)/gmp/gmp-impl.h $(s)/gmp/longlong.h ../gmp/ ; \
  	$(SHELL) $${libsrcdir}/configure \
  	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
  	  --target=${target_alias} $${srcdiroption} \
*************** configure-stage2-mpfr:
*** 11343,11348 ****
--- 11346,11352 ----
  	  --disable-shared @extra_mpfr_configure_flags@
  @endif mpfr-bootstrap
  
+ 
  .PHONY: configure-stage3-mpfr maybe-configure-stage3-mpfr
  maybe-configure-stage3-mpfr:
  @if mpfr-bootstrap
*************** configure-stage3-mpfr:
*** 11369,11374 ****
--- 11373,11379 ----
  	esac; \
  	srcdiroption="--srcdir=$${topdir}/mpfr"; \
  	libsrcdir="$$s/mpfr"; \
+ 	cp $(s)/gmp/gmp-impl.h $(s)/gmp/longlong.h ../gmp/ ; \
  	$(SHELL) $${libsrcdir}/configure \
  	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
  	  --target=${target_alias} $${srcdiroption} \
*************** configure-stage4-mpfr:
*** 11403,11408 ****
--- 11408,11414 ----
  	esac; \
  	srcdiroption="--srcdir=$${topdir}/mpfr"; \
  	libsrcdir="$$s/mpfr"; \
+ 	cp $(s)/gmp/gmp-impl.h $(s)/gmp/longlong.h ../gmp/ ; \
  	$(SHELL) $${libsrcdir}/configure \
  	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
  	  --target=${target_alias} $${srcdiroption} \
*************** configure-stageprofile-mpfr:
*** 11437,11442 ****
--- 11443,11449 ----
  	esac; \
  	srcdiroption="--srcdir=$${topdir}/mpfr"; \
  	libsrcdir="$$s/mpfr"; \
+ 	cp $(s)/gmp/gmp-impl.h $(s)/gmp/longlong.h ../gmp/ ; \
  	$(SHELL) $${libsrcdir}/configure \
  	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
  	  --target=${target_alias} $${srcdiroption} \
*************** configure-stagefeedback-mpfr:
*** 11471,11476 ****
--- 11478,11484 ----
  	esac; \
  	srcdiroption="--srcdir=$${topdir}/mpfr"; \
  	libsrcdir="$$s/mpfr"; \
+ 	cp $(s)/gmp/gmp-impl.h $(s)/gmp/longlong.h ../gmp/ ; \
  	$(SHELL) $${libsrcdir}/configure \
  	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
  	  --target=${target_alias} $${srcdiroption} \
diff -Nrcpad gcc-4.7.2-orig/zlib/configure gcc-4.7.2/zlib/configure
*** gcc-4.7.2-orig/zlib/configure	2012-08-06 10:34:27.000000000 -0400
--- gcc-4.7.2/zlib/configure	2012-11-16 19:33:52.836833873 -0500
*************** haiku*)
*** 9571,9578 ****
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
    shlibpath_var=LIBRARY_PATH
!   shlibpath_overrides_runpath=yes
!   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
    hardcode_into_libs=yes
    ;;
  
--- 9571,9578 ----
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
    shlibpath_var=LIBRARY_PATH
!   shlibpath_overrides_runpath=no
!   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
    hardcode_into_libs=yes
    ;;
  
