Hi!

The default sh-elf configuration has no multi-libs for SH3 and SH4 variants
without FPU (from what I can see).  So it won't use soft-fp so much during
sim testing.  So please change to soft-fp for sh*, not just SH3/SH4.

Got it, done that locally, and will update patch once tested.

Here's an old proposed change to the simtest instructions to not use
combined trees:

https://gcc.gnu.org/pipermail/gcc-patches/attachments/20140815/fb38918e/attachment.bin

Thanks for the instructions. Apologies for the back-and-forth as I'm pretty new with this infrastructure (I usually do research stuff on LLVM).

The split-tree build goes better, still fails with GCC 15 (as expected, though somehow my custom toolchain did build originally) and sort of works with GCC 14.

The binutils/gdb repos have been merged since that attachement, and while I can build binutils only with --disable-gdb, building gdb (in another build folder, reconfiguring from scratch) seems iffy. The global CFLAGS/CXXFLAGS to switch to 32-bit affects at least parts of binutils, resulting in a broken toolchain due to architecture mixup:

---
% sh-elf-g++ /tmp/test.cc -o /tmp/test
$PREFIX/lib/gcc/sh-elf/14.1.1/../../../../sh-elf/bin/ld: $PREFIX/libexec/gcc/sh-elf/14.1.1/liblto_plugin.so: error loading plugin: $PREFIX/libexec/gcc/sh-elf/14.1.1/liblto_plugin.so: wrong ELF class: ELFCLASS64
---

My first build kept GDB as 64-bit, but running the test binary in sh-elf-run gave a Bus error. Even with the 32-bit GDB build, ignoring the broken toolchain and running that old binary still gives a Bus error.

For reference, here's my latest attempt.

---
% cd ${TOP}
% git clone git://sourceware.org/git/binutils-gdb.git
% git clone https://sourceware.org/git/newlib-cygwin.git newlib
% ln -sf PATH_TO_MY_GCC_14.1 gcc

% cd ${TOP}/build-binutils
% ../binutils-gdb/configure --target=sh-elf --prefix="$PREFIX" --disable-nls --disable-werror --disable-gdb
% make all && make install

% cd ${TOP}/build-gcc
% ../gcc/configure --target=sh-elf --prefix="$PREFIX" --enable-languages=c,c++ --disable-nls --disable-werror --with-newlib --enable-lto --enable-multilib
% make all-gcc && make install-gcc

% cd ${TOP}/build-newlib
% ../newlib/configure --target=sh-elf --prefix="$PREFIX" --enable-lto --enable-multilib
% make all && make install

% cd ${TOP}/build-gcc
% rm -rf *
% ../gcc/configure --target=sh-elf --prefix="$PREFIX" --enable-languages=c,c++ --disable-nls --disable-werror --with-newlib --enable-lto --enable-multilib
% make all && make install

% cd ${TOP}/build-gdb
% CFLAGS="-O2 -m32 -msse -mfpmath=sse" CXXFLAGS="-O2 -m32 -msse -mfpmath=sse" ../binutils-gdb/configure --target=sh-elf --prefix="$PREFIX" --enable-interwork --enable-multilib --disable-nls --disable-werror
% make all && make install
---

Yeah I just defaulted to SH3/SH4 conservatively because that's the only hardware I have. (My main platform also happens to be one of these SH4 without an FPU, the SH4AL-DSP.)

Oh, wow, especially rare type!

How active are the main types? Like are there still new products designed with these (maybe the J2)?

The patterns were written and tested to the best of our knowledge at that
time many years ago.  Nobody thought that we'll get a 2nd combine pass after
RA.  Anyway, I'll have a look at the remaining patterns.

I'd be interested to learn more about the history of the SH backend, if anyone wrote that up somewhere...

Thanks again,
Sébastien

Reply via email to