added clean and fix README

This commit is contained in:
Ada Orbit 2026-04-02 13:05:56 +02:00
parent 32265a5e25
commit f2350a41f7
3 changed files with 30 additions and 22 deletions

2
.gitignore vendored
View file

@ -3,3 +3,5 @@ binutils-*/
gcc-*/
*.tar.gz
sysroot/
fxlibc
OpenLibm

View file

@ -38,7 +38,7 @@ mkdir build-binutils build-gcc sysroot
```bash
cd build-binutils
../binutils-*/configure \
--prefix="$(sysroot)/../sysroot" \
--prefix="$(pwd)/../sysroot" \
--target="sh3eb-elf" \
--with-multilib-list="m3,m4-nofpu" \
--program-prefix="sh-elf-" \
@ -62,14 +62,12 @@ You might ask yourself now why we chose these flags. Here I have tried to lay ou
We now compile `binutils` with our custom configuration using
```bash
make -j(nproc)
make -j$(nproc)
make install-strip
```
%TODO: What does configure-host do? why install-strip?
---
We now configure and install `gcc` using the same steps but with different flags.
### Configuring GCC (Part 1)
@ -78,20 +76,22 @@ We will first compile a working C cross compiler without a libc and add it later
```bash
cd ../build-gcc
../gcc-*/configure \
--prefix="../sysroot" \
--target="sh3eb-elf" \
--with-multilib-list="m3,m4-nofpu" \
--enable-languages="c,c++,ada" \
--without-headers \
--program-prefix="sh-elf-" \
--enable-libssp \
--enable-lto \
--enable-clocale="generic" \
--enable-libstdcxx-allocator \
--disable-threads \
--disable-libstdcxx-verbose \
--enable-cxx-flags="-fno-exceptions"```
../gcc-*/configure \
--prefix="$(pwd)/../sysroot" \
--target="sh3eb-elf" \
--with-multilib-list="m3,m4-nofpu" \
--enable-languages="c,c++,ada" \
--without-libada \
--without-headers \
--program-prefix="sh-elf-" \
--enable-libssp \
--enable-lto \
--enable-clocale="generic" \
--enable-libstdcxx-allocator \
--disable-threads \
--disable-libstdcxx-verbose \
--enable-cxx-flags="-fno-exceptions"
```
TODO: Da fuck all these flags for?
| Column1 | Column2 |
@ -121,9 +121,10 @@ LIBDIR="$COMPILER_DIR"
INCDIR="$COMPILER_DIR/include"
git clone https://git.planet-casio.com/Lephenixnoir/OpenLibm.git
cd OpenLibm
make USEGCC=1 TOOLPREFIX=sh-elf- AR=sh-elf-ar CC=sh-elf-gcc \
libdir="$LIBDIR" includedir="$INCDIR" \
install-static-superh install-headers-superh
make USEGCC=1 TOOLPREFIX=sh-elf- AR=sh-elf-ar CC=sh-elf-gcc libdir="$(pwd)/../sysroot/lib/gcc/sh3eb-elf/15.2.0/" includedir="$(pwd)/../sysroot/lib/gcc/sh3eb-elf/15.2.0/include" install-static-superh install-headers-superh
# make USEGCC=1 TOOLPREFIX=sh-elf- AR=sh-elf-ar CC=sh-elf-gcc \
# libdir="$LIBDIR" includedir="$INCDIR" \
# install-static-superh install-headers-superh
```
Now we install the actual libc
@ -131,7 +132,7 @@ Now we install the actual libc
```bash
git clone https://git.planet-casio.com/Vhex-Kernel-Core/fxlibc.git
cd fxlibc
cmake -B build-casiowin-cg -DFXLIBC_TARGET=casiowin-cg -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-sh.cmake -DCMAKE_INSTALL_PREFIX="$SYSROOT"
cmake -B build-gint -DFXLIBC_TARGET=gint -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-sh.cmake -DCMAKE_INSTALL_PREFIX="$SYSROOT" #instead of Sysroot use lib/gcc/15.2.0
make -C build-casiowin-cg
make -C build-casiowin-cg install
```

5
clean.sh Executable file
View file

@ -0,0 +1,5 @@
rm -rf build-gcc
rm -rf build-binutils
rm -rf sysroot
rm -rf OpenLibm
rm -rf fxlibc