最新のUbuntu25.04でSH7706組み込みLinuxクロスコンパイラを構築してみます。
クロスコンパイラは https://crosstool-ng.github.io/ でダウンロードできます。
2020年4月時点での最新版 crosstool-ng-1.27.0 のアーカイブを展開し、フォルダ内に入ります。
クロスコンパイラを構築する前に以下のように必要なパッケージを追加します。
最初に以下のように bootstrapコマンドを実行します。
INFO :: *** Generating package version descriptions
INFO :: Master packages: autoconf automake avr-libc binutils bison cloog dtc duma elf2flt expat gcc gdb gettext glibc gmp gnuprumcu isl libelf libiconv libtool linux ltrace m4 make mingw-w64 mold moxiebox mpc mpfr musl ncurses newlib-nano newlib picolibc strace uClibc-ng zlib zstd
INFO :: Generating ‘config/versions/autoconf.in’
INFO :: Generating ‘config/versions/automake.in’
INFO :: Generating ‘config/versions/avr-libc.in’
INFO :: Generating ‘config/versions/binutils.in’
INFO :: Generating ‘config/versions/bison.in’
INFO :: Generating ‘config/versions/cloog.in’
INFO :: Generating ‘config/versions/dtc.in’
INFO :: Generating ‘config/versions/duma.in’
INFO :: Generating ‘config/versions/elf2flt.in’
INFO :: Generating ‘config/versions/expat.in’
INFO :: Generating ‘config/versions/gcc.in’
INFO :: Generating ‘config/versions/gdb.in’
INFO :: Generating ‘config/versions/gettext.in’
INFO :: Generating ‘config/versions/glibc.in’
INFO :: Generating ‘config/versions/gmp.in’
INFO :: Generating ‘config/versions/gnuprumcu.in’
INFO :: Generating ‘config/versions/isl.in’
INFO :: Generating ‘config/versions/libelf.in’
INFO :: Generating ‘config/versions/libiconv.in’
INFO :: Generating ‘config/versions/libtool.in’
INFO :: Generating ‘config/versions/linux.in’
INFO :: Generating ‘config/versions/ltrace.in’
INFO :: Generating ‘config/versions/m4.in’
INFO :: Generating ‘config/versions/make.in’
INFO :: Generating ‘config/versions/mingw-w64.in’
INFO :: Generating ‘config/versions/mold.in’
INFO :: Generating ‘config/versions/moxiebox.in’
INFO :: Generating ‘config/versions/mpc.in’
INFO :: Generating ‘config/versions/mpfr.in’
INFO :: Generating ‘config/versions/musl.in’
INFO :: Generating ‘config/versions/ncurses.in’
INFO :: Generating ‘config/versions/newlib-nano.in’
INFO :: Generating ‘config/versions/newlib.in’
INFO :: Generating ‘config/versions/picolibc.in’
INFO :: Generating ‘config/versions/strace.in’
INFO :: Generating ‘config/versions/uClibc-ng.in’
INFO :: Generating ‘config/versions/zlib.in’
INFO :: Generating ‘config/versions/zstd.in’
INFO :: *** Generating menu/choice selections
INFO :: Generating arch.in (choice)
INFO :: Generating kernel.in (choice)
INFO :: Generating cc.in (choice)
INFO :: Generating binutils.in (choice)
INFO :: Generating libc.in (choice)
INFO :: Generating linker.in (menu)
INFO :: Generating debug.in (menu)
INFO :: Generating comp_tools.in (menu)
INFO :: Generating comp_libs.in (menu)
INFO :: *** Gathering the list of data files to install
INFO :: *** Running autoreconf
configure.ac:309: warning: gl_HOST_CPU_C_ABI_32BIT is m4_require’d but not m4_defun’d
m4/lib-prefix.m4:155: AC_LIB_PREPARE_MULTILIB is expanded from…
m4/lib-link.m4:181: AC_LIB_LINKFLAGS_BODY is expanded from…
m4/iconv.m4:10: AM_ICONV_LINKFLAGS_BODY is expanded from…
m4/gettext.m4:55: AM_GNU_GETTEXT is expanded from…
configure.ac:309: the top level
INFO :: *** Done!
$
次に以下のように configureコマンドでMakefileを生成します。
checking for a BSD-compatible install… /usr/bin/install -c
checking whether sleep supports fractional seconds… yes
checking filesystem timestamp resolution… 0.01
checking whether build environment is sane… yes
checking for a race-free mkdir -p… /usr/bin/mkdir -p
checking for gawk… gawk
checking whether make sets $(MAKE)… yes
checking whether make supports nested variables… yes
checking xargs -n works… yes
checking how to create a pax tar archive… gnutar
checking whether to enable maintainer-specific portions of Makefiles… yes
checking build system type… x86_64-pc-linux-gnu
checking host system type… x86_64-pc-linux-gnu
checking whether ln -s works… yes
checking whether install takes –strip-program option… yes
checking for ggrep… no
checking for grep… grep
checking for absolute path to grep… /usr/bin/grep
checking for gegrep… no
checking for egrep… egrep
checking for absolute path to egrep… /usr/bin/egrep
checking for grep that handles long lines and -e… /usr/bin/grep
checking for egrep… /usr/bin/grep -E
checking for sed… /usr/bin/sed
checking for GNU sed >= 4.0… yes
checking for gcc… gcc
checking whether the C compiler works… yes
checking for C compiler default output file name… a.out
checking for suffix of executables…
checking whether we are cross compiling… no
checking for suffix of object files… o
checking whether the compiler supports GNU C… yes
checking whether gcc accepts -g… yes
checking for gcc option to enable C11 features… none needed
checking whether gcc understands -c and -o together… yes
checking whether make supports the include directive… yes (GNU style)
checking dependency style of gcc… gcc3
checking for g++… g++
checking whether the compiler supports GNU C++… yes
checking whether g++ accepts -g… yes
checking for g++ option to enable C++11 features… none needed
checking dependency style of g++… gcc3
checking how to run the C preprocessor… gcc -E
checking for flex… flex
checking for lex output file root… lex.yy
checking for lex library… none needed
checking whether yytext is a pointer… yes
checking for bison… bison -y
checking if bison is the parser generator… yes
checking whether g++ supports C++11 features by default… yes
checking if gcc can static link… yes
checking for ranlib… ranlib
checking for gobjcopy… no
checking for objcopy… objcopy
checking for absolute path to objcopy… /usr/bin/objcopy
checking for gobjdump… no
checking for objdump… objdump
checking for absolute path to objdump… /usr/bin/objdump
checking for greadelf… no
checking for readelf… readelf
checking for absolute path to readelf… /usr/bin/readelf
checking for flex… flex
checking for makeinfo… makeinfo
checking for cut… cut
checking for readlink… readlink
checking for tar… tar
checking for gzip… gzip
checking for bzip2… bzip2
checking for xz… xz
checking for unzip… unzip
checking for help2man… help2man
checking for file… file
checking for which… which
checking for lzip… no
checking for wget… wget
checking for curl… no
checking for meson… no
checking for ninja… no
checking whether to use getconf or sysctl to count CPUs… getconf _NPROCESSORS_ONLN
checking for gpatch… no
checking for patch… patch
checking for absolute path to patch… /usr/bin/patch
checking whether patch supports –no-backup-if-mismatch… yes
checking for bash… /usr/bin/bash
checking for GNU bash >= 4.0… yes
checking for absolute path to gawk… /usr/bin/gawk
checking for GNU awk… yes
checking for make… /usr/bin/gmake
checking for GNU make >= 3.81… yes
checking for GNU make >= 4.0… yes
checking for GNU make >= 4.4… yes
checking for libtool… /usr/bin/libtool
checking for GNU libtool >= 2.4… yes
checking for libtoolize… /usr/bin/libtoolize
checking for GNU libtoolize >= 2.4… yes
checking for GNU autoconf >= 2.65… yes
checking for autoreconf… /usr/bin/autoreconf
checking for GNU autoreconf >= 2.63… yes
checking for GNU automake >= 1.15… yes
checking for m4… /usr/bin/m4
checking for GNU m4 >= 1.4.12… yes
checking for python build information…
checking for python3.13… /usr/bin/python3.13
checking for python3.13… python3.13
checking for main in -lpython3.13… no
checking for main in -lpython3.13m… no
checking for python3.12… (cached) /usr/bin/python3.13
checking for python3.12… (cached) python3.13
checking for main in -lpython3.13… (cached) no
checking for main in -lpython3.13m… (cached) no
checking for python3.11… (cached) /usr/bin/python3.13
checking for python3.11… (cached) python3.13
checking for main in -lpython3.13… (cached) no
checking for main in -lpython3.13m… (cached) no
checking for python3.10… (cached) /usr/bin/python3.13
checking for python3.10… (cached) python3.13
checking for main in -lpython3.13… (cached) no
checking for main in -lpython3.13m… (cached) no
checking for python3.9… (cached) /usr/bin/python3.13
checking for python3.9… (cached) python3.13
checking for main in -lpython3.13… (cached) no
checking for main in -lpython3.13m… (cached) no
checking for python3.8… (cached) /usr/bin/python3.13
checking for python3.8… (cached) python3.13
checking for main in -lpython3.13… (cached) no
checking for main in -lpython3.13m… (cached) no
checking for python3.7… (cached) /usr/bin/python3.13
checking for python3.7… (cached) python3.13
checking for main in -lpython3.13… (cached) no
checking for main in -lpython3.13m… (cached) no
checking for python3.6… (cached) /usr/bin/python3.13
checking for python3.6… (cached) python3.13
checking for main in -lpython3.13… (cached) no
checking for main in -lpython3.13m… (cached) no
checking for python3.5… (cached) /usr/bin/python3.13
checking for python3.5… (cached) python3.13
checking for main in -lpython3.13… (cached) no
checking for main in -lpython3.13m… (cached) no
checking for python3.4… (cached) /usr/bin/python3.13
checking for python3.4… (cached) python3.13
checking for main in -lpython3.13… (cached) no
checking for main in -lpython3.13m… (cached) no
checking for python3.3… (cached) /usr/bin/python3.13
checking for python3.3… (cached) python3.13
checking for main in -lpython3.13… (cached) no
checking for main in -lpython3.13m… (cached) no
checking for python3.2… (cached) /usr/bin/python3.13
checking for python3.2… (cached) python3.13
checking for main in -lpython3.13… (cached) no
checking for main in -lpython3.13m… (cached) no
checking for python3.1… (cached) /usr/bin/python3.13
checking for python3.1… (cached) python3.13
checking for main in -lpython3.13… (cached) no
checking for main in -lpython3.13m… (cached) no
checking for python3.0… (cached) /usr/bin/python3.13
checking for python3.0… (cached) python3.13
checking for main in -lpython3.13… (cached) no
checking for main in -lpython3.13m… (cached) no
checking for python2.7… (cached) /usr/bin/python3.13
checking for python2.7… (cached) python3.13
checking for main in -lpython3.13… (cached) no
checking for main in -lpython3.13m… (cached) no
checking for python2.6… (cached) /usr/bin/python3.13
checking for python2.6… (cached) python3.13
checking for main in -lpython3.13… (cached) no
checking for main in -lpython3.13m… (cached) no
checking for python2.5… (cached) /usr/bin/python3.13
checking for python2.5… (cached) python3.13
checking for main in -lpython3.13… (cached) no
checking for main in -lpython3.13m… (cached) no
checking for python2.4… (cached) /usr/bin/python3.13
checking for python2.4… (cached) python3.13
checking for main in -lpython3.13… (cached) no
checking for main in -lpython3.13m… (cached) no
checking for python2.3… (cached) /usr/bin/python3.13
checking for python2.3… (cached) python3.13
checking for main in -lpython3.13… (cached) no
checking for main in -lpython3.13m… (cached) no
checking for python2.2… (cached) /usr/bin/python3.13
checking for python2.2… (cached) python3.13
checking for main in -lpython3.13… (cached) no
checking for main in -lpython3.13m… (cached) no
checking for python2.1… (cached) /usr/bin/python3.13
checking for python2.1… (cached) python3.13
checking for main in -lpython3.13… (cached) no
checking for main in -lpython3.13m… (cached) no
checking for python… (cached) /usr/bin/python3.13
checking for python… (cached) python3.13
checking for main in -lpython3.13… (cached) no
checking for main in -lpython3.13m… (cached) no
results of the Python check:
Binary: /usr/bin/python3.13
Library: no
Include Dir: no
checking for python version greater than 3.4… yes: 3.13
checking for bison… /usr/bin/bison
checking for bison >= 2.7… yes
checking for bison >= 3.0.4… yes
checking for dtc… no
checking for cvs… no
checking for svn… no
checking for git… no
checking for gmd5sum… no
checking for md5sum… /usr/bin/md5sum
checking for gsha1sum… no
checking for sha1sum… /usr/bin/sha1sum
checking for gsha256sum… no
checking for sha256sum… /usr/bin/sha256sum
checking for gsha512sum… no
checking for sha512sum… /usr/bin/sha512sum
checking for inline… inline
checking for GNU libc compatible malloc… yes
checking for GNU libc compatible realloc… yes
checking for stdio.h… yes
checking for stdlib.h… yes
checking for string.h… yes
checking for inttypes.h… yes
checking for stdint.h… yes
checking for strings.h… yes
checking for sys/stat.h… yes
checking for sys/types.h… yes
checking for unistd.h… yes
checking for size_t… yes
checking for working alloca.h… yes
checking for alloca… yes
checking for ld used by gcc… /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld… yes
checking for shared library run path origin… done
./configure: line 14236: gl_HOST_CPU_C_ABI_32BIT: command not found
checking for egrep -e… (cached) /usr/bin/grep -E
checking for ELF binary format… yes
checking for the common suffixes of directories in the library search path… ./configure: line 14473: test: !=: unary operator expected
./configure: line 14479: test: !=: unary operator expected
./configure: line 14504: test: =: unary operator expected
./configure: line 14508: test: =: unary operator expected
lib,lib,lib
checking whether NLS is requested… yes
checking for CFPreferencesCopyAppValue… no
checking for CFLocaleCopyPreferredLanguages… no
checking for GNU gettext in libc… yes
checking whether to use NLS… yes
checking where the gettext function comes from… libc
checking for pkg-config… no
checking for ncursesw via pkg-config… no
checking for ncursesw via fallback…
checking for initscr() with -lncursesw… yes
checking for nodelay() with -lncursesw… yes
checking for working ncursesw/curses.h… yes
checking for working ncursesw.h… no
checking for working ncurses.h… yes
checking for Curses Panel library with ncursesw/panel.h… yes
checking for Curses Menu library with ncursesw/menu.h… yes
checking for build time… Mon Jul 14 22:19:46 2025
checking if the manual needs to be installed… yes
checking that generated files are newer than configure… done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating paths.sh
config.status: creating kconfig/Makefile
config.status: creating config/configure.in
config.status: creating config.h
config.status: executing depfiles commands
$
Makefileができたら、以下のコマンドでct-ng コマンドが使えるようにします。
/usr/bin/gmake all-recursive
gmake[1]: ディレクトリ ‘/home/general/crosstool-ng-1.27.0’ に入ります
Making all in kconfig
gmake[2]: ディレクトリ ‘/home/general/crosstool-ng-1.27.0/kconfig’ に入ります
LEX lexer.lex.c
YACC parser.tab.c
/usr/bin/gmake all-am
gmake[3]: ディレクトリ ‘/home/general/crosstool-ng-1.27.0/kconfig’ に入ります
CC conf.o
CC expr.o
CC confdata.o
CC symbol.o
CC preprocess.o
CC util.o
CC parser.tab.o
CC lexer.lex.o
CC nconf-nconf.o
CC nconf-nconf.gui.o
CC nconf-confdata.o
CC nconf-expr.o
CC nconf-symbol.o
CC nconf-preprocess.o
CC nconf-util.o
CC nconf-parser.tab.o
CC nconf-lexer.lex.o
CC mconf.o
CC lxdialog/checklist.o
CC lxdialog/inputbox.o
CC lxdialog/menubox.o
CC lxdialog/textbox.o
CC lxdialog/util.o
CC lxdialog/yesno.o
CCLD conf
CCLD mconf
CCLD nconf
gmake[3]: ディレクトリ ‘/home/general/crosstool-ng-1.27.0/kconfig’ から出ます
gmake[2]: ディレクトリ ‘/home/general/crosstool-ng-1.27.0/kconfig’ から出ます
gmake[2]: ディレクトリ ‘/home/general/crosstool-ng-1.27.0’ に入ります
GEN bash-completion/ct-ng
GEN ct-ng
GEN docs/ct-ng.1
gmake[2]: ディレクトリ ‘/home/general/crosstool-ng-1.27.0’ から出ます
gmake[1]: ディレクトリ ‘/home/general/crosstool-ng-1.27.0’ から出ます
$
まず、ct-ngコマンドでSHプロセッサ向けの設定し、メニューを開きます。
$ ./ct-ng sh-multilib-linux-gnu
CONF sh-multilib-linux-gnu
#
# configuration written to .config
#
***********************************************************
Initially reported by: Alexey Neyman
URL:
Comment:
Multilib configuration for SuperH/glibc.
***********************************************************
Now configured for “sh-multilib-linux-gnu”
$ ./ct-ng menuconfig
デフォルトでSH3に変更するには以下のように設定します。



