From 38e6a9f9c89cd5902f2d9272ba91064edcccf750 Mon Sep 17 00:00:00 2001 From: Murai Takashi Date: Sat, 5 May 2018 22:06:18 +0900 Subject: [PATCH] haiku patch --- config.rpath | 2 + config/acx.m4 | 36 +- configure | 48 +- configure.ac | 12 + gcc/Makefile.in | 12 +- gcc/config.gcc | 48 + gcc/config.host | 8 +- gcc/config/arm/haiku.h | 80 + gcc/config/arm/t-haiku | 21 + gcc/config/haiku-stdint.h | 55 + gcc/config/haiku.h | 214 +++ gcc/config/haiku.h-gcc6 | 218 +++ gcc/config/i386/haiku.h | 77 + gcc/config/i386/haiku64.h | 136 ++ gcc/config/i386/i386.c | 4 +- gcc/config/i386/t-haiku64 | 16 + gcc/config/m68k/haiku.h | 268 +++ gcc/config/mips/haiku.h | 44 + gcc/config/rs6000/haiku.h | 56 + gcc/config/t-haiku | 4 + gcc/configure | 46 +- gcc/configure.ac | 21 +- gcc/defaults.h-gcc6 | 1490 +++++++++++++++++ gcc/ginclude/stdarg.h | 2 +- gcc/ginclude/stddef.h | 10 +- include/filenames.h | 2 + libgcc/Makefile.in | 6 + libgcc/config.host | 42 +- libgcc/config/t-haiku | 3 + libgcc/crtstuff.c | 2 + libgomp/configure | 19 +- libquadmath/configure | 2 +- libssp/configure | 17 +- libstdc++-v3/config/os/haiku/ctype_base.h | 61 + .../config/os/haiku/ctype_configure_char.cc | 99 ++ libstdc++-v3/config/os/haiku/ctype_inline.h | 168 ++ .../config/os/haiku/error_constants.h | 178 ++ libstdc++-v3/config/os/haiku/os_defines.h | 45 + libstdc++-v3/configure | 186 +- libstdc++-v3/configure.host | 3 + libstdc++-v3/crossconfig.m4 | 39 + libstdc++-v3/libsupc++/tinfo.cc | 9 + libtool.m4 | 14 +- lto-plugin/configure | 2 +- zlib/configure | 2 +- 45 files changed, 3722 insertions(+), 105 deletions(-) create mode 100644 gcc/config/arm/haiku.h create mode 100644 gcc/config/arm/t-haiku create mode 100644 gcc/config/haiku-stdint.h create mode 100644 gcc/config/haiku.h create mode 100644 gcc/config/haiku.h-gcc6 create mode 100644 gcc/config/i386/haiku.h create mode 100644 gcc/config/i386/haiku64.h create mode 100644 gcc/config/i386/t-haiku64 create mode 100644 gcc/config/m68k/haiku.h create mode 100644 gcc/config/mips/haiku.h create mode 100644 gcc/config/rs6000/haiku.h create mode 100644 gcc/config/t-haiku create mode 100644 gcc/defaults.h-gcc6 create mode 100644 libgcc/config/t-haiku create mode 100644 libstdc++-v3/config/os/haiku/ctype_base.h create mode 100644 libstdc++-v3/config/os/haiku/ctype_configure_char.cc create mode 100644 libstdc++-v3/config/os/haiku/ctype_inline.h create mode 100644 libstdc++-v3/config/os/haiku/error_constants.h create mode 100644 libstdc++-v3/config/os/haiku/os_defines.h diff --git a/config.rpath b/config.rpath index 4dea75957..5bcc5be17 100755 --- a/config.rpath +++ b/config.rpath @@ -161,6 +161,8 @@ if test "$with_gnu_ld" = yes; then ;; netbsd*) ;; + haiku*) + ;; solaris* | sysv5*) if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then ld_shlibs=no diff --git a/config/acx.m4 b/config/acx.m4 index 87c1b5e29..6fdb7a0f9 100644 --- a/config/acx.m4 +++ b/config/acx.m4 @@ -428,24 +428,30 @@ dnl for the parameter format "cmp file1 file2 skip1 skip2" which is 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 -c +17 $$f1 > tmp-foo1; tail -c +17 $$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' +[# 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 - 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' + 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 - rm t1 t2 ]) do_compare="$gcc_cv_prog_cmp_skip" AC_SUBST(do_compare) diff --git a/configure b/configure index 060139551..3c3dac3b2 100755 --- a/configure +++ b/configure @@ -3053,6 +3053,9 @@ case "${host}" in i[3456789]86-*-msdosdjgpp*) noconfigdirs="$noconfigdirs tcl tk itcl" ;; + *-*-haiku*) + noconfigdirs="$noconfigdirs tk itcl libgui gdb" + ;; esac @@ -3378,6 +3381,9 @@ case "${target}" in *-*-darwin*) noconfigdirs="$noconfigdirs target-libffi" ;; + *-*-haiku*) + noconfigdirs="$noconfigdirs target-libffi" + ;; *-*-netware*) noconfigdirs="$noconfigdirs target-libffi" ;; @@ -3556,6 +3562,9 @@ case "${target}" in *-*-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" ;; @@ -3617,6 +3626,9 @@ case "${target}" in with_gmp=/usr/local fi ;; + *-*-haiku*) + noconfigdirs="$noconfigdirs gdb target-libiberty" + ;; *-*-kaos*) # Remove unsupported stuff on all kaOS configurations. noconfigdirs="$noconfigdirs target-libgloss" @@ -5265,24 +5277,30 @@ $as_echo_n "checking how to compare bootstrapped objects... " >&6; } 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 -c +17 $$f1 > tmp-foo1; tail -c +17 $$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' + # 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 - 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' + 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 - rm t1 t2 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_prog_cmp_skip" >&5 diff --git a/configure.ac b/configure.ac index c34333365..ee305bff3 100644 --- a/configure.ac +++ b/configure.ac @@ -419,6 +419,9 @@ case "${host}" in i[[3456789]]86-*-msdosdjgpp*) noconfigdirs="$noconfigdirs tcl tk itcl" ;; + *-*-haiku*) + noconfigdirs="$noconfigdirs tk itcl libgui gdb" + ;; esac @@ -709,6 +712,9 @@ case "${target}" in *-*-darwin*) noconfigdirs="$noconfigdirs target-libffi" ;; + *-*-haiku*) + noconfigdirs="$noconfigdirs target-libffi" + ;; *-*-netware*) noconfigdirs="$noconfigdirs target-libffi" ;; @@ -887,6 +893,9 @@ case "${target}" in *-*-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" ;; @@ -948,6 +957,9 @@ case "${target}" in with_gmp=/usr/local fi ;; + *-*-haiku*) + noconfigdirs="$noconfigdirs gdb target-libiberty" + ;; *-*-kaos*) # Remove unsupported stuff on all kaOS configurations. noconfigdirs="$noconfigdirs target-libgloss" diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 20bee0494..f42df7eb0 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -106,6 +106,8 @@ build_objdir := $(toplevel_builddir)/$(build_subdir) build_libobjdir := $(toplevel_builddir)/$(build_libsubdir) target_objdir := $(toplevel_builddir)/$(target_subdir) +HYBRID_SECONDARY = @HYBRID_SECONDARY@ + # -------- # Defined vpaths # -------- @@ -2192,6 +2194,10 @@ DRIVER_DEFINES = \ $(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) -DBASEVER=$(BASEVER_s) gcc.o: $(BASEVER) @@ -2813,7 +2819,7 @@ $(genprogerr:%=build/gen%$(build_exeext)): $(BUILD_ERRORS) 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 +build/genautomata$(build_exeext) : BUILD_LIBS += @build_math_library@ build/genrecog$(build_exeext) : build/hash-table.o build/inchash.o build/gencfn-macros$(build_exeext) : build/hash-table.o build/vec.o \ @@ -2883,6 +2889,10 @@ PREPROCESSOR_DEFINES = \ -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 --git a/gcc/config.gcc b/gcc/config.gcc index a5defb0f0..24b5282ab 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -744,6 +744,19 @@ case ${target} in 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 + ;; *-*-fuchsia*) native_system_header_dir=/include ;; @@ -1128,6 +1141,16 @@ arm*-*-netbsdelf*) tmake_file="${tmake_file} arm/t-arm" target_cpu_cname="arm6" ;; +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" @@ -1520,6 +1543,14 @@ i[34567]86-*-freebsd*) 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 ${nbsd_tm_file} i386/netbsd-elf.h" extra_options="${extra_options} netbsd.opt netbsd-elf.opt" @@ -2006,6 +2037,13 @@ m68k-*-rtems*) 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 @@ -2124,6 +2162,11 @@ mips*-mti-linux*) gnu_ld=yes gas=yes ;; +mipsel-*-haiku*) + target_cpu_default="MASK_ABICALLS" + tm_file="elfos.h ${tm_file} haiku.h mips/haiku.h" + tmake_file="${tmake_file} mips/t-elf t-haiku" + ;; mips*-*-linux*) # Linux MIPS, either endian. tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h" extra_options="${extra_options} linux-android.opt" @@ -2469,6 +2512,11 @@ powerpc-*-rtems*spe*) extra_options="${extra_options} powerpcspe/sysv4.opt" tmake_file="${tmake_file} powerpcspe/t-fprules powerpcspe/t-rtems powerpcspe/t-ppccomm" ;; +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="rs6000/biarch64.h ${tm_file} dbxelf.h elfos.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/rtems.h rtems.h" extra_options="${extra_options} rs6000/sysv4.opt rs6000/linux64.opt" diff --git a/gcc/config.host b/gcc/config.host index c65569da2..dd405629c 100644 --- a/gcc/config.host +++ b/gcc/config.host @@ -107,7 +107,7 @@ case ${host} in ;; esac ;; - arm*-*-freebsd* | arm*-*-linux* | arm*-*-fuchsia*) + arm*-*-freebsd* | arm*-*-haiku* | arm*-*-linux*) case ${target} in arm*-*-*) host_extra_gcc_objs="driver-arm.o" @@ -133,9 +133,11 @@ case ${host} in ;; esac ;; - mips*-*-linux*) + mips*-*-linux* \ + | mips*-*-haiku* ) case ${target} in - mips*-*-linux*) + mips*-*-linux* \ + | mips*-*-haiku* ) host_extra_gcc_objs="driver-native.o" host_xmake_file="${host_xmake_file} mips/x-native" ;; diff --git a/gcc/config/arm/haiku.h b/gcc/config/arm/haiku.h new file mode 100644 index 000000000..f0c0d6326 --- /dev/null +++ b/gcc/config/arm/haiku.h @@ -0,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 --git a/gcc/config/arm/t-haiku b/gcc/config/arm/t-haiku new file mode 100644 index 000000000..3f7f488fe --- /dev/null +++ b/gcc/config/arm/t-haiku @@ -0,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 --git a/gcc/config/haiku-stdint.h b/gcc/config/haiku-stdint.h new file mode 100644 index 000000000..19f141296 --- /dev/null +++ b/gcc/config/haiku-stdint.h @@ -0,0 +1,55 @@ +/* Definitions for types on Haiku. + Copyright (C) 2014 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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 --git a/gcc/config/haiku.h b/gcc/config/haiku.h new file mode 100644 index 000000000..8e9f10134 --- /dev/null +++ b/gcc/config/haiku.h @@ -0,0 +1,214 @@ +/* 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 \ + "%{fpic|fPIC|fpie|fPIE|fno-pic|fno-PIC|fno-pie|fno-PIE:;:-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 use TM clone registry in Haiku for now */ +#define USE_TM_CLONE_REGISTRY 0 diff --git a/gcc/config/haiku.h-gcc6 b/gcc/config/haiku.h-gcc6 new file mode 100644 index 000000000..d35f37b61 --- /dev/null +++ b/gcc/config/haiku.h-gcc6 @@ -0,0 +1,218 @@ +/* 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 \ + "%{fpic|fPIC|fpie|fPIE|fno-pic|fno-PIC|fno-pie|fno-PIE:;:-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 use JCR_SECTION_NAME default definition for Haiku */ +#define TARGET_NO_JCR_SECTION_NAME 1 + + +/* Do not use TM clone registry in Haiku for now */ +#define USE_TM_CLONE_REGISTRY 0 diff --git a/gcc/config/i386/haiku.h b/gcc/config/i386/haiku.h new file mode 100644 index 000000000..3379e19f5 --- /dev/null +++ b/gcc/config/i386/haiku.h @@ -0,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 --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 6a2141e48..d54bea536 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -52117,11 +52117,11 @@ ix86_run_selftests (void) #undef TARGET_ADDR_SPACE_ZERO_ADDRESS_VALID #define TARGET_ADDR_SPACE_ZERO_ADDRESS_VALID ix86_addr_space_zero_address_valid -#undef TARGET_INIT_LIBFUNCS +/* #undef TARGET_INIT_LIBFUNCS #define TARGET_INIT_LIBFUNCS ix86_init_libfuncs #undef TARGET_EXPAND_DIVMOD_LIBFUNC -#define TARGET_EXPAND_DIVMOD_LIBFUNC ix86_expand_divmod_libfunc +#define TARGET_EXPAND_DIVMOD_LIBFUNC ix86_expand_divmod_libfunc */ #undef TARGET_MAX_NOCE_IFCVT_SEQ_COST #define TARGET_MAX_NOCE_IFCVT_SEQ_COST ix86_max_noce_ifcvt_seq_cost diff --git a/gcc/config/i386/t-haiku64 b/gcc/config/i386/t-haiku64 new file mode 100644 index 000000000..9c8f8e62e --- /dev/null +++ b/gcc/config/i386/t-haiku64 @@ -0,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 --git a/gcc/config/m68k/haiku.h b/gcc/config/m68k/haiku.h new file mode 100644 index 000000000..358c19f5c --- /dev/null +++ b/gcc/config/m68k/haiku.h @@ -0,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 --git a/gcc/config/mips/haiku.h b/gcc/config/mips/haiku.h new file mode 100644 index 000000000..f6d2efb97 --- /dev/null +++ b/gcc/config/mips/haiku.h @@ -0,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 --git a/gcc/config/rs6000/haiku.h b/gcc/config/rs6000/haiku.h new file mode 100644 index 000000000..4dff89e5c --- /dev/null +++ b/gcc/config/rs6000/haiku.h @@ -0,0 +1,56 @@ +/* Definitions for PowerPC running Haiku + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 + Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + + +/* long double is 128 bits wide; the documentation claims + LIBGCC2_LONG_DOUBLE_TYPE_SIZE to default to LONG_DOUBLE_TYPE_SIZE, but + it apparently does not */ +/*#undef LONG_DOUBLE_TYPE_SIZE +#define LONG_DOUBLE_TYPE_SIZE 128 +#undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE +#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128*/ + +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("__HAIKU__"); \ + builtin_define ("__POWERPC__"); \ + builtin_define ("__powerpc__"); \ + builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ + builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ + builtin_define ("__STDC_ISO_10646__=201103L"); \ + builtin_assert ("system=haiku"); \ + builtin_assert ("cpu=powerpc"); \ + builtin_assert ("machine=powerpc"); \ + TARGET_OS_SYSV_CPP_BUILTINS (); \ + } \ + while (0) + +/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support + for the special GCC options -static and -shared, which allow us to + link things in one of these three modes by applying the appropriate + combinations of options at link-time. */ + +/* If ELF is the default format, we should not use /lib/elf. */ + +#undef LINK_SPEC +#define LINK_SPEC "%{!o*:-o %b} -m elf32ppchaiku %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}" diff --git a/gcc/config/t-haiku b/gcc/config/t-haiku new file mode 100644 index 000000000..587d1fb01 --- /dev/null +++ b/gcc/config/t-haiku @@ -0,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 ] \ No newline at end of file diff --git a/gcc/configure b/gcc/configure index 6121e1632..65d4c8e3d 100755 --- a/gcc/configure +++ b/gcc/configure @@ -750,6 +750,7 @@ LDEXP_LIB EXTRA_GCC_LIBS GNAT_LIBEXC COLLECT2_LIBS +build_math_library CXXDEPMODE DEPDIR am__leading_dot @@ -786,6 +787,7 @@ with_float with_cpu enable_multiarch enable_multilib +HYBRID_SECONDARY coverage_flags valgrind_command valgrind_path_defines @@ -902,6 +904,7 @@ enable_checking enable_coverage enable_gather_detailed_mem_stats enable_valgrind_annotations +with_hybrid_secondary with_stabs enable_multilib enable_multiarch @@ -1723,6 +1726,8 @@ Optional Packages: --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-specs=SPECS add SPECS to driver command-line processing @@ -7385,6 +7390,18 @@ fi # 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. @@ -9392,6 +9409,16 @@ fi # -------- +# 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 @@ -11692,7 +11719,7 @@ case ${enable_threads} in # default target_thread_file='single' ;; - aix | dce | lynx | mipssde | posix | rtems | \ + aix | dce | haiku | lynx | mipssde | posix | rtems | \ single | tpf | vxworks | win32) target_thread_file=${enable_threads} ;; @@ -15539,8 +15566,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } haiku*) # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static= ;; hpux*) @@ -17652,8 +17677,9 @@ haiku*) 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 + 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*) @@ -18170,7 +18196,7 @@ else lt_cv_dlopen_libs= case $host_os in - beos*) + beos* | haiku* ) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes @@ -20368,7 +20394,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } ;; esac ;; - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; @@ -20390,8 +20415,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } ;; 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. @@ -21312,8 +21335,9 @@ haiku*) 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 + 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*) diff --git a/gcc/configure.ac b/gcc/configure.ac index b066cc609..c3a3456ed 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -771,6 +771,15 @@ fi # 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], @@ -1155,6 +1164,16 @@ ZW_PROG_COMPILER_DEPENDENCIES([CXX]) # -------- +# 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, @@ -1611,7 +1630,7 @@ case ${enable_threads} in # default target_thread_file='single' ;; - aix | dce | lynx | mipssde | posix | rtems | \ + aix | dce | haiku | lynx | mipssde | posix | rtems | \ single | tpf | vxworks | win32) target_thread_file=${enable_threads} ;; diff --git a/gcc/defaults.h-gcc6 b/gcc/defaults.h-gcc6 new file mode 100644 index 000000000..d756ee6ed --- /dev/null +++ b/gcc/defaults.h-gcc6 @@ -0,0 +1,1490 @@ +/* Definitions of various defaults for tm.h macros. + Copyright (C) 1992-2017 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 +. */ + +#ifndef GCC_DEFAULTS_H +#define GCC_DEFAULTS_H + +/* How to start an assembler comment. */ +#ifndef ASM_COMMENT_START +#define ASM_COMMENT_START ";#" +#endif + +/* Store in OUTPUT a string (made with alloca) containing an + assembler-name for a local static variable or function named NAME. + LABELNO is an integer which is different for each call. */ + +#ifndef ASM_PN_FORMAT +# ifndef NO_DOT_IN_LABEL +# define ASM_PN_FORMAT "%s.%lu" +# else +# ifndef NO_DOLLAR_IN_LABEL +# define ASM_PN_FORMAT "%s$%lu" +# else +# define ASM_PN_FORMAT "__%s_%lu" +# endif +# endif +#endif /* ! ASM_PN_FORMAT */ + +#ifndef ASM_FORMAT_PRIVATE_NAME +# define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \ + do { const char *const name_ = (NAME); \ + char *const output_ = (OUTPUT) = \ + (char *) alloca (strlen (name_) + 32); \ + sprintf (output_, ASM_PN_FORMAT, name_, (unsigned long)(LABELNO)); \ + } while (0) +#endif + +/* Choose a reasonable default for ASM_OUTPUT_ASCII. */ + +#ifndef ASM_OUTPUT_ASCII +#define ASM_OUTPUT_ASCII(MYFILE, MYSTRING, MYLENGTH) \ + do { \ + FILE *_hide_asm_out_file = (MYFILE); \ + const unsigned char *_hide_p = (const unsigned char *) (MYSTRING); \ + int _hide_thissize = (MYLENGTH); \ + { \ + FILE *asm_out_file = _hide_asm_out_file; \ + const unsigned char *p = _hide_p; \ + int thissize = _hide_thissize; \ + int i; \ + fprintf (asm_out_file, "\t.ascii \""); \ + \ + for (i = 0; i < thissize; i++) \ + { \ + int c = p[i]; \ + if (c == '\"' || c == '\\') \ + putc ('\\', asm_out_file); \ + if (ISPRINT (c)) \ + putc (c, asm_out_file); \ + else \ + { \ + fprintf (asm_out_file, "\\%o", c); \ + /* After an octal-escape, if a digit follows, \ + terminate one string constant and start another. \ + The VAX assembler fails to stop reading the escape \ + after three digits, so this is the only way we \ + can get it to parse the data properly. */ \ + if (i < thissize - 1 && ISDIGIT (p[i + 1])) \ + fprintf (asm_out_file, "\"\n\t.ascii \""); \ + } \ + } \ + fprintf (asm_out_file, "\"\n"); \ + } \ + } \ + while (0) +#endif + +/* This is how we tell the assembler to equate two values. */ +#ifdef SET_ASM_OP +#ifndef ASM_OUTPUT_DEF +#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \ + do { fprintf ((FILE), "%s", SET_ASM_OP); \ + assemble_name (FILE, LABEL1); \ + fprintf (FILE, ","); \ + assemble_name (FILE, LABEL2); \ + fprintf (FILE, "\n"); \ + } while (0) +#endif +#endif + +#ifndef IFUNC_ASM_TYPE +#define IFUNC_ASM_TYPE "gnu_indirect_function" +#endif + +#ifndef TLS_COMMON_ASM_OP +#define TLS_COMMON_ASM_OP ".tls_common" +#endif + +#if defined (HAVE_AS_TLS) && !defined (ASM_OUTPUT_TLS_COMMON) +#define ASM_OUTPUT_TLS_COMMON(FILE, DECL, NAME, SIZE) \ + do \ + { \ + fprintf ((FILE), "\t%s\t", TLS_COMMON_ASM_OP); \ + assemble_name ((FILE), (NAME)); \ + fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ + (SIZE), DECL_ALIGN (DECL) / BITS_PER_UNIT); \ + } \ + while (0) +#endif + +/* Decide whether to defer emitting the assembler output for an equate + of two values. The default is to not defer output. */ +#ifndef TARGET_DEFERRED_OUTPUT_DEFS +#define TARGET_DEFERRED_OUTPUT_DEFS(DECL,TARGET) false +#endif + +/* This is how to output the definition of a user-level label named + NAME, such as the label on variable NAME. */ + +#ifndef ASM_OUTPUT_LABEL +#define ASM_OUTPUT_LABEL(FILE,NAME) \ + do { \ + assemble_name ((FILE), (NAME)); \ + fputs (":\n", (FILE)); \ + } while (0) +#endif + +/* This is how to output the definition of a user-level label named + NAME, such as the label on a function. */ + +#ifndef ASM_OUTPUT_FUNCTION_LABEL +#define ASM_OUTPUT_FUNCTION_LABEL(FILE, NAME, DECL) \ + ASM_OUTPUT_LABEL ((FILE), (NAME)) +#endif + +/* Output the definition of a compiler-generated label named NAME. */ +#ifndef ASM_OUTPUT_INTERNAL_LABEL +#define ASM_OUTPUT_INTERNAL_LABEL(FILE,NAME) \ + do { \ + assemble_name_raw ((FILE), (NAME)); \ + fputs (":\n", (FILE)); \ + } while (0) +#endif + +/* This is how to output a reference to a user-level label named NAME. */ + +#ifndef ASM_OUTPUT_LABELREF +#define ASM_OUTPUT_LABELREF(FILE,NAME) \ + do { \ + fputs (user_label_prefix, (FILE)); \ + fputs ((NAME), (FILE)); \ + } while (0); +#endif + +/* Allow target to print debug info labels specially. This is useful for + VLIW targets, since debug info labels should go into the middle of + instruction bundles instead of breaking them. */ + +#ifndef ASM_OUTPUT_DEBUG_LABEL +#define ASM_OUTPUT_DEBUG_LABEL(FILE, PREFIX, NUM) \ + (*targetm.asm_out.internal_label) (FILE, PREFIX, NUM) +#endif + +/* This is how we tell the assembler that a symbol is weak. */ +#ifndef ASM_OUTPUT_WEAK_ALIAS +#if defined (ASM_WEAKEN_LABEL) && defined (ASM_OUTPUT_DEF) +#define ASM_OUTPUT_WEAK_ALIAS(STREAM, NAME, VALUE) \ + do \ + { \ + ASM_WEAKEN_LABEL (STREAM, NAME); \ + if (VALUE) \ + ASM_OUTPUT_DEF (STREAM, NAME, VALUE); \ + } \ + while (0) +#endif +#endif + +/* This is how we tell the assembler that a symbol is a weak alias to + another symbol that doesn't require the other symbol to be defined. + Uses of the former will turn into weak uses of the latter, i.e., + uses that, in case the latter is undefined, will not cause errors, + and will add it to the symbol table as weak undefined. However, if + the latter is referenced directly, a strong reference prevails. */ +#ifndef ASM_OUTPUT_WEAKREF +#if defined HAVE_GAS_WEAKREF +#define ASM_OUTPUT_WEAKREF(FILE, DECL, NAME, VALUE) \ + do \ + { \ + fprintf ((FILE), "\t.weakref\t"); \ + assemble_name ((FILE), (NAME)); \ + fprintf ((FILE), ","); \ + assemble_name ((FILE), (VALUE)); \ + fprintf ((FILE), "\n"); \ + } \ + while (0) +#endif +#endif + +/* How to emit a .type directive. */ +#ifndef ASM_OUTPUT_TYPE_DIRECTIVE +#if defined TYPE_ASM_OP && defined TYPE_OPERAND_FMT +#define ASM_OUTPUT_TYPE_DIRECTIVE(STREAM, NAME, TYPE) \ + do \ + { \ + fputs (TYPE_ASM_OP, STREAM); \ + assemble_name (STREAM, NAME); \ + fputs (", ", STREAM); \ + fprintf (STREAM, TYPE_OPERAND_FMT, TYPE); \ + putc ('\n', STREAM); \ + } \ + while (0) +#endif +#endif + +/* How to emit a .size directive. */ +#ifndef ASM_OUTPUT_SIZE_DIRECTIVE +#ifdef SIZE_ASM_OP +#define ASM_OUTPUT_SIZE_DIRECTIVE(STREAM, NAME, SIZE) \ + do \ + { \ + HOST_WIDE_INT size_ = (SIZE); \ + fputs (SIZE_ASM_OP, STREAM); \ + assemble_name (STREAM, NAME); \ + fprintf (STREAM, ", " HOST_WIDE_INT_PRINT_DEC "\n", size_); \ + } \ + while (0) + +#define ASM_OUTPUT_MEASURED_SIZE(STREAM, NAME) \ + do \ + { \ + fputs (SIZE_ASM_OP, STREAM); \ + assemble_name (STREAM, NAME); \ + fputs (", .-", STREAM); \ + assemble_name (STREAM, NAME); \ + putc ('\n', STREAM); \ + } \ + while (0) + +#endif +#endif + +/* This determines whether or not we support weak symbols. SUPPORTS_WEAK + must be a preprocessor constant. */ +#ifndef SUPPORTS_WEAK +#if defined (ASM_WEAKEN_LABEL) || defined (ASM_WEAKEN_DECL) +#define SUPPORTS_WEAK 1 +#else +#define SUPPORTS_WEAK 0 +#endif +#endif + +/* This determines whether or not we support weak symbols during target + code generation. TARGET_SUPPORTS_WEAK can be any valid C expression. */ +#ifndef TARGET_SUPPORTS_WEAK +#define TARGET_SUPPORTS_WEAK (SUPPORTS_WEAK) +#endif + +/* This determines whether or not we support the discriminator + attribute in the .loc directive. */ +#ifndef SUPPORTS_DISCRIMINATOR +#ifdef HAVE_GAS_DISCRIMINATOR +#define SUPPORTS_DISCRIMINATOR 1 +#else +#define SUPPORTS_DISCRIMINATOR 0 +#endif +#endif + +/* This determines whether or not we support link-once semantics. */ +#ifndef SUPPORTS_ONE_ONLY +#ifdef MAKE_DECL_ONE_ONLY +#define SUPPORTS_ONE_ONLY 1 +#else +#define SUPPORTS_ONE_ONLY 0 +#endif +#endif + +/* This determines whether weak symbols must be left out of a static + archive's table of contents. Defining this macro to be nonzero has + the consequence that certain symbols will not be made weak that + otherwise would be. The C++ ABI requires this macro to be zero; + see the documentation. */ +#ifndef TARGET_WEAK_NOT_IN_ARCHIVE_TOC +#define TARGET_WEAK_NOT_IN_ARCHIVE_TOC 0 +#endif + +/* This determines whether or not we need linkonce unwind information. */ +#ifndef TARGET_USES_WEAK_UNWIND_INFO +#define TARGET_USES_WEAK_UNWIND_INFO 0 +#endif + +/* By default, there is no prefix on user-defined symbols. */ +#ifndef USER_LABEL_PREFIX +#define USER_LABEL_PREFIX "" +#endif + +/* If the target supports weak symbols, define TARGET_ATTRIBUTE_WEAK to + provide a weak attribute. Else define it to nothing. + + This would normally belong in ansidecl.h, but SUPPORTS_WEAK is + not available at that time. + + Note, this is only for use by target files which we know are to be + compiled by GCC. */ +#ifndef TARGET_ATTRIBUTE_WEAK +# if SUPPORTS_WEAK +# define TARGET_ATTRIBUTE_WEAK __attribute__ ((weak)) +# else +# define TARGET_ATTRIBUTE_WEAK +# endif +#endif + +/* By default we can assume that all global symbols are in one namespace, + across all shared libraries. */ +#ifndef MULTIPLE_SYMBOL_SPACES +# define MULTIPLE_SYMBOL_SPACES 0 +#endif + +/* If the target supports init_priority C++ attribute, give + SUPPORTS_INIT_PRIORITY a nonzero value. */ +#ifndef SUPPORTS_INIT_PRIORITY +#define SUPPORTS_INIT_PRIORITY 1 +#endif /* SUPPORTS_INIT_PRIORITY */ + +/* If we have a definition of INCOMING_RETURN_ADDR_RTX, assume that + the rest of the DWARF 2 frame unwind support is also provided. */ +#if !defined (DWARF2_UNWIND_INFO) && defined (INCOMING_RETURN_ADDR_RTX) +#define DWARF2_UNWIND_INFO 1 +#endif + +/* If we have named sections, and we're using crtstuff to run ctors, + use them for registering eh frame information. */ +#if defined (TARGET_ASM_NAMED_SECTION) && DWARF2_UNWIND_INFO \ + && !defined (EH_FRAME_THROUGH_COLLECT2) +#ifndef EH_FRAME_SECTION_NAME +#define EH_FRAME_SECTION_NAME ".eh_frame" +#endif +#endif + +/* On many systems, different EH table encodings are used under + difference circumstances. Some will require runtime relocations; + some will not. For those that do not require runtime relocations, + we would like to make the table read-only. However, since the + read-only tables may need to be combined with read-write tables + that do require runtime relocation, it is not safe to make the + tables read-only unless the linker will merge read-only and + read-write sections into a single read-write section. If your + linker does not have this ability, but your system is such that no + encoding used with non-PIC code will ever require a runtime + relocation, then you can define EH_TABLES_CAN_BE_READ_ONLY to 1 in + your target configuration file. */ +#ifndef EH_TABLES_CAN_BE_READ_ONLY +#ifdef HAVE_LD_RO_RW_SECTION_MIXING +#define EH_TABLES_CAN_BE_READ_ONLY 1 +#else +#define EH_TABLES_CAN_BE_READ_ONLY 0 +#endif +#endif + +/* Provide defaults for stuff that may not be defined when using + sjlj exceptions. */ +#ifndef EH_RETURN_DATA_REGNO +#define EH_RETURN_DATA_REGNO(N) INVALID_REGNUM +#endif + +/* Offset between the eh handler address and entry in eh tables. */ +#ifndef RETURN_ADDR_OFFSET +#define RETURN_ADDR_OFFSET 0 +#endif + +#ifndef MASK_RETURN_ADDR +#define MASK_RETURN_ADDR NULL_RTX +#endif + +/* If we have named section and we support weak symbols, then use the + .jcr section for recording java classes which need to be registered + at program start-up time. Can be overridden by defining + TARGET_NO_JCR_SECTION_NAME. */ +#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK \ + && !defined (TARGET_NO_JCR_SECTION_NAME) +#ifndef JCR_SECTION_NAME +#define JCR_SECTION_NAME ".jcr" +#endif +#endif + + +/* Number of hardware registers that go into the DWARF-2 unwind info. + If not defined, equals FIRST_PSEUDO_REGISTER */ + +#ifndef DWARF_FRAME_REGISTERS +#define DWARF_FRAME_REGISTERS FIRST_PSEUDO_REGISTER +#endif + +/* Offsets recorded in opcodes are a multiple of this alignment factor. */ +#ifndef DWARF_CIE_DATA_ALIGNMENT +#ifdef STACK_GROWS_DOWNWARD +#define DWARF_CIE_DATA_ALIGNMENT (-((int) UNITS_PER_WORD)) +#else +#define DWARF_CIE_DATA_ALIGNMENT ((int) UNITS_PER_WORD) +#endif +#endif + +/* The DWARF 2 CFA column which tracks the return address. Normally this + is the column for PC, or the first column after all of the hard + registers. */ +#ifndef DWARF_FRAME_RETURN_COLUMN +#ifdef PC_REGNUM +#define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (PC_REGNUM) +#else +#define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGISTERS +#endif +#endif + +/* How to renumber registers for dbx and gdb. If not defined, assume + no renumbering is necessary. */ + +#ifndef DBX_REGISTER_NUMBER +#define DBX_REGISTER_NUMBER(REGNO) (REGNO) +#endif + +/* The mapping from gcc register number to DWARF 2 CFA column number. + By default, we just provide columns for all registers. */ +#ifndef DWARF_FRAME_REGNUM +#define DWARF_FRAME_REGNUM(REG) DBX_REGISTER_NUMBER (REG) +#endif + +/* The mapping from dwarf CFA reg number to internal dwarf reg numbers. */ +#ifndef DWARF_REG_TO_UNWIND_COLUMN +#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO) +#endif + +/* Map register numbers held in the call frame info that gcc has + collected using DWARF_FRAME_REGNUM to those that should be output in + .debug_frame and .eh_frame. */ +#ifndef DWARF2_FRAME_REG_OUT +#define DWARF2_FRAME_REG_OUT(REGNO, FOR_EH) (REGNO) +#endif + +/* The size of addresses as they appear in the Dwarf 2 data. + Some architectures use word addresses to refer to code locations, + but Dwarf 2 info always uses byte addresses. On such machines, + Dwarf 2 addresses need to be larger than the architecture's + pointers. */ +#ifndef DWARF2_ADDR_SIZE +#define DWARF2_ADDR_SIZE ((POINTER_SIZE + BITS_PER_UNIT - 1) / BITS_PER_UNIT) +#endif + +/* The size in bytes of a DWARF field indicating an offset or length + relative to a debug info section, specified to be 4 bytes in the + DWARF-2 specification. The SGI/MIPS ABI defines it to be the same + as PTR_SIZE. */ +#ifndef DWARF_OFFSET_SIZE +#define DWARF_OFFSET_SIZE 4 +#endif + +/* The size in bytes of a DWARF 4 type signature. */ +#ifndef DWARF_TYPE_SIGNATURE_SIZE +#define DWARF_TYPE_SIGNATURE_SIZE 8 +#endif + +/* Default sizes for base C types. If the sizes are different for + your target, you should override these values by defining the + appropriate symbols in your tm.h file. */ + +#ifndef BITS_PER_WORD +#define BITS_PER_WORD (BITS_PER_UNIT * UNITS_PER_WORD) +#endif + +#ifndef CHAR_TYPE_SIZE +#define CHAR_TYPE_SIZE BITS_PER_UNIT +#endif + +#ifndef BOOL_TYPE_SIZE +/* `bool' has size and alignment `1', on almost all platforms. */ +#define BOOL_TYPE_SIZE CHAR_TYPE_SIZE +#endif + +#ifndef SHORT_TYPE_SIZE +#define SHORT_TYPE_SIZE (BITS_PER_UNIT * MIN ((UNITS_PER_WORD + 1) / 2, 2)) +#endif + +#ifndef INT_TYPE_SIZE +#define INT_TYPE_SIZE BITS_PER_WORD +#endif + +#ifndef LONG_TYPE_SIZE +#define LONG_TYPE_SIZE BITS_PER_WORD +#endif + +#ifndef LONG_LONG_TYPE_SIZE +#define LONG_LONG_TYPE_SIZE (BITS_PER_WORD * 2) +#endif + +#ifndef WCHAR_TYPE_SIZE +#define WCHAR_TYPE_SIZE INT_TYPE_SIZE +#endif + +#ifndef FLOAT_TYPE_SIZE +#define FLOAT_TYPE_SIZE BITS_PER_WORD +#endif + +#ifndef DOUBLE_TYPE_SIZE +#define DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2) +#endif + +#ifndef LONG_DOUBLE_TYPE_SIZE +#define LONG_DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2) +#endif + +#ifndef DECIMAL32_TYPE_SIZE +#define DECIMAL32_TYPE_SIZE 32 +#endif + +#ifndef DECIMAL64_TYPE_SIZE +#define DECIMAL64_TYPE_SIZE 64 +#endif + +#ifndef DECIMAL128_TYPE_SIZE +#define DECIMAL128_TYPE_SIZE 128 +#endif + +#ifndef SHORT_FRACT_TYPE_SIZE +#define SHORT_FRACT_TYPE_SIZE BITS_PER_UNIT +#endif + +#ifndef FRACT_TYPE_SIZE +#define FRACT_TYPE_SIZE (BITS_PER_UNIT * 2) +#endif + +#ifndef LONG_FRACT_TYPE_SIZE +#define LONG_FRACT_TYPE_SIZE (BITS_PER_UNIT * 4) +#endif + +#ifndef LONG_LONG_FRACT_TYPE_SIZE +#define LONG_LONG_FRACT_TYPE_SIZE (BITS_PER_UNIT * 8) +#endif + +#ifndef SHORT_ACCUM_TYPE_SIZE +#define SHORT_ACCUM_TYPE_SIZE (SHORT_FRACT_TYPE_SIZE * 2) +#endif + +#ifndef ACCUM_TYPE_SIZE +#define ACCUM_TYPE_SIZE (FRACT_TYPE_SIZE * 2) +#endif + +#ifndef LONG_ACCUM_TYPE_SIZE +#define LONG_ACCUM_TYPE_SIZE (LONG_FRACT_TYPE_SIZE * 2) +#endif + +#ifndef LONG_LONG_ACCUM_TYPE_SIZE +#define LONG_LONG_ACCUM_TYPE_SIZE (LONG_LONG_FRACT_TYPE_SIZE * 2) +#endif + +/* We let tm.h override the types used here, to handle trivial differences + such as the choice of unsigned int or long unsigned int for size_t. + When machines start needing nontrivial differences in the size type, + it would be best to do something here to figure out automatically + from other information what type to use. */ + +#ifndef SIZE_TYPE +#define SIZE_TYPE "long unsigned int" +#endif + +#ifndef SIZETYPE +#define SIZETYPE SIZE_TYPE +#endif + +#ifndef PID_TYPE +#define PID_TYPE "int" +#endif + +/* If GCC knows the exact uint_least16_t and uint_least32_t types from + , use them for char16_t and char32_t. Otherwise, use + these guesses; getting the wrong type of a given width will not + affect C++ name mangling because in C++ these are distinct types + not typedefs. */ + +#ifdef UINT_LEAST16_TYPE +#define CHAR16_TYPE UINT_LEAST16_TYPE +#else +#define CHAR16_TYPE "short unsigned int" +#endif + +#ifdef UINT_LEAST32_TYPE +#define CHAR32_TYPE UINT_LEAST32_TYPE +#else +#define CHAR32_TYPE "unsigned int" +#endif + +#ifndef WCHAR_TYPE +#define WCHAR_TYPE "int" +#endif + +/* WCHAR_TYPE gets overridden by -fshort-wchar. */ +#define MODIFIED_WCHAR_TYPE \ + (flag_short_wchar ? "short unsigned int" : WCHAR_TYPE) + +#ifndef PTRDIFF_TYPE +#define PTRDIFF_TYPE "long int" +#endif + +#ifndef WINT_TYPE +#define WINT_TYPE "unsigned int" +#endif + +#ifndef INTMAX_TYPE +#define INTMAX_TYPE ((INT_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \ + ? "int" \ + : ((LONG_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \ + ? "long int" \ + : "long long int")) +#endif + +#ifndef UINTMAX_TYPE +#define UINTMAX_TYPE ((INT_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \ + ? "unsigned int" \ + : ((LONG_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \ + ? "long unsigned int" \ + : "long long unsigned int")) +#endif + + +/* There are no default definitions of these types. */ + +#ifndef SIG_ATOMIC_TYPE +#define SIG_ATOMIC_TYPE ((const char *) NULL) +#endif + +#ifndef INT8_TYPE +#define INT8_TYPE ((const char *) NULL) +#endif + +#ifndef INT16_TYPE +#define INT16_TYPE ((const char *) NULL) +#endif + +#ifndef INT32_TYPE +#define INT32_TYPE ((const char *) NULL) +#endif + +#ifndef INT64_TYPE +#define INT64_TYPE ((const char *) NULL) +#endif + +#ifndef UINT8_TYPE +#define UINT8_TYPE ((const char *) NULL) +#endif + +#ifndef UINT16_TYPE +#define UINT16_TYPE ((const char *) NULL) +#endif + +#ifndef UINT32_TYPE +#define UINT32_TYPE ((const char *) NULL) +#endif + +#ifndef UINT64_TYPE +#define UINT64_TYPE ((const char *) NULL) +#endif + +#ifndef INT_LEAST8_TYPE +#define INT_LEAST8_TYPE ((const char *) NULL) +#endif + +#ifndef INT_LEAST16_TYPE +#define INT_LEAST16_TYPE ((const char *) NULL) +#endif + +#ifndef INT_LEAST32_TYPE +#define INT_LEAST32_TYPE ((const char *) NULL) +#endif + +#ifndef INT_LEAST64_TYPE +#define INT_LEAST64_TYPE ((const char *) NULL) +#endif + +#ifndef UINT_LEAST8_TYPE +#define UINT_LEAST8_TYPE ((const char *) NULL) +#endif + +#ifndef UINT_LEAST16_TYPE +#define UINT_LEAST16_TYPE ((const char *) NULL) +#endif + +#ifndef UINT_LEAST32_TYPE +#define UINT_LEAST32_TYPE ((const char *) NULL) +#endif + +#ifndef UINT_LEAST64_TYPE +#define UINT_LEAST64_TYPE ((const char *) NULL) +#endif + +#ifndef INT_FAST8_TYPE +#define INT_FAST8_TYPE ((const char *) NULL) +#endif + +#ifndef INT_FAST16_TYPE +#define INT_FAST16_TYPE ((const char *) NULL) +#endif + +#ifndef INT_FAST32_TYPE +#define INT_FAST32_TYPE ((const char *) NULL) +#endif + +#ifndef INT_FAST64_TYPE +#define INT_FAST64_TYPE ((const char *) NULL) +#endif + +#ifndef UINT_FAST8_TYPE +#define UINT_FAST8_TYPE ((const char *) NULL) +#endif + +#ifndef UINT_FAST16_TYPE +#define UINT_FAST16_TYPE ((const char *) NULL) +#endif + +#ifndef UINT_FAST32_TYPE +#define UINT_FAST32_TYPE ((const char *) NULL) +#endif + +#ifndef UINT_FAST64_TYPE +#define UINT_FAST64_TYPE ((const char *) NULL) +#endif + +#ifndef INTPTR_TYPE +#define INTPTR_TYPE ((const char *) NULL) +#endif + +#ifndef UINTPTR_TYPE +#define UINTPTR_TYPE ((const char *) NULL) +#endif + +/* Width in bits of a pointer. Mind the value of the macro `Pmode'. */ +#ifndef POINTER_SIZE +#define POINTER_SIZE BITS_PER_WORD +#endif +#ifndef POINTER_SIZE_UNITS +#define POINTER_SIZE_UNITS ((POINTER_SIZE + BITS_PER_UNIT - 1) / BITS_PER_UNIT) +#endif + + +#ifndef PIC_OFFSET_TABLE_REGNUM +#define PIC_OFFSET_TABLE_REGNUM INVALID_REGNUM +#endif + +#ifndef PIC_OFFSET_TABLE_REG_CALL_CLOBBERED +#define PIC_OFFSET_TABLE_REG_CALL_CLOBBERED 0 +#endif + +#ifndef TARGET_DLLIMPORT_DECL_ATTRIBUTES +#define TARGET_DLLIMPORT_DECL_ATTRIBUTES 0 +#endif + +#ifndef TARGET_DECLSPEC +#if TARGET_DLLIMPORT_DECL_ATTRIBUTES +/* If the target supports the "dllimport" attribute, users are + probably used to the "__declspec" syntax. */ +#define TARGET_DECLSPEC 1 +#else +#define TARGET_DECLSPEC 0 +#endif +#endif + +/* By default, the preprocessor should be invoked the same way in C++ + as in C. */ +#ifndef CPLUSPLUS_CPP_SPEC +#ifdef CPP_SPEC +#define CPLUSPLUS_CPP_SPEC CPP_SPEC +#endif +#endif + +#ifndef ACCUMULATE_OUTGOING_ARGS +#define ACCUMULATE_OUTGOING_ARGS 0 +#endif + +/* By default, use the GNU runtime for Objective C. */ +#ifndef NEXT_OBJC_RUNTIME +#define NEXT_OBJC_RUNTIME 0 +#endif + +/* Supply a default definition for PUSH_ARGS. */ +#ifndef PUSH_ARGS +#ifdef PUSH_ROUNDING +#define PUSH_ARGS !ACCUMULATE_OUTGOING_ARGS +#else +#define PUSH_ARGS 0 +#endif +#endif + +/* Decide whether a function's arguments should be processed + from first to last or from last to first. + + They should if the stack and args grow in opposite directions, but + only if we have push insns. */ + +#ifdef PUSH_ROUNDING + +#ifndef PUSH_ARGS_REVERSED +#if defined (STACK_GROWS_DOWNWARD) != defined (ARGS_GROW_DOWNWARD) +#define PUSH_ARGS_REVERSED PUSH_ARGS +#endif +#endif + +#endif + +#ifndef PUSH_ARGS_REVERSED +#define PUSH_ARGS_REVERSED 0 +#endif + +/* Default value for the alignment (in bits) a C conformant malloc has to + provide. This default is intended to be safe and always correct. */ +#ifndef MALLOC_ABI_ALIGNMENT +#define MALLOC_ABI_ALIGNMENT BITS_PER_WORD +#endif + +/* If PREFERRED_STACK_BOUNDARY is not defined, set it to STACK_BOUNDARY. + STACK_BOUNDARY is required. */ +#ifndef PREFERRED_STACK_BOUNDARY +#define PREFERRED_STACK_BOUNDARY STACK_BOUNDARY +#endif + +/* Set INCOMING_STACK_BOUNDARY to PREFERRED_STACK_BOUNDARY if it is not + defined. */ +#ifndef INCOMING_STACK_BOUNDARY +#define INCOMING_STACK_BOUNDARY PREFERRED_STACK_BOUNDARY +#endif + +#ifndef TARGET_DEFAULT_PACK_STRUCT +#define TARGET_DEFAULT_PACK_STRUCT 0 +#endif + +/* By default, the vtable entries are void pointers, the so the alignment + is the same as pointer alignment. The value of this macro specifies + the alignment of the vtable entry in bits. It should be defined only + when special alignment is necessary. */ +#ifndef TARGET_VTABLE_ENTRY_ALIGN +#define TARGET_VTABLE_ENTRY_ALIGN POINTER_SIZE +#endif + +/* There are a few non-descriptor entries in the vtable at offsets below + zero. If these entries must be padded (say, to preserve the alignment + specified by TARGET_VTABLE_ENTRY_ALIGN), set this to the number of + words in each data entry. */ +#ifndef TARGET_VTABLE_DATA_ENTRY_DISTANCE +#define TARGET_VTABLE_DATA_ENTRY_DISTANCE 1 +#endif + +/* Decide whether it is safe to use a local alias for a virtual function + when constructing thunks. */ +#ifndef TARGET_USE_LOCAL_THUNK_ALIAS_P +#ifdef ASM_OUTPUT_DEF +#define TARGET_USE_LOCAL_THUNK_ALIAS_P(DECL) 1 +#else +#define TARGET_USE_LOCAL_THUNK_ALIAS_P(DECL) 0 +#endif +#endif + +/* Select a format to encode pointers in exception handling data. We + prefer those that result in fewer dynamic relocations. Assume no + special support here and encode direct references. */ +#ifndef ASM_PREFERRED_EH_DATA_FORMAT +#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) DW_EH_PE_absptr +#endif + +/* By default, the C++ compiler will use the lowest bit of the pointer + to function to indicate a pointer-to-member-function points to a + virtual member function. However, if FUNCTION_BOUNDARY indicates + function addresses aren't always even, the lowest bit of the delta + field will be used. */ +#ifndef TARGET_PTRMEMFUNC_VBIT_LOCATION +#define TARGET_PTRMEMFUNC_VBIT_LOCATION \ + (FUNCTION_BOUNDARY >= 2 * BITS_PER_UNIT \ + ? ptrmemfunc_vbit_in_pfn : ptrmemfunc_vbit_in_delta) +#endif + +#ifndef DEFAULT_GDB_EXTENSIONS +#define DEFAULT_GDB_EXTENSIONS 1 +#endif + +#ifndef SDB_DEBUGGING_INFO +#define SDB_DEBUGGING_INFO 0 +#endif + +/* If more than one debugging type is supported, you must define + PREFERRED_DEBUGGING_TYPE to choose the default. */ + +#if 1 < (defined (DBX_DEBUGGING_INFO) + (SDB_DEBUGGING_INFO) \ + + defined (DWARF2_DEBUGGING_INFO) + defined (XCOFF_DEBUGGING_INFO) \ + + defined (VMS_DEBUGGING_INFO)) +#ifndef PREFERRED_DEBUGGING_TYPE +#error You must define PREFERRED_DEBUGGING_TYPE +#endif /* no PREFERRED_DEBUGGING_TYPE */ + +/* If only one debugging format is supported, define PREFERRED_DEBUGGING_TYPE + here so other code needn't care. */ +#elif defined DBX_DEBUGGING_INFO +#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG + +#elif SDB_DEBUGGING_INFO +#define PREFERRED_DEBUGGING_TYPE SDB_DEBUG + +#elif defined DWARF2_DEBUGGING_INFO || defined DWARF2_LINENO_DEBUGGING_INFO +#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG + +#elif defined VMS_DEBUGGING_INFO +#define PREFERRED_DEBUGGING_TYPE VMS_AND_DWARF2_DEBUG + +#elif defined XCOFF_DEBUGGING_INFO +#define PREFERRED_DEBUGGING_TYPE XCOFF_DEBUG + +#else +/* No debugging format is supported by this target. */ +#define PREFERRED_DEBUGGING_TYPE NO_DEBUG +#endif + +#ifndef FLOAT_LIB_COMPARE_RETURNS_BOOL +#define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) false +#endif + +/* True if the targets integer-comparison functions return { 0, 1, 2 + } to indicate { <, ==, > }. False if { -1, 0, 1 } is used + instead. The libgcc routines are biased. */ +#ifndef TARGET_LIB_INT_CMP_BIASED +#define TARGET_LIB_INT_CMP_BIASED (true) +#endif + +/* If FLOAT_WORDS_BIG_ENDIAN is not defined in the header files, + then the word-endianness is the same as for integers. */ +#ifndef FLOAT_WORDS_BIG_ENDIAN +#define FLOAT_WORDS_BIG_ENDIAN WORDS_BIG_ENDIAN +#endif + +#ifndef REG_WORDS_BIG_ENDIAN +#define REG_WORDS_BIG_ENDIAN WORDS_BIG_ENDIAN +#endif + + +#ifndef TARGET_DEC_EVAL_METHOD +#define TARGET_DEC_EVAL_METHOD 2 +#endif + +#ifndef HAS_LONG_COND_BRANCH +#define HAS_LONG_COND_BRANCH 0 +#endif + +#ifndef HAS_LONG_UNCOND_BRANCH +#define HAS_LONG_UNCOND_BRANCH 0 +#endif + +/* Determine whether __cxa_atexit, rather than atexit, is used to + register C++ destructors for local statics and global objects. */ +#ifndef DEFAULT_USE_CXA_ATEXIT +#define DEFAULT_USE_CXA_ATEXIT 0 +#endif + +#if GCC_VERSION >= 3000 && defined IN_GCC +/* These old constraint macros shouldn't appear anywhere in a + configuration using MD constraint definitions. */ +#endif + +/* Determin whether the target runtime library is Bionic */ +#ifndef TARGET_HAS_BIONIC +#define TARGET_HAS_BIONIC 0 +#endif + +/* Indicate that CLZ and CTZ are undefined at zero. */ +#ifndef CLZ_DEFINED_VALUE_AT_ZERO +#define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) 0 +#endif +#ifndef CTZ_DEFINED_VALUE_AT_ZERO +#define CTZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) 0 +#endif + +/* Provide a default value for STORE_FLAG_VALUE. */ +#ifndef STORE_FLAG_VALUE +#define STORE_FLAG_VALUE 1 +#endif + +/* This macro is used to determine what the largest unit size that + move_by_pieces can use is. */ + +/* MOVE_MAX_PIECES is the number of bytes at a time which we can + move efficiently, as opposed to MOVE_MAX which is the maximum + number of bytes we can move with a single instruction. */ + +#ifndef MOVE_MAX_PIECES +#define MOVE_MAX_PIECES MOVE_MAX +#endif + +/* STORE_MAX_PIECES is the number of bytes at a time that we can + store efficiently. Due to internal GCC limitations, this is + MOVE_MAX_PIECES limited by the number of bytes GCC can represent + for an immediate constant. */ + +#ifndef STORE_MAX_PIECES +#define STORE_MAX_PIECES MIN (MOVE_MAX_PIECES, 2 * sizeof (HOST_WIDE_INT)) +#endif + +/* Likewise for block comparisons. */ +#ifndef COMPARE_MAX_PIECES +#define COMPARE_MAX_PIECES MOVE_MAX_PIECES +#endif + +#ifndef MAX_MOVE_MAX +#define MAX_MOVE_MAX MOVE_MAX +#endif + +#ifndef MIN_UNITS_PER_WORD +#define MIN_UNITS_PER_WORD UNITS_PER_WORD +#endif + +#ifndef MAX_BITS_PER_WORD +#define MAX_BITS_PER_WORD BITS_PER_WORD +#endif + +#ifndef STACK_POINTER_OFFSET +#define STACK_POINTER_OFFSET 0 +#endif + +#ifndef LOCAL_REGNO +#define LOCAL_REGNO(REGNO) 0 +#endif + +#ifndef HONOR_REG_ALLOC_ORDER +#define HONOR_REG_ALLOC_ORDER 0 +#endif + +/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function, + the stack pointer does not matter. The value is tested only in + functions that have frame pointers. */ +#ifndef EXIT_IGNORE_STACK +#define EXIT_IGNORE_STACK 0 +#endif + +/* Assume that case vectors are not pc-relative. */ +#ifndef CASE_VECTOR_PC_RELATIVE +#define CASE_VECTOR_PC_RELATIVE 0 +#endif + +/* Force minimum alignment to be able to use the least significant bits + for distinguishing descriptor addresses from code addresses. */ +#define FUNCTION_ALIGNMENT(ALIGN) \ + (lang_hooks.custom_function_descriptors \ + && targetm.calls.custom_function_descriptors > 0 \ + ? MAX ((ALIGN), \ + 2 * targetm.calls.custom_function_descriptors * BITS_PER_UNIT)\ + : (ALIGN)) + +/* Assume that trampolines need function alignment. */ +#ifndef TRAMPOLINE_ALIGNMENT +#define TRAMPOLINE_ALIGNMENT FUNCTION_ALIGNMENT (FUNCTION_BOUNDARY) +#endif + +/* Register mappings for target machines without register windows. */ +#ifndef INCOMING_REGNO +#define INCOMING_REGNO(N) (N) +#endif + +#ifndef OUTGOING_REGNO +#define OUTGOING_REGNO(N) (N) +#endif + +#ifndef SHIFT_COUNT_TRUNCATED +#define SHIFT_COUNT_TRUNCATED 0 +#endif + +#ifndef LEGITIMATE_PIC_OPERAND_P +#define LEGITIMATE_PIC_OPERAND_P(X) 1 +#endif + +#ifndef TARGET_MEM_CONSTRAINT +#define TARGET_MEM_CONSTRAINT 'm' +#endif + +#ifndef REVERSIBLE_CC_MODE +#define REVERSIBLE_CC_MODE(MODE) 0 +#endif + +/* Biggest alignment supported by the object file format of this machine. */ +#ifndef MAX_OFILE_ALIGNMENT +#define MAX_OFILE_ALIGNMENT BIGGEST_ALIGNMENT +#endif + +#ifndef FRAME_GROWS_DOWNWARD +#define FRAME_GROWS_DOWNWARD 0 +#endif + +#ifndef RETURN_ADDR_IN_PREVIOUS_FRAME +#define RETURN_ADDR_IN_PREVIOUS_FRAME 0 +#endif + +/* On most machines, the CFA coincides with the first incoming parm. */ +#ifndef ARG_POINTER_CFA_OFFSET +#define ARG_POINTER_CFA_OFFSET(FNDECL) \ + (FIRST_PARM_OFFSET (FNDECL) + crtl->args.pretend_args_size) +#endif + +/* On most machines, we use the CFA as DW_AT_frame_base. */ +#ifndef CFA_FRAME_BASE_OFFSET +#define CFA_FRAME_BASE_OFFSET(FNDECL) 0 +#endif + +/* The offset from the incoming value of %sp to the top of the stack frame + for the current function. */ +#ifndef INCOMING_FRAME_SP_OFFSET +#define INCOMING_FRAME_SP_OFFSET 0 +#endif + +#ifndef HARD_REGNO_NREGS_HAS_PADDING +#define HARD_REGNO_NREGS_HAS_PADDING(REGNO, MODE) 0 +#define HARD_REGNO_NREGS_WITH_PADDING(REGNO, MODE) -1 +#endif + +#ifndef OUTGOING_REG_PARM_STACK_SPACE +#define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 0 +#endif + +/* MAX_STACK_ALIGNMENT is the maximum stack alignment guaranteed by + the backend. MAX_SUPPORTED_STACK_ALIGNMENT is the maximum best + effort stack alignment supported by the backend. If the backend + supports stack alignment, MAX_SUPPORTED_STACK_ALIGNMENT and + MAX_STACK_ALIGNMENT are the same. Otherwise, the incoming stack + boundary will limit the maximum guaranteed stack alignment. */ +#ifdef MAX_STACK_ALIGNMENT +#define MAX_SUPPORTED_STACK_ALIGNMENT MAX_STACK_ALIGNMENT +#else +#define MAX_STACK_ALIGNMENT STACK_BOUNDARY +#define MAX_SUPPORTED_STACK_ALIGNMENT PREFERRED_STACK_BOUNDARY +#endif + +#define SUPPORTS_STACK_ALIGNMENT (MAX_STACK_ALIGNMENT > STACK_BOUNDARY) + +#ifndef LOCAL_ALIGNMENT +#define LOCAL_ALIGNMENT(TYPE, ALIGNMENT) ALIGNMENT +#endif + +#ifndef STACK_SLOT_ALIGNMENT +#define STACK_SLOT_ALIGNMENT(TYPE,MODE,ALIGN) \ + ((TYPE) ? LOCAL_ALIGNMENT ((TYPE), (ALIGN)) : (ALIGN)) +#endif + +#ifndef LOCAL_DECL_ALIGNMENT +#define LOCAL_DECL_ALIGNMENT(DECL) \ + LOCAL_ALIGNMENT (TREE_TYPE (DECL), DECL_ALIGN (DECL)) +#endif + +#ifndef MINIMUM_ALIGNMENT +#define MINIMUM_ALIGNMENT(EXP,MODE,ALIGN) (ALIGN) +#endif + +/* Alignment value for attribute ((aligned)). */ +#ifndef ATTRIBUTE_ALIGNED_VALUE +#define ATTRIBUTE_ALIGNED_VALUE BIGGEST_ALIGNMENT +#endif + +#ifndef SLOW_UNALIGNED_ACCESS +#define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) STRICT_ALIGNMENT +#endif + +/* For most ports anything that evaluates to a constant symbolic + or integer value is acceptable as a constant address. */ +#ifndef CONSTANT_ADDRESS_P +#define CONSTANT_ADDRESS_P(X) (CONSTANT_P (X) && GET_CODE (X) != CONST_DOUBLE) +#endif + +#ifndef MAX_FIXED_MODE_SIZE +#define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (DImode) +#endif + +/* Nonzero if structures and unions should be returned in memory. + + This should only be defined if compatibility with another compiler or + with an ABI is needed, because it results in slower code. */ + +#ifndef DEFAULT_PCC_STRUCT_RETURN +#define DEFAULT_PCC_STRUCT_RETURN 1 +#endif + +#ifndef PCC_BITFIELD_TYPE_MATTERS +#define PCC_BITFIELD_TYPE_MATTERS false +#endif + +#ifndef INSN_SETS_ARE_DELAYED +#define INSN_SETS_ARE_DELAYED(INSN) false +#endif + +#ifndef INSN_REFERENCES_ARE_DELAYED +#define INSN_REFERENCES_ARE_DELAYED(INSN) false +#endif + +#ifndef NO_FUNCTION_CSE +#define NO_FUNCTION_CSE false +#endif + +#ifndef HARD_REGNO_RENAME_OK +#define HARD_REGNO_RENAME_OK(FROM, TO) true +#endif + +#ifndef EPILOGUE_USES +#define EPILOGUE_USES(REG) false +#endif + +#ifndef ARGS_GROW_DOWNWARD +#define ARGS_GROW_DOWNWARD 0 +#endif + +#ifndef STACK_GROWS_DOWNWARD +#define STACK_GROWS_DOWNWARD 0 +#endif + +#ifndef STACK_PUSH_CODE +#if STACK_GROWS_DOWNWARD +#define STACK_PUSH_CODE PRE_DEC +#else +#define STACK_PUSH_CODE PRE_INC +#endif +#endif + +/* Default value for flag_pie when flag_pie is initialized to -1: + --enable-default-pie: Default flag_pie to -fPIE. + --disable-default-pie: Default flag_pie to 0. + */ +#ifdef ENABLE_DEFAULT_PIE +# ifndef DEFAULT_FLAG_PIE +# define DEFAULT_FLAG_PIE 2 +# endif +#else +# define DEFAULT_FLAG_PIE 0 +#endif + +#ifndef SWITCHABLE_TARGET +#define SWITCHABLE_TARGET 0 +#endif + +/* If the target supports integers that are wider than two + HOST_WIDE_INTs on the host compiler, then the target should define + TARGET_SUPPORTS_WIDE_INT and make the appropriate fixups. + Otherwise the compiler really is not robust. */ +#ifndef TARGET_SUPPORTS_WIDE_INT +#define TARGET_SUPPORTS_WIDE_INT 0 +#endif + +#ifndef SHORT_IMMEDIATES_SIGN_EXTEND +#define SHORT_IMMEDIATES_SIGN_EXTEND 0 +#endif + +#ifndef WORD_REGISTER_OPERATIONS +#define WORD_REGISTER_OPERATIONS 0 +#endif + +#ifndef LOAD_EXTEND_OP +#define LOAD_EXTEND_OP(M) UNKNOWN +#endif + +#ifndef CONSTANT_ALIGNMENT +#define CONSTANT_ALIGNMENT(EXP, ALIGN) ALIGN +#endif + +#ifndef INITIAL_FRAME_ADDRESS_RTX +#define INITIAL_FRAME_ADDRESS_RTX NULL +#endif + +#ifndef SETUP_FRAME_ADDRESSES +#define SETUP_FRAME_ADDRESSES() do { } while (0) +#endif + +#ifndef DYNAMIC_CHAIN_ADDRESS +#define DYNAMIC_CHAIN_ADDRESS(x) (x) +#endif + +#ifndef FRAME_ADDR_RTX +#define FRAME_ADDR_RTX(x) (x) +#endif + +#ifndef REVERSE_CONDITION +#define REVERSE_CONDITION(code, mode) reverse_condition (code) +#endif + +#ifndef TARGET_PECOFF +#define TARGET_PECOFF 0 +#endif + +#ifndef EH_RETURN_HANDLER_RTX +#define EH_RETURN_HANDLER_RTX NULL +#endif + +#ifdef GCC_INSN_FLAGS_H +/* Dependent default target macro definitions + + This section of defaults.h defines target macros that depend on generated + headers. This is a bit awkward: We want to put all default definitions + for target macros in defaults.h, but some of the defaults depend on the + HAVE_* flags defines of insn-flags.h. But insn-flags.h is not always + included by files that do include defaults.h. + + Fortunately, the default macro definitions that depend on the HAVE_* + macros are also the ones that will only be used inside GCC itself, i.e. + not in the gen* programs or in target objects like libgcc. + + Obviously, it would be best to keep this section of defaults.h as small + as possible, by converting the macros defined below to target hooks or + functions. +*/ + +/* The default branch cost is 1. */ +#ifndef BRANCH_COST +#define BRANCH_COST(speed_p, predictable_p) 1 +#endif + +/* If a memory-to-memory move would take MOVE_RATIO or more simple + move-instruction sequences, we will do a movmem or libcall instead. */ + +#ifndef MOVE_RATIO +#if defined (HAVE_movmemqi) || defined (HAVE_movmemhi) || defined (HAVE_movmemsi) || defined (HAVE_movmemdi) || defined (HAVE_movmemti) +#define MOVE_RATIO(speed) 2 +#else +/* If we are optimizing for space (-Os), cut down the default move ratio. */ +#define MOVE_RATIO(speed) ((speed) ? 15 : 3) +#endif +#endif + +/* If a clear memory operation would take CLEAR_RATIO or more simple + move-instruction sequences, we will do a setmem or libcall instead. */ + +#ifndef CLEAR_RATIO +#if defined (HAVE_setmemqi) || defined (HAVE_setmemhi) || defined (HAVE_setmemsi) || defined (HAVE_setmemdi) || defined (HAVE_setmemti) +#define CLEAR_RATIO(speed) 2 +#else +/* If we are optimizing for space, cut down the default clear ratio. */ +#define CLEAR_RATIO(speed) ((speed) ? 15 :3) +#endif +#endif + +/* If a memory set (to value other than zero) operation would take + SET_RATIO or more simple move-instruction sequences, we will do a movmem + or libcall instead. */ +#ifndef SET_RATIO +#define SET_RATIO(speed) MOVE_RATIO (speed) +#endif + +/* Supply a default definition for FUNCTION_ARG_PADDING: + usually pad upward, but pad short args downward on + big-endian machines. */ + +#define DEFAULT_FUNCTION_ARG_PADDING(MODE, TYPE) \ + (! BYTES_BIG_ENDIAN \ + ? upward \ + : (((MODE) == BLKmode \ + ? ((TYPE) && TREE_CODE (TYPE_SIZE (TYPE)) == INTEGER_CST \ + && int_size_in_bytes (TYPE) < (PARM_BOUNDARY / BITS_PER_UNIT)) \ + : GET_MODE_BITSIZE (MODE) < PARM_BOUNDARY) \ + ? downward : upward)) + +#ifndef FUNCTION_ARG_PADDING +#define FUNCTION_ARG_PADDING(MODE, TYPE) \ + DEFAULT_FUNCTION_ARG_PADDING ((MODE), (TYPE)) +#endif + +/* Supply a default definition of STACK_SAVEAREA_MODE for emit_stack_save. + Normally move_insn, so Pmode stack pointer. */ + +#ifndef STACK_SAVEAREA_MODE +#define STACK_SAVEAREA_MODE(LEVEL) Pmode +#endif + +/* Supply a default definition of STACK_SIZE_MODE for + allocate_dynamic_stack_space. Normally PLUS/MINUS, so word_mode. */ + +#ifndef STACK_SIZE_MODE +#define STACK_SIZE_MODE word_mode +#endif + +/* Default value for flag_stack_protect when flag_stack_protect is initialized to -1: + --enable-default-ssp: Default flag_stack_protect to -fstack-protector-strong. + --disable-default-ssp: Default flag_stack_protect to 0. + */ +#ifdef ENABLE_DEFAULT_SSP +# ifndef DEFAULT_FLAG_SSP +# define DEFAULT_FLAG_SSP 3 +# endif +#else +# define DEFAULT_FLAG_SSP 0 +#endif + +/* Provide default values for the macros controlling stack checking. */ + +/* The default is neither full builtin stack checking... */ +#ifndef STACK_CHECK_BUILTIN +#define STACK_CHECK_BUILTIN 0 +#endif + +/* ...nor static builtin stack checking. */ +#ifndef STACK_CHECK_STATIC_BUILTIN +#define STACK_CHECK_STATIC_BUILTIN 0 +#endif + +/* The default interval is one page (4096 bytes). */ +#ifndef STACK_CHECK_PROBE_INTERVAL_EXP +#define STACK_CHECK_PROBE_INTERVAL_EXP 12 +#endif + +/* The default is not to move the stack pointer. */ +#ifndef STACK_CHECK_MOVING_SP +#define STACK_CHECK_MOVING_SP 0 +#endif + +/* This is a kludge to try to capture the discrepancy between the old + mechanism (generic stack checking) and the new mechanism (static + builtin stack checking). STACK_CHECK_PROTECT needs to be bumped + for the latter because part of the protection area is effectively + included in STACK_CHECK_MAX_FRAME_SIZE for the former. */ +#ifdef STACK_CHECK_PROTECT +#define STACK_OLD_CHECK_PROTECT STACK_CHECK_PROTECT +#else +#define STACK_OLD_CHECK_PROTECT \ + (!global_options.x_flag_exceptions \ + ? 75 * UNITS_PER_WORD \ + : targetm_common.except_unwind_info (&global_options) == UI_SJLJ \ + ? 4 * 1024 \ + : 8 * 1024) +#endif + +/* Minimum amount of stack required to recover from an anticipated stack + overflow detection. The default value conveys an estimate of the amount + of stack required to propagate an exception. */ +#ifndef STACK_CHECK_PROTECT +#define STACK_CHECK_PROTECT \ + (!global_options.x_flag_exceptions \ + ? 4 * 1024 \ + : targetm_common.except_unwind_info (&global_options) == UI_SJLJ \ + ? 8 * 1024 \ + : 12 * 1024) +#endif + +/* Make the maximum frame size be the largest we can and still only need + one probe per function. */ +#ifndef STACK_CHECK_MAX_FRAME_SIZE +#define STACK_CHECK_MAX_FRAME_SIZE \ + ((1 << STACK_CHECK_PROBE_INTERVAL_EXP) - UNITS_PER_WORD) +#endif + +/* This is arbitrary, but should be large enough everywhere. */ +#ifndef STACK_CHECK_FIXED_FRAME_SIZE +#define STACK_CHECK_FIXED_FRAME_SIZE (4 * UNITS_PER_WORD) +#endif + +/* Provide a reasonable default for the maximum size of an object to + allocate in the fixed frame. We may need to be able to make this + controllable by the user at some point. */ +#ifndef STACK_CHECK_MAX_VAR_SIZE +#define STACK_CHECK_MAX_VAR_SIZE (STACK_CHECK_MAX_FRAME_SIZE / 100) +#endif + +/* By default, the C++ compiler will use function addresses in the + vtable entries. Setting this nonzero tells the compiler to use + function descriptors instead. The value of this macro says how + many words wide the descriptor is (normally 2). It is assumed + that the address of a function descriptor may be treated as a + pointer to a function. */ +#ifndef TARGET_VTABLE_USES_DESCRIPTORS +#define TARGET_VTABLE_USES_DESCRIPTORS 0 +#endif + +#endif /* GCC_INSN_FLAGS_H */ + +#ifndef DWARF_GNAT_ENCODINGS_DEFAULT +#define DWARF_GNAT_ENCODINGS_DEFAULT DWARF_GNAT_ENCODINGS_GDB +#endif + +#endif /* ! GCC_DEFAULTS_H */ diff --git a/gcc/ginclude/stdarg.h b/gcc/ginclude/stdarg.h index e4c73fd23..cc7324854 100644 --- a/gcc/ginclude/stdarg.h +++ b/gcc/ginclude/stdarg.h @@ -94,7 +94,7 @@ typedef __gnuc_va_list va_list; #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. */ +/* The macro __va_list__ is used by BeOS and Haiku. */ #ifndef __va_list__ typedef __gnuc_va_list va_list; #endif /* not __va_list__ */ diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h index 31b96a7e5..ca20f4d10 100644 --- a/gcc/ginclude/stddef.h +++ b/gcc/ginclude/stddef.h @@ -167,7 +167,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; /* 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__ /* BeOS, Haiku */ #ifndef __SIZE_T__ /* Cray Unicos/Mk */ #ifndef _SIZE_T /* in case has defined it. */ #ifndef _SYS_SIZE_T_H @@ -184,7 +184,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; #ifndef _GCC_SIZE_T #ifndef _SIZET_ #ifndef __size_t -#define __size_t__ /* BeOS */ +#define __size_t__ /* BeOS, Haiku */ #define __SIZE_T__ /* Cray Unicos/Mk */ #define _SIZE_T #define _SYS_SIZE_T_H @@ -214,7 +214,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; #endif #if !(defined (__GNUG__) && defined (size_t)) typedef __SIZE_TYPE__ size_t; -#ifdef __BEOS__ +#if defined(__BEOS__) typedef long ssize_t; #endif /* __BEOS__ */ #endif /* !(defined (__GNUG__) && defined (size_t)) */ @@ -247,7 +247,7 @@ typedef long ssize_t; /* 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__ /* BeOS, Haiku */ #ifndef __WCHAR_T__ /* Cray Unicos/Mk */ #ifndef _WCHAR_T #ifndef _T_WCHAR_ @@ -264,7 +264,7 @@ typedef long ssize_t; #ifndef ___int_wchar_t_h #ifndef __INT_WCHAR_T_H #ifndef _GCC_WCHAR_T -#define __wchar_t__ /* BeOS */ +#define __wchar_t__ /* BeOS, Haiku */ #define __WCHAR_T__ /* Cray Unicos/Mk */ #define _WCHAR_T #define _T_WCHAR_ diff --git a/include/filenames.h b/include/filenames.h index 6164048c2..492b0c91c 100644 --- a/include/filenames.h +++ b/include/filenames.h @@ -44,9 +44,11 @@ extern "C" { # 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 --git a/libgcc/Makefile.in b/libgcc/Makefile.in index dd8cee99f..23850c896 100644 --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in @@ -397,10 +397,16 @@ ifeq ($(enable_shared),yes) 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 --git a/libgcc/config.host b/libgcc/config.host index 11b4acaff..335bb9f89 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -235,6 +235,14 @@ case ${host} in tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-fuchsia" extra_parts="crtbegin.o crtend.o" ;; +*-*-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 | *-*-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" @@ -421,6 +429,12 @@ arm*-*-fuchsia*) 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 t-crtfm" tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc" @@ -631,6 +645,12 @@ x86_64-*-freebsd*) tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff" md_unwind_header=i386/freebsd-unwind.h ;; +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*) tmake_file="${tmake_file} i386/t-crtstuff" ;; @@ -839,6 +859,8 @@ m32r-*-linux*) m32rle-*-linux*) tmake_file="$tmake_file m32r/t-linux t-fdpbit" ;; +m68k-*-haiku*) + ;; m68k-*-elf* | fido-*-elf) tmake_file="$tmake_file m68k/t-floatlib" ;; @@ -909,6 +931,8 @@ mips*-sde-elf*) esac extra_parts="$extra_parts crti.o crtn.o" ;; +mipsel-*-haiku*) + ;; mipsisa32-*-elf* | mipsisa32el-*-elf* | \ mipsisa32r2-*-elf* | mipsisa32r2el-*-elf* | \ mipsisa32r6-*-elf* | mipsisa32r6el-*-elf* | \ @@ -1035,6 +1059,8 @@ powerpc*-*-freebsd*) ;; esac ;; +powerpc-*-haiku*) + ;; powerpc-*-netbsd*) tmake_file="$tmake_file rs6000/t-netbsd rs6000/t-crtstuff" ;; @@ -1390,10 +1416,18 @@ i[34567]86-*-linux* | x86_64-*-linux* | \ esac case ${host} in -i[34567]86-*-elfiamcu | i[34567]86-*-rtems*) - # These use soft-fp for SFmode and DFmode, not just TFmode. - ;; -i[34567]86-*-* | x86_64-*-*) +i[34567]86-*-darwin* | x86_64-*-darwin* | \ + i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu | \ + i[34567]86-*-linux* | x86_64-*-linux* | \ + i[34567]86-*-msdosdjgpp* | \ + i[34567]86-*-gnu* | \ + i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]* | \ + i[34567]86-*-cygwin* | x86_64-*-cygwin* | \ + i[34567]86-*-mingw* | x86_64-*-mingw* | \ + i[34567]86-*-dragonfly* | x86_64-*-dragonfly* | \ + i[34567]86-*-freebsd* | x86_64-*-freebsd* | \ + i[34567]86-*-openbsd* | x86_64-*-openbsd* | \ + i[34567]86-*-haiku* | x86_64-*-haiku*) tmake_file="${tmake_file} t-softfp-tf" if test "${host_address}" = 32; then tmake_file="${tmake_file} i386/${host_address}/t-softfp" diff --git a/libgcc/config/t-haiku b/libgcc/config/t-haiku new file mode 100644 index 000000000..b4fff2d8f --- /dev/null +++ b/libgcc/config/t-haiku @@ -0,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 --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c index 5e894455e..41b858358 100644 --- a/libgcc/crtstuff.c +++ b/libgcc/crtstuff.c @@ -108,7 +108,9 @@ call_ ## FUNC (void) \ && 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__) \ diff --git a/libgomp/configure b/libgomp/configure index ced7606b3..42166ea4f 100755 --- a/libgomp/configure +++ b/libgomp/configure @@ -8228,7 +8228,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } esac ;; - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + beos* | haiku* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; @@ -8918,8 +8918,8 @@ _LT_EOF ;; haiku*) - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - link_all_deplibs=yes + allow_undefined_flag=unsupported + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ;; interix[3-9]*) @@ -10353,16 +10353,9 @@ gnu*) ;; 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' + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" 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*) @@ -14001,7 +13994,7 @@ haiku*) 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' + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; diff --git a/libquadmath/configure b/libquadmath/configure index 14610d662..02b0b0f40 100755 --- a/libquadmath/configure +++ b/libquadmath/configure @@ -9761,7 +9761,7 @@ haiku*) 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' + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; diff --git a/libssp/configure b/libssp/configure index 4e88e4916..ce64a7187 100755 --- a/libssp/configure +++ b/libssp/configure @@ -7803,7 +7803,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } esac ;; - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + beos* | haiku* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; @@ -8493,8 +8493,8 @@ _LT_EOF ;; haiku*) - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - link_all_deplibs=yes + allow_undefined_flag=unsupported + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ;; interix[3-9]*) @@ -9937,16 +9937,9 @@ gnu*) ;; 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' + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" 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*) diff --git a/libstdc++-v3/config/os/haiku/ctype_base.h b/libstdc++-v3/config/os/haiku/ctype_base.h new file mode 100644 index 000000000..86e15cb47 --- /dev/null +++ b/libstdc++-v3/config/os/haiku/ctype_base.h @@ -0,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 --git a/libstdc++-v3/config/os/haiku/ctype_configure_char.cc b/libstdc++-v3/config/os/haiku/ctype_configure_char.cc new file mode 100644 index 000000000..35e6b80f0 --- /dev/null +++ b/libstdc++-v3/config/os/haiku/ctype_configure_char.cc @@ -0,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 --git a/libstdc++-v3/config/os/haiku/ctype_inline.h b/libstdc++-v3/config/os/haiku/ctype_inline.h new file mode 100644 index 000000000..041913962 --- /dev/null +++ b/libstdc++-v3/config/os/haiku/ctype_inline.h @@ -0,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 --git a/libstdc++-v3/config/os/haiku/error_constants.h b/libstdc++-v3/config/os/haiku/error_constants.h new file mode 100644 index 000000000..fa6d88919 --- /dev/null +++ b/libstdc++-v3/config/os/haiku/error_constants.h @@ -0,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 --git a/libstdc++-v3/config/os/haiku/os_defines.h b/libstdc++-v3/config/os/haiku/os_defines.h new file mode 100644 index 000000000..4674f7b66 --- /dev/null +++ b/libstdc++-v3/config/os/haiku/os_defines.h @@ -0,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 --git a/libstdc++-v3/configure b/libstdc++-v3/configure index ba094be6f..8c884ffcf 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -8670,8 +8670,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } haiku*) # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static= ;; hpux*) @@ -10792,8 +10790,9 @@ haiku*) 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 + 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*) @@ -11313,7 +11312,7 @@ else lt_cv_dlopen_libs= case $host_os in - beos*) + beos* | haiku* ) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes @@ -13532,7 +13531,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } ;; esac ;; - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; @@ -13554,8 +13552,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } ;; 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. @@ -14476,8 +14472,9 @@ haiku*) 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 + 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*) @@ -15102,6 +15099,92 @@ _ACEOF # Enable compiler support that doesn't require linking. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for exception model to use" >&5 +$as_echo_n "checking for exception model to use... " >&6; } + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + # Check whether --enable-sjlj-exceptions was given. +if test "${enable_sjlj_exceptions+set}" = set; then : + enableval=$enable_sjlj_exceptions; + case "$enableval" in + yes|no|auto) ;; + *) as_fn_error "Unknown argument to enable/disable sjlj-exceptions" "$LINENO" 5 ;; + esac + +else + enable_sjlj_exceptions=auto +fi + + + + if test $enable_sjlj_exceptions = auto; then + # Botheration. Now we've got to detect the exception model. Link tests + # against libgcc.a are problematic since we've not been given proper -L + # bits for single-tree newlib and libgloss. + # + # Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style. + cat > conftest.$ac_ext << EOF +#line 15124 "configure" +struct S { ~S(); }; +void bar(); +void foo() +{ + S s; + bar(); +} +EOF + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS=-S + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then + enable_sjlj_exceptions=yes + elif grep _Unwind_SjLj_Register conftest.s >/dev/null 2>&1 ; then + enable_sjlj_exceptions=yes + elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then + enable_sjlj_exceptions=no + elif grep __cxa_end_cleanup conftest.s >/dev/null 2>&1 ; then + enable_sjlj_exceptions=no + fi + fi + CXXFLAGS="$old_CXXFLAGS" + rm -f conftest* + fi + + # This is a tad weird, for hysterical raisins. We have to map + # enable/disable to two different models. + case $enable_sjlj_exceptions in + yes) + +$as_echo "#define _GLIBCXX_SJLJ_EXCEPTIONS 1" >>confdefs.h + + ac_exception_model_name=sjlj + ;; + no) + ac_exception_model_name="call frame" + ;; + *) + as_fn_error "unable to detect exception model" "$LINENO" 5 + ;; + esac + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_exception_model_name" >&5 +$as_echo "$ac_exception_model_name" >&6; } + + # Check whether --enable-libstdcxx-pch was given. if test "${enable_libstdcxx_pch+set}" = set; then : enableval=$enable_libstdcxx_pch; @@ -53369,6 +53452,89 @@ done ;; + *-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 --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host index caea9de9c..00b70daf2 100644 --- a/libstdc++-v3/configure.host +++ b/libstdc++-v3/configure.host @@ -270,6 +270,9 @@ case "${host_os}" in os_include_dir="os/gnu-linux" fi ;; + haiku*) + os_include_dir="os/haiku" + ;; hpux*) os_include_dir="os/hpux" ;; diff --git a/libstdc++-v3/crossconfig.m4 b/libstdc++-v3/crossconfig.m4 index fa56795b2..78d940168 100644 --- a/libstdc++-v3/crossconfig.m4 +++ b/libstdc++-v3/crossconfig.m4 @@ -141,6 +141,45 @@ case "${host}" in AC_SUBST(SECTION_FLAGS) ;; + *-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 --git a/libstdc++-v3/libsupc++/tinfo.cc b/libstdc++-v3/libsupc++/tinfo.cc index 16097def7..72447b12e 100644 --- a/libstdc++-v3/libsupc++/tinfo.cc +++ b/libstdc++-v3/libsupc++/tinfo.cc @@ -30,6 +30,15 @@ std::type_info:: ~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 --git a/libtool.m4 b/libtool.m4 index 24d13f344..94d96d9ea 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -1137,7 +1137,7 @@ fi # Invoke $ECHO with all args, space-separated. func_echo_all () { - $ECHO "$*" + $ECHO "$*" } case "$ECHO" in @@ -1722,7 +1722,7 @@ else lt_cv_dlopen_libs= case $host_os in - beos*) + beos* | haiku* ) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes @@ -2342,8 +2342,9 @@ haiku*) 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 + 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*) @@ -3603,7 +3604,6 @@ m4_if([$1], [CXX], [ ;; esac ;; - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; @@ -3626,8 +3626,6 @@ m4_if([$1], [CXX], [ ;; 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. @@ -3937,8 +3935,6 @@ m4_if([$1], [CXX], [ haiku*) # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) diff --git a/lto-plugin/configure b/lto-plugin/configure index 7843cd7f6..c68f32388 100755 --- a/lto-plugin/configure +++ b/lto-plugin/configure @@ -10673,7 +10673,7 @@ haiku*) 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' + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; diff --git a/zlib/configure b/zlib/configure index ee5527c4a..6d5e1caac 100755 --- a/zlib/configure +++ b/zlib/configure @@ -9592,7 +9592,7 @@ haiku*) 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' + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; -- 2.17.0