From 0400e3c470929b33e1e05a2787df9aedbb596506 Mon Sep 17 00:00:00 2001 From: Lephenixnoir Date: Sat, 2 Jan 2021 22:48:31 +0100 Subject: [PATCH] explicitly link previously-built binutils to GCC --- configure.sh | 9 +++++++++ util.sh | 12 ++++++++++++ 2 files changed, 21 insertions(+) diff --git a/configure.sh b/configure.sh index 5053742..d6c780c 100755 --- a/configure.sh +++ b/configure.sh @@ -36,6 +36,15 @@ mkdir build # directory and later symlink executables to $PREFIX/bin. PREFIX="$(pwd)" + +# Symlink as, ld, ar and ranlib, which gcc will not find by itself (we renamed +# them from sh3eb-elf-* to sh-elf-* with --program-prefix). +mkdir -p sh3eb-elf/bin +ln -s $(command -v sh-elf-as) sh3eb-elf/bin/as +ln -s $(command -v sh-elf-ld) sh3eb-elf/bin/ld +ln -s $(command -v sh-elf-ar) sh3eb-elf/bin/ar +ln -s $(command -v sh-elf-ranlib) sh3eb-elf/bin/ranlib + cd build echo "$TAG Configuring gcc..." diff --git a/util.sh b/util.sh index af37679..746ad23 100644 --- a/util.sh +++ b/util.sh @@ -9,3 +9,15 @@ run_quietly() { exit 1 fi } + +# Names of binutils tools, otherwise GCC assumes sh3eb-elf-* +export AR_FOR_TARGET=sh-elf-ar +export AS_FOR_TARGET=sh-elf-as +export DLLTOOL_FOR_TARGET=sh-elf-dlltool +export LD_FOR_TARGET=sh-elf-ld +export NM_FOR_TARGET=sh-elf-nm +export OBJCOPY_FOR_TARGET=sh-elf-objcopy +export OBJDUMP_FOR_TARGET=sh-elf-objdump +export RANLIB_FOR_TARGET=sh-elf-ranlib +export READELF_FOR_TARGET=sh-elf-readelf +export STRIP_FOR_TARGET=sh-elf-strip