--- libgcc/config.host.orig 2016-10-24 12:26:59 UTC +++ libgcc/config.host @@ -195,7 +195,19 @@ case ${host} in ;; esac ;; -*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) +*-*-bsdsunix*) + # This is the generic ELF configuration of FreeBSD. Later + # machine-specific sections may refine and add to this + # configuration. + tmake_file="$tmake_file t-bsdsux t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver" + extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o" + case ${target_thread_file} in + posix) + tmake_file="${tmake_file} t-bsdsux-thread" + ;; + esac + ;; +*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-kbsdsunix*-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" ;; @@ -268,7 +280,7 @@ case ${host} in esac case ${host} in -*-*-darwin* | *-*-freebsd* | *-*-netbsd* | *-*-openbsd* | *-*-solaris2*) +*-*-darwin* | *-*-freebsd* | *-*-bsdsunix* | *-*-netbsd* | *-*-openbsd* | *-*-solaris2*) enable_execute_stack=enable-execute-stack-mprotect.c ;; i[34567]86-*-mingw* | x86_64-*-mingw*) @@ -295,6 +307,10 @@ alpha*-*-linux*) extra_parts="$extra_parts crtfastmath.o" md_unwind_header=alpha/linux-unwind.h ;; +alpha*-*-bsdsunix*) + tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee t-crtfm" + extra_parts="$extra_parts crtbeginT.o crtfastmath.o" + ;; alpha*-*-freebsd*) tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee t-crtfm" extra_parts="$extra_parts crtbeginT.o crtfastmath.o" @@ -326,6 +342,13 @@ arm*-*-freebsd*) # ARM Fr unwind_header=config/arm/unwind-arm.h tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp" ;; +arm*-*-bsdsunix*) # ARM BSDSUniX EABI + tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix arm/t-elf" + tmake_file="${tmake_file} arm/t-bpabi arm/t-bsdsux t-slibgcc-libgcc" + tm_file="${tm_file} arm/bpabi-lib.h" + unwind_header=config/arm/unwind-arm.h + tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp" + ;; arm*-*-netbsdelf*) tmake_file="$tmake_file arm/t-arm arm/t-netbsd t-slibgcc-gld-nover" ;; @@ -514,6 +537,12 @@ i[34567]86-*-freebsd*) x86_64-*-freebsd*) tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff" ;; +i[34567]86-*-bsdsunix*) + tmake_file="${tmake_file} i386/t-bsdsux i386/t-bsdsunix i386/t-crtstuff" + ;; +x86_64-*-bsdsunix*) + tmake_file="${tmake_file} i386/t-bsdsux i386/t-bsdsunix i386/t-crtstuff" + ;; i[34567]86-*-netbsdelf*) ;; x86_64-*-netbsd*) @@ -530,7 +559,7 @@ i[34567]86-*-linux*) tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules" md_unwind_header=i386/linux-unwind.h ;; -i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu) +i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-kbsdsunix*-gnu | i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu) extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o" tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules" ;; @@ -539,7 +568,7 @@ x86_64-*-linux*) tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules" md_unwind_header=i386/linux-unwind.h ;; -x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu) +x86_64-*-kfreebsd*-gnu | x86_64-*-kbsdsunix*-gnu | x86_64-*-knetbsd*-gnu) extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o" tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules" ;; @@ -638,6 +667,10 @@ ia64*-*-freebsd*) extra_parts="$extra_parts crtfastmath.o" tmake_file="$tmake_file ia64/t-ia64 ia64/t-ia64-elf ia64/t-eh-ia64 t-crtfm" ;; +ia64*-*-bsdsunix*) + extra_parts="$extra_parts crtfastmath.o" + tmake_file="$tmake_file ia64/t-ia64 ia64/t-ia64-elf ia64/t-eh-ia64 t-crtfm" + ;; ia64*-*-linux*) # Don't use crtbeginT.o from *-*-linux* default. extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o" @@ -841,6 +874,16 @@ powerpc*-*-freebsd*) ;; esac ;; +powerpc*-*-bsdsunix*) + tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-savresfgpr rs6000/t-crtstuff rs6000/t-bsdsux t-softfp-sfdf t-softfp-excl t-softfp" + extra_parts="$extra_parts crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o" + case ${host} in + powerpc64*) + tmake_file="${tmake_file} rs6000/t-bsdsux64" + md_unwind_header=rs6000/bsdsux-unwind.h + ;; + esac + ;; powerpc-*-netbsd*) tmake_file="$tmake_file rs6000/t-netbsd rs6000/t-crtstuff" ;; @@ -1049,6 +1092,10 @@ sparc64-*-freebsd*|ultrasparc-*-freebsd* tmake_file="$tmake_file t-crtfm" extra_parts="$extra_parts crtfastmath.o" ;; +sparc64-*-bsdsunix*|ultrasparc-*-bsdsunix*) + tmake_file="$tmake_file t-crtfm" + extra_parts="$extra_parts crtfastmath.o" + ;; sparc64-*-linux*) # 64-bit SPARC's running GNU/Linux extra_parts="$extra_parts crtfastmath.o" tmake_file="${tmake_file} t-crtfm sparc/t-linux" @@ -1139,6 +1186,7 @@ esac case ${host} in i[34567]86-*-linux* | x86_64-*-linux* | \ i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu | \ + i[34567]86-*-kbsdsunix*-gnu | x86_64-*-kbsdsunix*-gnu | \ i[34567]86-*-knetbsd*-gnu | \ i[34567]86-*-gnu*) tmake_file="${tmake_file} t-tls i386/t-linux" @@ -1151,11 +1199,13 @@ esac case ${host} in i[34567]86-*-darwin* | x86_64-*-darwin* | \ i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu | \ + i[34567]86-*-kbsdsunix*-gnu | x86_64-*-kbsdsunix*-gnu | \ i[34567]86-*-linux* | x86_64-*-linux* | \ i[34567]86-*-gnu* | \ i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]* | \ i[34567]86-*-cygwin* | i[34567]86-*-mingw* | x86_64-*-mingw* | \ i[34567]86-*-freebsd* | x86_64-*-freebsd* | \ + i[34567]86-*-bsdsunix* | x86_64-*-bsdsunix* | \ i[34567]86-*-openbsd* | x86_64-*-openbsd*) tmake_file="${tmake_file} t-softfp-tf" if test "${host_address}" = 32; then