tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] Re: Tinycc-devel Digest, Vol 10, Issue 1


From: Dave Long
Subject: [Tinycc-devel] Re: Tinycc-devel Digest, Vol 10, Issue 1
Date: Sat, 04 Oct 2003 08:30:27 -0700


> 1. How does TCC expect its code to be loaded and run? or, How do I go
> about designing a loader and VM to run tcc code ...

Tcc will "load" and run code itself,
using the '-run' option, or it can
act as a traditional toolchain, and
then it generates ELF.

> 2. How do I write special modules such as the boot immage which must be
> linked in such a way that certain structures in the binary, such as the
> Multiboot header, appear in the correct format and within the necessary
> address range? 

GRUB likes ELF, so if you use it, you
are in luck.  As far as getting the
Multiboot header in the right place,
it's a matter of learning:
        - how object order affects linking
        - how C structs appear in an object
and, if brute force is required,
        - how to use (inline) assembler
        
Tcc contains an assembler and linker, so
the above can be done with easy reference
to the source.

:: :: ::

> When I try to compile in a `foreign' linux, tinycc reports missing
> /usr/lib/crt[01n].o files.  Also, how can I use the standard C header
> file names, such as stdio.h?

When I cross-compile, I make sure to use
-nostdinc and -nostdlib to avoid picking
up any host files, and then -I and -L as
necessary to find the target files.

Of course, if you are using tcc for native
compilation on a system without any another
compilers, it should be possible to install
tcc headers and libraries in the standard
places.

If all else fails, you may wish to take a
look at CONFIG_TCC_CRT_PREFIX.

-Dave




reply via email to

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