Add custom target for compiling relibc-freestanding for riscv64gc

This commit is contained in:
Jeremy Soller 2025-04-17 10:10:29 -06:00
parent fce1ea9e43
commit 5e3bcaee08
No known key found for this signature in database
GPG Key ID: 670FDFB5428E05CA
3 changed files with 45 additions and 0 deletions

View File

@ -234,6 +234,7 @@ else
export PATH="$(PREFIX_FREESTANDING_PATH):$$PATH" && \
export CARGO="env -u CARGO -u RUSTUP_TOOLCHAIN cargo" && \
export CC_$(subst -,_,$(TARGET))="$(GNU_TARGET)-gcc -isystem $(ROOT)/$@.partial/$(GNU_TARGET)/include" && \
export RUST_TARGET_PATH="$(ROOT)/targets" && \
$(MAKE) clean && \
$(MAKE) -j 1 all && \
$(MAKE) -j 1 install DESTDIR="$(ROOT)/$@.partial/$(GNU_TARGET)"

3
targets/README Normal file
View File

@ -0,0 +1,3 @@
This contains a target definition for targets that Redox supports but have not
yet been added to the upstream rust, specifically for compiling relibc in
freestanding mode.

View File

@ -0,0 +1,41 @@
{
"arch": "riscv64",
"code-model": "medium",
"cpu": "generic-rv64",
"crt-objects-fallback": "false",
"crt-static-allows-dylibs": true,
"crt-static-default": true,
"crt-static-respected": true,
"data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128",
"dynamic-linking": true,
"env": "relibc",
"features": "+m,+a,+f,+d,+c",
"has-rpath": true,
"has-thread-local": true,
"late-link-args": {
"gnu-cc": [
"-lgcc"
],
"gnu-lld-cc": [
"-lgcc"
]
},
"linker-flavor": "gnu-cc",
"llvm-abiname": "lp64d",
"llvm-target": "riscv64-unknown-redox",
"max-atomic-width": 64,
"metadata": {
"description": null,
"host_tools": null,
"std": null,
"tier": null
},
"os": "redox",
"plt-by-default": false,
"position-independent-executables": true,
"relro-level": "full",
"target-family": [
"unix"
],
"target-pointer-width": "64"
}