working compiler instructions

This commit is contained in:
Ada Orbit 2026-04-05 22:21:03 +02:00
parent 6f94e52d07
commit 9836a9e372
6 changed files with 22 additions and 13 deletions

2
.gitignore vendored
View file

@ -5,3 +5,5 @@ gcc-*/
sysroot/
fxlibc
OpenLibm
libfxcg/
test

View file

@ -109,7 +109,7 @@ make -j$(nproc) all-gcc all-target-libgcc
make install-strip-gcc install-strip-target-libgcc # TODO: may need to add Ada stuff?
```
We now have successfully corss compiled gcc. However we still need to add a libc and compile gnat.
We now have successfully cross 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
```bash
@ -142,16 +142,6 @@ make -C gcc cross-gnattools
make install-strip
```
Now we install the actual libc
```bash
# git clone https://git.planet-casio.com/Vhex-Kernel-Core/fxlibc.git
# cd fxlibc
# 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 #casiowin-cg does not work? using gint instead
# make -C build-casiowin-cg install
```
> [!NOTE]
> There is also gint and vhex form the repo but those target also other calculators that I don't have access to.
> For my own sanity sake I'll just stick with the casiowin-cg
@ -180,7 +170,6 @@ make
make install/local
```
## Adding our custom compiler to GPRBuild
TODO: look into ironclad gprbuild integration

View file

@ -2,7 +2,7 @@
set -e
# Step 1. Download GCC and binutils source code
# Definitions
ADACASIO_BINUTILS_VERSION="2.46.0"
ADACASIO_GCC_VERSION="15.2.0"
ADACASIO_BINUTILS_URL="https://ftp.gnu.org/gnu/binutils/binutils-$ADACASIO_BINUTILS_VERSION.tar.gz"
@ -10,6 +10,13 @@ ADACASIO_GCC_URL="https://ftp.gnu.org/gnu/gcc/gcc-15.2.0/gcc-$ADACASIO_GCC_VERSI
ADACASIO_PREFIX="$(pwd)/sysroot"
ADACASIO_TARGET="sh-elf"
# Install dependencies
# For now I have only tested Fedora 43. YMMV
sudo -i
dnf install mg
dnf upgrade
dnf install @c-development gnat gprbuild gmp-devel mpfr-devel libmpc-devel git
# prepare configure and build enviornment
wget -O binutils.tar.gz $ADACASIO_BINUTILS_URL
wget -O gcc.tar.gz $ADACASIO_GCC_URL

1
libfxcg Submodule

@ -0,0 +1 @@
Subproject commit daa76d9e37758ab5b9b0f614b7e0aa6acfbe2e18

6
test/program.adb Normal file
View file

@ -0,0 +1,6 @@
package body Program is
procedure Main is
begin
null;
end Main;
end Program;

4
test/program.ads Normal file
View file

@ -0,0 +1,4 @@
package Program is
procedure Main;
pragma Export (C, Main, "main");
end Program;