--- libgcc/config.host.orig 2020-03-04 19:30:03.000000000 +1100 +++ libgcc/config.host 2020-09-21 19:04:44.730851000 +1000 @@ -212,6 +212,15 @@ tmake_file="$tmake_file t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver" extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o" ;; +*-*-bsdsunix*) + tmake_file="$tmake_file t-bsdsunix 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-bsdsunix-thread" + ;; + esac + ;; *-*-freebsd*) # This is the generic ELF configuration of FreeBSD. Later # machine-specific sections may refine and add to this @@ -318,7 +327,7 @@ case ${host} in *-*-darwin* | *-*-dragonfly* | *-*-freebsd* | *-*-netbsd* | *-*-openbsd* | \ - *-*-solaris2*) + *-*-bsdsunix* | *-*-solaris2*) enable_execute_stack=enable-execute-stack-mprotect.c ;; i[34567]86-*-mingw* | x86_64-*-mingw*) @@ -340,6 +349,12 @@ tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp t-crtfm" md_unwind_header=aarch64/aarch64-unwind.h ;; +aarch64*-*-bsdsunix*) + extra_parts="$extra_parts crtfastmath.o" + tmake_file="${tmake_file} ${cpu_type}/t-aarch64" + tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp t-crtfm" + md_unwind_header=aarch64/bsdsunix-unwind.h + ;; aarch64*-*-freebsd*) extra_parts="$extra_parts crtfastmath.o" tmake_file="${tmake_file} ${cpu_type}/t-aarch64" @@ -361,6 +376,10 @@ 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" @@ -405,6 +424,13 @@ ;; esac ;; +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-bsdsunix" + 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*-*-freebsd*) # ARM FreeBSD EABI tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix arm/t-elf" tmake_file="${tmake_file} arm/t-bpabi arm/t-freebsd" @@ -623,10 +649,18 @@ tmake_file="${tmake_file} i386/t-dragonfly i386/t-crtstuff" md_unwind_header=i386/dragonfly-unwind.h ;; +i[34567]86-*-bsdsunix*) + tmake_file="${tmake_file} i386/t-bsdsunix i386/t-crtstuff" + md_unwind_header=i386/bsdsunix-unwind.h + ;; i[34567]86-*-freebsd*) tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff" md_unwind_header=i386/freebsd-unwind.h ;; +x86_64-*-bsdsunix*) + tmake_file="${tmake_file} i386/t-bsdsunix i386/t-crtstuff" + md_unwind_header=i386/bsdsunix-unwind.h + ;; x86_64-*-freebsd*) tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff" md_unwind_header=i386/freebsd-unwind.h @@ -788,6 +822,10 @@ extra_parts="$extra_parts crtbeginS.o crtendS.o crtfastmath.o" tmake_file="ia64/t-ia64 ia64/t-ia64-elf ia64/t-eh-ia64 t-crtfm t-softfp-tf ia64/t-softfp t-softfp ia64/t-softfp-compat" ;; +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 t-softfp-tf ia64/t-softfp t-softfp ia64/t-softfp-compat" + ;; 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 t-softfp-tf ia64/t-softfp t-softfp ia64/t-softfp-compat" @@ -1025,6 +1063,16 @@ tmake_file="$tmake_file rs6000/t-darwin64 rs6000/t-ibm-ldouble" extra_parts="$extra_parts crt2.o crt3_2.o libef_ppc.a dw_ppc.o" ;; +powerpc*-*-bsdsunix*) + tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-savresfgpr rs6000/t-crtstuff rs6000/t-bsdsunix 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-bsdsunix" + md_unwind_header=rs6000/bsdsunix-unwind.h + ;; + esac + ;; powerpc*-*-freebsd*) tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-savresfgpr rs6000/t-crtstuff rs6000/t-freebsd t-softfp-sfdf t-softfp-excl t-softfp" extra_parts="$extra_parts crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o" @@ -1128,6 +1176,10 @@ extra_parts="$extra_parts crtbegin.o crtend.o crti.o crtn.o crtendS.o crtbeginT.o" md_unwind_header=riscv/linux-unwind.h ;; +riscv*-*-bsdsunix*) + tmake_file="${tmake_file} riscv/t-softfp${host_address} t-softfp riscv/t-elf riscv/t-elf${host_address}" + extra_parts="$extra_parts crtbegin.o crtend.o crti.o crtn.o crtendS.o crtbeginT.o" + ;; riscv*-*-freebsd*) tmake_file="${tmake_file} riscv/t-softfp${host_address} t-softfp riscv/t-elf riscv/t-elf${host_address}" extra_parts="$extra_parts crtbegin.o crtend.o crti.o crtn.o crtendS.o crtbeginT.o" @@ -1268,6 +1320,10 @@ ;; sparc-wrs-vxworks) ;; +sparc64-*-bsdsunix*|ultrasparc-*-bsdsunix*) + tmake_file="$tmake_file t-crtfm" + extra_parts="$extra_parts crtfastmath.o" + ;; sparc64-*-freebsd*|ultrasparc-*-freebsd*) tmake_file="$tmake_file t-crtfm" extra_parts="$extra_parts crtfastmath.o"