aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* switch: collect case ranges first, then generate codePavlas, Zdenek2016-09-301-49/+65
| | | | | Collect cases first, then emit lookup code. Elliminates jumps to implement pass-through and jumps to link cases.
* Prevent tail spin crash when option -pthread is used.Jean-Claude Beaudoin2016-09-291-2/+4
|
* Use etags to produce target TAGS.Jean-Claude Beaudoin2016-09-291-1/+1
|
* Rein in unintended external functions on Windows.Jean-Claude Beaudoin2016-09-274-5/+7
|
* More properly propagate ONE_SOURCE.Jean-Claude Beaudoin2016-09-271-1/+8
|
* pstrcpy looks to be needed by Windows win32/win64 builds. Reverted as ↵Christian Jullien2016-09-262-2/+2
| | | | PUB_FUNC to allow tcc.exe build again.
* Merge branch 'mob' of git://repo.or.cz/tinycc into mypatchChristian Jullien2016-09-265-20/+20
|\ | | | | | | Add Visual Studio processor identification
| * Rein in unintended external functions.Jean-Claude Beaudoin2016-09-255-20/+20
| |
* | Add Microsoft processor identificationChristian Jullien2016-09-261-0/+6
|/
* Fix test for __*LP*__ predefined macrosChristian Jullien2016-09-251-11/+11
|
* Improve __*LP*__ predefined macrosChristian Jullien2016-09-251-2/+9
|
* Add test for __*LP*__ predefined macrosChristian Jullien2016-09-252-0/+39
|
* x86_64/elf: only variadic calls need raxPavlas, Zdenek2016-08-171-1/+2
|
* Remove vestiges of earlier type mergerDavid Mertens2016-08-161-4/+1
|
* tccgen: return: avoid jmp to retsym if possiblePavlas, Zdenek2016-08-111-1/+5
| | | | | When 'return' is the last statement of the top-level block (very common and often recommended case) jump is not needed.
* Avoid conflicting definition for va_list on 64-bit MacsDavid Mertens2016-08-041-0/+3
|
* win64: fix va_arggrischka2016-07-105-5/+12
| | | | | | | | | | | fixes 5c35ba66c5ade4713bbd9c005e66889f6d7db293 Implementation was consistent within tcc but incompatible with the ABI (for example library functions vprintf etc) Also: - tccpp.c/get_tok_str() : avoid "unknown format "%llu" warning - x86_64_gen.c/gen_vla_alloc() : fix vstack leak
* fix typo in -Wl,-rpath documentationVincent Lefevre2016-07-051-1/+1
| | | | Signed-off-by: Vincent Lefevre <vincent@vinc17.net>
* tiny_libmaker: fix a commentAvi Halachmi (:avih)2016-06-191-1/+1
|
* win32: _mingw.h: add definition for _TRUNCATE from newer _mingw.hAvi Halachmi (:avih)2016-06-191-0/+4
|
* win32: malloc.h: use alloca instead of (missing) _allocaAvi Halachmi (:avih)2016-06-191-1/+7
| | | | | | _alloca is not part of msvcrt (and therefore not found if used), and tcc has an internal implementation for alloca for x86[_64] since d778bde7 - initally as _alloca and later changed to alloca. Use it instead.
* win32: wchar.h: don't redifine WCHAR_MIN[/MAX] (after stdint.h)Avi Halachmi (:avih)2016-06-191-0/+2
|
* tiny_libmaker: more robust arguments interpretationAvi Halachmi (:avih)2016-06-191-34/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Syntax is now much closer to gnu ar, but still supports whatever was supported before, with the following exceptions (which gnu ar has too): - lib is now mandatory (was optional and defaulted to ar_test.a before). - Path cannot start with '-' (but ./-myfile.o is OK). - Unlike gnu ar, modes are still optional (as before). - Now supports also (like gnu ar): - First argument as options doesn't have to start with '-', later options do. - Now supports mode v (verbose) with same output format as gnu ar. - Any names for lib/objs (were limited to .a/.o - broke cmake on windows). - Now explicitly fail on options which would be destructive for the user. - Now doesn't get confused by options between file arguments. - Still ignores other unknown options - as before. - Now doesn't read out-of-bounds if an option is one char. - As a result, cmake for windows can now use tiny_libmaker as ar, and configure can also detect tiny_libmaker as a valid ar (both couldn't before). Ignoring all options could previously cause to misinterpret the mode in a destructive way, e.g. if the user wanted to do something with an existing archive (such as p - print, or x - extract, etc), then it would instead just delete (re-create) the archive. Modes which can be destructive if ignored now explicitly fail. These include [habdioptxN]. Note that 'h' can be ignored, but this way we also implicitly print the usage for -h/--help. The .a/.o name limitations previously resulted in complete failure on some cases, such as cmake on windows which uses <filename>.obj and <libname>.lib . Fixed: e.g. 'tiny_libmaker r x.a x.o' was reading out of bounds [-1] for 'r'.
* tccgen: gen_assign_cast(): cannot cast struct to scalargrischka2016-05-251-0/+3
| | | | | | | | | | | | | | | The case below previously was causing an assertion failure in the target specific generator. It probably is not incorrect not to allow this even if gcc does. struct S { long b; }; void f(struct S *x) { struct S y[1] = { *x }; }
* Redo "fix line number in macro redefined message"grischka2016-05-252-6/+3
| | | | | | Smaller change to fix more cases This reverts commit 0f36f60faa05da7e250a4b4eebd4b534e8a2b537.
* Allow to perform tests from the custom build dir:seyko2016-05-201-15/+8
| | | | | | | | mkdir build; cd build ../configure --prefix=./package make make test make install
* [avih] a custom build dir fix for lib/Makefileseyko2016-05-201-4/+4
| | | | | | | | | | | mkdir build; cd build ../configure && make ../../lib/libtcc1.c:31: error: include file 'stddef.h' not found Author: Avi Halachmi Date: Sat Nov 14 18:40:36 2015 +0200 When building from the root tcc dir, $TOP and $top_srcdir are the same, but with a custom build dir, we need top_srcdir
* fix a mingw64 build on Linux with --enable-tcc64-mingwseyko2016-05-203-4/+16
| | | | | * define CONFIG_WIN64=yes when ARCH=x86-64 (not CONFIG_WIN32=yes) * CONFIG_WIN64 now use a windows install part (not a Linux one)
* make and install tiny_libmaker on all platformsseyko2016-05-201-4/+2
| | | | not only on Windows/Darwin.
* [avih] configure: support custom ar with --ar=seyko2016-05-201-0/+4
| | | | | | | Author: Avi Halachmi (:avih) Date: Mon Nov 2 18:46:32 2015 +0200 configure: support custom ar with --ar=
* configure: docdir fixseyko2016-05-201-1/+1
| | | | | was /usr/local/share/doc/usr/local/lib/tcc now /usr/local/share/doc
* --whole-archive supportseyko2016-05-206-3/+43
| | | | | | | | | | | | | | | A patch is implemented as suggested in tinycc-devel mail list. From: Reuben Thomas Date: Thu, 31 Jul 2014 16:52:53 +0100 Subject: [PATCH] Add --{no,}-whole-archive support I resurrected the patch supplied to the mailing list in 2009 Since --whole-archive is a useful flag to get tcc working with autotools, and of course in its own right, I suggest you have a look at the patch and see if it is acceptable. I cannot see any suggestion that it was actively rejected last time round, just no evidence that it was ever added.
* Microsoft says that _spawnp must be used instead of spawnp. It fixes a ↵Christian Jullien2016-05-161-1/+1
| | | | warning when compiled with MinGW 32/64 gcc compilers
* fix asm_expr_unary()seyko2016-05-161-1/+1
| | | | | | | | keep unary unsigned. problem is exposed on i386 with unary like 0xC0000000. In this case a sign is extended in pe->v = n; if n declared as long.
* x86-asm: Reject some invalid arith imm8 instructionMichael Matz2016-05-164-2/+25
| | | | | | | There were two errors in the arithmetic imm8 instruction. They accept only REGW, and in case the user write a xxxb opcode that variant needs to be rejected as well (it's not automatically rejected by REGW in case the destination is memory).
* fix line number in macro redefined messageseyko2016-05-161-2/+5
|
* short_call_convention patch from tcc bugzillaseyko2016-05-151-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | BUGZILLA: interfacing with other compilers extend the return value to the whole register if necessary. visual studio and gcc do not always set the whole eax register when assigning the return value of a function. We've encountered wrong execution results on i386 platforms with an application that uses both code compiled with TCC and code compiled with other compilers (namely: Visual Studio on Windows, and GCC on Linux). When calling a function that returns an integer value shorter than 32 bits, TCC reads the return value from the whole EAX register, although the code generated by the other compilers can only sets AL for 8 bit values or AX for 16 bits values, and the rest of EAX can be anything. We worked around this with the attached patch on i386 for the version 0.9.26, but we did not look at other platforms to find if there are similar issues.
* memory model macros __{L,}LP64__seyko2016-05-151-0/+2
| | | | | | | a patch from tcc bugzilla. From: Reuben Thomas Date: Thu, 31 Jul 2014 13:50:13 +0100 Subject: [PATCH] libtcc.c: add memory model macros __{L,}LP64__
* x86-asm: Add .fill testMichael Matz2016-05-141-0/+1
|
* x86-asm: Fix signed constants and opcode orderMichael Matz2016-05-144-3/+12
| | | | | | | | Two things: negative constants were rejected (e.g. "add $-15,%eax"). Second the insn order was such that the arithmetic IM8S forms weren't used (always the IM32 ones). Switching them prefers those but requires a fix for size calculation in case the opcodes were OPC_ARITH and OPC_WLX (whose size starts with 1, not zero).
* x86-asm: Consolidate insn descriptionsMichael Matz2016-05-143-171/+173
| | | | | Use OPC_BWLX and OPC_WLX in i386-asm.h and x86_64-asm.h to reduce number of differences between both.
* tcc -E -P10 : output all numbers as decimalsgrischka2016-05-121-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This may be used to preprocess Fabrice Bellards initial revision in this repository to demonstrate its capability to compile and run itself (on i386 32-bit linux or windows). Initial revision: 27f6e16bae9d0f73acec07f61aea696ab5adc680 Also needed: * an empty stdio.h * a wrapper named tc.c with void expr(void); void decl(int); void next(void); #include "tcc.c" * an hello.c such as int main() { printf("Hello World\n"); return 0; } All files with unix LF only lines. Then ... * preprocess the source $ tcc -E -P10 -I. tcc.c -o tc1.c * compile the compiler $ tcc -w -I. tc.c -o tc -ldl * run it to compile and run itself to compile and run itself to compile and run itself to compile and run hello.c $ ./tc tc1.c tc1.c tc1.c hello.c --> Hello World! ------------------------------------------------------ * On i386 windows this may be added to the tc.c wrapper #ifdef _WIN32 #include <windows.h> void *dlsym(int x, const char *func) { if (0 == strcmp(func, "dlsym")) return &dlsym; return GetProcAddress(LoadLibrary("msvcrt"), func); } #endif
* Error out on operations on structsMichael Matz2016-05-121-3/+3
| | | | | | | The check for structs was too late and on amd64 and aarch64 could lead to accepting and then asserting with code like: struct S {...} s; char *c = (char*)0x10 - s;
* x86-64-asm: Add mov[sz]xq opcodesMichael Matz2016-05-123-1/+14
| | | | This adds the zero/sign-extending opcodes with 64bit destinations.
* x86-64-asm: Clean up 64bit immediate supportMichael Matz2016-05-115-24/+39
| | | | | | | | | Fix it to actually be able to parse 64bit immediates (enlarge operand value type). Then, generally there's no need for accepting IM64 anywhere, except in the 0xba+r mov opcodes, so OP_IM is unnecessary, as is OPT_IMNO64. Improve the generated code a bit by preferring the 0xc7 opcode for im32->reg64, instead of the im64->reg64 form (which we therefore hardcode).
* x86-asm: Get rid of is_short_jumpMichael Matz2016-05-111-7/+4
| | | | Can be implemented differently.
* x86-asm: Remove old ASM_16 codeMichael Matz2016-05-112-207/+6
| | | | | | This code was inactive since a long time (and was deactivated because it was wrong to start with) and just clutters the sources. Remove it.
* x86-64: Run asmtest as wellMichael Matz2016-05-112-13/+31
| | | | | This fixes and activates the asm test that's part of tcctest.c also on x86-64, requiring a small fix for the 'm' constraint.
* tests: Compile asmtest.S without -m32Michael Matz2016-05-111-1/+1
| | | | | Don't hardcode that option, if you want it do make CC="gcc -m32". The test assembles with -m64 as well now.
* x86-64 asm: Remove useless jmp opcodeMichael Matz2016-05-113-8/+1
| | | | | Also remove the hacky mod/rm byte emission during disp/imm writing.