tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] How to force TinyCC to compile code to ARMv4 code instead


From: Giang Vĩnh Lộc
Subject: [Tinycc-devel] How to force TinyCC to compile code to ARMv4 code instead of ARMv6 like in current version, and how to generate Thumb-1 code instead of ARM code?
Date: Sat, 8 Oct 2022 17:35:09 +0700

Hello!

I was the guy who asked the question in the thread https://lists.nongnu.org/archive/html/tinycc-devel/2022-10/msg00004.html

The compiler works well (as least for now).

I compile a C source file (call it `main.c`), with `arm-tcc main.c -o main.o`, then parse the output ELF file with `readelf -A main.o`, and the result said that the file has the target instruction of ARMv6.

But I actually need the code to be compiled to ARMv4, particularly for ARM7TDMI-S cpus. In GCC, there was an option `-march=` to specify the target CPU to run on, therefore generate the instructions properly. But I can't see an option like this in tcc.

In `./configure`, there is a variable called `cpuver` (https://github.com/TinyCC/tinycc/blob/0fd7376000c68784d82464875bb1a6be58c63b29/configure#L221), but I believe this is only for building the correct tcc for running on *the host*

My question is, how can I force TinyCC to compile code to ARMv4 code instead of ARMv6 like in current version?

Also another question: output of arm-tcc is usually in ARM32 instructions. How can I force tcc to output Thumb-1 code? Is there any options like `-mthumb` on GCC?

Thank you!

reply via email to

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