Commit Graph

657 Commits (d63ec6f20dc7e29e266589458ea90fb56f8c86ea)
 

Author SHA1 Message Date
Ali Gholami Rudi d63ec6f20d fill got table for static linking 2010-02-05 08:25:48 +03:30
Alexandre Becoulet b9aeac0a64 Fixed bug which prevent tcc preprocessor to ignore line number directives 2010-02-01 18:08:51 +01:00
Nikos Mavrogiannopoulos 253bad7993 Added patch to detect and use the paths for 64bit libraries as
used by CentOS (affects X86_64 only).
2010-01-28 08:27:38 +01:00
Detlef Riekenberg 900871ca8d Dump the current token in skip(), when it's not the expected token 2010-01-27 00:02:33 +01:00
Detlef Riekenberg 62ba135228 Add support for --help 2010-01-26 22:58:48 +01:00
Detlef Riekenberg a975008ae7 Add support for the __mode__ attribute
--
By by ... Detlef
2010-01-26 22:56:22 +01:00
Detlef Riekenberg 2650584ac4 Recognize -Wl,-Bsymbolic
Without -Bsymbolic, a symbol/function in a *.so can be overridden
by a symbol/function in the main module.
That is the default search order, but not supported by tcc.

With -Bsymbolic, the linker tries to resolve a symbol/function in
the current module first.
The loader in tcc implements this search order.

We do not distinguish -Bsymbolic and -Bsymbolic-function

--
By by ... Detlef
2010-01-26 22:55:14 +01:00
Detlef Riekenberg 5caf6235cf Makefile: Delete tcc-doc.html during 'make distclean' 2010-01-26 22:53:52 +01:00
grischka 3aa26a794e win32: adjust for mingw32 winapi packages
Note: the files in tcc/win32/include/winapi are now from the
mingw-w64 project, however with this fix using mingw32 winapi
should still work.
2010-01-26 22:18:03 +01:00
grischka a40814cc9d tccpp: signal missing #endif error 2010-01-14 21:00:05 +01:00
grischka 4e5170d4a5 tccpp: convert TOK_GET macro into function 2010-01-14 20:59:44 +01:00
grischka 280e20b1d3 tccpp: warn about #define redefinition 2010-01-14 20:59:44 +01:00
grischka e20bf69ac5 win64: defined size_t and ptrdiff_t to unsigned long long 2010-01-14 20:59:43 +01:00
grischka b0abcfde9d win32: cleanup include 2010-01-14 20:59:43 +01:00
grischka 5299142286 x86-64: use uplong for symbol values 2010-01-14 20:59:42 +01:00
grischka 2341ee5142 tccpe: improve dllimport/export and use for tcc_add_symbol 2010-01-14 20:59:42 +01:00
grischka bdb9387a74 win32: readme: add libtcc_test example 2010-01-14 20:59:41 +01:00
grischka 903b6001e7 update Makefiles 2009-12-20 20:34:35 +01:00
grischka 0de95730ad build from multiple objects: fix other targets 2009-12-20 20:33:41 +01:00
grischka b54862406e x86-64: fix gtst, back to only 5 regs for now 2009-12-20 20:33:21 +01:00
grischka 070b86a870 x86-64: use r8/r9 as generic integer registers 2009-12-20 02:19:51 +01:00
grischka 0e5c0ee045 x86-64: use r8,r9 as load/store registers 2009-12-20 01:54:39 +01:00
grischka cda8c41ef3 win32: add size_t to _mingw.h 2009-12-20 01:54:38 +01:00
grischka 4a01eb09d8 use vpushv in some places 2009-12-20 01:54:38 +01:00
grischka 50b040ef83 win64: add tiny unwind data for setjmp/longjmp
This enables native unwind semantics with longjmp on
win64 by putting an entry into the .pdata section for
each compiled fuction.

Also, the function now use a fixed stack and store arguments
into X(%rsp) rather than using push.
2009-12-20 01:54:37 +01:00
grischka 88a3ccab9f allow tcc be build from separate objects
If you want that, run: make NOTALLINONE=1
2009-12-20 01:53:49 +01:00
grischka 7fa712e00c win32: enable bounds checker & exception handler
exception handler borrowed from k1w1. Thanks.
2009-12-19 22:22:43 +01:00
grischka 8bbde91f62 tcc_relocate: revert to 0.9.24 behavior 2009-12-19 22:16:23 +01:00
grischka 3db219477a tccrun: new file
factor out -run support
2009-12-19 22:16:22 +01:00
grischka 41e112360f fix uninitialized warnings with 'type.ref' 2009-12-19 22:16:22 +01:00
grischka 3020a4765d tccpe: with -l try also with "lib" prefix
-lfoo searches: foo.def, libfoo.def, foo.dll, libfoo.dll
2009-12-19 22:16:21 +01:00
grischka 94bf4d2c22 tccpe: improve dllimport 2009-12-19 22:16:21 +01:00
grischka 1308e8ebcf integrate x86_64-asm.c into i386-asm.c
Also, disable 16bit support for now as it causes bugs
in 32bit mode.  #define I386_ASM_16 if you want it.
2009-12-19 22:16:20 +01:00
grischka e81569bc70 tcc: add "-Wl,-rpath=path" option (library search path) 2009-12-19 22:16:20 +01:00
grischka dd3d4f7295 x86-64: fix udiv, add cqto instruction 2009-12-19 22:16:19 +01:00
grischka 1445fea582 tccpe: allow linkage to extern symbols from asm 2009-12-19 22:16:18 +01:00
grischka b5e2238483 tccasm: make VT_VOID symbols ST_NOTYPE, elf-wise
This was confusing objdump such that it did not print
disassembly with -d.

