[Top][All Lists]

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

Re: [Tinycc-devel] tcc (arm) vs gcc

From: Sven Oliver Moll
Subject: Re: [Tinycc-devel] tcc (arm) vs gcc
Date: Thu, 7 Sep 2006 00:06:00 +0200 (CEST)

On Wed, 6 Sep 2006, Jens Thiele wrote:

Perhaps it would be a good idea to modify gcc/binutils to be suitable in
such a scenario instead? (I would especially like to see a libtcc pendant)
What do you think?

I think that's _way_ more work than getting tcc to work in a selfhosted arm

Problems I could think of:
- licensing issues (tcc: LGPL vs. gcc: GPL)
- compilation speed/memory usage (process startup costs)
- in memory compilation instead of using files

The problem I'm thinking of is where you want to head to. gcc has a higher
"cost" (slower uses more memory) during compilation, but creates faster
code. tcc is about 10 times faster during compilation, but the generated
code is also twice as slow. (These figures a rough guesses from what I
remember reading on this list.)

Probably it is not realistic in an "embedded scenario" (for now) but it
would still be a nice to have on the "desktop/server"?

For that I would create some wrappercode that runs gcc, create a dll for
it and use that one via dlopen(). That would get some similar effect with
much less development time.

Trying a quick shot on compiling a selfhosted arm compiler I encounter the
following issues:

tcc.c:9528:2: warning: #warning add arch specific rt_get_caller_pc()

libtcc1.c:140:2: #error unsupported CPU type
libtcc1.c: In function `__udivmoddi4':
libtcc1.c:169: warning: implicit declaration of function `udiv_qrnnd'
libtcc1.c:292: warning: implicit declaration of function `count_leading_zeros'
libtcc1.c:306: warning: implicit declaration of function `sub_ddmmss'
libtcc1.c:334: warning: implicit declaration of function `umul_ppmm'

The ones from libtcc1.c are inline assembler defines, which need to be ported from i386 to arm. I guess these might be "borrowed" from glibc.

The first one needs a small function (guessed ~20 lines of code), that
- according to a comment - should "return the PC at [a given] frame level."

This doesn't seem to be that much and should be doable. I've got no knowledge about coding in either i386- or arm-assembler. But someone on
this list should at least be able to port the inline assembler functions
to C, so they could be included that way. It might be a slow running approach, but at least something that gets us on the road.

Greetings from Germany,
|  _______       |
| (  /\          | I fell in love with my killer, this is hijacked emotion,
|__)v\/lli a.k.a.| Throwing kisses with a machine-gun, in the name of devotion.
|Sven Oliver Moll|   -- Escape With Romeo, "Somebody"

reply via email to

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