Commit graph

4 commits

Author SHA1 Message Date
Ekaitz Zarraga f9efe47257 lib: Add missing (empty) crt files for RISC-V.
These are needed by the build scripts, but in RISC-V being empty is
enough.

* lib/linux/riscv64-mes-gcc/crti.c,
lib/linux/riscv64-mes-gcc/crtn.c,
lib/linux/riscv64-mes-tcc/crti.c,
lib/linux/riscv64-mes-tcc/crtn.c: New files.
2023-11-05 14:45:38 +01:00
Andrius Štikonas f49689d31a DRAFT riscv64: Fix arguments of main function in tcc.
* lib/linux/riscv64-mes-tcc/crt1.c

Co-authored-by: Ekaitz Zarraga <ekaitz@elenq.tech>.
2023-11-05 09:45:31 +01:00
Andrius Štikonas 958da104e5 DRAFT riscv64: simplify assembly constructs not supported by tcc.
At the moment tcc does not support assembler instructions
with C expression operands. As a workaround read values
directly from stack.

* lib/linux/riscv64-mes-tcc/_exit.c
* lib/linux/riscv64-mes-tcc/_write.c
* lib/linux/riscv64-mes-tcc/syscall.c
2023-11-05 09:45:31 +01:00
Ekaitz Zarraga 10054b2f17 riscv64: add support for tcc
Adapted from -gcc but make assembly match tcc style assembly where the
offsets are received as an extra input argument:

  sw a0, 9(t0)

Becomes:

  sw a0, t0, 9

* lib/linux/riscv64-mes-tcc/_exit.c,
lib/linux/riscv64-mes-tcc/_write.c,
lib/linux/riscv64-mes-tcc/crt1.c,
lib/linux/riscv64-mes-tcc/exit-42.S,
lib/linux/riscv64-mes-tcc/hello-mes.S,
lib/linux/riscv64-mes-tcc/syscall-internal.c,
lib/linux/riscv64-mes-tcc/syscall.c: New files.
2023-11-05 09:45:31 +01:00