aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* document -dM in "tcc -h" outputseyko2016-04-131-1/+1
|
* revert of the 'Identifiers can start and/or contain'seyko2016-04-134-92/+70
| | | | | | | | When tccboot kernels compiles with 'Identifiers can start and/or', this kernel don't start. It is hard to find what is wrong. PS: there was no test for identifiers in *.S with '.'
* Skip math library if not found when -lm option is usedVlad Vissoultchev2016-04-081-2/+5
| | | | | | This only silences "cannot find library" error and allows Makefiles targeting gcc to not complain about missing libraries If there is custom libm then standard handling applies.
* Implement -dM preprocessor option as in gccVlad Vissoultchev2016-04-064-8/+14
| | | | | | There was already support for -dD option but in contrast -dM dumps only `#define` directives w/o actual preprocessor output. The original -dD output differs from gcc output by additional comment in front of `#define`s so this quirk is left for -dM as well.
* tccgen.c: Allow type attributes to prefix enum/struct/union nameVlad Vissoultchev2016-04-063-10/+28
| | | | | | From gcc docs: "You may also specify attributes between the enum, struct or union tag and the name of the type rather than after the closing brace." Adds `82_attribs_position.c` in `tests/tests2`
* cleaning "Identifiers can start and/or contain"seyko2016-04-051-4/+6
| | | | more logical algorithm of the isidnum_table[] changing
* compilation speed of the tccboot correctionseyko2016-04-051-0/+4
| | | | | | | we use gnu extension "case 0x80 ... 0xFF" for tcc & gcc and perform test if(c & 0x80) for other compilers
* utf8 in identifiersseyko2016-04-053-1/+24
| | | | | | | | | | | | | | made like in pcc (pcc.ludd.ltu.se/ftp/pub/pcc-docs/pcc-utf8-ver3.pdf) We treat all chars with high bit set as alphabetic. This allow code like #include <stdio.h> int Lefèvre=2; int main() { printf("Lefèvre=%d\n",Lefèvre); return 0; }
* nocode_wanted with while/for inside ({})seyko2016-04-053-3/+96
| | | | a test included.
* optimization of the previous patchseyko2016-04-051-4/+6
| | | | | compilation speed of the tccboot restored (patch remove testing of the parse_flags in loop)
* Identifiers can start and/or contain '.' in *.Sseyko2016-04-058-73/+115
| | | | | | | | | | | | | | | | | modified version of the old one which don't allow '.' in #define Identifiers. This allow correctly preprocess the following code in *.S #define SRC(y...) \ 9999: y; \ .section __ex_table, "a"; \ .long 9999b, 6001f ; \ // .previous SRC(1: movw (%esi), %bx) 6001: A test included.
* describe -fnormalize-inc-dirs in tcc-doc.texiseyko2016-04-041-1/+5
|
* R_386_COPYseyko2016-04-031-0/+6
| | | | | | This reloction must copy initialized data from the library to the program .bss segment. Currently made like for ARM (to remove noise of defaukt case). Is this true?
* -fnormalize-inc-dirsseyko2016-04-033-1/+96
| | | | | | remove non-existent or duplicate directories from include paths if -fnormalize-inc-dirs is specified. This will help to compile current coreutils package
* reverse of the "Identifiers can start and/or contain '.'"seyko2016-04-034-82/+69
| | | | | | | | | | | | | | | | | - Identifiers can start and/or contain '.' in PARSE_FLAG_ASM_FILE - Move all GAS directives under TOK_ASMDIR prefix This patches breaks compilation of the tccboot (linux 2.4.26 kernel). A test.S which fails with this patches: #define SRC(y...) \ 9999: y; \ .section __ex_table, "a"; \ .long 9999b, 6001f<---->; \ .previous SRC(1:<>movw (%esi), %bx<------>) // 029-test.S:7: error: macro 'SRC' used with too many args
* Fix assignment to/from volatile typesMichael Matz2016-03-263-0/+17
| | | | | | | | | Code like this was broken: char volatile vi = i; See testcase, happens in ideosyncratic legacy code sprinkling volatile all over.
* Fix tokenization of TOK_DOTSMichael Matz2016-03-242-3/+14
| | | | | We really need to use PEEKC during tokenization so as to skip line continuations automatically.
* Fix type parsingMichael Matz2016-03-244-7/+19
| | | | | | the check on incomplete struct/union/enum types was too early, disallowing mixed specifiers and qualifiers. Simply rely on the size (->c) field for that. See testcases.
* Move all GAS directives under TOK_ASMDIR prefix to include leading '.'Vlad Vissoultchev2016-03-153-68/+80
| | | | Use only these tokens in `asm_parse_directive` and don't recycle others' tokens (like TOK_SECTION1)
* Identifiers can start and/or contain '.' in PARSE_FLAG_ASM_FILEVlad Vissoultchev2016-03-141-10/+8
| | | | Including labels, directives and section names
* tccpp.c: Fix failing `PPTest 03` by reverting rogue modification in ↵Vlad Vissoultchev2016-03-141-1/+1
| | | | `macro_arg_subst`
* Fix tests Makefiles on WindowsVlad Vissoultchev2016-03-143-2/+14
| | | | Compiled tcc.exe location is under $(top_srcdir)/win32
* Use proper ifdef for x64 check in winnt.hVlad Vissoultchev2016-03-141-3/+3
|
* Revert spawnvp param cast and use `no-incompatible-pointer-types` in ↵Vlad Vissoultchev2016-03-142-3/+3
| | | | build-tcc.bat
* Keep lvalue category on structs when evaluating ternary operatorVlad Vissoultchev2016-03-131-4/+17
|
* Migrate static STRING_MAX_SIZE buffers to CString instances for large macros ↵Vlad Vissoultchev2016-03-131-14/+23
| | | | expansion
* Add x64 SEH decls. Add exports to kernel32.defVlad Vissoultchev2016-03-132-0/+68
|
* Move WIN32_LEAN_AND_MEAN to windows.h (silence redeclarations)Vlad Vissoultchev2016-03-132-3/+4
|
* Win32 build script handles `x64` and `debug` paramsVlad Vissoultchev2016-03-131-6/+11
|
* Silence FIXME and compiler warningVlad Vissoultchev2016-03-132-1/+4
|
* tccgen.c: Fix flex array members some moreMichael Matz2016-03-113-2/+31
| | | | Last fix didn't work for function f1int in the added testcase.
* tccgen.c: off by one in flexible array membersHenry Kroll III2016-03-101-1/+1
| | | | tccgen.c: fix fexible array member breaking struct alignment
* tccgen.c: In parse_btype, handle type qualifiers applied to arrays.Edmund Grimley Evans2016-01-112-14/+41
| | | | Also add some test cases in tests/tests2/39_typedef.c.
* CodingStyle: Remove reference to misaligned struct CString.Edmund Grimley Evans2016-01-061-3/+0
| | | | This was fixed by 1c2dfa1 on 2015-11-21.
* i386: Add support for new psABI relocationThomas Preud'homme2015-12-272-3/+11
| | | | | | | R_386_GOT32X can occur in object files assembled by new binutils, and in particular do appear in glibc startup code (crt*.o). This patch is modeled after the x86_64 one, handling the new relocation in the same trivial way.
* x86-64: fix shared libsMichael Matz2015-12-171-2/+4
| | | | | | | | | | | | | | The introduction of read32le everywhere created a subtle issue, going from x = *(int*)p; to x = read32le(p); is not equivalent if x is a larger than 32bit quantity, like an address on x86_64, because read32le returns an unsigned int. The first sign extends, the latter zero extends. This broke shared library creation for gawk. It's enough to amend the case of the above situation, cases like "write32le(p, read32le(p) +- something)" are okay, no extensions happen or matter.
* x86-64: Define symbol constant for new relocsMichael Matz2015-12-172-7/+13
| | | | | | Whoops, we have our own <elf.h> copy, so I can just as well add the symbol defines for the relocs instead of hard-coding numbers in tccelf.c.
* x86-64: Add support for new psABI relocationsMichael Matz2015-12-171-4/+10
| | | | | | | | | R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX can occur in object files comiled by new binutils. They are not dynamic relocations, so normally wouldn't be a problem for tcc (one doesn't normally mix object files created by different compiler/binutils, static archives are so out :)). If it weren't for the glibc startup code, crt*.o, of course. They now do contain such relocs --> boom. Handle them in the trivial way.
* Fixed a dependency (error with make -j8).Vincent Lefevre2015-12-151-1/+1
| | | | Signed-off-by: Vincent Lefevre <vincent@vinc17.net>
* Change the way struct CStrings are handled.Edmund Grimley Evans2015-11-266-66/+67
| | | | | | | | | A CString used to be copied into a token string, which is an int array. On a 64-bit architecture the pointers were misaligned, so ASan gave lots of warnings. On a 64-bit architecture that required memory accesses to be correctly aligned it would not work at all. The CString is now included in CValue instead.
* TODO: Add two issues.Edmund Grimley Evans2015-11-261-0/+2
|
* tccgen.c: Give error if statement expression found when const wanted.Edmund Grimley Evans2015-11-261-6/+2
| | | | | | | | | | | | | | | | Some test cases: #define SE ({ switch (0) { } 0; }) // Should give error: int x = SE; void f(void) { static int x = SE; } void f(void) { enum e { a = SE }; } void f(void) { switch (0) { case SE: break; } } // Correct: int f(void) { return SE; } int f(void) { return sizeof(SE); }
* tcc.h: Change order of built-in include paths: put TCC's own dir first.Edmund Grimley Evans2015-11-231-3/+3
| | | | | There may be compiler-specific header files that should override system headers. See TCC's include paths by running "tcc -vv".
* tccgen.c: Try to make sizeof(!x) work.Edmund Grimley Evans2015-11-223-3/+4
| | | | tests/tests2/27_sizeof.*: Add test.
* tccgen.c: Bug fix for 992cbda and 3ff77a1: set nocode_wanted.Edmund Grimley Evans2015-11-213-8/+39
| | | | tests/tests2/78_vla_label.*: Add test.
* TODO: Add note on handling of floating-point values.Edmund Grimley Evans2015-11-211-0/+3
|
* TODO: Add some issues.Edmund Grimley Evans2015-11-211-0/+15
|
* CodingStyle: Add notes on language and testing.Edmund Grimley Evans2015-11-201-1/+69
|
* Improve constant propagation with "&&" and "||".Edmund Grimley Evans2015-11-203-52/+58
|
* tccelf.c: On arm64, use read64le, and use uint64_t to check range.Edmund Grimley Evans2015-11-201-3/+2
|