From cb83cf1ca3f762d9c5a0f89b0b9e99111bf2c51c Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Fri, 18 Jul 2014 11:59:51 +0200 Subject: [PATCH] Adjust configuration for gcc/libgcc. * Gcc will now build libgcc.a, libgcc_eh.a and libgcc_s.so. * Activate thread support for libgcc. * Let libgcc use ELF dwarf2 unwinding on Haiku. * Activate ELF symbol versioning on Haiku. * Activate use of __cxa_atexit * Drop fragments of Haiku support for mipsel --- gcc/gcc/config.gcc | 25 +++++++++++++++++++++---- gcc/libgcc/config.host | 18 +++++++++++++++--- gcc/libgcc/config/t-haiku | 3 +++ 3 files changed, 31 insertions(+), 15 deletions(-) diff --git a/gcc/gcc/config.gcc b/gcc/gcc/config.gcc index 55e8bf9..8002129 100644 --- a/gcc/gcc/config.gcc +++ b/gcc/gcc/config.gcc @@ -625,6 +625,19 @@ # need_64bit_hwint=yes # system compiler has this for all arch! use_gcc_stdint=wrap ;; +*-*-haiku*) + # This is the generic ELF configuration of Haiku. Later + # machine-specific sections may refine and add to this + # configuration. + # + gas=yes + gnu_ld=yes + tmake_file="t-slibgcc" + case ${enable_threads} in + "" | yes | posix) thread_file='posix' ;; + esac + default_use_cxa_atexit=yes + ;; *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) extra_options="$extra_options gnu-user.opt" gas=yes @@ -1239,11 +1252,11 @@ 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='t-haiku i386/t-crtpic' + 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='t-haiku i386/t-haiku64' + 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*) @@ -1749,7 +1762,7 @@ m68k-*-haiku*) default_m68k_cpu=68020 default_cf_cpu=5206 - tmake_file="m68k/t-m68kbare m68k/t-crtstuff t-haiku" #?? + 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" ;; @@ -1953,10 +1966,6 @@ mips-*-elf* | mipsel-*-elf*) tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h" tmake_file="mips/t-elf" - ;; -mipsel-*-haiku*) - tmake_file='mips/t-elf t-haiku' - tm_file="elfos.h ${tm_file} haiku.h mips/haiku.h" ;; mips64-*-elf* | mips64el-*-elf*) tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h" @@ -2100,7 +2109,7 @@ use_gcc_stdint=wrap ;; powerpc-*-haiku*) - tmake_file="rs6000/t-fprules rs6000/t-ppcos rs6000/t-ppccomm t-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" ;; diff --git a/gcc/libgcc/config.host b/gcc/libgcc/config.host index 1596263..d394074 100644 --- a/gcc/libgcc/config.host +++ b/gcc/libgcc/config.host @@ -195,6 +195,14 @@ ;; esac ;; +*-*-haiku*) + # This is the generic ELF configuration of Haiku. Later + # machine-specific sections may refine and add to this + # configuration. + tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-haiku t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver" + tmake_file="$tmake_file t-slibgcc-nolc-override" + extra_parts="crtbegin.o crtend.o" + ;; *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux" extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" @@ -324,7 +332,7 @@ ;; 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" + 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 extra_parts="crtbegin.o crtend.o" @@ -515,11 +523,10 @@ tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff" ;; i[34567]86-*-haiku*) - tmake_file="${tmake_file} i386/t-crtstuff t-libgcc-pic" - extra_parts="crtbegin.o crtend.o" + tmake_file="${tmake_file} i386/t-crtstuff i386/t-eh-dw2" ;; x86_64-*-haiku*) - tmake_file="${tmake_file} i386/t-crtstuff t-libgcc-pic" + tmake_file="${tmake_file} i386/t-crtstuff i386/t-eh-dw2" extra_parts="crtbegin.o crtend.o" ;; i[34567]86-*-netbsdelf*) @@ -749,9 +756,6 @@ if test "${ac_cv_sizeof_long_double}" = 16; then tmake_file="${tmake_file} mips/t-tpbit" fi - ;; -mips*-*-haiku*) - extra_parts="crtbegin.o crtend.o" ;; mips*-sde-elf*) tmake_file="$tmake_file mips/t-crtstuff mips/t-mips16" diff --git a/gcc/libgcc/config/t-haiku b/gcc/libgcc/config/t-haiku new file mode 100644 index 0000000..b4fff2d 100644 --- /dev/null +++ b/gcc/libgcc/config/t-haiku @@ -1,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 -- gitore 0.2.2