NOT WORKING

This commit is contained in:
Ada Orbit 2026-04-03 12:20:22 +02:00
parent f2350a41f7
commit 71a50b1871
2 changed files with 46 additions and 20 deletions

View file

@ -66,8 +66,6 @@ make -j$(nproc)
make install-strip 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. We now configure and install `gcc` using the same steps but with different flags.
### Configuring GCC (Part 1) ### Configuring GCC (Part 1)
@ -111,30 +109,39 @@ make -j$(nproc) all-gcc all-target-libgcc
make install-strip-gcc install-strip-target-libgcc # TODO: may need to add Ada stuff? make install-strip-gcc install-strip-target-libgcc # TODO: may need to add Ada stuff?
``` ```
### Adding libc We now have successfully corss compiled gcc. However we still need to add a libc and compile gnat.
For that we will have to install the required headers into the correct coresponding direcotry
We will now install a libc implementation that works on the CG50. For that we will use [OpenLibm](https://git.planet-casio.com/Lephenixnoir/OpenLibm) and [fxlibc](https://git.planet-casio.com/Vhex-Kernel-Core/fxlibc/)
```bash ```bash
COMPILER_DIR="$(sh-elf-gcc --print-file-name=.)" #TODO: maybe more elegant way to search for path? cd ..
LIBDIR="$COMPILER_DIR" export PATH="$PATH:$(pwd)/sysroot/bin"
INCDIR="$COMPILER_DIR/include" PREFIX="$(sh-elf-gcc --print-file-name=.)"
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="$(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 The `PREFIX` directory is where gcc is going to look for all the system headers.
# make USEGCC=1 TOOLPREFIX=sh-elf- AR=sh-elf-ar CC=sh-elf-gcc \
# libdir="$LIBDIR" includedir="$INCDIR" \ ### Adding libc
# install-static-superh install-headers-superh
We will now install a libc implementation that works on the CG50. For that we will use [OpenLibm](https://git.planet-casio.com/Lephenixnoir/OpenLibm) and [libfxcg](https://github.com/Jonimoose/libfxcg.git)
```bash
git clone https://github.com/Jonimoose/libfxcg.git
cd libfxcg/libc
```
replace all the `sh3eb-` with `sh-elf`
```bash
make
cp the lib files to gcc dir
``` ```
Now we install the actual libc 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-gint -DFXLIBC_TARGET=gint -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-sh.cmake -DCMAKE_INSTALL_PREFIX="$SYSROOT" #instead of Sysroot use lib/gcc/15.2.0 # cmake -B build-gint -DFXLIBC_TARGET=gint -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-sh.cmake -DCMAKE_INSTALL_PREFIX="$PREFIX" #instead of Sysroot use lib/gcc/15.2.0
make -C build-casiowin-cg # make -C build-casiowin-cg #casiowin-cg does not work? using gint instead
make -C build-casiowin-cg install # make -C build-casiowin-cg install
``` ```
> [!NOTE] > [!NOTE]
@ -152,6 +159,20 @@ make install-strip-target-libstdc++-v3
--- ---
## packaging the binary
We will need to build `mkg3a` to package the binary.
```bash
git clone https://gitlab.com/taricorp/mkg3a.git
mkdir build
cd build
cmake ..
make
make install/local
```
## Adding our custom compiler to GPRBuild ## Adding our custom compiler to GPRBuild
TODO: look into ironclad gprbuild integration TODO: look into ironclad gprbuild integration
@ -162,6 +183,7 @@ Sources used:
- https://www.planet-casio.com/Fr/forums/topic12970-1-tutoriel-installation-manuelle-de-gcc-et-du-fxsdk.html - https://www.planet-casio.com/Fr/forums/topic12970-1-tutoriel-installation-manuelle-de-gcc-et-du-fxsdk.html
- https://gcc.gnu.org/install/configure.html - https://gcc.gnu.org/install/configure.html
- https://git.planet-casio.com/Lephenixnoir/fxsdk - https://git.planet-casio.com/Lephenixnoir/fxsdk
- https://prizm.cemetech.net/Mkg3a/
--- ---
Copyright (c) 2026 Ada Orbit. All Rights Reserved. Copyright (c) 2026 Ada Orbit. All Rights Reserved.

View file

@ -3,3 +3,7 @@ rm -rf build-binutils
rm -rf sysroot rm -rf sysroot
rm -rf OpenLibm rm -rf OpenLibm
rm -rf fxlibc rm -rf fxlibc
rm -rf binutils-*/
rm -rf gcc-*/
rm -rf libfxcg
rm -rf mkg3a