tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] How to build tinycc for cross-compile code for arm ta


From: grischka
Subject: Re: [Tinycc-devel] How to build tinycc for cross-compile code for arm target on x86_64 host
Date: Mon, 3 Oct 2022 19:20:44 +0200
User-agent: Mozilla/5.0 (Windows NT 6.0; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

On 02.10.2022 17:33, Giang Vĩnh Lộc wrote:
Hi all,

I will try to explain my situation as simple as I can :))

- I have x86_64 Linux machine as host
- I want to compile tcc (from source, no prebuild binary) for running tcc on 
that machine
- I have ARM Linux as target. I want to build my C code using tcc (on the 
x86_64 machine) to run on that.

How can I do this?

I tried compiling tcc on the host machine using
```
./configure --cpu=arm
make -j8
```
but it failed ...

Also, it's possible to do this on Windows? I want to compile C code using tcc 
on x86 Windows to output ARM ELF for Linux (It's likely not possible, so feel 
free to skip that)

In general it is possible to cross-compile from any host for any
target that is supported by tcc.

To build and use an arm-eabihf-tcc, for example:

  $ ./configure
  $ make cross-arm-eabihf
  $ sudo make install

  $ arm-eabihf-tcc -v hello.c

Of course, the cross-compiler needs to know where to find the header
files, crtX.o's and libraries for that target.  It might work out of
the box if those files are present in /usr/arm-linux-gnueabihf for
example.  Otherwise it is possible to create a "config-extra.mak"
manually.  See "$ make help".

The commit comment here shows how a cross-compiler for android-armeabi-v7a
can be made on windows (as well as on any other host).

https://repo.or.cz/tinycc.git/commitdiff/09808f327f1d22c4cc5a2c7f96ba65be7ee9affa

-- gr

Thank you so much!
giangvinhloc610


_______________________________________________
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]