また、gdbを使わない場合は、デフォルトで有効なので、無効にします。

設定ができたら、以下のようにビルドします。
[INFO ] Performing some trivial sanity checks
[WARN ] Number of open files 1024 may not be sufficient to build the toolchain; increasing to 2048
[INFO ] Build started 20250714.222155
[INFO ] Building environment variables
[WARN ] Directory ‘/home/general/src’ does not exist.
[WARN ] Will not save downloaded tarballs to local storage.
[WARN ] Ignoring ‘m3’ in multilib list: it is the default multilib
[EXTRA] Preparing working directories
[EXTRA] Installing user-supplied crosstool-NG configuration
[EXTRA] =================================================================
[EXTRA] Dumping internal crosstool-NG configuration
[EXTRA] Building a toolchain for:
[EXTRA] build = x86_64-pc-linux-gnu
[EXTRA] host = x86_64-pc-linux-gnu
[EXTRA] target = sh-multilib-linux-gnu
[EXTRA] Dumping internal crosstool-NG configuration: done in 0.08s (at 00:02)
[INFO ] =================================================================
[INFO ] Retrieving needed toolchain components’ tarballs
[EXTRA] Retrieving ‘linux-6.13’
[EXTRA] Verifying SHA512 checksum for ‘linux-6.13.tar.xz’
[EXTRA] Retrieving ‘zlib-1.3.1’
[EXTRA] Verifying SHA512 checksum for ‘zlib-1.3.1.tar.xz’
[EXTRA] Retrieving ‘zstd-1.5.6’
[EXTRA] Verifying SHA512 checksum for ‘zstd-1.5.6.tar.gz’
[EXTRA] Retrieving ‘gmp-6.3.0’
[EXTRA] Verifying SHA512 checksum for ‘gmp-6.3.0.tar.xz’
[EXTRA] Retrieving ‘mpfr-4.2.1’
[EXTRA] Verifying SHA512 checksum for ‘mpfr-4.2.1.tar.xz’
[EXTRA] Retrieving ‘isl-0.26’
[EXTRA] Verifying SHA512 checksum for ‘isl-0.26.tar.xz’
[EXTRA] Retrieving ‘mpc-1.3.1’
[EXTRA] Verifying SHA512 checksum for ‘mpc-1.3.1.tar.gz’
[EXTRA] Retrieving ‘ncurses-6.4’
[EXTRA] Verifying SHA512 checksum for ‘ncurses-6.4.tar.gz’
[EXTRA] Retrieving ‘libiconv-1.16’
[EXTRA] Verifying SHA512 checksum for ‘libiconv-1.16.tar.gz’
[EXTRA] Retrieving ‘gettext-0.23.1’
[EXTRA] Verifying SHA512 checksum for ‘gettext-0.23.1.tar.xz’
[EXTRA] Retrieving ‘binutils-2.43.1’
[EXTRA] Verifying SHA512 checksum for ‘binutils-2.43.1.tar.xz’
[EXTRA] Retrieving ‘gcc-14.2.0’
[EXTRA] Verifying SHA512 checksum for ‘gcc-14.2.0.tar.xz’
[EXTRA] Retrieving ‘glibc-2.41’
[EXTRA] Verifying SHA512 checksum for ‘glibc-2.41.tar.xz’
[INFO ] Retrieving needed toolchain components’ tarballs: done in 46.74s (at 00:49)
[INFO ] =================================================================
[INFO ] Extracting and patching toolchain components
[EXTRA] Extracting linux-6.13
[EXTRA] Patching linux-6.13
[EXTRA] Extracting zlib-1.3.1
[EXTRA] Patching zlib-1.3.1
[EXTRA] Extracting zstd-1.5.6
[EXTRA] Patching zstd-1.5.6
[EXTRA] Extracting gmp-6.3.0
[EXTRA] Patching gmp-6.3.0
[EXTRA] Extracting mpfr-4.2.1
[EXTRA] Patching mpfr-4.2.1
[EXTRA] Extracting isl-0.26
[EXTRA] Patching isl-0.26
[EXTRA] Extracting mpc-1.3.1
[EXTRA] Patching mpc-1.3.1
[EXTRA] Extracting ncurses-6.4
[EXTRA] Patching ncurses-6.4
[EXTRA] Extracting libiconv-1.16
[EXTRA] Patching libiconv-1.16
[EXTRA] Extracting gettext-0.23.1
[EXTRA] Patching gettext-0.23.1
[EXTRA] Extracting binutils-2.43.1
[EXTRA] Patching binutils-2.43.1
[EXTRA] Extracting gcc-14.2.0
[EXTRA] Patching gcc-14.2.0
[EXTRA] Extracting glibc-2.41
[EXTRA] Patching glibc-2.41
[INFO ] Extracting and patching toolchain components: done in 35.35s (at 01:24)
[INFO ] =================================================================
[INFO ] Installing ncurses for build
[EXTRA] Configuring ncurses
[EXTRA] Building ncurses
[EXTRA] Installing ncurses
[INFO ] Installing ncurses for build: done in 24.40s (at 01:49)
[INFO ] =================================================================
[INFO ] Installing zlib for host
[EXTRA] Configuring zlib
[EXTRA] Building zlib
[EXTRA] Installing zlib
[INFO ] Installing zlib for host: done in 1.51s (at 01:50)
[INFO ] =================================================================
[INFO ] Installing zstd for host
[EXTRA] Building zstd
[EXTRA] Installing zstd
[INFO ] Installing zstd for host: done in 13.25s (at 02:03)
[INFO ] =================================================================
[INFO ] Installing GMP for host
[EXTRA] Configuring GMP
[EXTRA] Building GMP
[EXTRA] Installing GMP
[INFO ] Installing GMP for host: done in 32.97s (at 02:36)
[INFO ] =================================================================
[INFO ] Installing MPFR for host
[EXTRA] Configuring MPFR
[EXTRA] Building MPFR
[EXTRA] Installing MPFR
[INFO ] Installing MPFR for host: done in 20.47s (at 02:57)
[INFO ] =================================================================
[INFO ] Installing ISL for host
[EXTRA] Configuring ISL
[EXTRA] Building ISL
[EXTRA] Installing ISL
[INFO ] Installing ISL for host: done in 29.31s (at 03:26)
[INFO ] =================================================================
[INFO ] Installing MPC for host
[EXTRA] Configuring MPC
[EXTRA] Building MPC
[EXTRA] Installing MPC
[INFO ] Installing MPC for host: done in 7.60s (at 03:34)
[INFO ] =================================================================
[INFO ] Installing ncurses for host
[EXTRA] Configuring ncurses
[EXTRA] Building ncurses
[EXTRA] Installing ncurses
[INFO ] Installing ncurses for host: done in 24.92s (at 03:59)
[INFO ] =================================================================
[INFO ] Installing libiconv for host
[EXTRA] Skipping (included in GNU C library)
[INFO ] Installing libiconv for host: done in 0.02s (at 03:59)
[INFO ] =================================================================
[INFO ] Installing gettext for host
[EXTRA] Skipping (included in GNU C library)
[INFO ] Installing gettext for host: done in 0.01s (at 03:59)
[INFO ] =================================================================
[INFO ] Installing binutils for host
[EXTRA] Configuring binutils
[EXTRA] Building binutils
[EXTRA] Installing binutils
[INFO ] Installing binutils for host: done in 65.97s (at 05:05)
[INFO ] =================================================================
[INFO ] Installing kernel headers
[EXTRA] Installing kernel headers
[INFO ] Installing kernel headers: done in 11.71s (at 05:17)
[INFO ] =================================================================
[INFO ] Installing core C gcc compiler
[EXTRA] Configuring core C gcc compiler
[EXTRA] Building gcc
[EXTRA] Installing gcc
[EXTRA] Housekeeping for core gcc compiler
[EXTRA] ” –> lib (gcc) lib (os)
[EXTRA] ‘ -mb’ –> lib/mb (gcc) lib/mb (os)
[EXTRA] ‘ -m4-nofpu’ –> lib/m4-nofpu (gcc) lib/m4-nofpu (os)
[EXTRA] ‘ -m4a’ –> lib/m4a (gcc) lib/m4a (os)
[EXTRA] ‘ -mb -m4-nofpu’ –> lib/mb/m4-nofpu (gcc) lib/mb/m4-nofpu (os)
[EXTRA] ‘ -mb -m4a’ –> lib/mb/m4a (gcc) lib/mb/m4a (os)
[INFO ] Installing core C gcc compiler: done in 549.01s (at 14:26)
[INFO ] =================================================================
[INFO ] Installing C library
[INFO ] =================================================================
[INFO ] Building for multilib 1/6: ”
[EXTRA] Configuring C library
[EXTRA] Building C library
[EXTRA] Installing C library
[INFO ] Building for multilib 1/6: ”: done in 261.25s (at 18:47)
[INFO ] =================================================================
[INFO ] Building for multilib 2/6: ‘ -mb’
[EXTRA] Configuring C library
[EXTRA] Building C library
[EXTRA] Installing C library
[INFO ] Building for multilib 2/6: ‘ -mb’: done in 260.70s (at 23:08)
[INFO ] =================================================================
[INFO ] Building for multilib 3/6: ‘ -m4-nofpu’
[EXTRA] Configuring C library
[EXTRA] Building C library
[EXTRA] Installing C library
[INFO ] Building for multilib 3/6: ‘ -m4-nofpu’: done in 258.65s (at 27:27)
[INFO ] =================================================================
[INFO ] Building for multilib 4/6: ‘ -m4a’
[EXTRA] Configuring C library
[EXTRA] Building C library
[EXTRA] Installing C library
[INFO ] Building for multilib 4/6: ‘ -m4a’: done in 257.75s (at 31:44)
[INFO ] =================================================================
[INFO ] Building for multilib 5/6: ‘ -mb -m4-nofpu’
[EXTRA] Configuring C library
[EXTRA] Building C library
[EXTRA] Installing C library
[INFO ] Building for multilib 5/6: ‘ -mb -m4-nofpu’: done in 257.64s (at 36:02)
[INFO ] =================================================================
[INFO ] Building for multilib 6/6: ‘ -mb -m4a’
[EXTRA] Configuring C library
[EXTRA] Building C library
[EXTRA] Installing C library
[INFO ] Building for multilib 6/6: ‘ -mb -m4a’: done in 259.01s (at 40:21)
[INFO ] Installing C library: done in 1555.63s (at 40:21)
[INFO ] =================================================================
[INFO ] Installing final gcc compiler
[EXTRA] Configuring final gcc compiler
[EXTRA] Building final gcc compiler
[EXTRA] Installing final gcc compiler
[EXTRA] Housekeeping for final gcc compiler
[EXTRA] ” –> lib (gcc) lib (os)
[EXTRA] ‘ -mb’ –> lib/mb (gcc) lib/mb (os)
[EXTRA] ‘ -m4-nofpu’ –> lib/m4-nofpu (gcc) lib/m4-nofpu (os)
[EXTRA] ‘ -m4a’ –> lib/m4a (gcc) lib/m4a (os)
[EXTRA] ‘ -mb -m4-nofpu’ –> lib/mb/m4-nofpu (gcc) lib/mb/m4-nofpu (os)
[EXTRA] ‘ -mb -m4a’ –> lib/mb/m4a (gcc) lib/mb/m4a (os)
[INFO ] Installing final gcc compiler: done in 1262.55s (at 61:24)
[INFO ] =================================================================
[INFO ] Finalizing the toolchain’s directory
[INFO ] Stripping all toolchain executables
[EXTRA] Installing the populate helper
[EXTRA] Installing a cross-ldd helper
[EXTRA] Creating toolchain aliases
[EXTRA] Removing installed documentation
[EXTRA] Collect license information from: /home/general/crosstool-ng-1.27.0/.build/sh-multilib-linux-gnu/src
[EXTRA] Put the license information to: /home/general/x-tools/sh-multilib-linux-gnu/share/licenses
[INFO ] Finalizing the toolchain’s directory: done in 5.58s (at 61:29)
[INFO ] Build completed at 20250714.232323
[INFO ] (elapsed: 61:28.81)
[INFO ] Finishing installation (may take a few seconds)…
[61:30] / $
クロスコンパイラのデフォルトがSH3になっていることの確認のため、以下のように確認します。

–with-cpu=sh3 の文字が含まれていれば、クロスコンパイラのデフォルトがSH3になっています。