[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] Using tcc for C development on Android tablet
From: |
Thomas Preud'homme |
Subject: |
Re: [Tinycc-devel] Using tcc for C development on Android tablet |
Date: |
Thu, 20 Sep 2012 17:30:51 +0200 |
User-agent: |
KMail/1.13.7 (Linux/3.2.0-3-amd64; KDE/4.8.4; x86_64; ; ) |
Le jeudi 20 septembre 2012 16:47:32, Mason a écrit :
> IIUC, it is possible to use tcc on an ARM-based Android system,
> to produce ARM machine code which can be run locally?
Absolutely, that's what I mean.
> So you'd guess the Android application (C4droid) is simply generating
> native ARM code, and running the resulting binary?
I'm not sure what does the application in the first place. Does it (compile and
then) run a source code you give it?
If yes I would assume it's used via the -run switch or script mode as you call
it.
> In that case, the app would not work on MIPS-based Android systems.
> (Because tcc cannot output MIPS machine code.)
Exactly. Script mode or not, it's not possible. Script mode works by outputing
the binary in memory instead of doing it in a file and then executing this
binary by calling the main function of this binary.
> In my example, tcc is not a cross-compiler, it would generate binaries
> for the same architecture it was compiled for. Thus for ARM-based systems,
> it would be compiled for ARM and generate ARM binaries.
>
> Even though I could compile tcc for MIPS, it is pointless if it cannot
> generate MIPS machine code to run my compiled programs.
Yes absolutely. I mentionned this possibility to explain the difference between
host and target architecture. tcc only needs support for the target
architecture, the code of tcc itself should be able to run on any architecture
linux support except I recall a comment about endianness issue so that may be
not completely true. Anyway in your case if you want tcc to be useful (that is
runs the code it generates) you need it to support the platform it runs on.
Best regards,
Thomas Preud'homme
signature.asc
Description: This is a digitally signed message part.