On 1/29/26 11:17, Sagar Acharya wrote:
So what should I do during configure script?

You should not use "--cpu=...".  This would build a tcc
which thinks that it's on riscv, while it's running on arm.

For example. arm64-tcc knows __uint128_t, but riscv64-tcc does
not. (See include/tccdefs.h)

Anyway. Type 'make help' and read:

To build tcc and all cross compilers:
   ./configure --enable-cross
   make
   make test
   sudo make install

To build only the riscv64 cross compiler:
   ./configure
   make cross-riscv64
   sudo make install

To check its paths:
   riscv64-tcc -vv

   tcc version 0.9.28rc (riscv64 Linux)
   install: /usr/local/lib/tcc
   include:
     /usr/local/lib/tcc/include
     /usr/riscv64-linux-gnu/include
   libraries:
     /usr/local/lib/tcc
     /usr/riscv64-linux-gnu/lib
   libtcc1:
     /usr/local/lib/tcc/riscv64-libtcc1.a
   crt:
     /usr/riscv64-linux-gnu/lib
   elfinterp:
     /lib/ld-linux-riscv64-lp64d.so.1

As you can see, this riscv64-tcc in order to work wants
includes, libs, crtx.o for riscv64 in /usr/riscv64-linux-gnu/...

You can install them on debian systems for example with:
   apt install libc6-dev-riscv64-cross
You can also copy those files from the target system instead.
You can also make riscv64-tcc look in other places.
See 'make help' about 'config-extra.mak'

-- gr


_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to