--- gcc/config.gcc.orig 2016-10-24 14:26:59.594037000 +0200 +++ gcc/config.gcc 2016-10-24 21:43:34.704033000 +0200 @@ -278,6 +278,7 @@ | thumb-*-* \ | *-*-freebsd[12] | *-*-freebsd[12].* \ | *-*-freebsd*aout* \ + | *-*-bsdsunix*aout* \ | *-*-linux*aout* \ | *-*-linux*coff* \ | *-*-linux*libc1* \ @@ -580,6 +581,45 @@ "" | yes | posix) thread_file='posix' ;; esac ;; +*-*-bsdsunix*) + # This is the generic ELF configuration of BSDSUniX. Later + # machine-specific sections may refine and add to this + # configuration. + # + # Due to tm_file entry ordering issues that vary between cpu + # architectures, we only define bsdsux_tm_file to allow the + # machine-specific section to dictate the final order of all + # entries of tm_file with the minor exception that components + # of the tm_file set here will always be of the form: + # + # bsdsunix.h [bsdsunix-.h ...] bsdsunix-spec.h bsdsunix.h + # + # The machine-specific section should not tamper with this + # ordering but may order all other entries of tm_file as it + # pleases around the provided core setting. + gas=yes + gnu_ld=yes + bsdsux_major=`echo ${target} | sed -e 's/.*bsdsunix//g' | sed -e 's/\..*//g'` + tm_defines="${tm_defines} BSDSUX_MAJOR=${bsdsux_major}" + tmake_file="t-slibgcc" + case ${enable_threads} in + no) + bsdsux_tm_file="${bsdsux_tm_file} bsdsunix-nthr.h" + ;; + "" | yes | posix) + thread_file='posix' + ;; + *) + echo 'Unknown thread configuration for BSDSUniX' + exit 1 + ;; + esac + bsdsux_tm_file="${bsdsux_tm_file} bsdsunix-spec.h bsdsunix.h bsdsunix-stdint.h" + extra_options="$extra_options rpath.opt bsdsunix.opt" + default_use_cxa_atexit=yes + # need_64bit_hwint=yes # system compiler has this for all arch! + use_gcc_stdint=wrap + ;; *-*-freebsd*) # This is the generic ELF configuration of FreeBSD. Later # machine-specific sections may refine and add to this @@ -624,7 +664,7 @@ # need_64bit_hwint=yes # system compiler has this for all arch! use_gcc_stdint=wrap ;; -*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) +*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-kbsdsunix*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) extra_options="$extra_options gnu-user.opt" gas=yes gnu_ld=yes @@ -633,7 +673,7 @@ esac tmake_file="t-slibgcc" case $target in - *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-kopensolaris*-gnu) + *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-kbsdsunix*-gnu | *-*-knetbsd*-gnu | *-*-kopensolaris*-gnu) :;; *-*-gnu*) native_system_header_dir=/include @@ -844,6 +884,10 @@ tm_file="elfos.h ${tm_file} ${fbsd_tm_file} alpha/elf.h alpha/freebsd.h" extra_options="${extra_options} alpha/elf.opt" ;; +alpha*-*-bsdsunix*) + tm_file="elfos.h ${tm_file} ${bsdsux_tm_file} alpha/elf.h alpha/bsdsunix.h" + extra_options="${extra_options} alpha/elf.opt" + ;; alpha*-*-netbsd*) tm_file="elfos.h ${tm_file} netbsd.h alpha/elf.h netbsd-elf.h alpha/netbsd.h" extra_options="${extra_options} netbsd.opt netbsd-elf.opt \ @@ -886,6 +930,28 @@ need_64bit_hwint=yes with_tls=${with_tls:-gnu} ;; +arm*-*-bsdsunix*) # ARM BSDSUniX EABI + tm_file="dbxelf.h elfos.h ${bsdsux_tm_file} arm/elf.h" + case $target in + arm*b-*-bsdsunix*) + tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" + ;; + esac + tmake_file="${tmake_file} arm/t-arm arm/t-bpabi" + tm_file="${tm_file} arm/bpabi.h arm/bsdsunix.h arm/aout.h arm/arm.h" + case $target in + armv6*-*-bsdsunix*) + tm_defines="${tm_defines} TARGET_BSDSUNIX_ARMv6=1" + ;; + esac + case $target in + arm*hf-*-bsdsunix*) + tm_defines="${tm_defines} TARGET_BSDSUNIX_ARM_HARD_FLOAT=1" + ;; + esac + need_64bit_hwint=yes + with_tls=${with_tls:-gnu} + ;; arm*-*-netbsdelf*) tm_file="dbxelf.h elfos.h netbsd.h netbsd-elf.h arm/elf.h arm/aout.h ${tm_file} arm/netbsd-elf.h" extra_options="${extra_options} netbsd.opt netbsd-elf.opt" @@ -1249,6 +1315,14 @@ 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-*-bsdsunix*) + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${bsdsux_tm_file} i386/bsdsunix.h" + tmake_file="${tmake_file} i386/t-bsdsunix i386/t-crtstuff" + ;; +x86_64-*-bsdsunix*) + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${bsdsux_tm_file} i386/x86-64.h i386/bsdsunix.h i386/bsdsunix64.h" + tmake_file="${tmake_file} i386/t-bsdsunix i386/t-crtstuff" + ;; i[34567]86-*-netbsdelf*) tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h" extra_options="${extra_options} netbsd.opt netbsd-elf.opt" @@ -1279,7 +1353,7 @@ gas=yes gnu_ld=yes ;; -i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu) +i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-kbsdsunix*-gnu | i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu) # Intel 80386's running GNU/* # with ELF format using glibc 2 tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h gnu-user.h glibc-stdint.h" @@ -1341,7 +1418,7 @@ ;; esac ;; -x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu) +x86_64-*-linux* | x86_64-*-kbsdsunix*-gnu | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu) tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h gnu-user.h glibc-stdint.h \ i386/x86-64.h i386/gnu-user-common.h i386/gnu-user64.h" case ${target} in @@ -1589,6 +1663,11 @@ target_cpu_default="MASK_GNU_AS|MASK_GNU_LD" tmake_file="${tmake_file} ia64/t-ia64" ;; +ia64*-*-bsdsunix*) + tm_file="${tm_file} dbxelf.h elfos.h ${bsdsux_tm_file} ia64/sysv4.h ia64/bsdsunix.h" + target_cpu_default="MASK_GNU_AS|MASK_GNU_LD" + tmake_file="${tmake_file} ia64/t-ia64" + ;; ia64*-*-linux*) tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ia64/sysv4.h ia64/linux.h" tmake_file="${tmake_file} ia64/t-ia64 ia64/t-linux t-libunwind" @@ -2044,6 +2123,21 @@ ;; esac ;; +powerpc*-*-bsdsunix*) + tm_file="${tm_file} dbxelf.h elfos.h ${bsdsux_tm_file} rs6000/sysv4.h" + extra_options="${extra_options} rs6000/sysv4.opt" + tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm" + case ${target} in + powerpc64*) + tm_file="${tm_file} rs6000/default64.h rs6000/bsdsunix64.h" + tmake_file="${tmake_file} rs6000/t-bsdsunix64" + extra_options="${extra_options} rs6000/linux64.opt" + ;; + *) + tm_file="${tm_file} rs6000/bsdsunix.h" + ;; + esac + ;; powerpc-*-netbsd*) tm_file="${tm_file} dbxelf.h elfos.h netbsd.h netbsd-elf.h freebsd-spec.h rs6000/sysv4.h rs6000/netbsd.h" extra_options="${extra_options} netbsd.opt netbsd-elf.opt" @@ -2568,6 +2662,16 @@ esac tmake_file="${tmake_file} sparc/t-sparc" ;; +sparc64-*-bsdsunix*|ultrasparc-*-bsdsunix*) + tm_file="${tm_file} ${bsdsux_tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/bsdsunix.h" + extra_options="${extra_options} sparc/long-double-switch.opt" + case "x$with_cpu" in + xultrasparc) ;; + x) with_cpu=ultrasparc ;; + *) echo "$with_cpu not supported for bsdsunix target"; exit 1 ;; + esac + tmake_file="${tmake_file} sparc/t-sparc" + ;; sparc64-*-netbsd*) tm_file="sparc/biarch64.h ${tm_file}" tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h netbsd.h netbsd-elf.h sparc/netbsd-elf.h" @@ -2756,6 +2860,12 @@ arch_without_sse2=no arch_without_64bit=no case ${target} in + i386-*-bsdsunix*) + arch=i486 + cpu=generic + arch_without_sse2=yes + arch_without_64bit=yes + ;; i386-*-freebsd*) if test $fbsd_major -ge 6; then arch=i486 @@ -3784,6 +3897,9 @@ ;; i[34567]86-*-cygwin* | i[34567]86-*-mingw* | x86_64-*-mingw*) ;; + i[34567]86-*-bsdsunix* | x86_64-*-bsdsunix*) + tmake_file="$tmake_file i386/t-bsdsunix" + ;; i[34567]86-*-freebsd* | x86_64-*-freebsd*) ;; ia64*-*-linux*)