--- gcc/config.gcc.orig 2015-09-10 16:17:53.000000000 +0200 +++ gcc/config.gcc 2017-02-10 09:27:36.673574000 +0100 @@ -269,6 +269,7 @@ | sparc-hal-solaris2* \ | thumb-*-* \ | *-*-freebsd[12] | *-*-freebsd[12].* \ + | *-*-bsdsunix*aout* \ | *-*-freebsd*aout* \ | *-*-linux*aout* \ | *-*-linux*coff* \ @@ -645,6 +646,44 @@ default_use_cxa_atexit=yes use_gcc_stdint=wrap ;; +*-*-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 + use_gcc_stdint=wrap + ;; *-*-freebsd*) # This is the generic ELF configuration of FreeBSD. Later # machine-specific sections may refine and add to this @@ -942,6 +981,10 @@ tmake_file="${tmake_file} alpha/t-linux" 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*-*-freebsd*) tm_file="elfos.h ${tm_file} ${fbsd_tm_file} alpha/elf.h alpha/freebsd.h" extra_options="${extra_options} alpha/elf.opt" @@ -1014,6 +1057,27 @@ extra_options="${extra_options} arm/vxworks.opt" tmake_file="${tmake_file} arm/t-arm arm/t-vxworks" ;; +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 + with_tls=${with_tls:-gnu} + ;; arm*-*-freebsd*) # ARM FreeBSD EABI tm_file="dbxelf.h elfos.h ${fbsd_tm_file} arm/elf.h" case $target in @@ -1392,6 +1456,12 @@ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h dragonfly.h dragonfly-stdint.h i386/x86-64.h i386/dragonfly.h" tmake_file="${tmake_file} i386/t-crtstuff" ;; +i[34567]86-*-bsdsunix*) + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${bsdsux_tm_file} i386/bsdsunix.h" + ;; +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" + ;; i[34567]86-*-freebsd*) tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/freebsd.h" ;; @@ -1758,6 +1828,11 @@ target_cpu_default="${target_cpu_default}|MASK_GNU_LD" fi ;; +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*-*-freebsd*) tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file} ia64/sysv4.h ia64/freebsd.h" target_cpu_default="MASK_GNU_AS|MASK_GNU_LD" @@ -2275,6 +2350,21 @@ tm_file="${tm_file} ${cpu_type}/darwin8.h ${cpu_type}/darwin64.h" extra_headers=altivec.h ;; +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*-*-freebsd*) tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file} rs6000/sysv4.h" extra_options="${extra_options} rs6000/sysv4.opt" @@ -2812,6 +2902,16 @@ extra_options="${extra_options} sparc/long-double-switch.opt" tmake_file="${tmake_file} sparc/t-sparc sparc/t-linux64" ;; +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-*-freebsd*|ultrasparc-*-freebsd*) tm_file="${tm_file} ${fbsd_tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/freebsd.h" extra_options="${extra_options} sparc/long-double-switch.opt" @@ -3026,6 +3126,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 @@ -4250,6 +4356,8 @@ ;; i[34567]86-*-mingw* | x86_64-*-mingw*) ;; + i[34567]86-*-bsdsunix* | x86_64-*-bsdsunix*) + ;; i[34567]86-*-dragonfly* | x86_64-*-dragonfly*) ;; i[34567]86-*-freebsd* | x86_64-*-freebsd*)