From f2350a41f7e33d10c5212028525e77424aa8cd47 Mon Sep 17 00:00:00 2001 From: Ada Orbit Date: Thu, 2 Apr 2026 13:05:56 +0200 Subject: [PATCH] added clean and fix README --- .gitignore | 2 ++ README.md | 45 +++++++++++++++++++++++---------------------- clean.sh | 5 +++++ 3 files changed, 30 insertions(+), 22 deletions(-) create mode 100755 clean.sh diff --git a/.gitignore b/.gitignore index 9eda451..e873da7 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ binutils-*/ gcc-*/ *.tar.gz sysroot/ +fxlibc +OpenLibm diff --git a/README.md b/README.md index 8ec6db9..d5e4798 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/clean.sh b/clean.sh new file mode 100755 index 0000000..05dc495 --- /dev/null +++ b/clean.sh @@ -0,0 +1,5 @@ +rm -rf build-gcc +rm -rf build-binutils +rm -rf sysroot +rm -rf OpenLibm +rm -rf fxlibc