Files
Manu Linares 4b13ad692a fixes for RISC-V ABI Implementation #1567 (#2937)
* fixes for RISC-V ABI Implementation #1567

Fixed RISC-V floating-point ABI by correcting the target triple to
`riscv64-unknown-linux-gnu`, adding the `target-abi` module flag, and
ensuring ABI-required CPU features are enabled.

I tested this with:
```bash
build/c3c compile-only --target linux-riscv64 rv_hello.c3
readelf -h obj/linux-riscv64/rv_hello.o | grep Flags
# Output: Flags: 0x5, RVC, double-float ABI
```

```bash
# and qemu because I don't have a riscv machine :/
qemu-riscv64-static -L /usr/riscv64-linux-gnu ./rv_hello
```

---

@lerno I purposedly left these two failing tests to clearly see the
difference.

`test/test_suite/abi/riscv64-lp64-lp64f-abi-1.c3t`
`test/test_suite/abi/riscv64-lp64-abi.c3t`

* improve Linux cross-compilation, specifically for RISC-V

- Implement automatic sysroot and CRT object discovery for RISC-V.
- Fix dynamic linker paths and emulation flags for LLD.
- Link against libgcc to resolve required arithmetic symbols.

* Update tests.

* fix linker CRT detection by centralizing host arch check

use target_host_arch() in linker.c
move target_host_arch() from hostinfo.c to target.c

* missing debug info

---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
2026-02-20 01:53:29 +01:00
..
2025-10-25 12:31:06 +02:00
2025-10-25 12:31:06 +02:00
2023-05-30 16:42:15 +02:00
2025-10-25 12:31:06 +02:00
2025-10-25 12:31:06 +02:00
2025-10-25 12:31:06 +02:00
2025-10-25 12:31:06 +02:00
2025-10-25 12:31:06 +02:00
2026-01-05 00:11:48 +01:00
2025-10-25 12:31:06 +02:00
2025-10-25 12:31:06 +02:00
2025-10-25 12:31:06 +02:00
2025-10-25 12:31:06 +02:00
2025-10-25 12:31:06 +02:00
2025-10-25 12:31:06 +02:00
2025-10-25 12:31:06 +02:00
2025-10-25 12:31:06 +02:00
2023-11-13 17:20:46 +01:00