From 5cbd1de5406f6ae7c2adbf247f72bb88f18c8517 Mon Sep 17 00:00:00 2001 From: Lephenixnoir Date: Sun, 7 Nov 2021 14:39:13 +0100 Subject: [PATCH] binutils/gcc: basic customized toolchain --- binutils-2.37/bfd/config.bfd | 5 +++++ binutils-2.37/config.sub | 3 ++- binutils-2.37/gas/configure.tgt | 1 + binutils-2.37/ld/configure.tgt | 3 +++ gcc-11.2.0/config.sub | 3 ++- gcc-11.2.0/fixincludes/mkfixinc.sh | 3 ++- gcc-11.2.0/gcc/config.gcc | 8 ++++++-- gcc-11.2.0/libgcc/config.host | 3 +++ 8 files changed, 24 insertions(+), 5 deletions(-) diff --git a/binutils-2.37/bfd/config.bfd b/binutils-2.37/bfd/config.bfd index 30087e3..2f7bbda 100644 --- a/binutils-2.37/bfd/config.bfd +++ b/binutils-2.37/bfd/config.bfd @@ -1272,6 +1272,11 @@ case "${targ}" in targ_selvecs="$targ_selvecs sh_coff_vec sh_coff_le_vec sh_coff_small_vec sh_coff_small_le_vec" targ_underscore=yes ;; + sh*-*-vhex*) + targ_defvec=sh_elf32_vec + targ_selvecs="sh_elf32_vec" + targ_underscore=yes + ;; sh-*-*) targ_defvec=sh_coff_vec targ_selvecs="sh_coff_vec sh_coff_le_vec sh_coff_small_vec sh_coff_small_le_vec" diff --git a/binutils-2.37/config.sub b/binutils-2.37/config.sub index 7384e91..245b5ac 100755 --- a/binutils-2.37/config.sub +++ b/binutils-2.37/config.sub @@ -1729,7 +1729,8 @@ case $os in | skyos* | haiku* | rdos* | toppers* | drops* | es* \ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ - | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx*) + | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* \ + | vhex*) ;; # This one is extra strict with allowed versions sco3.2v2 | sco3.2v[4-9]* | sco5v6*) diff --git a/binutils-2.37/gas/configure.tgt b/binutils-2.37/gas/configure.tgt index 338892a..1ae54ad 100644 --- a/binutils-2.37/gas/configure.tgt +++ b/binutils-2.37/gas/configure.tgt @@ -386,6 +386,7 @@ case ${generic_target} in sh-*-pe*) fmt=coff em=pe endian=little ;; sh-*-kaos*) fmt=elf ;; shle*-*-kaos*) fmt=elf ;; + sh*-*-vhex*) fmt=elf ;; sparc-*-linux-*) fmt=elf em=linux ;; sparc-*-solaris*) fmt=elf em=solaris ;; diff --git a/binutils-2.37/ld/configure.tgt b/binutils-2.37/ld/configure.tgt index 6205d7c..16625cd 100644 --- a/binutils-2.37/ld/configure.tgt +++ b/binutils-2.37/ld/configure.tgt @@ -839,6 +839,9 @@ sh-*-nto*) targ_emul=shelf_nto sh-*-pe) targ_emul=shpe ; targ_extra_ofiles="deffilep.o pe-dll.o" ;; +sh*-*-vhex*) targ_emul=shelf + targ_extra_emuls="shelf shl sh" + ;; sh-*-*) targ_emul=sh; targ_extra_emuls=shl targ_extra_ofiles= diff --git a/gcc-11.2.0/config.sub b/gcc-11.2.0/config.sub index 63c1f1c..c289758 100755 --- a/gcc-11.2.0/config.sub +++ b/gcc-11.2.0/config.sub @@ -1725,7 +1725,8 @@ case $os in | skyos* | haiku* | rdos* | toppers* | drops* | es* \ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ - | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx*) + | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* \ + | vhex*) ;; # This one is extra strict with allowed versions sco3.2v2 | sco3.2v[4-9]* | sco5v6*) diff --git a/gcc-11.2.0/fixincludes/mkfixinc.sh b/gcc-11.2.0/fixincludes/mkfixinc.sh index df90720..108799a 100755 --- a/gcc-11.2.0/fixincludes/mkfixinc.sh +++ b/gcc-11.2.0/fixincludes/mkfixinc.sh @@ -20,7 +20,8 @@ case $machine in powerpcle-*-eabisim* | \ powerpcle-*-eabi* | \ *-*-vxworks7* | \ - *-musl* ) + *-musl* | \ + sh*-*-vhex*) # IF there is no include fixing, # THEN create a no-op fixer and exit (echo "#! /bin/sh" ; echo "exit 0" ) > ${target} diff --git a/gcc-11.2.0/gcc/config.gcc b/gcc-11.2.0/gcc/config.gcc index 357b0be..6e2526d 100644 --- a/gcc-11.2.0/gcc/config.gcc +++ b/gcc-11.2.0/gcc/config.gcc @@ -3204,7 +3204,9 @@ s390x-ibm-tpf*) ;; sh-*-elf* | sh[12346l]*-*-elf* | \ sh-*-linux* | sh[2346lbe]*-*-linux* | \ - sh-*-netbsdelf* | shl*-*-netbsdelf*) + sh-*-netbsdelf* | shl*-*-netbsdelf* | \ + sh*-*-vhex*) + tmake_file="${tmake_file} sh/t-sh sh/t-elf" if test x${with_endian} = x; then case ${target} in @@ -3214,6 +3216,7 @@ sh-*-elf* | sh[12346l]*-*-elf* | \ shl* | sh*-*-linux* | \ sh-superh-elf) with_endian=little,big ;; sh[1234]*-*-*) with_endian=big ;; + sh*-*-vhex*) with_endian=big ;; *) with_endian=big,little ;; esac fi @@ -3266,7 +3269,8 @@ sh-*-elf* | sh[12346l]*-*-elf* | \ case `echo ${target} | sed 's/e[lb]-/-/'` in sh4a_single_only*) sh_cpu_target=sh4a-single-only ;; sh4a_single*) sh_cpu_target=sh4a-single ;; - sh4a_nofpu*) sh_cpu_target=sh4a-nofpu ;; + sh-*-vhex* | sh4a_nofpu*) + sh_cpu_target=sh4a-nofpu ;; sh4al) sh_cpu_target=sh4al ;; sh4a*) sh_cpu_target=sh4a ;; sh4_single_only*) sh_cpu_target=sh4-single-only ;; diff --git a/gcc-11.2.0/libgcc/config.host b/gcc-11.2.0/libgcc/config.host index 50f0006..bbdc863 100644 --- a/gcc-11.2.0/libgcc/config.host +++ b/gcc-11.2.0/libgcc/config.host @@ -1358,6 +1358,9 @@ sh-*-rtems*) libic_invalidate_array_4a.a \ libgcc-Os-4-200.a libgcc-4-300.a" ;; +sh*-*-vhex*) + tmake_file="${tmake_file} sh/t-sh t-slibgcc-libgcc t-libgcc-pic" + ;; sh-wrs-vxworks) tmake_file="$tmake_file sh/t-sh t-crtstuff-pic t-fdpbit" ;;