TinyC upgrade (#6593)

This commit is contained in:
Dmitry Atamanov 2017-10-28 10:25:56 +03:00 • committed by Andreas Rumpf
commit d2c7d391c8
395 changed files with 68184 additions and 32394 deletions

View file

@ -6,40 +6,10 @@
under MS-Windows. See tcc-doc.html to have all the features.
Compilation from source:
------------------------
* You can use the MinGW and MSYS tools available at
http://www.mingw.org
Untar the TCC archive and type in the MSYS shell:
./configure
make
make install
The default install location is c:\Program Files\tcc
* Alternatively you can compile TCC with just GCC from MinGW using
win32\build-tcc.bat
To install, copy the entire contents of the win32 directory to
where you want.
Installation from the binary ZIP package:
-----------------------------------------
Unzip the package to a directory of your choice.
(Note that the binary package does not include libtcc. If you
want TCC as dynamic code generator, please use the source code
distribution.)
Set the system PATH:
--------------------
@ -48,6 +18,11 @@
system PATH.
Include and library search paths
--------------------------------
On windows, the standard "include" and "lib" directories are searched
relatively from the location of the executables (tcc.exe, libtcc.dll).
Examples:
---------
@ -61,29 +36,45 @@
tcc hello_win.c
for the 'Hello DLL' example type
For the 'Hello DLL' example type
tcc -shared dll.c
tiny_impdef dll.dll (optional)
tcc -impdef dll.dll (optional)
tcc hello_dll.c dll.def
Using libtcc as JIT compiler in your program
--------------------------------------------
Check out the 'libtcc_test' example:
- Running it from source:
tcc -I libtcc libtcc/libtcc.def -run examples/libtcc_test.c
- Compiling with TCC:
tcc examples/libtcc_test.c -I libtcc libtcc/libtcc.def
- Compiling with MinGW:
gcc examples/libtcc_test.c -I libtcc libtcc.dll -o libtcc_test.exe
- Compiling with MSVC:
lib /def:libtcc\libtcc.def /out:libtcc.lib
cl /MD examples/libtcc_test.c -I libtcc libtcc.lib
Import Definition Files:
------------------------
To link with Windows system DLLs, TCC uses import definition
files (.def) instead of libraries.
The included 'tiny_impdef' program may be used to make additional
.def files for any DLL. For example:
The now built-in 'tiny_impdef' program may be used to make
additional .def files for any DLL. For example
tiny_impdef.exe opengl32.dll
tcc -impdef [-v] opengl32.dll [-o opengl32.def]
Put opengl32.def into the tcc/lib directory. Specify -lopengl32 at
the TCC commandline to link a program that uses opengl32.dll.
Header Files:
-------------
The system header files (except _mingw.h) are from the MinGW
@ -92,8 +83,8 @@
http://www.mingw.org/
From the windows headers, only a minimal set is included. If you need
more, get MinGW's "w32api" package.
more, get MinGW's "w32api" package. Extract the files from "include"
into your "tcc/include/winapi" directory.
Resource Files:
@ -105,34 +96,55 @@
tcc app.c appres.o -o app.exe
Tiny Libmaker:
--------------
The included tiny_libmaker tool by Timovj Lahde can be used as
The now built-in tiny_libmaker tool by Timovj Lahde can be used as
'ar' replacement to make a library from several object files:
tiny_libmaker [rcs] library objectfiles ...
tcc -ar [rcsv] library objectfiles ...
Compilation from source:
------------------------
* You can use the MinGW and MSYS tools available at
http://www.mingw.org
http://www.mingw-w64.org
http://www.msys2.org
Untar the TCC archive and type in the MSYS shell:
./configure [--prefix installpath]
make
make install
The default install location is c:\Program Files\tcc
Cygwin can be used too with its mingw cross-compiler installed:
./configure --cross-prefix=i686-w64-mingw32-
(the prefix may vary)
* Alternatively you can compile TCC with just GCC from MinGW using
> build-tcc.bat (from the win32 directory)
Also MSVC can be used with the "VSTools Developer Command Prompt":
> build-tcc.bat -c cl
or with an existing tcc (needs to be in a different directory)
> build-tcc.bat -c some-tcc-dir\tcc.exe
Also you can copy/install everything into another directory:
> build-tcc.bat -i <dir>
Limitations:
------------
- On the object file level, currently TCC supports only the ELF format,
not COFF as used by MinGW and MSVC. It is not possible to exchange
object files or libraries between TCC and these compilers. However
libraries for TCC from objects by TCC can be made using tiny_libmaker
or MinGW's ar.
object files or libraries between TCC and these compilers.
However libraries for TCC from objects by TCC can be made using
tcc -ar lib.a files.o ,,,
- No leading underscore is generated in the ELF symbols.
- With DLLs, only functions (not data) can be im-/exported.
- Bounds checking (option -b) is not supported currently.
- 64-bit systems are not (yet) supported.
Documentation and License:
--------------------------
TCC is distributed under the GNU Lesser General Public License. (See
@ -143,7 +155,6 @@
http://fabrice.bellard.free.fr/tcc/
WinAPI Help and 3rd-party tools:
--------------------------------
The Windows API documentation (Win95) in a single .hlp file is
@ -154,5 +165,4 @@
"ResEd", available at the RadASM website.
--- grischka