1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 09:37:44 +00:00

Toolchain: Add (basic) support for riscv64

This makes `ARCH=riscv64 Toolchain/BuildGNU.sh` work, but the patches
might not be completely correct.
This commit is contained in:
Sönke Holz 2023-08-10 12:55:29 +02:00 committed by Daniel Bertalan
parent 68924a8e81
commit 9522794a0e
5 changed files with 136 additions and 27 deletions

View file

@ -19,17 +19,17 @@ Co-Authored-By: Brian Gianforcaro <bgianf@serenityos.org>
Co-Authored-By: Philip Herron <herron.philip@googlemail.com>
Co-Authored-By: Shannon Booth <shannon@serenityos.org>
---
gcc/config.gcc | 19 ++++++++++++++
gcc/config.gcc | 23 +++++++++++++++++
gcc/config/i386/serenity.h | 7 ++++++
gcc/config/serenity.h | 51 ++++++++++++++++++++++++++++++++++++++
gcc/config/serenity.opt | 35 ++++++++++++++++++++++++++
4 files changed, 112 insertions(+)
4 files changed, 116 insertions(+)
create mode 100644 gcc/config/i386/serenity.h
create mode 100644 gcc/config/serenity.h
create mode 100644 gcc/config/serenity.opt
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 6fd1594480a1d2054f499573b498781dfafd1d93..8e3d6c378796f324b904a7c58b274472362600fb 100644
index 6fd1594480a1d2054f499573b498781dfafd1d93..6f4fc0f34f4c19c7371d5431aad86f9b0652342b 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -690,6 +690,18 @@ x86_cpus="generic intel"
@ -43,7 +43,7 @@ index 6fd1594480a1d2054f499573b498781dfafd1d93..8e3d6c378796f324b904a7c58b274472
+ extra_options="${extra_options} serenity.opt"
+ tmake_file="t-slibgcc"
+ case ${target} in
+ aarch64*-* | x86_64-*)
+ aarch64*-* | riscv64-* | x86_64-*)
+ default_gnu_indirect_function=yes
+ ;;
+ esac
@ -51,7 +51,7 @@ index 6fd1594480a1d2054f499573b498781dfafd1d93..8e3d6c378796f324b904a7c58b274472
*-*-darwin*)
tmake_file="t-darwin "
tm_file="${tm_file} darwin.h"
@@ -1126,6 +1138,13 @@ case ${target} in
@@ -1126,6 +1138,17 @@ case ${target} in
esac
case ${target} in
@ -61,6 +61,10 @@ index 6fd1594480a1d2054f499573b498781dfafd1d93..8e3d6c378796f324b904a7c58b274472
+aarch64*-*-serenity*)
+ tm_file="${tm_file} elfos.h glibc-stdint.h aarch64/aarch64-elf.h serenity.h"
+ tmake_file="${tmake_file} aarch64/t-aarch64"
+ ;;
+riscv64-*-serenity*)
+ tm_file="${tm_file} elfos.h glibc-stdint.h riscv/elf.h serenity.h"
+ tmake_file="${tmake_file} riscv/t-riscv"
+ ;;
aarch64*-*-elf | aarch64*-*-fuchsia* | aarch64*-*-rtems*)
tm_file="${tm_file} elfos.h newlib-stdint.h"