Compiling sh-gcc separately
Posté le 20/06/2025 20:16
I'm having some trouble compiling sh-gcc manually according to Method 3 listed
here. This is the error: configure: error: cannot compute suffix of object files: cannot compile
I tried first in a Docker container starting with the debian:latest image then again with a fresh Debian install in a VM and got the same error. Here is what I tried:
- Downloaded and decompressed gcc-15.1.0.tar.xz from
https://ftp.gnu.org/gnu/gcc/gcc-15.1.0/. I want 15.1.0 specifically for the musttail attribute. I plan to compile just one of the C files in my project to assembly with -S with this toolchain, so I don't need the full fxsdk functionality.
- Created directory /home/druzyek/sh-gcc/gcc and set SYSROOT to that.
- Set VERSION to 15.1.0
- sudo apt install build-essential
- Followed the command line instructions for Method 3 but did not run the patch line since not using GCC 11.1 or earlier.
- The error happens when running
make -j$(nproc) all-gcc all-target-libgcc
Here is the error text and checking a few things:
checking for sh3eb-elf-gcc... /home/druzyek/sh-gcc/build/./gcc/xgcc -B/home/druzyek/sh-gcc/build/./gcc/ -B/home/druzyek/sh-gcc/gcc/sh3eb-elf/bin/ -B/home/druzyek/sh-gcc/gcc/sh3eb-elf/lib/ -isystem /home/druzyek/sh-gcc/gcc/sh3eb-elf/include -isystem /home/druzyek/sh-gcc/gcc/sh3eb-elf/sys-include
checking for suffix of object files... configure: error: in `/home/druzyek/sh-gcc/build/sh3eb-elf/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details
make: *** [Makefile:15378: configure-target-libgcc] Error 1
druzyek@debian:~/sh-gcc/build$ echo $SYSROOT
/home/druzyek/sh-gcc/gcc
druzyek@debian:~/sh-gcc/build$ echo $VERSION
15.1.0
druzyek@debian:~/sh-gcc/build$ cd ..
druzyek@debian:~/sh-gcc$ ls
ar as build gcc gcc-15.1.0 gcc.tar.xz ld ranlib
Citer : Posté le 20/06/2025 20:20 | # |
Fichier joint
config.log attached
Citer : Posté le 20/06/2025 20:45 | #
So... you didn't install binutils?
Citer : Posté le 20/06/2025 20:53 | #
If you mean binutils on the host, that should come with build-essential. ld -v shows 2.40 for example. Do you mean binutils for sh?
Citer : Posté le 20/06/2025 21:57 | #
Yes I mean binutils for SH: https://git.planet-casio.com/Lephenixnoir/sh-elf-binutils/
That's what the symlink step symlinks to.
Citer : Posté le 21/06/2025 03:54 | #
Thanks as always for your help. I got it working in an arch container.