tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Re: Cross compiling for riscv64 on arm64


From: Detlef Riekenberg
Subject: Re: [Tinycc-devel] Re: Cross compiling for riscv64 on arm64
Date: Sat, 18 Feb 2023 23:12:02 +0100


For tcc, it should make no difference in the code,
if your system is a x86_64 or an aarch64 machine,
but i expect, that tcc on aarch64 is far less tested.

And yes, an full assembler for riscv64 is missing in tcc.

For your issues with the missing "crt1.o" and "crti.o" files:
These are the startup files and they are provided by
by the c runtime library. (dev package)
For the gnu c library, they are in the cross dev packages
in your linux distro.

A gcc cross compiler package is always specific:
one host, one target(family),
but you can try zig.

While the package is designed/created for the zig language,
zig is also a c and a c++ compiler
(mostly based on clang and llvm).

The interesting part of zig is also the fact,
that all targets are supported in one package
and that the c and c++ runtime libraries
are included in source form and compiled
for each target.

And the zig downloads are not only x86_64 and x86,
but also for running zig on aarch64 systems
(linux, windows, macos)
See the downloads at https://ziglang.org/downloads
and you might want to try: zig-linux-aarch64-*

zig cc -target riscv64-linux-musl
zig c++ -target riscv64-linux-musl

supported targets:
( https://ziglang.org/learn/overview/#support-table )


--
bye bye ... Detlef

Am 10.02.23, 11:21 schrieb Sagar Acharya via Tinycc-devel <tinycc-devel@nongnu.org>:
I have this feature request. Can you please add asm support for riscv64 cross compiler built on arm64?
Thanking you
Sagar Acharya
https://designman.org



7 Feb 2023, 21:22 by sagaracharya@tutanota.com:

> musl isn't compiled for riscv64. I tried to compile musl-1.2.3 with
>
> cd musl-1.2.3
> ./configure --target=riscv64 CC=riscv64-tcc
> make
>
> It shows an error which has asm module
>
> __asm__(....);
>
> I think current riscv64 cross compiler doesn't support asm. Is riscv64-asm.c for physical hardware based on rv64 processor and not for cross compilation?
>
> Thanking you
> Sagar Acharya
> https://designman.org
>
>
>
> 6 Feb 2023, 23:39 by sagaracharya@tutanota.com:
>
>> I built a cross-compiler with
>>
>> ./configure --config-musl
>> make cross-riscv64
>>
>> On using the built riscv64-tcc to compile, I get,
>>
>> tcc: error: file 'crt1.o' not found
>> tcc: error: file 'crti.o' not found
>> error: include file 'stdint.h' not found
>>
>> Please help.
>>
>>
>> Thanking you
>> Sagar Acharya
>>
>>
>>
>> 6 Feb 2023, 21:17 by sagaracharya@tutanota.com:
>>
>>> I built an older commit successfully for
>>>
>>> --config-musl
>>>
>>> Can you help me with how to build tcc on arm64 to cross-compile a program for riscv64?
>>>
>>>
>>> Thanking you
>>> Sagar Acharya
>>> https://designman.org
>>>
>>
>>

_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

reply via email to

[Prev in Thread] Current Thread [Next in Thread]