Also, put filename as with C compilation
2009-12-19 22:16:18 +01:00
grischka ab4a4ab25e x86-64: in gv(): ignore second register 2009-12-19 22:16:17 +01:00
grischka d79b867d55 win64: adjust for two args with setjmp(buf,ctx) 2009-12-19 22:16:17 +01:00
Christian Jullien 614790dc14 x86-64: Fix Wrong comparisonbetweenpointerandlongcste
main (int argc, char *argv[])
{
    char *p = (char *)0x12345678ABCD000F;
    int res;
    res = (p != (char *)0x12345678ABCD000F);
    return res;
}
2009-12-19 22:16:16 +01:00
grischka e500c9118a i386-asm: fix imul
With imul the 3rd operand defaults to the 2nd on.  The previous
logic left 'op_type[2]' uninitialized which caused the bug to
show up only sometimes.
2009-12-06 17:41:22 +01:00
grischka 56d6abdb3d tccgen: propagate alignment from typedef
Store (part of) the AttributeDef structure in the (int)sym-r
field of the typedef symbol (kludgy).
2009-12-06 17:37:33 +01:00
bobbl c0620c8a00 avoid needless register save when storing structures
When storing structs with a memcpy call in vstore(),
so far a needless entry remaining on the vstack
sometimes resulted in an useless store generated by
save_regs() in gfunc_call() for the memcpy routine.
2009-12-01 17:59:30 +01:00
Bernhard Reutner-Fischer b573072300 document -print-search-dirs
Signed-off-by: aldot <rep.dot.nop@gmail.com>
2009-12-01 17:59:29 +01:00
Bernhard Reutner-Fischer d2e125186f improve handling of --help
Previously ./configure --prefix=/foo --help didn't show the help-text

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-12-01 17:59:29 +01:00
Luigi Rizzo 55cb2170cd solve tccelf problem on FreeBSD
On Sun, Nov 22, 2009 at 05:43:14PM +0100, Luigi Rizzo wrote:
> Hi,
> there is a well known problem with tcc and FreeBSD in the generation
> of elf objects -- see
> http://lists.gnu.org/archive/html/tinycc-devel/2005-07/msg00070.html
>
> Apparently Sergey Lyubka has tried a partial fix to the problem.
> I was wondering if Sergey or someone can post some more detail on
> what needs to be done so we can try to help fixing this issue

I think i have managed to solve the problem and produce
almost valid elf files on FreeBSD. The two patches attached
address a few problems (trying to explain to the
best of my knowledge; i am not very familiar with ELF and
the FreeBSD ELF conventions):

1. ELF file format
  tcc produces an ELF executable which is good for linux but
  not for FreeBSD. It misses the PHDR section which is almost
  mandatory for shared executables, puts in the .dynsym section
  some relocation info that FreeBSD expects to be in .got,
  and expect the relocation sections to be contiguous.

  patch-tccelf.c tries to address the above problem using
  conditional sections (so hopefully can be imported upstream)
  and also adds the ability to override the name of the dynamic
  loader through an environment variable (this is important to
  debug tcc).

2. predefined macros

  patch-libtcc.c adds/fixes some predefined macros when compiling
  on FreeBSD: these are __FreeBSD__ and the usual set of
  __i386__ and __unix__ variants.
  It also sets __INTEL_COMPILER so we can grab the __aligned
  macro from cdefs.h , otherwise many programs would fail

The resulting elf file is still not 100% correct -- if you strip it,
the program will not run (presumably there is some dangling reference).
Other than that, program do seem to run correctly.

It would be nice to integrate these patches in the main repository.
The FreeBSD specific code is in #ifdef so it should not harm
linux users
	cheers
	luigi
2009-12-01 17:59:28 +01:00
grischka 720a32ede4 win32: remove #define alloca from mingw headers 2009-12-01 17:58:39 +01:00
grischka 679f0794f8 win32: explain usage of mingw w32api package 2009-11-30 17:14:41 +01:00
grischka a5279b2c05 tccpe: fclose FILE*
Reported by Martin Ettl (thanks)
2009-11-30 17:14:37 +01:00
grischka a26bf10de3 win64: Use tcc's own assembler
Now that we have it thanks to Mr. Féret
2009-11-21 23:43:38 +01:00