diff -Nrcpad ./gcc-5.1.0/config/acx.m4 ./gcc-5.1.0-Haiku/config/acx.m4 *** ./gcc-5.1.0/config/acx.m4 2011-12-18 18:58:37.000000000 +0900 --- ./gcc-5.1.0-Haiku/config/acx.m4 2015-04-23 05:42:59.077533017 +0900 *************** 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-5.1.0/config.rpath ./gcc-5.1.0-Haiku/config.rpath *** ./gcc-5.1.0/config.rpath 2011-02-13 20:45:53.000000000 +0900 --- ./gcc-5.1.0-Haiku/config.rpath 2015-04-23 05:42:59.153533015 +0900 *************** 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-5.1.0/configure ./gcc-5.1.0-Haiku/configure *** ./gcc-5.1.0/configure 2015-04-18 02:10:27.000000000 +0900 --- ./gcc-5.1.0-Haiku/configure 2015-04-23 05:42:59.189533014 +0900 *************** case "${host}" in *** 3026,3031 **** --- 3026,3034 ---- i[3456789]86-*-msdosdjgpp*) noconfigdirs="$noconfigdirs tcl tk itcl" ;; + *-*-haiku*) + noconfigdirs="$noconfigdirs tk itcl libgui gdb" + ;; esac *************** case "${target}" in *** 3440,3445 **** --- 3443,3451 ---- *-*-darwin*) noconfigdirs="$noconfigdirs ${libgcj}" ;; + *-*-haiku*) + noconfigdirs="$noconfigdirs ${libgcj}" + ;; *-*-netware*) noconfigdirs="$noconfigdirs ${libgcj}" ;; *************** case "${target}" in *** 3627,3632 **** --- 3633,3641 ---- *-*-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 *** 3680,3685 **** --- 3689,3697 ---- 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 *** 5331,5354 **** 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 --- 5343,5372 ---- 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 diff -Nrcpad ./gcc-5.1.0/gcc/Makefile.in ./gcc-5.1.0-Haiku/gcc/Makefile.in *** ./gcc-5.1.0/gcc/Makefile.in 2015-03-31 14:31:57.000000000 +0900 --- ./gcc-5.1.0-Haiku/gcc/Makefile.in 2015-04-23 05:47:42.037526462 +0900 *************** build_objdir := $(toplevel_builddir)/$(b *** 101,106 **** --- 101,108 ---- build_libobjdir := $(toplevel_builddir)/$(build_libsubdir) target_objdir := $(toplevel_builddir)/$(target_subdir) + HYBRID_SECONDARY = @HYBRID_SECONDARY@ + # -------- # Defined vpaths # -------- *************** DRIVER_DEFINES = \ *** 1982,1987 **** --- 1984,1993 ---- $(if $(SHLIB),$(if $(filter yes,@enable_shared@),-DENABLE_SHARED_LIBGCC)) \ -DCONFIGURE_SPECS="\"@CONFIGURE_SPECS@\"" + ifneq ($(HYBRID_SECONDARY),) + DRIVER_DEFINES += -DHYBRID_SECONDARY="\"$(HYBRID_SECONDARY)\"" + endif + CFLAGS-gcc.o += $(DRIVER_DEFINES) specs.h : s-specs ; @true *************** $(genprogerr:%=build/gen%$(build_exeext) *** 2554,2560 **** genprog = $(genprogerr) check checksum condmd match # These programs need libs over and above what they get from the above list. ! build/genautomata$(build_exeext) : BUILD_LIBS += -lm # For stage1 and when cross-compiling use the build libcpp which is # built with NLS disabled. For stage2+ use the host library and --- 2560,2566 ---- genprog = $(genprogerr) check checksum condmd match # These programs need libs over and above what they get from the above list. ! build/genautomata$(build_exeext) : BUILD_LIBS += @build_math_library@ # For stage1 and when cross-compiling use the build libcpp which is # built with NLS disabled. For stage2+ use the host library and *************** PREPROCESSOR_DEFINES = \ *** 2616,2621 **** --- 2622,2631 ---- -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \ @TARGET_SYSTEM_ROOT_DEFINE@ + ifneq ($(HYBRID_SECONDARY),) + PREPROCESSOR_DEFINES += -DHYBRID_SECONDARY="\"$(HYBRID_SECONDARY)\"" + endif + CFLAGS-cppbuiltin.o += $(PREPROCESSOR_DEFINES) -DBASEVER=$(BASEVER_s) cppbuiltin.o: $(BASEVER) diff -Nrcpad ./gcc-5.1.0/gcc/config/arm/haiku.h ./gcc-5.1.0-Haiku/gcc/config/arm/haiku.h *** ./gcc-5.1.0/gcc/config/arm/haiku.h 1970-01-01 09:00:00.000000000 +0900 --- ./gcc-5.1.0-Haiku/gcc/config/arm/haiku.h 2015-04-23 05:42:59.193533014 +0900 *************** *** 0 **** --- 1,80 ---- + /* 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. */ + + /* 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 %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}\ + %{mbig-endian:-EB} %{mlittle-endian:-EL} -X" + diff -Nrcpad ./gcc-5.1.0/gcc/config/arm/t-haiku ./gcc-5.1.0-Haiku/gcc/config/arm/t-haiku *** ./gcc-5.1.0/gcc/config/arm/t-haiku 1970-01-01 09:00:00.000000000 +0900 --- ./gcc-5.1.0-Haiku/gcc/config/arm/t-haiku 2015-04-23 05:42:59.193533014 +0900 *************** *** 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-5.1.0/gcc/config/haiku-stdint.h ./gcc-5.1.0-Haiku/gcc/config/haiku-stdint.h *** ./gcc-5.1.0/gcc/config/haiku-stdint.h 1970-01-01 09:00:00.000000000 +0900 --- ./gcc-5.1.0-Haiku/gcc/config/haiku-stdint.h 2015-04-23 05:42:59.193533014 +0900 *************** *** 0 **** --- 1,55 ---- + /* Definitions for types on Haiku. + Copyright (C) 2014 Paweł Dziepak. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + . */ + + #define SIG_ATOMIC_TYPE "int" + + #define INT8_TYPE "signed char" + #define INT16_TYPE "short int" + #define INT32_TYPE "int" + #define INT64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") + #define UINT8_TYPE "unsigned char" + #define UINT16_TYPE "short unsigned int" + #define UINT32_TYPE "unsigned int" + #define UINT64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") + + #define INT_LEAST8_TYPE "signed char" + #define INT_LEAST16_TYPE "short int" + #define INT_LEAST32_TYPE "int" + #define INT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") + #define UINT_LEAST8_TYPE "unsigned char" + #define UINT_LEAST16_TYPE "short unsigned int" + #define UINT_LEAST32_TYPE "unsigned int" + #define UINT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") + + #define INT_FAST8_TYPE "int" + #define INT_FAST16_TYPE "int" + #define INT_FAST32_TYPE "int" + #define INT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") + #define UINT_FAST8_TYPE "unsigned int" + #define UINT_FAST16_TYPE "unsigned int" + #define UINT_FAST32_TYPE "unsigned int" + #define UINT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") + + #define INTPTR_TYPE "long int" + #define UINTPTR_TYPE "long unsigned int" diff -Nrcpad ./gcc-5.1.0/gcc/config/haiku.h ./gcc-5.1.0-Haiku/gcc/config/haiku.h *** ./gcc-5.1.0/gcc/config/haiku.h 1970-01-01 09:00:00.000000000 +0900 --- ./gcc-5.1.0-Haiku/gcc/config/haiku.h 2015-04-23 05:42:59.197533014 +0900 *************** *** 0 **** --- 1,215 ---- + /* 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" + + /* Use --as-needed -lgcc_s for eh support. */ + #ifdef HAVE_LD_AS_NEEDED + #define USE_LD_AS_NEEDED 1 + #endif + + #undef STARTFILE_SPEC + #define STARTFILE_SPEC "crti.o%s crtbeginS.o%s %{!shared:%{!nostart:start_dyn.o%s}} init_term_dyn.o%s" + + #undef ENDFILE_SPEC + #define ENDFILE_SPEC "crtendS.o%s crtn.o%s" + + /* Every program on Haiku links against libroot which contains the pthread + routines, so there's no need to explicitly call out when doing threaded + work. */ + #undef GOMP_SELF_SPECS + #define GOMP_SELF_SPECS "" + #undef GTM_SELF_SPECS + #define GTM_SELF_SPECS "" + + #ifdef HYBRID_SECONDARY + /* For a secondary compiler on a hybrid system, use alternative search paths.*/ + #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/system/non-packaged/develop/headers/" HYBRID_SECONDARY, 0, 0, 0, 1, 0 }, \ + { "/boot/system/develop/headers/os", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/app", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/device", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/drivers", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/game", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/interface", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/kernel", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/locale", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/mail", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/media", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/midi", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/midi2", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/net", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/opengl", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/storage", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/support", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/translation", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/add-ons/graphics", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/add-ons/input_server", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/add-ons/mail_daemon", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/add-ons/registrar", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/add-ons/screen_saver", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/add-ons/tracker", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/be_apps/Deskbar", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/be_apps/NetPositive", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/be_apps/Tracker", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/3rdparty", 0, 0, 0, 1, 0 }, \ + { "/boot/system/develop/headers/bsd", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/glibc", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/gnu", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/posix", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/" HYBRID_SECONDARY, 0, 0, 0, 1, 0 }, \ + /* Hybrid secondary folders for os kits not in base haiku package */\ + { "/boot/system/develop/headers/" HYBRID_SECONDARY "/os", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/" HYBRID_SECONDARY "/os/opengl", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers", 0, 0, 0, 1, 0 }, \ + { 0, 0, 0, 0, 0, 0 } \ + } + #else /* HYBRID_SECONDARY */ + /* For both native and cross compiler, use standard Haiku include file + search paths. + For a cross compiler, it is expected that an appropriate sysroot has + been configured (e.g. /boot/system/develop/cross/x86) which will + be appended to each search folder given below. */ + #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/system/non-packaged/develop/headers", 0, 0, 0, 1, 0 }, \ + { "/boot/system/develop/headers/os", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/app", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/device", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/drivers", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/game", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/interface", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/kernel", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/locale", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/mail", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/media", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/midi", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/midi2", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/net", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/opengl", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/storage", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/support", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/translation", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/add-ons/graphics", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/add-ons/input_server", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/add-ons/mail_daemon", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/add-ons/registrar", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/add-ons/screen_saver", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/add-ons/tracker", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/be_apps/Deskbar", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/be_apps/NetPositive", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/os/be_apps/Tracker", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/3rdparty", 0, 0, 0, 1, 0 }, \ + /* TODO: To be removed when libtiff has been outsourced. */\ + { "/boot/system/develop/headers/bsd", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/glibc", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/gnu", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers/posix", 0, 0, 1, 1, 0 }, \ + { "/boot/system/develop/headers", 0, 0, 0, 1, 0 }, \ + { 0, 0, 0, 0, 0, 0 } \ + } + #endif /* HYBRID_SECONDARY */ + + /* 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" + + /* Set STANDARD_STARTFILE_PREFIX_1 set to "/boot/system/develop/lib/", or the + respective secondary architecture path. The user specific paths are set via + LIBRARY_PATH_ENV. */ + #undef STANDARD_STARTFILE_PREFIX_1 + #undef STANDARD_STARTFILE_PREFIX_2 + #undef MD_STARTFILE_PREFIX + #undef STARTFILE_PREFIX_SPEC + #ifdef HYBRID_SECONDARY + /* For a secondary compiler on a hybrid system, use alternative search paths.*/ + #define STANDARD_STARTFILE_PREFIX_1 \ + "/boot/system/non-packaged/develop/lib/" HYBRID_SECONDARY "/" + #define STANDARD_STARTFILE_PREFIX_2 \ + "/boot/system/develop/lib/" HYBRID_SECONDARY "/" + #else /* HYBRID_SECONDARY */ + #define STANDARD_STARTFILE_PREFIX_1 "/boot/system/non-packaged/develop/lib/" + #define STANDARD_STARTFILE_PREFIX_2 "/boot/system/develop/lib/" + #endif /* HYBRID_SECONDARY */ + + /* 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-5.1.0/gcc/config/i386/haiku.h ./gcc-5.1.0-Haiku/gcc/config/i386/haiku.h *** ./gcc-5.1.0/gcc/config/i386/haiku.h 1970-01-01 09:00:00.000000000 +0900 --- ./gcc-5.1.0-Haiku/gcc/config/i386/haiku.h 2015-04-23 05:42:59.197533014 +0900 *************** *** 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 %{!r:-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< 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 + + #define USE_X86_64_FRAME_POINTER 1 diff -Nrcpad ./gcc-5.1.0/gcc/config/i386/t-haiku64 ./gcc-5.1.0-Haiku/gcc/config/i386/t-haiku64 *** ./gcc-5.1.0/gcc/config/i386/t-haiku64 1970-01-01 09:00:00.000000000 +0900 --- ./gcc-5.1.0-Haiku/gcc/config/i386/t-haiku64 2015-04-23 05:42:59.197533014 +0900 *************** *** 0 **** --- 1,16 ---- + MULTILIB_OPTIONS = m32 + MULTILIB_DIRNAMES = 32 + + LIBGCC = stmp-multilib + INSTALL_LIBGCC = install-multilib + + EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o + + # The pushl in CTOR initialization interferes with frame pointer elimination. + # crtend*.o cannot be compiled without -fno-asynchronous-unwind-tables, + # because then __FRAME_END__ might not be the last thing in .eh_frame + # section. + CRTSTUFF_T_CFLAGS = -fno-omit-frame-pointer -fno-asynchronous-unwind-tables + + # Compile libgcc2.a with pic. + TARGET_LIBGCC2_CFLAGS = -fPIC diff -Nrcpad ./gcc-5.1.0/gcc/config/m68k/haiku.h ./gcc-5.1.0-Haiku/gcc/config/m68k/haiku.h *** ./gcc-5.1.0/gcc/config/m68k/haiku.h 1970-01-01 09:00:00.000000000 +0900 --- ./gcc-5.1.0-Haiku/gcc/config/m68k/haiku.h 2015-04-23 05:42:59.197533014 +0900 *************** *** 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 %{!r:-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"), \ + LCT_NORMAL, VOIDmode, 2, TRAMP, Pmode, \ + plus_constant (Pmode, 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-5.1.0/gcc/config/mips/haiku.h ./gcc-5.1.0-Haiku/gcc/config/mips/haiku.h *** ./gcc-5.1.0/gcc/config/mips/haiku.h 1970-01-01 09:00:00.000000000 +0900 --- ./gcc-5.1.0-Haiku/gcc/config/mips/haiku.h 2015-04-23 05:42:59.197533014 +0900 *************** *** 0 **** --- 1,44 ---- + /* 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 %{!r:-shared} %{nostart:-e 0}" + diff -Nrcpad ./gcc-5.1.0/gcc/config/rs6000/haiku.h ./gcc-5.1.0-Haiku/gcc/config/rs6000/haiku.h *** ./gcc-5.1.0/gcc/config/rs6000/haiku.h 1970-01-01 09:00:00.000000000 +0900 --- ./gcc-5.1.0-Haiku/gcc/config/rs6000/haiku.h 2015-04-23 05:42:59.197533014 +0900 *************** *** 0 **** --- 1,59 ---- + /* 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 elf32ppchaiku %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}" + + #undef CC1_SPEC + #define CC1_SPEC "%{!no-fpic:%{!fno-pic:%{!fno-pie:%{!fpie:%{!fPIC:%{!fPIE:-fPIC}}}}}} %{!Wmultichar: -Wno-multichar} %(cc1_cpu) %{profile:-p}" diff -Nrcpad ./gcc-5.1.0/gcc/config/t-haiku ./gcc-5.1.0-Haiku/gcc/config/t-haiku *** ./gcc-5.1.0/gcc/config/t-haiku 1970-01-01 09:00:00.000000000 +0900 --- ./gcc-5.1.0-Haiku/gcc/config/t-haiku 2015-04-23 05:42:59.197533014 +0900 *************** *** 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/system/develop/headers + LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/posix/limits.h ] \ ファイル末尾に改行がありません diff -Nrcpad ./gcc-5.1.0/gcc/config.gcc ./gcc-5.1.0-Haiku/gcc/config.gcc *** ./gcc-5.1.0/gcc/config.gcc 2015-03-10 18:50:41.000000000 +0900 --- ./gcc-5.1.0-Haiku/gcc/config.gcc 2015-04-23 05:42:59.201533014 +0900 *************** case ${target} in *** 688,693 **** --- 688,706 ---- esac use_gcc_stdint=wrap ;; + *-*-haiku*) + # This is the generic ELF configuration of Haiku. Later + # machine-specific sections may refine and add to this + # configuration. + # + gas=yes + gnu_ld=yes + tmake_file="t-slibgcc" + case ${enable_threads} in + "" | yes | posix) thread_file='posix' ;; + esac + default_use_cxa_atexit=yes + ;; *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) extra_options="$extra_options gnu-user.opt" gas=yes *************** arm*-*-netbsdelf*) *** 1034,1039 **** --- 1047,1062 ---- 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 haiku-stdint.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 + 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" extra_options="${extra_options} linux-android.opt" *************** i[34567]86-*-freebsd*) *** 1392,1397 **** --- 1415,1428 ---- 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 i386/t-crtpic" + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h haiku.h i386/haiku.h haiku-stdint.h" + ;; + 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 haiku-stdint.h" + ;; 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*) *** 1914,1919 **** --- 1945,1957 ---- 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="${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" + ;; mcore-*-elf) tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file} mcore/mcore-elf.h" tmake_file=mcore/t-mcore *************** powerpc-*-eabi*) *** 2331,2336 **** --- 2369,2379 ---- tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" use_gcc_stdint=wrap ;; + powerpc-*-haiku*) + tmake_file="${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" + ;; 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-5.1.0/gcc/config.host ./gcc-5.1.0-Haiku/gcc/config.host *** ./gcc-5.1.0/gcc/config.host 2015-01-09 23:06:02.000000000 +0900 --- ./gcc-5.1.0-Haiku/gcc/config.host 2015-04-23 05:50:08.581523068 +0900 *************** case ${host} in *** 99,105 **** esac case ${host} in ! arm*-*-freebsd* | arm*-*-linux*) case ${target} in arm*-*-*) host_extra_gcc_objs="driver-arm.o" --- 99,105 ---- esac case ${host} in ! arm*-*-freebsd* | arm*-*-linux* | arm*-*-haiku* ) case ${target} in arm*-*-*) host_extra_gcc_objs="driver-arm.o" diff -Nrcpad ./gcc-5.1.0/gcc/configure ./gcc-5.1.0-Haiku/gcc/configure *** ./gcc-5.1.0/gcc/configure 2015-04-10 15:43:52.000000000 +0900 --- ./gcc-5.1.0-Haiku/gcc/configure 2015-04-23 05:52:53.169519256 +0900 *************** LDEXP_LIB *** 737,742 **** --- 737,743 ---- EXTRA_GCC_LIBS GNAT_LIBEXC COLLECT2_LIBS + build_math_library CXXDEPMODE DEPDIR am__leading_dot *************** with_float *** 778,783 **** --- 779,785 ---- with_cpu enable_multiarch enable_multilib + HYBRID_SECONDARY coverage_flags valgrind_command valgrind_path_defines *************** enable_werror_always *** 884,889 **** --- 886,892 ---- enable_checking enable_coverage enable_gather_detailed_mem_stats + with_hybrid_secondary enable_valgrind_annotations with_stabs enable_multilib *************** Optional Packages: *** 1681,1686 **** --- 1684,1691 ---- --with-demangler-in-ld try to use demangler in GNU ld --with-gnu-as arrange to work with GNU as --with-as arrange to use the specified as (full pathname) + --with-hybrid_secondary specify the packaging architecture for building a + secondary compiler for a Haiku hybrid system --with-stabs arrange to use stabs instead of host debug format --with-dwarf2 force the default debug format to be DWARF 2 --with-native-system-header-dir=dir *************** fi *** 7030,7035 **** --- 7035,7051 ---- # Miscenalleous configure options # ------------------------------- + # handle --with-hybrid-secondary + + # Check whether --with-hybrid_secondary was given. + if test "${with_hybrid_secondary+set}" = set; then : + withval=$with_hybrid_secondary; HYBRID_SECONDARY=$withval + else + HYBRID_SECONDARY= + + fi + + # With stabs # Check whether --with-stabs was given. *************** ac_compiler_gnu=$ac_cv_c_compiler_gnu *** 9106,9111 **** --- 9122,9137 ---- # -------- + # Configure -lm usage for host tools that need it + build_math_library="-lm" + case $build in + *-*-haiku*) + # no separate math library needed + build_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 *** 11405,11411 **** # default target_thread_file='single' ;; ! aix | dce | lynx | mipssde | posix | rtems | \ single | tpf | vxworks | win32) target_thread_file=${enable_threads} ;; --- 11431,11437 ---- # default target_thread_file='single' ;; ! aix | dce | haiku | lynx | mipssde | posix | rtems | \ single | tpf | vxworks | win32) target_thread_file=${enable_threads} ;; *************** _LT_EOF *** 15914,15921 **** ;; haiku*) ! archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ! link_all_deplibs=yes ;; interix[3-9]*) --- 15940,15947 ---- ;; haiku*) ! allow_undefined_flag=unsupported ! archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ;; interix[3-9]*) *************** haiku*) *** 17357,17363 **** 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 ;; --- 17383,17389 ---- 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/system/lib' hardcode_into_libs=yes ;; *************** else *** 17875,17881 **** lt_cv_dlopen_libs= case $host_os in ! beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes --- 17901,17907 ---- lt_cv_dlopen_libs= case $host_os in ! beos* | haiku* ) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes *************** if test -z "$aix_libpath"; then aix_libp *** 19205,19212 **** ;; haiku*) ! archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ! link_all_deplibs_CXX=yes ;; hpux9*) --- 19231,19238 ---- ;; haiku*) ! allow_undefined_flag_CXX=unsupported ! archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ;; hpux9*) *************** $as_echo_n "checking for $compiler optio *** 20073,20079 **** ;; esac ;; - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; --- 20099,20104 ---- *************** haiku*) *** 21017,21023 **** 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 ;; --- 21042,21048 ---- 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/system/lib' hardcode_into_libs=yes ;; diff -Nrcpad ./gcc-5.1.0/gcc/configure.ac ./gcc-5.1.0-Haiku/gcc/configure.ac *** ./gcc-5.1.0/gcc/configure.ac 2015-03-12 03:51:09.000000000 +0900 --- ./gcc-5.1.0-Haiku/gcc/configure.ac 2015-04-23 05:42:59.225533013 +0900 *************** fi *** 649,654 **** --- 649,663 ---- # Miscenalleous configure options # ------------------------------- + # handle --with-hybrid-secondary + AC_ARG_WITH(hybrid_secondary, + [AS_HELP_STRING([--with-hybrid_secondary], + [specify the packaging architecture for building a secondary compiler for a Haiku hybrid system])], + [HYBRID_SECONDARY=$withval], + [HYBRID_SECONDARY=] + ) + AC_SUBST(HYBRID_SECONDARY) + # With stabs AC_ARG_WITH(stabs, [AS_HELP_STRING([--with-stabs], *************** AC_LANG_POP(C++) *** 1079,1084 **** --- 1088,1103 ---- # -------- + # Configure -lm usage for host tools that need it + build_math_library="-lm" + case $build in + *-*-haiku*) + # no separate math library needed + build_math_library= + ;; + esac + AC_SUBST(build_math_library) + # These libraries may be used by collect2. # We may need a special search path to get them linked. AC_CACHE_CHECK(for collect2 libraries, gcc_cv_collect2_libs, *************** case ${enable_threads} in *** 1534,1540 **** # default target_thread_file='single' ;; ! aix | dce | lynx | mipssde | posix | rtems | \ single | tpf | vxworks | win32) target_thread_file=${enable_threads} ;; --- 1553,1559 ---- # default target_thread_file='single' ;; ! aix | dce | haiku | lynx | mipssde | posix | rtems | \ single | tpf | vxworks | win32) target_thread_file=${enable_threads} ;; diff -Nrcpad ./gcc-5.1.0/gcc/defaults.h ./gcc-5.1.0-Haiku/gcc/defaults.h *** ./gcc-5.1.0/gcc/defaults.h 2015-03-04 00:04:02.000000000 +0900 --- ./gcc-5.1.0-Haiku/gcc/defaults.h 2015-04-23 05:42:59.229533013 +0900 *************** see the files COPYING3 and COPYING.RUNTI *** 382,390 **** --- 382,394 ---- at program start-up time. */ #if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK #ifndef JCR_SECTION_NAME + /* Hack to remove _Jv crap on BeOS. i know it should be made somehow through + config files, but i don't know how (in which file ;) */ + #if !defined(__BEOS__) && !defined(__HAIKU__) #define JCR_SECTION_NAME ".jcr" #endif #endif + #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 diff -Nrcpad ./gcc-5.1.0/gcc/ginclude/stdarg.h ./gcc-5.1.0-Haiku/gcc/ginclude/stdarg.h *** ./gcc-5.1.0/gcc/ginclude/stdarg.h 2015-01-05 21:33:28.000000000 +0900 --- ./gcc-5.1.0-Haiku/gcc/ginclude/stdarg.h 2015-04-23 05:42:59.229533013 +0900 *************** typedef __gnuc_va_list va_list; *** 93,99 **** #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__ */ --- 93,99 ---- #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-5.1.0/gcc/ginclude/stddef.h ./gcc-5.1.0-Haiku/gcc/ginclude/stddef.h *** ./gcc-5.1.0/gcc/ginclude/stddef.h 2015-01-05 21:33:28.000000000 +0900 --- ./gcc-5.1.0-Haiku/gcc/ginclude/stddef.h 2015-04-23 05:42:59.229533013 +0900 *************** 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 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 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 __PTRDIFF_TYPE__ ptrdiff_t; *** 214,220 **** #endif #if !(defined (__GNUG__) && defined (size_t)) typedef __SIZE_TYPE__ size_t; ! #ifdef __BEOS__ typedef long ssize_t; #endif /* __BEOS__ */ #endif /* !(defined (__GNUG__) && defined (size_t)) */ --- 214,220 ---- #endif #if !(defined (__GNUG__) && defined (size_t)) typedef __SIZE_TYPE__ size_t; ! #if defined(__BEOS__) typedef long ssize_t; #endif /* __BEOS__ */ #endif /* !(defined (__GNUG__) && defined (size_t)) */ *************** typedef long ssize_t; *** 247,253 **** /* 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_ --- 247,253 ---- /* 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; *** 264,270 **** #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_ --- 264,270 ---- #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-5.1.0/include/filenames.h ./gcc-5.1.0-Haiku/include/filenames.h *** ./gcc-5.1.0/include/filenames.h 2014-11-12 08:33:25.000000000 +0900 --- ./gcc-5.1.0-Haiku/include/filenames.h 2015-04-23 05:42:59.229533013 +0900 *************** extern "C" { *** 44,52 **** --- 44,54 ---- # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) #else /* not DOSish */ # if defined(__APPLE__) + /* # ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM # define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 # endif + */ # endif /* __APPLE__ */ # define HAS_DRIVE_SPEC(f) (0) # define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c) diff -Nrcpad ./gcc-5.1.0/libgcc/Makefile.in ./gcc-5.1.0-Haiku/libgcc/Makefile.in *** ./gcc-5.1.0/libgcc/Makefile.in 2015-01-29 17:03:56.000000000 +0900 --- ./gcc-5.1.0-Haiku/libgcc/Makefile.in 2015-04-23 06:02:22.465506069 +0900 *************** ifeq ($(enable_shared),yes) *** 371,380 **** --- 371,386 ---- endif endif + ifneq ($(enable_shared),yes) + # Maintain the same visibility as older GCC for now. Needed on Haiku + # because the static library is included in libroot.so. + vis_hide = + else # For -fvisibility=hidden. We need both a -fvisibility=hidden on # the command line, and a #define to prevent libgcc2.h etc from # overriding that with #pragmas. vis_hide = @vis_hide@ + endif ifneq (,$(vis_hide)) diff -Nrcpad ./gcc-5.1.0/libgcc/config/t-haiku ./gcc-5.1.0-Haiku/libgcc/config/t-haiku *** ./gcc-5.1.0/libgcc/config/t-haiku 1970-01-01 09:00:00.000000000 +0900 --- ./gcc-5.1.0-Haiku/libgcc/config/t-haiku 2015-04-23 05:42:59.237533013 +0900 *************** *** 0 **** --- 1,3 ---- + # Use unwind-dw2-fde + LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \ + $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c diff -Nrcpad ./gcc-5.1.0/libgcc/config.host ./gcc-5.1.0-Haiku/libgcc/config.host *** ./gcc-5.1.0/libgcc/config.host 2015-03-25 17:32:17.000000000 +0900 --- ./gcc-5.1.0-Haiku/libgcc/config.host 2015-04-23 05:42:59.237533013 +0900 *************** arm*-*-*) *** 99,105 **** ;; avr-*-*) cpu_type=avr ! ;; bfin*-*) cpu_type=bfin ;; --- 99,105 ---- ;; avr-*-*) cpu_type=avr ! ;; bfin*-*) cpu_type=bfin ;; *************** case ${host} in *** 228,233 **** --- 228,241 ---- ;; esac ;; + *-*-haiku*) + # This is the generic ELF configuration of Haiku. Later + # machine-specific sections may refine and add to this + # configuration. + tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-haiku t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver" + tmake_file="$tmake_file t-slibgcc-nolc-override" + extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" + ;; *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux" extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" *************** arm*-*-freebsd*) # ARM Fr *** 376,381 **** --- 384,395 ---- arm*-*-netbsdelf*) tmake_file="$tmake_file arm/t-arm arm/t-netbsd t-slibgcc-gld-nover" ;; + arm-*-haiku*) + tmake_file="${tmake_file} arm/t-arm arm/t-elf arm/t-bpabi" + tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp" + tm_file="${tm_file} arm/bpabi-lib.h" + unwind_header=config/arm/unwind-arm.h + ;; arm*-*-linux*) # ARM GNU/Linux with ELF tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix" tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc" *************** i[34567]86-*-freebsd*) *** 571,576 **** --- 585,596 ---- x86_64-*-freebsd*) tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff" ;; + i[34567]86-*-haiku*) + tmake_file="${tmake_file} i386/t-crtstuff i386/t-eh-dw2" + ;; + x86_64-*-haiku*) + tmake_file="${tmake_file} i386/t-crtstuff i386/t-eh-dw2" + ;; i[34567]86-*-netbsdelf*) ;; x86_64-*-netbsd*) *************** lm32-*-rtems*) *** 762,768 **** lm32-*-uclinux*) extra_parts="$extra_parts crtbegin.o crtendS.o crtbeginT.o" tmake_file="lm32/t-lm32 lm32/t-uclinux t-libgcc-pic t-softfp-sfdf t-softfp" ! ;; m32r-*-elf*) tmake_file=t-fdpbit ;; --- 782,788 ---- lm32-*-uclinux*) extra_parts="$extra_parts crtbegin.o crtendS.o crtbeginT.o" tmake_file="lm32/t-lm32 lm32/t-uclinux t-libgcc-pic t-softfp-sfdf t-softfp" ! ;; m32r-*-elf*) tmake_file=t-fdpbit ;; *************** m32r-*-linux*) *** 779,784 **** --- 799,806 ---- m32rle-*-linux*) tmake_file="$tmake_file m32r/t-linux t-fdpbit" ;; + m68k-*-haiku*) + ;; m68k-*-elf* | fido-*-elf) tmake_file="$tmake_file m68k/t-floatlib" ;; *************** powerpc*-*-freebsd*) *** 979,984 **** --- 1001,1008 ---- ;; esac ;; + powerpc-*-haiku*) + ;; powerpc-*-netbsd*) tmake_file="$tmake_file rs6000/t-netbsd rs6000/t-crtstuff" ;; diff -Nrcpad ./gcc-5.1.0/libgcc/crtstuff.c ./gcc-5.1.0-Haiku/libgcc/crtstuff.c *** ./gcc-5.1.0/libgcc/crtstuff.c 2015-01-05 21:33:28.000000000 +0900 --- ./gcc-5.1.0-Haiku/libgcc/crtstuff.c 2015-04-18 16:11:30.855061892 +0900 *************** call_ ## FUNC (void) \ *** 108,114 **** --- 108,116 ---- && defined(HAVE_LD_EH_FRAME_HDR) \ && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \ && defined(__GLIBC__) && __GLIBC__ >= 2 + #ifndef __HAIKU__ #include + #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__) \ *************** extern void *__deregister_frame_info_bas *** 188,195 **** --- 190,199 ---- TARGET_ATTRIBUTE_WEAK; extern void __do_global_ctors_1 (void); + #if TARGET_USE_JCR_SECTION /* Likewise for _Jv_RegisterClasses. */ extern void _Jv_RegisterClasses (void *) TARGET_ATTRIBUTE_WEAK; + #endif /* Likewise for transactional memory clone tables. */ extern void _ITM_registerTMCloneTable (void *, size_t) TARGET_ATTRIBUTE_WEAK; *************** STATIC EH_FRAME_SECTION_CONST char __EH_ *** 266,272 **** = { }; #endif /* USE_EH_FRAME_REGISTRY */ ! #ifdef __LIBGCC_JCR_SECTION_NAME__ /* Stick a label at the beginning of the java class registration info so we can register them properly. */ STATIC void *__JCR_LIST__[] --- 270,276 ---- = { }; #endif /* USE_EH_FRAME_REGISTRY */ ! #if TARGET_USE_JCR_SECTION /* Stick a label at the beginning of the java class registration info so we can register them properly. */ STATIC void *__JCR_LIST__[] *************** frame_dummy (void) *** 472,478 **** #endif /* CRT_GET_RFIB_DATA */ #endif /* USE_EH_FRAME_REGISTRY */ ! #ifdef __LIBGCC_JCR_SECTION_NAME__ void **jcr_list; __asm ("" : "=g" (jcr_list) : "0" (__JCR_LIST__)); if (__builtin_expect (*jcr_list != NULL, 0)) --- 476,482 ---- #endif /* CRT_GET_RFIB_DATA */ #endif /* USE_EH_FRAME_REGISTRY */ ! #if TARGET_USE_JCR_SECTION void **jcr_list; __asm ("" : "=g" (jcr_list) : "0" (__JCR_LIST__)); if (__builtin_expect (*jcr_list != NULL, 0)) *************** __do_global_ctors_1(void) *** 579,585 **** __register_frame_info (__EH_FRAME_BEGIN__, &object); #endif ! #ifdef __LIBGCC_JCR_SECTION_NAME__ void **jcr_list; __asm ("" : "=g" (jcr_list) : "0" (__JCR_LIST__)); if (__builtin_expect (*jcr_list != NULL, 0)) --- 583,589 ---- __register_frame_info (__EH_FRAME_BEGIN__, &object); #endif ! #if TARGET_USE_JCR_SECTION void **jcr_list; __asm ("" : "=g" (jcr_list) : "0" (__JCR_LIST__)); if (__builtin_expect (*jcr_list != NULL, 0)) *************** STATIC EH_FRAME_SECTION_CONST int32 __FR *** 671,677 **** = { 0 }; #endif /* __LIBGCC_EH_FRAME_SECTION_NAME__ */ ! #ifdef __LIBGCC_JCR_SECTION_NAME__ /* Null terminate the .jcr section array. */ STATIC void *__JCR_END__[1] __attribute__ ((used, section(__LIBGCC_JCR_SECTION_NAME__), --- 675,681 ---- = { 0 }; #endif /* __LIBGCC_EH_FRAME_SECTION_NAME__ */ ! #if TARGET_USE_JCR_SECTION /* Null terminate the .jcr section array. */ STATIC void *__JCR_END__[1] __attribute__ ((used, section(__LIBGCC_JCR_SECTION_NAME__), diff -Nrcpad ./gcc-5.1.0/libgcc/crtstuff.c.orig ./gcc-5.1.0-Haiku/libgcc/crtstuff.c.orig *** ./gcc-5.1.0/libgcc/crtstuff.c.orig 1970-01-01 09:00:00.000000000 +0900 --- ./gcc-5.1.0-Haiku/libgcc/crtstuff.c.orig 2015-04-23 05:42:59.237533013 +0900 *************** *** 0 **** --- 1,776 ---- + /* Specialized bits of code needed to support construction and + destruction of file-scope objects in C++ code. + Copyright (C) 1991-2015 Free Software Foundation, Inc. + Contributed by Ron Guilmette (rfg@monkeys.com). + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License as published by the Free + Software Foundation; either version 3, or (at your option) any later + version. + + GCC is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + . */ + + /* This file is a bit like libgcc2.c in that it is compiled + multiple times and yields multiple .o files. + + This file is useful on target machines where the object file format + supports multiple "user-defined" sections (e.g. COFF, ELF, ROSE). On + such systems, this file allows us to avoid running collect (or any + other such slow and painful kludge). Additionally, if the target + system supports a .init section, this file allows us to support the + linking of C++ code with a non-C++ main program. + + Note that if INIT_SECTION_ASM_OP is defined in the tm.h file, then + this file *will* make use of the .init section. If that symbol is + not defined however, then the .init section will not be used. + + Currently, only ELF and COFF are supported. It is likely however that + ROSE could also be supported, if someone was willing to do the work to + make whatever (small?) adaptations are needed. (Some work may be + needed on the ROSE assembler and linker also.) + + This file must be compiled with gcc. */ + + /* Target machine header files require this define. */ + #define IN_LIBGCC2 + + /* FIXME: Including auto-host is incorrect, but until we have + identified the set of defines that need to go into auto-target.h, + this will have to do. */ + #include "auto-host.h" + #undef caddr_t + #undef pid_t + #undef rlim_t + #undef ssize_t + #undef vfork + #include "tconfig.h" + #include "tsystem.h" + #include "coretypes.h" + #include "tm.h" + #include "libgcc_tm.h" + #include "unwind-dw2-fde.h" + + #ifndef FORCE_CODE_SECTION_ALIGN + # define FORCE_CODE_SECTION_ALIGN + #endif + + #ifndef CRT_CALL_STATIC_FUNCTION + # define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \ + static void __attribute__((__used__)) \ + call_ ## FUNC (void) \ + { \ + asm (SECTION_OP); \ + FUNC (); \ + FORCE_CODE_SECTION_ALIGN \ + asm (__LIBGCC_TEXT_SECTION_ASM_OP__); \ + } + #endif + + #if defined(TARGET_DL_ITERATE_PHDR) && \ + (defined(__DragonFly__) || defined(__FreeBSD__)) + #define BSD_DL_ITERATE_PHDR_AVAILABLE + #endif + + #if defined(OBJECT_FORMAT_ELF) \ + && !defined(OBJECT_FORMAT_FLAT) \ + && defined(HAVE_LD_EH_FRAME_HDR) \ + && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \ + && defined(BSD_DL_ITERATE_PHDR_AVAILABLE) + #include + # define USE_PT_GNU_EH_FRAME + #endif + + #if defined(OBJECT_FORMAT_ELF) \ + && !defined(OBJECT_FORMAT_FLAT) \ + && defined(HAVE_LD_EH_FRAME_HDR) && defined(TARGET_DL_ITERATE_PHDR) \ + && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \ + && defined(__sun__) && defined(__svr4__) + #include + # define USE_PT_GNU_EH_FRAME + #endif + + #if defined(OBJECT_FORMAT_ELF) \ + && !defined(OBJECT_FORMAT_FLAT) \ + && defined(HAVE_LD_EH_FRAME_HDR) \ + && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \ + && defined(__GLIBC__) && __GLIBC__ >= 2 + #ifndef __HAIKU__ + #include + #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__) \ + && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \ + || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG))) + # define USE_PT_GNU_EH_FRAME + # endif + #endif + + #if defined(OBJECT_FORMAT_ELF) \ + && !defined(OBJECT_FORMAT_FLAT) \ + && defined(HAVE_LD_EH_FRAME_HDR) \ + && !defined(CRTSTUFFT_O) \ + && defined(inhibit_libc) \ + && (defined(__GLIBC__) || defined(__gnu_linux__) || defined(__GNU__)) + /* On systems using glibc, an inhibit_libc build of libgcc is only + part of a bootstrap process. Build the same crt*.o as would be + built with headers present, so that it is not necessary to build + glibc more than once for the bootstrap to converge. */ + # define USE_PT_GNU_EH_FRAME + #endif + + #ifdef USE_EH_FRAME_REGISTRY_ALWAYS + # ifndef __LIBGCC_EH_FRAME_SECTION_NAME__ + # error "Can't use explicit exception-frame-registration without __LIBGCC_EH_FRAME_SECTION_NAME__" + # endif + #endif + #if defined(__LIBGCC_EH_FRAME_SECTION_NAME__) && (!defined(USE_PT_GNU_EH_FRAME) || defined(USE_EH_FRAME_REGISTRY_ALWAYS)) + # define USE_EH_FRAME_REGISTRY + #endif + #if defined(__LIBGCC_EH_FRAME_SECTION_NAME__) \ + && __LIBGCC_EH_TABLES_CAN_BE_READ_ONLY__ + # define EH_FRAME_SECTION_CONST const + #else + # define EH_FRAME_SECTION_CONST + #endif + + #if !defined(DTOR_LIST_END) && defined(OBJECT_FORMAT_ELF) \ + && defined(HAVE_GAS_HIDDEN) && !defined(FINI_ARRAY_SECTION_ASM_OP) + # define HIDDEN_DTOR_LIST_END + #endif + + #if !defined(USE_TM_CLONE_REGISTRY) && defined(OBJECT_FORMAT_ELF) + # define USE_TM_CLONE_REGISTRY 1 + #endif + + /* We do not want to add the weak attribute to the declarations of these + routines in unwind-dw2-fde.h because that will cause the definition of + these symbols to be weak as well. + + This exposes a core issue, how to handle creating weak references vs + how to create weak definitions. Either we have to have the definition + of TARGET_WEAK_ATTRIBUTE be conditional in the shared header files or + have a second declaration if we want a function's references to be weak, + but not its definition. + + Making TARGET_WEAK_ATTRIBUTE conditional seems like a good solution until + one thinks about scaling to larger problems -- i.e., the condition under + which TARGET_WEAK_ATTRIBUTE is active will eventually get far too + complicated. + + So, we take an approach similar to #pragma weak -- we have a second + declaration for functions that we want to have weak references. + + Neither way is particularly good. */ + + /* References to __register_frame_info and __deregister_frame_info should + be weak in this file if at all possible. */ + extern void __register_frame_info (const void *, struct object *) + TARGET_ATTRIBUTE_WEAK; + extern void __register_frame_info_bases (const void *, struct object *, + void *, void *) + TARGET_ATTRIBUTE_WEAK; + extern void *__deregister_frame_info (const void *) + TARGET_ATTRIBUTE_WEAK; + extern void *__deregister_frame_info_bases (const void *) + TARGET_ATTRIBUTE_WEAK; + extern void __do_global_ctors_1 (void); + + /* Likewise for _Jv_RegisterClasses. */ + extern void _Jv_RegisterClasses (void *) TARGET_ATTRIBUTE_WEAK; + + /* Likewise for transactional memory clone tables. */ + extern void _ITM_registerTMCloneTable (void *, size_t) TARGET_ATTRIBUTE_WEAK; + extern void _ITM_deregisterTMCloneTable (void *) TARGET_ATTRIBUTE_WEAK; + + #ifdef OBJECT_FORMAT_ELF + + /* Declare a pointer to void function type. */ + typedef void (*func_ptr) (void); + #define STATIC static + + #else /* OBJECT_FORMAT_ELF */ + + #include "gbl-ctors.h" + + #define STATIC + + #endif /* OBJECT_FORMAT_ELF */ + + #ifdef CRT_BEGIN + + /* NOTE: In order to be able to support SVR4 shared libraries, we arrange + to have one set of symbols { __CTOR_LIST__, __DTOR_LIST__, __CTOR_END__, + __DTOR_END__ } per root executable and also one set of these symbols + per shared library. So in any given whole process image, we may have + multiple definitions of each of these symbols. In order to prevent + these definitions from conflicting with one another, and in order to + ensure that the proper lists are used for the initialization/finalization + of each individual shared library (respectively), we give these symbols + only internal (i.e. `static') linkage, and we also make it a point to + refer to only the __CTOR_END__ symbol in crtend.o and the __DTOR_LIST__ + symbol in crtbegin.o, where they are defined. */ + + /* No need for .ctors/.dtors section if linker can place them in + .init_array/.fini_array section. */ + #ifndef USE_INITFINI_ARRAY + /* The -1 is a flag to __do_global_[cd]tors indicating that this table + does not start with a count of elements. */ + #ifdef CTOR_LIST_BEGIN + CTOR_LIST_BEGIN; + #elif defined(__LIBGCC_CTORS_SECTION_ASM_OP__) + /* Hack: force cc1 to switch to .data section early, so that assembling + __CTOR_LIST__ does not undo our behind-the-back change to .ctors. */ + static func_ptr force_to_data[1] __attribute__ ((__used__)) = { }; + asm (__LIBGCC_CTORS_SECTION_ASM_OP__); + STATIC func_ptr __CTOR_LIST__[1] + __attribute__ ((__used__, aligned(sizeof(func_ptr)))) + = { (func_ptr) (-1) }; + #else + STATIC func_ptr __CTOR_LIST__[1] + __attribute__ ((__used__, section(".ctors"), aligned(sizeof(func_ptr)))) + = { (func_ptr) (-1) }; + #endif /* __CTOR_LIST__ alternatives */ + + #ifdef DTOR_LIST_BEGIN + DTOR_LIST_BEGIN; + #elif defined(__LIBGCC_DTORS_SECTION_ASM_OP__) + asm (__LIBGCC_DTORS_SECTION_ASM_OP__); + STATIC func_ptr __DTOR_LIST__[1] + __attribute__ ((aligned(sizeof(func_ptr)))) + = { (func_ptr) (-1) }; + #else + STATIC func_ptr __DTOR_LIST__[1] + __attribute__((section(".dtors"), aligned(sizeof(func_ptr)))) + = { (func_ptr) (-1) }; + #endif /* __DTOR_LIST__ alternatives */ + #endif /* USE_INITFINI_ARRAY */ + + #ifdef USE_EH_FRAME_REGISTRY + /* Stick a label at the beginning of the frame unwind info so we can register + and deregister it with the exception handling library code. */ + STATIC EH_FRAME_SECTION_CONST char __EH_FRAME_BEGIN__[] + __attribute__((section(__LIBGCC_EH_FRAME_SECTION_NAME__), aligned(4))) + = { }; + #endif /* USE_EH_FRAME_REGISTRY */ + + #ifdef __LIBGCC_JCR_SECTION_NAME__ + /* Stick a label at the beginning of the java class registration info + so we can register them properly. */ + STATIC void *__JCR_LIST__[] + __attribute__ ((used, section(__LIBGCC_JCR_SECTION_NAME__), + aligned(sizeof(void*)))) + = { }; + #endif /* __LIBGCC_JCR_SECTION_NAME__ */ + + #if USE_TM_CLONE_REGISTRY + STATIC func_ptr __TMC_LIST__[] + __attribute__((used, section(".tm_clone_table"), aligned(sizeof(void*)))) + = { }; + # ifdef HAVE_GAS_HIDDEN + extern func_ptr __TMC_END__[] __attribute__((__visibility__ ("hidden"))); + # endif + + static inline void + deregister_tm_clones (void) + { + void (*fn) (void *); + + #ifdef HAVE_GAS_HIDDEN + if (__TMC_END__ - __TMC_LIST__ == 0) + return; + #else + if (__TMC_LIST__[0] == NULL) + return; + #endif + + fn = _ITM_deregisterTMCloneTable; + __asm ("" : "+r" (fn)); + if (fn) + fn (__TMC_LIST__); + } + + static inline void + register_tm_clones (void) + { + void (*fn) (void *, size_t); + size_t size; + + #ifdef HAVE_GAS_HIDDEN + size = (__TMC_END__ - __TMC_LIST__) / 2; + #else + for (size = 0; __TMC_LIST__[size * 2] != NULL; size++) + continue; + #endif + if (size == 0) + return; + + fn = _ITM_registerTMCloneTable; + __asm ("" : "+r" (fn)); + if (fn) + fn (__TMC_LIST__, size); + } + #endif /* USE_TM_CLONE_REGISTRY */ + + #if defined(__LIBGCC_INIT_SECTION_ASM_OP__) \ + || defined(__LIBGCC_INIT_ARRAY_SECTION_ASM_OP__) + + #ifdef OBJECT_FORMAT_ELF + + /* Declare the __dso_handle variable. It should have a unique value + in every shared-object; in a main program its value is zero. The + object should in any case be protected. This means the instance + in one DSO or the main program is not used in another object. The + dynamic linker takes care of this. */ + + #ifdef TARGET_LIBGCC_SDATA_SECTION + extern void *__dso_handle __attribute__ ((__section__ (TARGET_LIBGCC_SDATA_SECTION))); + #endif + #ifdef HAVE_GAS_HIDDEN + extern void *__dso_handle __attribute__ ((__visibility__ ("hidden"))); + #endif + #ifdef CRTSTUFFS_O + void *__dso_handle = &__dso_handle; + #else + void *__dso_handle = 0; + #endif + + /* The __cxa_finalize function may not be available so we use only a + weak declaration. */ + extern void __cxa_finalize (void *) TARGET_ATTRIBUTE_WEAK; + + /* Run all the global destructors on exit from the program. */ + + /* Some systems place the number of pointers in the first word of the + table. On SVR4 however, that word is -1. In all cases, the table is + null-terminated. On SVR4, we start from the beginning of the list and + invoke each per-compilation-unit destructor routine in order + until we find that null. + + Note that this function MUST be static. There will be one of these + functions in each root executable and one in each shared library, but + although they all have the same code, each one is unique in that it + refers to one particular associated `__DTOR_LIST__' which belongs to the + same particular root executable or shared library file. + + On some systems, this routine is run more than once from the .fini, + when exit is called recursively, so we arrange to remember where in + the list we left off processing, and we resume at that point, + should we be re-invoked. */ + + static void __attribute__((used)) + __do_global_dtors_aux (void) + { + static _Bool completed; + + if (__builtin_expect (completed, 0)) + return; + + #ifdef CRTSTUFFS_O + if (__cxa_finalize) + __cxa_finalize (__dso_handle); + #endif + + #ifdef FINI_ARRAY_SECTION_ASM_OP + /* If we are using .fini_array then destructors will be run via that + mechanism. */ + #elif defined(HIDDEN_DTOR_LIST_END) + { + /* Safer version that makes sure only .dtors function pointers are + called even if the static variable is maliciously changed. */ + extern func_ptr __DTOR_END__[] __attribute__((visibility ("hidden"))); + static size_t dtor_idx; + const size_t max_idx = __DTOR_END__ - __DTOR_LIST__ - 1; + func_ptr *dtor_list; + + __asm ("" : "=g" (dtor_list) : "0" (__DTOR_LIST__)); + while (dtor_idx < max_idx) + dtor_list[++dtor_idx] (); + } + #else /* !defined (FINI_ARRAY_SECTION_ASM_OP) */ + { + static func_ptr *p = __DTOR_LIST__ + 1; + func_ptr f; + + while ((f = *p)) + { + p++; + f (); + } + } + #endif /* !defined(FINI_ARRAY_SECTION_ASM_OP) */ + + #if USE_TM_CLONE_REGISTRY + deregister_tm_clones (); + #endif /* USE_TM_CLONE_REGISTRY */ + + #ifdef USE_EH_FRAME_REGISTRY + #ifdef CRT_GET_RFIB_DATA + /* If we used the new __register_frame_info_bases interface, + make sure that we deregister from the same place. */ + if (__deregister_frame_info_bases) + __deregister_frame_info_bases (__EH_FRAME_BEGIN__); + #else + if (__deregister_frame_info) + __deregister_frame_info (__EH_FRAME_BEGIN__); + #endif + #endif + + completed = 1; + } + + /* Stick a call to __do_global_dtors_aux into the .fini section. */ + #ifdef FINI_SECTION_ASM_OP + CRT_CALL_STATIC_FUNCTION (FINI_SECTION_ASM_OP, __do_global_dtors_aux) + #elif defined (FINI_ARRAY_SECTION_ASM_OP) + static func_ptr __do_global_dtors_aux_fini_array_entry[] + __attribute__ ((__used__, section(".fini_array"), aligned(sizeof(func_ptr)))) + = { __do_global_dtors_aux }; + #else /* !FINI_SECTION_ASM_OP && !FINI_ARRAY_SECTION_ASM_OP */ + static void __attribute__((used)) + __do_global_dtors_aux_1 (void) + { + atexit (__do_global_dtors_aux); + } + CRT_CALL_STATIC_FUNCTION (__LIBGCC_INIT_SECTION_ASM_OP__, + __do_global_dtors_aux_1) + #endif + + #if defined(USE_EH_FRAME_REGISTRY) \ + || defined(__LIBGCC_JCR_SECTION_NAME__) \ + || defined(USE_TM_CLONE_REGISTRY) + /* Stick a call to __register_frame_info into the .init section. For some + reason calls with no arguments work more reliably in .init, so stick the + call in another function. */ + + static void __attribute__((used)) + frame_dummy (void) + { + #ifdef USE_EH_FRAME_REGISTRY + static struct object object; + #ifdef CRT_GET_RFIB_DATA + void *tbase, *dbase; + tbase = 0; + CRT_GET_RFIB_DATA (dbase); + if (__register_frame_info_bases) + __register_frame_info_bases (__EH_FRAME_BEGIN__, &object, tbase, dbase); + #else + if (__register_frame_info) + __register_frame_info (__EH_FRAME_BEGIN__, &object); + #endif /* CRT_GET_RFIB_DATA */ + #endif /* USE_EH_FRAME_REGISTRY */ + + #ifdef __LIBGCC_JCR_SECTION_NAME__ + void **jcr_list; + __asm ("" : "=g" (jcr_list) : "0" (__JCR_LIST__)); + if (__builtin_expect (*jcr_list != NULL, 0)) + { + void (*register_classes) (void *) = _Jv_RegisterClasses; + __asm ("" : "+r" (register_classes)); + if (register_classes) + register_classes (jcr_list); + } + #endif /* __LIBGCC_JCR_SECTION_NAME__ */ + + #if USE_TM_CLONE_REGISTRY + register_tm_clones (); + #endif /* USE_TM_CLONE_REGISTRY */ + } + + #ifdef __LIBGCC_INIT_SECTION_ASM_OP__ + CRT_CALL_STATIC_FUNCTION (__LIBGCC_INIT_SECTION_ASM_OP__, frame_dummy) + #else /* defined(__LIBGCC_INIT_SECTION_ASM_OP__) */ + static func_ptr __frame_dummy_init_array_entry[] + __attribute__ ((__used__, section(".init_array"), aligned(sizeof(func_ptr)))) + = { frame_dummy }; + #endif /* !defined(__LIBGCC_INIT_SECTION_ASM_OP__) */ + #endif /* USE_EH_FRAME_REGISTRY || __LIBGCC_JCR_SECTION_NAME__ || USE_TM_CLONE_REGISTRY */ + + #else /* OBJECT_FORMAT_ELF */ + + /* The function __do_global_ctors_aux is compiled twice (once in crtbegin.o + and once in crtend.o). It must be declared static to avoid a link + error. Here, we define __do_global_ctors as an externally callable + function. It is externally callable so that __main can invoke it when + INVOKE__main is defined. This has the additional effect of forcing cc1 + to switch to the .text section. */ + + static void __do_global_ctors_aux (void); + void + __do_global_ctors (void) + { + #ifdef INVOKE__main + /* If __main won't actually call __do_global_ctors then it doesn't matter + what's inside the function. The inside of __do_global_ctors_aux is + called automatically in that case. And the Alliant fx2800 linker + crashes on this reference. So prevent the crash. */ + __do_global_ctors_aux (); + #endif + } + + asm (__LIBGCC_INIT_SECTION_ASM_OP__); /* cc1 doesn't know that we are switching! */ + + /* A routine to invoke all of the global constructors upon entry to the + program. We put this into the .init section (for systems that have + such a thing) so that we can properly perform the construction of + file-scope static-storage C++ objects within shared libraries. */ + + static void __attribute__((used)) + __do_global_ctors_aux (void) /* prologue goes in .init section */ + { + FORCE_CODE_SECTION_ALIGN /* explicit align before switch to .text */ + asm (__LIBGCC_TEXT_SECTION_ASM_OP__); /* don't put epilogue and body in .init */ + DO_GLOBAL_CTORS_BODY; + atexit (__do_global_dtors); + } + + #endif /* OBJECT_FORMAT_ELF */ + + #elif defined(HAS_INIT_SECTION) /* ! __LIBGCC_INIT_SECTION_ASM_OP__ */ + + extern void __do_global_dtors (void); + + /* This case is used by the Irix 6 port, which supports named sections but + not an SVR4-style .fini section. __do_global_dtors can be non-static + in this case because we protect it with -hidden_symbol. */ + + void + __do_global_dtors (void) + { + func_ptr *p, f; + for (p = __DTOR_LIST__ + 1; (f = *p); p++) + f (); + + #if USE_TM_CLONE_REGISTRY + deregister_tm_clones (); + #endif /* USE_TM_CLONE_REGISTRY */ + + #ifdef USE_EH_FRAME_REGISTRY + if (__deregister_frame_info) + __deregister_frame_info (__EH_FRAME_BEGIN__); + #endif + } + + #if defined(USE_EH_FRAME_REGISTRY) \ + || defined(__LIBGCC_JCR_SECTION_NAME__) \ + || defined(USE_TM_CLONE_REGISTRY) + /* A helper function for __do_global_ctors, which is in crtend.o. Here + in crtbegin.o, we can reference a couple of symbols not visible there. + Plus, since we're before libgcc.a, we have no problems referencing + functions from there. */ + void + __do_global_ctors_1(void) + { + #ifdef USE_EH_FRAME_REGISTRY + static struct object object; + if (__register_frame_info) + __register_frame_info (__EH_FRAME_BEGIN__, &object); + #endif + + #ifdef __LIBGCC_JCR_SECTION_NAME__ + void **jcr_list; + __asm ("" : "=g" (jcr_list) : "0" (__JCR_LIST__)); + if (__builtin_expect (*jcr_list != NULL, 0)) + { + void (*register_classes) (void *) = _Jv_RegisterClasses; + __asm ("" : "+r" (register_classes)); + if (register_classes) + register_classes (jcr_list); + } + #endif + + #if USE_TM_CLONE_REGISTRY + register_tm_clones (); + #endif /* USE_TM_CLONE_REGISTRY */ + } + #endif /* USE_EH_FRAME_REGISTRY || __LIBGCC_JCR_SECTION_NAME__ || USE_TM_CLONE_REGISTRY */ + + #else /* ! __LIBGCC_INIT_SECTION_ASM_OP__ && ! HAS_INIT_SECTION */ + #error "What are you doing with crtstuff.c, then?" + #endif + + #elif defined(CRT_END) /* ! CRT_BEGIN */ + + /* No need for .ctors/.dtors section if linker can place them in + .init_array/.fini_array section. */ + #ifndef USE_INITFINI_ARRAY + /* Put a word containing zero at the end of each of our two lists of function + addresses. Note that the words defined here go into the .ctors and .dtors + sections of the crtend.o file, and since that file is always linked in + last, these words naturally end up at the very ends of the two lists + contained in these two sections. */ + + #ifdef CTOR_LIST_END + CTOR_LIST_END; + #elif defined(__LIBGCC_CTORS_SECTION_ASM_OP__) + /* Hack: force cc1 to switch to .data section early, so that assembling + __CTOR_LIST__ does not undo our behind-the-back change to .ctors. */ + static func_ptr force_to_data[1] __attribute__ ((__used__)) = { }; + asm (__LIBGCC_CTORS_SECTION_ASM_OP__); + STATIC func_ptr __CTOR_END__[1] + __attribute__((aligned(sizeof(func_ptr)))) + = { (func_ptr) 0 }; + #else + STATIC func_ptr __CTOR_END__[1] + __attribute__((section(".ctors"), aligned(sizeof(func_ptr)))) + = { (func_ptr) 0 }; + #endif + + #ifdef DTOR_LIST_END + DTOR_LIST_END; + #elif defined(HIDDEN_DTOR_LIST_END) + #ifdef __LIBGCC_DTORS_SECTION_ASM_OP__ + asm (__LIBGCC_DTORS_SECTION_ASM_OP__); + #endif + func_ptr __DTOR_END__[1] + __attribute__ ((used, + #ifndef __LIBGCC_DTORS_SECTION_ASM_OP__ + section(".dtors"), + #endif + aligned(sizeof(func_ptr)), visibility ("hidden"))) + = { (func_ptr) 0 }; + #elif defined(__LIBGCC_DTORS_SECTION_ASM_OP__) + asm (__LIBGCC_DTORS_SECTION_ASM_OP__); + STATIC func_ptr __DTOR_END__[1] + __attribute__ ((used, aligned(sizeof(func_ptr)))) + = { (func_ptr) 0 }; + #else + STATIC func_ptr __DTOR_END__[1] + __attribute__((used, section(".dtors"), aligned(sizeof(func_ptr)))) + = { (func_ptr) 0 }; + #endif + #endif /* USE_INITFINI_ARRAY */ + + #ifdef __LIBGCC_EH_FRAME_SECTION_NAME__ + /* Terminate the frame unwind info section with a 4byte 0 as a sentinel; + this would be the 'length' field in a real FDE. */ + # if __INT_MAX__ == 2147483647 + typedef int int32; + # elif __LONG_MAX__ == 2147483647 + typedef long int32; + # elif __SHRT_MAX__ == 2147483647 + typedef short int32; + # else + # error "Missing a 4 byte integer" + # endif + STATIC EH_FRAME_SECTION_CONST int32 __FRAME_END__[] + __attribute__ ((used, section(__LIBGCC_EH_FRAME_SECTION_NAME__), + aligned(sizeof(int32)))) + = { 0 }; + #endif /* __LIBGCC_EH_FRAME_SECTION_NAME__ */ + + #ifdef __LIBGCC_JCR_SECTION_NAME__ + /* Null terminate the .jcr section array. */ + STATIC void *__JCR_END__[1] + __attribute__ ((used, section(__LIBGCC_JCR_SECTION_NAME__), + aligned(sizeof(void *)))) + = { 0 }; + #endif /* __LIBGCC_JCR_SECTION_NAME__ */ + + #if USE_TM_CLONE_REGISTRY + # ifndef HAVE_GAS_HIDDEN + static + # endif + func_ptr __TMC_END__[] + __attribute__((used, section(".tm_clone_table"), aligned(sizeof(void *)))) + # ifdef HAVE_GAS_HIDDEN + __attribute__((__visibility__ ("hidden"))) = { }; + # else + = { 0, 0 }; + # endif + #endif /* USE_TM_CLONE_REGISTRY */ + + #ifdef __LIBGCC_INIT_ARRAY_SECTION_ASM_OP__ + + /* If we are using .init_array, there is nothing to do. */ + + #elif defined(__LIBGCC_INIT_SECTION_ASM_OP__) + + #ifdef OBJECT_FORMAT_ELF + static void __attribute__((used)) + __do_global_ctors_aux (void) + { + func_ptr *p; + for (p = __CTOR_END__ - 1; *p != (func_ptr) -1; p--) + (*p) (); + } + + /* Stick a call to __do_global_ctors_aux into the .init section. */ + CRT_CALL_STATIC_FUNCTION (__LIBGCC_INIT_SECTION_ASM_OP__, __do_global_ctors_aux) + #else /* OBJECT_FORMAT_ELF */ + + /* Stick the real initialization code, followed by a normal sort of + function epilogue at the very end of the .init section for this + entire root executable file or for this entire shared library file. + + Note that we use some tricks here to get *just* the body and just + a function epilogue (but no function prologue) into the .init + section of the crtend.o file. Specifically, we switch to the .text + section, start to define a function, and then we switch to the .init + section just before the body code. + + Earlier on, we put the corresponding function prologue into the .init + section of the crtbegin.o file (which will be linked in first). + + Note that we want to invoke all constructors for C++ file-scope static- + storage objects AFTER any other possible initialization actions which + may be performed by the code in the .init section contributions made by + other libraries, etc. That's because those other initializations may + include setup operations for very primitive things (e.g. initializing + the state of the floating-point coprocessor, etc.) which should be done + before we start to execute any of the user's code. */ + + static void + __do_global_ctors_aux (void) /* prologue goes in .text section */ + { + asm (__LIBGCC_INIT_SECTION_ASM_OP__); + DO_GLOBAL_CTORS_BODY; + atexit (__do_global_dtors); + } /* epilogue and body go in .init section */ + + FORCE_CODE_SECTION_ALIGN + asm (__LIBGCC_TEXT_SECTION_ASM_OP__); + + #endif /* OBJECT_FORMAT_ELF */ + + #elif defined(HAS_INIT_SECTION) /* ! __LIBGCC_INIT_SECTION_ASM_OP__ */ + + extern void __do_global_ctors (void); + + /* This case is used by the Irix 6 port, which supports named sections but + not an SVR4-style .init section. __do_global_ctors can be non-static + in this case because we protect it with -hidden_symbol. */ + void + __do_global_ctors (void) + { + func_ptr *p; + #if defined(USE_EH_FRAME_REGISTRY) \ + || defined(__LIBGCC_JCR_SECTION_NAME__) \ + || defined(USE_TM_CLONE_REGISTRY) + __do_global_ctors_1(); + #endif + for (p = __CTOR_END__ - 1; *p != (func_ptr) -1; p--) + (*p) (); + } + + #else /* ! __LIBGCC_INIT_SECTION_ASM_OP__ && ! HAS_INIT_SECTION */ + #error "What are you doing with crtstuff.c, then?" + #endif + + #else /* ! CRT_BEGIN && ! CRT_END */ + #error "One of CRT_BEGIN or CRT_END must be defined." + #endif diff -Nrcpad ./gcc-5.1.0/libgomp/configure ./gcc-5.1.0-Haiku/libgomp/configure *** ./gcc-5.1.0/libgomp/configure 2015-04-22 17:45:05.000000000 +0900 --- ./gcc-5.1.0-Haiku/libgomp/configure 2015-04-23 05:42:59.273533012 +0900 *************** $as_echo_n "checking for $compiler optio *** 8189,8195 **** esac ;; ! beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; --- 8189,8195 ---- esac ;; ! beos* | haiku* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; *************** _LT_EOF *** 8879,8886 **** ;; haiku*) ! archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ! link_all_deplibs=yes ;; interix[3-9]*) --- 8879,8886 ---- ;; haiku*) ! allow_undefined_flag=unsupported ! archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ;; interix[3-9]*) *************** gnu*) *** 10314,10329 **** ;; haiku*) ! version_type=linux ! need_lib_prefix=no ! need_version=no ! dynamic_linker="$host_os runtime_loader" ! 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 ;; hpux9* | hpux10* | hpux11*) --- 10314,10322 ---- ;; haiku*) ! library_names_spec='${libname}${shared_ext}' ! dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; hpux9* | hpux10* | hpux11*) *************** haiku*) *** 13962,13968 **** 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 ;; --- 13955,13961 ---- 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/system/lib' hardcode_into_libs=yes ;; diff -Nrcpad ./gcc-5.1.0/libquadmath/configure ./gcc-5.1.0-Haiku/libquadmath/configure *** ./gcc-5.1.0/libquadmath/configure 2015-04-22 17:45:05.000000000 +0900 --- ./gcc-5.1.0-Haiku/libquadmath/configure 2015-04-23 05:42:59.277533012 +0900 *************** haiku*) *** 9751,9757 **** 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 ;; --- 9751,9757 ---- 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/system/lib' hardcode_into_libs=yes ;; diff -Nrcpad ./gcc-5.1.0/libssp/configure ./gcc-5.1.0-Haiku/libssp/configure *** ./gcc-5.1.0/libssp/configure 2014-11-22 01:49:17.000000000 +0900 --- ./gcc-5.1.0-Haiku/libssp/configure 2015-04-23 05:42:59.281533012 +0900 *************** $as_echo_n "checking for $compiler optio *** 7708,7714 **** esac ;; ! beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; --- 7708,7714 ---- esac ;; ! beos* | haiku* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; *************** _LT_EOF *** 8398,8405 **** ;; haiku*) ! archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ! link_all_deplibs=yes ;; interix[3-9]*) --- 8398,8405 ---- ;; haiku*) ! allow_undefined_flag=unsupported ! archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ;; interix[3-9]*) *************** gnu*) *** 9842,9857 **** ;; haiku*) ! version_type=linux ! need_lib_prefix=no ! need_version=no ! dynamic_linker="$host_os runtime_loader" ! 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 ;; hpux9* | hpux10* | hpux11*) --- 9842,9850 ---- ;; haiku*) ! library_names_spec='${libname}${shared_ext}' ! dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; hpux9* | hpux10* | hpux11*) diff -Nrcpad ./gcc-5.1.0/libstdc++-v3/config/os/haiku/ctype_base.h ./gcc-5.1.0-Haiku/libstdc++-v3/config/os/haiku/ctype_base.h *** ./gcc-5.1.0/libstdc++-v3/config/os/haiku/ctype_base.h 1970-01-01 09:00:00.000000000 +0900 --- ./gcc-5.1.0-Haiku/libstdc++-v3/config/os/haiku/ctype_base.h 2015-04-15 19:35:26.051530000 +0900 *************** *** 0 **** --- 1,61 ---- + // Locale support -*- C++ -*- + + // Copyright (C) 1997-2013 Free Software Foundation, Inc. + // + // This file is part of the GNU ISO C++ Library. This library is free + // software; you can redistribute it and/or modify it under the + // terms of the GNU General Public License as published by the + // Free Software Foundation; either version 3, or (at your option) + // any later version. + + // This library is distributed in the hope that it will be useful, + // but WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + // GNU General Public License for more details. + + // Under Section 7 of GPL version 3, you are granted additional + // permissions described in the GCC Runtime Library Exception, version + // 3.1, as published by the Free Software Foundation. + + // You should have received a copy of the GNU General Public License and + // a copy of the GCC Runtime Library Exception along with this program; + // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + // . + + // + // ISO C++ 14882: 22.1 Locales + // + + // Default information, may not be appropriate for specific host. + + namespace std _GLIBCXX_VISIBILITY(default) + { + _GLIBCXX_BEGIN_NAMESPACE_VERSION + + /// @brief Base class for ctype. + struct ctype_base + { + // Non-standard typedefs. + typedef const int* __to_type; + + // NB: Offsets into ctype::_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 = 1 << 0; + static const mask lower = 1 << 1; + static const mask alpha = 1 << 2; + static const mask digit = 1 << 3; + static const mask xdigit = 1 << 4; + static const mask space = 1 << 5; + static const mask print = 1 << 6; + static const mask graph = (1 << 2) | (1 << 3) | (1 << 9); // alnum|punct + static const mask cntrl = 1 << 8; + static const mask punct = 1 << 9; + static const mask alnum = (1 << 2) | (1 << 3); // alpha|digit + #if __cplusplus >= 201103L + static const mask blank = 1 << 10; + #endif + }; + + _GLIBCXX_END_NAMESPACE_VERSION + } // namespace diff -Nrcpad ./gcc-5.1.0/libstdc++-v3/config/os/haiku/ctype_configure_char.cc ./gcc-5.1.0-Haiku/libstdc++-v3/config/os/haiku/ctype_configure_char.cc *** ./gcc-5.1.0/libstdc++-v3/config/os/haiku/ctype_configure_char.cc 1970-01-01 09:00:00.000000000 +0900 --- ./gcc-5.1.0-Haiku/libstdc++-v3/config/os/haiku/ctype_configure_char.cc 2015-04-23 05:42:59.281533012 +0900 *************** *** 0 **** --- 1,99 ---- + // Locale support -*- C++ -*- + + // Copyright (C) 2011-2013 Free Software Foundation, Inc. + // + // This file is part of the GNU ISO C++ Library. This library is free + // software; you can redistribute it and/or modify it under the + // terms of the GNU General Public License as published by the + // Free Software Foundation; either version 3, or (at your option) + // any later version. + + // This library is distributed in the hope that it will be useful, + // but WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + // GNU General Public License for more details. + + // Under Section 7 of GPL version 3, you are granted additional + // permissions described in the GCC Runtime Library Exception, version + // 3.1, as published by the Free Software Foundation. + + // You should have received a copy of the GNU General Public License and + // a copy of the GCC Runtime Library Exception along with this program; + // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + // . + + /** @file ctype_configure_char.cc */ + + // + // ISO C++ 14882: 22.1 Locales + // + + #include + #include + #include + + namespace std _GLIBCXX_VISIBILITY(default) + { + _GLIBCXX_BEGIN_NAMESPACE_VERSION + + // Information as gleaned from /usr/include/ctype.h + + const ctype_base::mask* + ctype::classic_table() throw() + { return 0; } + + ctype::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::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::do_toupper(char __c) const + { return ::toupper((int) __c); } + + const char* + ctype::do_toupper(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = ::toupper((int) *__low); + ++__low; + } + return __high; + } + + char + ctype::do_tolower(char __c) const + { return ::tolower((int) __c); } + + const char* + ctype::do_tolower(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = ::tolower((int) *__low); + ++__low; + } + return __high; + } + + _GLIBCXX_END_NAMESPACE_VERSION + } // namespace diff -Nrcpad ./gcc-5.1.0/libstdc++-v3/config/os/haiku/ctype_inline.h ./gcc-5.1.0-Haiku/libstdc++-v3/config/os/haiku/ctype_inline.h *** ./gcc-5.1.0/libstdc++-v3/config/os/haiku/ctype_inline.h 1970-01-01 09:00:00.000000000 +0900 --- ./gcc-5.1.0-Haiku/libstdc++-v3/config/os/haiku/ctype_inline.h 2015-04-23 05:42:59.281533012 +0900 *************** *** 0 **** --- 1,168 ---- + // Locale support -*- C++ -*- + + // Copyright (C) 2000-2013 Free Software Foundation, Inc. + // + // This file is part of the GNU ISO C++ Library. This library is free + // software; you can redistribute it and/or modify it under the + // terms of the GNU General Public License as published by the + // Free Software Foundation; either version 3, or (at your option) + // any later version. + + // This library is distributed in the hope that it will be useful, + // but WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + // GNU General Public License for more details. + + // Under Section 7 of GPL version 3, you are granted additional + // permissions described in the GCC Runtime Library Exception, version + // 3.1, as published by the Free Software Foundation. + + // You should have received a copy of the GNU General Public License and + // a copy of the GCC Runtime Library Exception along with this program; + // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + // . + + /** @file bits/ctype_inline.h + * This is an internal header file, included by other library headers. + * Do not attempt to use it directly. @headername{locale} + */ + + // + // ISO C++ 14882: 22.1 Locales + // + + // ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) + // functions go in ctype.cc + + // 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. + + // Constructing a synthetic "C" table should be seriously considered... + + namespace std _GLIBCXX_VISIBILITY(default) + { + _GLIBCXX_BEGIN_NAMESPACE_VERSION + + bool + ctype:: + is(mask __m, char __c) const + { + if (_M_table) + return _M_table[static_cast(__c)] & __m; + else + { + bool __ret = false; + const size_t __bitmasksize = 15; + size_t __bitcur = 0; // Lowest bitmask in ctype_base == 0 + for (; __bitcur <= __bitmasksize; ++__bitcur) + { + const mask __bit = static_cast(1 << __bitcur); + if (__m & __bit) + { + bool __testis; + switch (__bit) + { + case space: + __testis = isspace(__c); + break; + case print: + __testis = isprint(__c); + break; + case cntrl: + __testis = iscntrl(__c); + break; + case upper: + __testis = isupper(__c); + break; + case lower: + __testis = islower(__c); + break; + case alpha: + __testis = isalpha(__c); + break; + case digit: + __testis = isdigit(__c); + break; + case punct: + __testis = ispunct(__c); + break; + case xdigit: + __testis = isxdigit(__c); + break; + case alnum: + __testis = isalnum(__c); + break; + case graph: + __testis = isgraph(__c); + break; + default: + __testis = false; + break; + } + __ret |= __testis; + } + } + return __ret; + } + } + + const char* + ctype:: + is(const char* __low, const char* __high, mask* __vec) const + { + if (_M_table) + while (__low < __high) + *__vec++ = _M_table[static_cast(*__low++)]; + else + { + // Highest bitmask in ctype_base == 10. + const size_t __bitmasksize = 15; + for (;__low < __high; ++__vec, ++__low) + { + mask __m = 0; + // Lowest bitmask in ctype_base == 0 + size_t __i = 0; + for (;__i <= __bitmasksize; ++__i) + { + const mask __bit = static_cast(1 << __i); + if (this->is(__bit, *__low)) + __m |= __bit; + } + *__vec = __m; + } + } + return __high; + } + + const char* + ctype:: + scan_is(mask __m, const char* __low, const char* __high) const + { + if (_M_table) + while (__low < __high + && !(_M_table[static_cast(*__low)] & __m)) + ++__low; + else + while (__low < __high && !this->is(__m, *__low)) + ++__low; + return __low; + } + + const char* + ctype:: + scan_not(mask __m, const char* __low, const char* __high) const + { + if (_M_table) + while (__low < __high + && (_M_table[static_cast(*__low)] & __m) != 0) + ++__low; + else + while (__low < __high && this->is(__m, *__low) != 0) + ++__low; + return __low; + } + + _GLIBCXX_END_NAMESPACE_VERSION + } // namespace diff -Nrcpad ./gcc-5.1.0/libstdc++-v3/config/os/haiku/error_constants.h ./gcc-5.1.0-Haiku/libstdc++-v3/config/os/haiku/error_constants.h *** ./gcc-5.1.0/libstdc++-v3/config/os/haiku/error_constants.h 1970-01-01 09:00:00.000000000 +0900 --- ./gcc-5.1.0-Haiku/libstdc++-v3/config/os/haiku/error_constants.h 2015-04-23 05:42:59.285533012 +0900 *************** *** 0 **** --- 1,178 ---- + // Specific definitions for generic platforms -*- C++ -*- + + // Copyright (C) 2007-2013 Free Software Foundation, Inc. + // + // This file is part of the GNU ISO C++ Library. This library is free + // software; you can redistribute it and/or modify it under the + // terms of the GNU General Public License as published by the + // Free Software Foundation; either version 3, or (at your option) + // any later version. + + // This library is distributed in the hope that it will be useful, + // but WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + // GNU General Public License for more details. + + // Under Section 7 of GPL version 3, you are granted additional + // permissions described in the GCC Runtime Library Exception, version + // 3.1, as published by the Free Software Foundation. + + // You should have received a copy of the GNU General Public License and + // a copy of the GCC Runtime Library Exception along with this program; + // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + // . + + /** @file bits/error_constants.h + * This is an internal header file, included by other library headers. + * Do not attempt to use it directly. @headername{system_error} + */ + + #ifndef _GLIBCXX_ERROR_CONSTANTS + #define _GLIBCXX_ERROR_CONSTANTS 1 + + #include + #include + + namespace std _GLIBCXX_VISIBILITY(default) + { + _GLIBCXX_BEGIN_NAMESPACE_VERSION + + enum class errc + { + address_family_not_supported = EAFNOSUPPORT, + address_in_use = EADDRINUSE, + address_not_available = EADDRNOTAVAIL, + already_connected = EISCONN, + argument_list_too_long = E2BIG, + argument_out_of_domain = EDOM, + bad_address = EFAULT, + bad_file_descriptor = EBADF, + + #ifdef _GLIBCXX_HAVE_EBADMSG + bad_message = EBADMSG, + #endif + + broken_pipe = EPIPE, + connection_aborted = ECONNABORTED, + connection_already_in_progress = EALREADY, + connection_refused = ECONNREFUSED, + connection_reset = ECONNRESET, + cross_device_link = EXDEV, + destination_address_required = EDESTADDRREQ, + device_or_resource_busy = EBUSY, + directory_not_empty = ENOTEMPTY, + executable_format_error = ENOEXEC, + file_exists = EEXIST, + file_too_large = EFBIG, + filename_too_long = ENAMETOOLONG, + function_not_supported = ENOSYS, + host_unreachable = EHOSTUNREACH, + + #ifdef _GLIBCXX_HAVE_EIDRM + identifier_removed = EIDRM, + #endif + + illegal_byte_sequence = EILSEQ, + inappropriate_io_control_operation = ENOTTY, + interrupted = EINTR, + invalid_argument = EINVAL, + invalid_seek = ESPIPE, + io_error = EIO, + is_a_directory = EISDIR, + message_size = EMSGSIZE, + network_down = ENETDOWN, + network_reset = ENETRESET, + network_unreachable = ENETUNREACH, + no_buffer_space = ENOBUFS, + no_child_process = ECHILD, + + #ifdef _GLIBCXX_HAVE_ENOLINK + no_link = ENOLINK, + #endif + + no_lock_available = ENOLCK, + + #ifdef _GLIBCXX_HAVE_ENODATA + no_message_available = ENODATA, + #endif + + no_message = ENOMSG, + no_protocol_option = ENOPROTOOPT, + no_space_on_device = ENOSPC, + + #ifdef _GLIBCXX_HAVE_ENOSR + no_stream_resources = ENOSR, + #endif + + no_such_device_or_address = ENXIO, + no_such_device = ENODEV, + no_such_file_or_directory = ENOENT, + no_such_process = ESRCH, + not_a_directory = ENOTDIR, + not_a_socket = ENOTSOCK, + + #ifdef _GLIBCXX_HAVE_ENOSTR + not_a_stream = ENOSTR, + #endif + + not_connected = ENOTCONN, + not_enough_memory = ENOMEM, + + #ifdef _GLIBCXX_HAVE_ENOTSUP + not_supported = ENOTSUP, + #endif + + #ifdef _GLIBCXX_HAVE_ECANCELED + operation_canceled = ECANCELED, + #endif + + operation_in_progress = EINPROGRESS, + operation_not_permitted = EPERM, + operation_not_supported = EOPNOTSUPP, + operation_would_block = EWOULDBLOCK, + + #ifdef _GLIBCXX_HAVE_EOWNERDEAD + owner_dead = EOWNERDEAD, + #endif + + permission_denied = EACCES, + + #ifdef _GLIBCXX_HAVE_EPROTO + protocol_error = EPROTO, + #endif + + protocol_not_supported = EPROTONOSUPPORT, + read_only_file_system = EROFS, + resource_deadlock_would_occur = EDEADLK, + resource_unavailable_try_again = EAGAIN, + result_out_of_range = ERANGE, + + #ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE + state_not_recoverable = ENOTRECOVERABLE, + #endif + + #ifdef _GLIBCXX_HAVE_ETIME + stream_timeout = ETIME, + #endif + + #ifdef _GLIBCXX_HAVE_ETXTBSY + text_file_busy = ETXTBSY, + #endif + + timed_out = ETIMEDOUT, + too_many_files_open_in_system = ENFILE, + too_many_files_open = EMFILE, + too_many_links = EMLINK, + too_many_symbolic_link_levels = ELOOP, + + #ifdef _GLIBCXX_HAVE_EOVERFLOW + value_too_large = EOVERFLOW, + #endif + + wrong_protocol_type = EPROTOTYPE + }; + + _GLIBCXX_END_NAMESPACE_VERSION + } // namespace + + #endif diff -Nrcpad ./gcc-5.1.0/libstdc++-v3/config/os/haiku/os_defines.h ./gcc-5.1.0-Haiku/libstdc++-v3/config/os/haiku/os_defines.h *** ./gcc-5.1.0/libstdc++-v3/config/os/haiku/os_defines.h 1970-01-01 09:00:00.000000000 +0900 --- ./gcc-5.1.0-Haiku/libstdc++-v3/config/os/haiku/os_defines.h 2015-04-23 05:42:59.285533012 +0900 *************** *** 0 **** --- 1,45 ---- + // Specific definitions for generic platforms -*- C++ -*- + + // Copyright (C) 2000-2013 Free Software Foundation, Inc. + // + // This file is part of the GNU ISO C++ Library. This library is free + // software; you can redistribute it and/or modify it under the + // terms of the GNU General Public License as published by the + // Free Software Foundation; either version 3, or (at your option) + // any later version. + + // This library is distributed in the hope that it will be useful, + // but WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + // GNU General Public License for more details. + + // Under Section 7 of GPL version 3, you are granted additional + // permissions described in the GCC Runtime Library Exception, version + // 3.1, as published by the Free Software Foundation. + + // You should have received a copy of the GNU General Public License and + // a copy of the GCC Runtime Library Exception along with this program; + // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + // . + + /** @file bits/os_defines.h + * This is an internal header file, included by other library headers. + * Do not attempt to use it directly. @headername{iosfwd} + */ + + #ifndef _GLIBCXX_OS_DEFINES + #define _GLIBCXX_OS_DEFINES 1 + + // System-specific #define, typedefs, corrections, etc, go here. This + // file will come before all others. + + // On Haiku, nanosleep and sched_yield are always available except for the + // kernel and the bootloader, so use them. + #if !defined(_KERNEL_MODE) && !defined(_LOADER_MODE) + #define _GLIBCXX_USE_NANOSLEEP 1 + #define _GLIBCXX_USE_SCHED_YIELD 1 + #define _GLIBCXX_USE_CLOCK_MONOTONIC 1 + #define _GLIBCXX_USE_CLOCK_REALTIME 1 + #endif + + #endif diff -Nrcpad ./gcc-5.1.0/libstdc++-v3/configure ./gcc-5.1.0-Haiku/libstdc++-v3/configure *** ./gcc-5.1.0/libstdc++-v3/configure 2015-03-24 01:47:18.000000000 +0900 --- ./gcc-5.1.0-Haiku/libstdc++-v3/configure 2015-04-23 05:42:59.389533009 +0900 *************** $as_echo_n "checking for $compiler optio *** 8657,8664 **** haiku*) # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static= ;; hpux*) --- 8657,8662 ---- *************** haiku*) *** 10779,10786 **** 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 ;; hpux9* | hpux10* | hpux11*) --- 10777,10785 ---- soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes ! sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' ! sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' ! hardcode_into_libs=no ;; hpux9* | hpux10* | hpux11*) *************** else *** 11300,11306 **** lt_cv_dlopen_libs= case $host_os in ! beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes --- 11299,11305 ---- lt_cv_dlopen_libs= case $host_os in ! beos* | haiku* ) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes *************** if test -z "$aix_libpath"; then aix_libp *** 12651,12658 **** ;; haiku*) ! archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ! link_all_deplibs_CXX=yes ;; hpux9*) --- 12650,12657 ---- ;; haiku*) ! archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ! link_all_deplibs=yes ;; hpux9*) *************** $as_echo_n "checking for $compiler optio *** 13519,13525 **** ;; esac ;; - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; --- 13518,13523 ---- *************** $as_echo_n "checking for $compiler optio *** 13541,13548 **** ;; haiku*) # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. --- 13539,13544 ---- *************** haiku*) *** 14463,14470 **** 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 ;; hpux9* | hpux10* | hpux11*) --- 14459,14467 ---- soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes ! sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' ! sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' ! hardcode_into_libs=no ;; hpux9* | hpux10* | hpux11*) *************** $as_echo "$ac_ld_relro" >&6; } *** 52160,52165 **** --- 52157,52246 ---- 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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` + ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" + eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 + _ACEOF + + fi + + done + + SECTION_FLAGS='-ffunction-sections -fdata-sections' + + + $as_echo "#define HAVE_INT64_T 1" >>confdefs.h + + + $as_echo "#define HAVE_ACOSF 1" >>confdefs.h + + $as_echo "#define HAVE_ASINF 1" >>confdefs.h + + $as_echo "#define HAVE_ATANF 1" >>confdefs.h + + $as_echo "#define HAVE_ATAN2F 1" >>confdefs.h + + $as_echo "#define HAVE_CEILF 1" >>confdefs.h + + $as_echo "#define HAVE_COSF 1" >>confdefs.h + + $as_echo "#define HAVE_COSHF 1" >>confdefs.h + + $as_echo "#define HAVE_EXPF 1" >>confdefs.h + + $as_echo "#define HAVE_FABSF 1" >>confdefs.h + + $as_echo "#define HAVE_FINITE 1" >>confdefs.h + + $as_echo "#define HAVE_FINITEF 1" >>confdefs.h + + $as_echo "#define HAVE_FLOORF 1" >>confdefs.h + + $as_echo "#define HAVE_FMODF 1" >>confdefs.h + + $as_echo "#define HAVE_FREXPF 1" >>confdefs.h + + $as_echo "#define HAVE_HYPOT 1" >>confdefs.h + + $as_echo "#define HAVE_HYPOTF 1" >>confdefs.h + + $as_echo "#define HAVE_ISINF 1" >>confdefs.h + + $as_echo "#define HAVE_ISINFF 1" >>confdefs.h + + $as_echo "#define HAVE_ISNAN 1" >>confdefs.h + + $as_echo "#define HAVE_ISNANF 1" >>confdefs.h + + $as_echo "#define HAVE_LOGF 1" >>confdefs.h + + $as_echo "#define HAVE_LOG10F 1" >>confdefs.h + + $as_echo "#define HAVE_MODFF 1" >>confdefs.h + + $as_echo "#define HAVE_SINF 1" >>confdefs.h + + $as_echo "#define HAVE_SINHF 1" >>confdefs.h + + $as_echo "#define HAVE_SQRTF 1" >>confdefs.h + + $as_echo "#define HAVE_TANF 1" >>confdefs.h + + $as_echo "#define HAVE_TANHF 1" >>confdefs.h + + $as_echo "#define HAVE_TLS 1" >>confdefs.h + + ;; + *-hpux*) SECTION_FLAGS='-ffunction-sections -fdata-sections' diff -Nrcpad ./gcc-5.1.0/libstdc++-v3/configure.host ./gcc-5.1.0-Haiku/libstdc++-v3/configure.host *** ./gcc-5.1.0/libstdc++-v3/configure.host 2015-01-09 23:06:02.000000000 +0900 --- ./gcc-5.1.0-Haiku/libstdc++-v3/configure.host 2015-04-23 05:42:59.389533009 +0900 *************** case "${host_os}" in *** 280,285 **** --- 280,288 ---- os_include_dir="os/gnu-linux" fi ;; + haiku*) + os_include_dir="os/haiku" + ;; hpux*) os_include_dir="os/hpux" ;; diff -Nrcpad ./gcc-5.1.0/libstdc++-v3/crossconfig.m4 ./gcc-5.1.0-Haiku/libstdc++-v3/crossconfig.m4 *** ./gcc-5.1.0/libstdc++-v3/crossconfig.m4 2014-04-22 21:30:59.000000000 +0900 --- ./gcc-5.1.0-Haiku/libstdc++-v3/crossconfig.m4 2015-04-23 05:42:59.393533009 +0900 *************** case "${host}" in *** 107,112 **** --- 107,153 ---- 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_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) + AC_DEFINE(HAVE_TLS) + ;; + *-hpux*) SECTION_FLAGS='-ffunction-sections -fdata-sections' AC_SUBST(SECTION_FLAGS) diff -Nrcpad ./gcc-5.1.0/libstdc++-v3/libsupc++/tinfo.cc ./gcc-5.1.0-Haiku/libstdc++-v3/libsupc++/tinfo.cc *** ./gcc-5.1.0/libstdc++-v3/libsupc++/tinfo.cc 2015-01-05 21:33:28.000000000 +0900 --- ./gcc-5.1.0-Haiku/libstdc++-v3/libsupc++/tinfo.cc 2015-04-23 05:42:59.393533009 +0900 *************** std::type_info:: *** 30,35 **** --- 30,44 ---- ~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-5.1.0/libtool.m4 ./gcc-5.1.0-Haiku/libtool.m4 *** ./gcc-5.1.0/libtool.m4 2014-11-22 01:49:17.000000000 +0900 --- ./gcc-5.1.0-Haiku/libtool.m4 2015-04-23 05:42:59.393533009 +0900 *************** fi *** 1137,1143 **** # Invoke $ECHO with all args, space-separated. func_echo_all () { ! $ECHO "$*" } case "$ECHO" in --- 1137,1143 ---- # Invoke $ECHO with all args, space-separated. func_echo_all () { ! $ECHO "$*" } case "$ECHO" in *************** else *** 1722,1728 **** lt_cv_dlopen_libs= case $host_os in ! beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes --- 1722,1728 ---- lt_cv_dlopen_libs= case $host_os in ! beos* | haiku* ) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes *************** haiku*) *** 2342,2349 **** 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 ;; hpux9* | hpux10* | hpux11*) --- 2342,2350 ---- soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes ! sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' ! sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' ! hardcode_into_libs=no ;; hpux9* | hpux10* | hpux11*) *************** m4_if([$1], [CXX], [ *** 3603,3609 **** ;; esac ;; - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; --- 3604,3609 ---- *************** m4_if([$1], [CXX], [ *** 3626,3633 **** ;; haiku*) # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. --- 3626,3631 ---- *************** m4_if([$1], [CXX], [ *** 3937,3944 **** haiku*) # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) --- 3935,3940 ---- diff -Nrcpad ./gcc-5.1.0/lto-plugin/configure ./gcc-5.1.0-Haiku/lto-plugin/configure *** ./gcc-5.1.0/lto-plugin/configure 2014-11-22 01:49:17.000000000 +0900 --- ./gcc-5.1.0-Haiku/lto-plugin/configure 2015-04-23 05:42:59.413533009 +0900 *************** haiku*) *** 9823,9829 **** 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 ;; --- 9823,9829 ---- 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/system/lib' hardcode_into_libs=yes ;; diff -Nrcpad ./gcc-5.1.0/zlib/configure ./gcc-5.1.0-Haiku/zlib/configure *** ./gcc-5.1.0/zlib/configure 2015-04-22 17:45:05.000000000 +0900 --- ./gcc-5.1.0-Haiku/zlib/configure 2015-04-23 05:42:59.509533007 +0900 *************** haiku*) *** 9589,9595 **** 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 ;; --- 9589,9595 ---- 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/system/lib' hardcode_into_libs=yes ;;