aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* a cpu option of the configure script as a method to specify a target cpuseyko2015-03-041-29/+27
| | | | | | | | | | * don't setup a cpu before scanning for --cpu= * --cpu= option sets a 'cpu' variable, not a 'build_cpu', 'build_cpu' was not used anywhere. * if cpu="" and ARCH != "" then cpu=$ARCH else cpu=`uname -m` * replace "Build CPU" with "Target CPU" in the output of the configure script. output this value only when not builing a cross compilers. * remove a HOST_I386, ... defines from a config.h file. thise defines are not used anywhere and cpu is now used to define a target cpu
* Disable floating-point test for ARM soft-floatseyko2015-03-042-2/+14
| | | | | | | | | | | From: Matteo Cypriani <mcy@lm7.fr> Date: Fri, 5 Sep 2014 23:22:56 -0400 Subject: Disable floating-point test for ARM soft-float tcc is not yet capable of doing softfloat floating-point operations on ARM, therefore we disable this test for these platforms. Note that tcc displays a warning to warn ARM users about this limitation (debian)
* disable-BTESTSseyko2015-03-041-1/+0
|
* correct a DllMain() declaration in dllcrt1.c and dllmain.cseyko2015-03-032-3/+3
| | | | | There is a DllMain() declaration in the mingw-runtime-4.0.3.1 and it differs from a tcc one.
* win32/include/winsock2.h (look previous commit)seyko2015-03-031-0/+1290
|
* add declaration of the "double trunc (double _x)" and winsock2.hseyko2015-03-031-0/+21
| | | | This allow to build a windows version of the nimrod compiler.
* A lrint functions in win32/include/math.h are rewrittem because tcc can't ↵seyko2015-03-031-15/+30
| | | | handle "t" constraint
* wincrt1.c: add definition of the __TRY__ if not definedseyko2015-03-032-0/+16
| | | | Some i686-pc-mingw32-gcc don't know about __TRY__
* Report a mingw as a execution environment instead of theseyko2015-03-031-16/+10
| | | | | | | | | | | Win32, Win64, WinCE when executing "tcc -v". Example $ ./i386-win-tcc -v tcc version 0.9.26 (i386, mingw) instead of the tcc version 0.9.26 (i386, Win32) There is a cpu info already about bits of the excution environment And display C67 for the TCC_TARGET_C67
* Don't add a slash to the install path of the tcc in display_info()seyko2015-03-031-1/+1
|
* A 32/64 bit tcc on linux: an arch specific path for libtcc1.aseyko2015-03-031-1/+19
| | | | | | | Don't use /usr/local/lib/tcc/libtcc1.a for i386 and x86_64 A $(tccdir)/i386 directory was used to install a libtcc1.a but only when cross compiling. And no x86_64 directory. And this directory location was unknown inside tccelf.c
* Disable floating-point test for ARM soft-floatseyko2015-03-031-0/+2
| | | | | | | | | | | From: Matteo Cypriani <mcy@lm7.fr> Date: Fri, 5 Sep 2014 23:22:56 -0400 Subject: Disable floating-point test for ARM soft-float tcc is not yet capable of doing softfloat floating-point operations on ARM, therefore we disable this test for these platforms. Note that tcc displays a warning to warn ARM users about this limitation (debian)
* arm-unused-warnings: remove problems with defined but unused wariablesseyko2015-03-032-5/+10
| | | | | | | | | arm-gen.c: In function `gfunc_call': arm-gen.c:1202: warning: unused variable `variadic' arm-gen.c: In function `gfunc_prolog': arm-gen.c:1258: warning: unused variable `avregs' arm-gen.c:1340: warning: label `from_stack' defined but not used arm-gen.c:222: warning: 'default_elfinterp' defined but not used
* tcc_add_runtime() for a CONFIG_USE_LIBGCC case: reducing a complexityseyko2015-03-031-5/+2
|
* x86_64-win-tcc elfinterp: a bug correctionseyko2015-03-031-4/+4
| | | | | | | | | | | ./x86_64-win-tcc -vv Before elfinterp: /lib64/ld-linux-x86-64.so.2 After elfinterp: - This output is identical to the output of the i386-win-tcc
* lddir-on-x86-64: let CONFIG_LDDIR=lib64 by default if TCC_TARGET_X86_64seyko2015-03-031-1/+5
| | | | | This is done for the case when CONFIG_LDDIR is not configured. Example: ./configure --enable-cross
* Turn on a implicit-function-declaration warning by default.seyko2015-03-034-0/+5
| | | | | | | | A non declared function leads to a seriuos problems. And while gcc don't turn this warning on lets tcc do it. This warning can be turned off by -Wno-implicit-function-declaration option. And autor must explicitly do this if program must be compiled with this warning off.
* x86_64-tcc and libtcc1.c: size_t definition is needed for a x86_64-tcc to ↵seyko2015-03-031-1/+2
| | | | parse memset()
* -std=c99 option for the tcc: allow to use a tcc as a reference compiler for ↵seyko2015-03-031-0/+6
| | | | | | "make test" tcc will igmore this option.
* remove a gcc warning for bcheck on x86_64 arch: conversion to pointer from ↵seyko2015-03-031-2/+4
| | | | integer of different size
* Use a display_info() to output a header of the tcc help listingseyko2015-03-031-55/+62
| | | | | | | | | | | | | | | | | tcc version 0.9.26 (i386 Linux) Tiny C Compiler - Copyright (C) 2001-2006 Fabrice Bellard Usage: tcc [options...] [-o outfile] [-c] infile(s)... tcc [options...] -run infile [arguments...] ... instead of the tcc version 0.9.26 - Tiny C Compiler - Copyright (C) 2001-2006 Fabrice Bellard Usage: tcc [options...] [-o outfile] [-c] infile(s)... tcc [options...] -run infile [arguments...] ... Displaing a "Hard Float" info for the ARM arch is restored. It was broken by the AArm64 patch.
* A partial reverse for commit eda2c756edc4dca004ba217d5bf361235dd9de1fseyko2015-03-035-5/+5
| | | | | | | | | | | | | | | Author: Thomas Preud'homme <robotux@celest.fr> Date: Tue Dec 31 23:51:20 2013 +0800 Move logic for if (int value) to tccgen.c Move the logic to do a test of an integer value (ex if (0)) out of arch-specific code to tccgen.c to avoid code duplication. This also fixes test of long long value which was only testing the bottom half of such values on 32 bits architectures. I don't understand why if () in gtst(i) was removed. This patch allows to compile a linux kernel v.2.4.26 W/o this patch a tcc simply crashes.
* A reverse of the commit 14745bdeb because of the problems while compiling ↵seyko2015-03-032-18/+16
| | | | | | | | | | | | | | | | | | | | | | | | | linux 2.4.26 A test program: /////////// typedef unsigned int __u32; static inline const __u32 __fswab32(__u32 x) { return ({ __u32 __tmp = (x) ; ___swab32(__tmp); }); } void func() { int aaa = 1; int snd_wnd = 2; int TCP_FLAG_ACK = 3; int pred_flags = (__builtin_constant_p((__u32) (((aaa << 26) | (__builtin_constant_p((__u32)((TCP_FLAG_ACK))) ? ({ __u32 __x = (((TCP_FLAG_ACK))); ((__u32)( (((__u32)(__x) & (__u32)0x000000ffUL) << 24) | (((__u32)(__x) & (__u32)0x0000ff00UL) << 8) | (((__u32)(__x) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(__x) & (__u32)0xff000000UL) >> 24) )); }) : __fswab32(((TCP_FLAG_ACK)))) | snd_wnd))) ? ({ __u32 __x = ((((aaa << 26) | (__builtin_constant_p((__u32)((TCP_FLAG_ACK))) ? ({ __u32 __x = (((TCP_FLAG_ACK))); ((__u32)( (((__u32)(__x) & (__u32)0x000000ffUL) << 24) | (((__u32)(__x) & (__u32)0x0000ff00UL) << 8) | (((__u32)(__x) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(__x) & (__u32)0xff000000UL) >> 24) )); }) : __fswab32(((TCP_FLAG_ACK)))) | snd_wnd))); ((__u32)( (((__u32)(__x) & (__u32)0x000000ffUL) << 24) | (((__u32)(__x) & (__u32)0x0000ff00UL) << 8) | (((__u32)(__x) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(__x) & (__u32)0xff000000UL) >> 24) )); }) : __fswab32((((aaa << 26) | (__builtin_constant_p((__u32)((TCP_FLAG_ACK))) ? ({ __u32 __x = (((TCP_FLAG_ACK))); ((__u32)( (((__u32)(__x) & (__u32)0x000000ffUL) << 24) | (((__u32)(__x) & (__u32)0x0000ff00UL) << 8) | (((__u32)(__x) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(__x) & (__u32)0xff000000UL) >> 24) )); }) : __fswab32(((TCP_FLAG_ACK)))) | snd_wnd)))); } //////////// error: ';' expected (got "(")
* a void to void cast.seyko2015-03-031-2/+14
| | | | | | | | | | | Allow tcc to compile the following program /////// void func1() {} void func2() { return func1(); } ////// gcc accepts this program
* a statement expressions with a pointer return typeseyko2015-03-031-1/+5
| | | | | | | | | | | | | A test program: ////////////// int main() { void *p = ({ 0 ; ((void *)1); }); } ///////////// Porblem is introduced in a commit a80acab: Display error on statement expressions with complex return type This error is exposed when compiling a linux 2.4.26. tcc 0.9.23 can sucessfully compile this version of the linux.
* iitialisation of the empty structseyko2015-03-031-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current tcc don't understand an initialization of the empty struct This problem was found trying to compile a linux kernel 2.4.26 which can be compiled by tcc 0.9.23 A test program: //////////////////// // ./tcc -c test_3.c // test_3.c:31: error: too many field init #undef __GNUC__ #undef __GNUC_MINOR__ #define __GNUC__ 2 #define __GNUC_MINOR__ 95 typedef struct { } rwlock_t; struct fs_struct { int count; rwlock_t lock; int umask; }; #define INIT_FS { \ 1, \ RW_LOCK_UNLOCKED, \ 0022, \ } #if (__GNUC__ > 2 || __GNUC_MINOR__ > 91) typedef struct { } rwlock_t; #define RW_LOCK_UNLOCKED (rwlock_t) { } #else typedef struct { int gcc_is_buggy; } rwlock_t; #define RW_LOCK_UNLOCKED (rwlock_t) { 0 } #endif static struct fs_struct init_fs = INIT_FS; // static struct fs_struct init_fs = { { (1) }, (rwlock_t) { 0 }, 0022, }; // ^ with this all Ok // static struct fs_struct init_fs = { { (1) }, (rwlock_t) { }, 0022, }; // ^ current tcc don't understand, but tcc 0.9.23 can int main() { return 0; } //////////////////// A regression is detected after a patch 69fdb57eddd00c592828605819f0678522d346c6 //////////////////// // A test for patch 69fdb57eddd00c592828605819f0678522d346c6 // Author: grischka <grischka> // Date: Wed Jun 17 02:09:07 2009 +0200 // unions: initzialize only one field // struct { // union { // int a,b; // }; // int c; // } sss = { 1,2 }; // This had previously assigned 1,2 to a,b and 0 to c which is wrong. // // Expected: sss.a=1 sss.b=1 sss.c=2 int main() { struct { union { int a,b; }; int c; } sss = { 1, 2 }; printf ("sss.a=%d sss.b=%d sss.c=%d\n", sss.a, sss.b, sss.c); return 0; } ////////////////////
* tcc don't understand am extern array of structs.seyko2015-03-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A regression was found trying to compile a linux kernel 2.4.26 which can be compiled by tcc 0.9.23 /////////////////// #include <stdio.h> // test for a bug: // compiler don't understand am extern array of structs // $ tcc test_1.c // test_1.c:8: error: unknown struct/union/enum extern struct FILE std_files[4]; int main() { return 0; } ////////////////// tcc-current /* enum/struct/union declaration. u is either VT_ENUM or VT_STRUCT */ static void struct_decl(CType *type, int u, int tdef) ... if (tok != '{') { v = tok; next(); /* struct already defined ? return it */ if (v < TOK_IDENT) expect("struct/union/enum name"); s = struct_find(v); if (s) { if (s->type.t != a) tcc_error("invalid type"); goto do_decl; } else if (tok >= TOK_IDENT && !tdef) tcc_error("unknown struct/union/enum"); } else { v = anon_sym++; } tcc-0.9.23 which don't have such error /* enum/struct/union declaration. u is either VT_ENUM or VT_STRUCT */ static void struct_decl(CType *type, int u) .... if (tok != '{') { v = tok; next(); /* struct already defined ? return it */ if (v < TOK_IDENT) expect("struct/union/enum name"); s = struct_find(v); if (s) { if (s->type.t != a) error("invalid type"); goto do_decl; } } else { v = anon_sym++; }
* tcc_free(table_ident) in preprocess_new() if table_ident != NULLseyko2015-03-032-1/+5
|
* tcc_undefine_symbol(): free an alloced symbolseyko2015-03-031-0/+1
|
* Add a debug info when a #line directive is handled.seyko2015-03-031-0/+2
| | | | | The problem was: a debug info for the file which contain a #line directive (for example a preprocessed one) was wrong.
* Revert a grischka patch: gdb refused to know "main"seyko2015-03-031-1/+1
| | | | | | | | | | | | | | | It is a strange patch because before this commit a gdb is working well and after this commit there is exactly the same problem on Linux: gdb refuses to know "main" Author: grischka <grischka> Date: Tue Feb 5 21:18:29 2013 +0100 tccelf: fix debug section relocation With: tcc -g hello.c gdb a.out b main gdb refused to know "main" because of broken dwarf info.
* pp-many-files: don't drop a preprocessor defines when tcc going to ↵seyko2015-03-031-4/+0
| | | | | | | | | | | | | | preprocess a next file in the same pass like tcc -E one.c two.c three.c -o combined.i This will allow to speed up a compilation process by using a commamd like tcc -E *.c | tcc -o program.exe -xc - It looks that multi-times initialization don't affect anything. Only call to the free_defines(define_start) in tcc_preprocess() is removed in assumption that free_defines(NULL) in tcc_cleanup() will free all defines.
* A gcc preprocessor option -dD addedseyko2015-03-034-22/+84
| | | | | | | | | With this option on a defines are included into the output (inside comments). This will allow to debug a problems like: In file included from math.c:8: In file included from /usr/include/math.h:43: /usr/include/bits/nan.h:52: warning: NAN redefined
* Added a gcc preprocessor options -P, -P1seyko2015-03-034-10/+46
| | | | | | | | | | | tcc -E -P do not output a #line directive, a gcc compatible option tcc -E -P1 don't follow a gcc preprocessor style and do output a standard #line directive. In such case we don't lose a location info when we going to compile a resulting file wtith a compiler not understanding a gnu style line info.
* Move a line_ref variable from tcc_preprocess() function into struct ↵seyko2015-03-032-5/+6
| | | | | | | BufferedFile. This id needed for a right ouput in other places, precisely to calculate a number of empty lines which are waiting to output.
* A preprocessor should Interpret an input line "# NUM FILENAME" as "#line NUM ↵seyko2015-03-031-1/+6
| | | | | | | | | | | FILENAME" A cpp from gcc do this. A test case: tcc -E tccasm.c -o tccasm.i tcc -E tccasm.i -o tccasm.ii After a patch the line numbers in tccasm.ii are the same as in tccasm.i
* arm64-gen.c: Improve generation of stack offsets.Edmund Grimley Evans2015-03-021-2/+10
|
* arm64-gen.c: Rename some functions and add comments.Edmund Grimley Evans2015-03-021-76/+79
|
* arm64: Improve constant generation, with tests.Edmund Grimley Evans2015-03-023-8/+55
|
* arm64-gen.c: Better explanation of relocation choice.Edmund Grimley Evans2015-03-011-21/+24
|
* 73_arm64.c: Avoid taking address of return value.Edmund Grimley Evans2015-02-261-21/+42
|
* Add 73_arm64 for testing some arm64 things, mostly PCS.Edmund Grimley Evans2015-02-253-0/+529
|
* arm64-gen.c: In gen_va_arg, handle the remaining HFA cases.Edmund Grimley Evans2015-02-251-9/+27
|
* Relicensing TinyCCEdmund Grimley Evans2015-02-251-0/+1
|
* tests/tcctest.c: Test COMPAT_TYPE(char *, signed char *).Edmund Grimley Evans2015-02-241-0/+2
|
* tccgen.c: Make sure that gen_op always returns an rvalue.Edmund Grimley Evans2015-02-231-0/+3
| | | | Either this fix, or an alternative one, is required for arm64.
* aarch64: Fix -run.Michael Matz2015-02-232-10/+54
| | | | | | | This adds some more support for properly transfering some offsets over the different stages of a relocations life. Still not at all psABI compliant and DSOs can't yet be generated. But it runs the testsuite in qemu-arm64.
* Add arm64 (AArch64) as a target architecture.Edmund Grimley Evans2015-02-2316-40/+3265
|
* Use RELA relocations properly for R_DATA_PTR on x86_64.Edmund Grimley Evans2015-02-214-13/+46
| | | | | | | libtcc.c: Add greloca, a generalisation of greloc that takes an addend. tcc.h: Add greloca and put_elf_reloca. tccelf.c: Add put_elf_reloca, a generalisation of put_elf_reloc. tccgen.c: On x86_64, use greloca instead of greloc in init_putv.
* tcc-doc.texi: Explain VT_LLOCAL a bit better.Edmund Grimley Evans2015-02-201-2/+4
| | | | And delete the sentence about it being removed.