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-*/ gcc-*/
*.tar.gz *.tar.gz
sysroot/ sysroot/
fxlibc
OpenLibm

View file

@ -38,7 +38,7 @@ mkdir build-binutils build-gcc sysroot
```bash ```bash
cd build-binutils cd build-binutils
../binutils-*/configure \ ../binutils-*/configure \
--prefix="$(sysroot)/../sysroot" \ --prefix="$(pwd)/../sysroot" \
--target="sh3eb-elf" \ --target="sh3eb-elf" \
--with-multilib-list="m3,m4-nofpu" \ --with-multilib-list="m3,m4-nofpu" \
--program-prefix="sh-elf-" \ --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 We now compile `binutils` with our custom configuration using
```bash ```bash
make -j(nproc) make -j$(nproc)
make install-strip make install-strip
``` ```
%TODO: What does configure-host do? why 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. We now configure and install `gcc` using the same steps but with different flags.
### Configuring GCC (Part 1) ### 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 ```bash
cd ../build-gcc cd ../build-gcc
../gcc-*/configure \ ../gcc-*/configure \
--prefix="../sysroot" \ --prefix="$(pwd)/../sysroot" \
--target="sh3eb-elf" \ --target="sh3eb-elf" \
--with-multilib-list="m3,m4-nofpu" \ --with-multilib-list="m3,m4-nofpu" \
--enable-languages="c,c++,ada" \ --enable-languages="c,c++,ada" \
--without-headers \ --without-libada \
--program-prefix="sh-elf-" \ --without-headers \
--enable-libssp \ --program-prefix="sh-elf-" \
--enable-lto \ --enable-libssp \
--enable-clocale="generic" \ --enable-lto \
--enable-libstdcxx-allocator \ --enable-clocale="generic" \
--disable-threads \ --enable-libstdcxx-allocator \
--disable-libstdcxx-verbose \ --disable-threads \
--enable-cxx-flags="-fno-exceptions"``` --disable-libstdcxx-verbose \
--enable-cxx-flags="-fno-exceptions"
```
TODO: Da fuck all these flags for? TODO: Da fuck all these flags for?
| Column1 | Column2 | | Column1 | Column2 |
@ -121,9 +121,10 @@ LIBDIR="$COMPILER_DIR"
INCDIR="$COMPILER_DIR/include" INCDIR="$COMPILER_DIR/include"
git clone https://git.planet-casio.com/Lephenixnoir/OpenLibm.git git clone https://git.planet-casio.com/Lephenixnoir/OpenLibm.git
cd OpenLibm cd OpenLibm
make USEGCC=1 TOOLPREFIX=sh-elf- AR=sh-elf-ar CC=sh-elf-gcc \ 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
libdir="$LIBDIR" includedir="$INCDIR" \ # make USEGCC=1 TOOLPREFIX=sh-elf- AR=sh-elf-ar CC=sh-elf-gcc \
install-static-superh install-headers-superh # libdir="$LIBDIR" includedir="$INCDIR" \
# install-static-superh install-headers-superh
``` ```
Now we install the actual libc Now we install the actual libc
@ -131,7 +132,7 @@ Now we install the actual libc
```bash ```bash
git clone https://git.planet-casio.com/Vhex-Kernel-Core/fxlibc.git git clone https://git.planet-casio.com/Vhex-Kernel-Core/fxlibc.git
cd fxlibc 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
make -C build-casiowin-cg install 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