aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Fix compile on ARM non-eabi and non-vfpMichael Matz2014-01-111-1/+1
| | | | Adjust arm_init prototype to match declaration.
* Fix Fixes for PE x86_64 for fail in codeMichael Matz2014-01-111-27/+20
| | | | | | | Applying 64bit relocs assumes that the CVal is initialized to zero for the whole 64bit. Consolidate this a bit, at the same time zeroing the .ull member more consistently when needed. Fixes segfault on x86_64-linux using global vars in tcctest.c.
* Fix missing mem_size assignment when using mmap()keren2014-01-101-0/+2
|
* Fixes previous fixesArchidemon2014-01-101-5/+5
|
* Fixes for PE x86_64 for fail in codeArchidemon2014-01-101-3/+15
| | | | | | | | | | | | int (*fn1)=0x13fde16b5; and int fn1(int a) {...} struct { int (*fn2)(int a); } b = { fn1 };
* Use anonymous file instead of regular file to back mmapkeren2014-01-091-14/+5
| | | | Signed-off-by: Keren Tan <tankeren@gmail.com>
* Various Makefile fixes for cross-compilationThomas Preud'homme2014-01-092-5/+19
| | | | | | - Build libtcc1 for cross-compiler on arm (arm to X cross compilers) - Install libtcc1 and includes for arm to i386 cross compiler - Add basic check of cross-compilers (compile ex1.c)
* Remove WITHOUT_LIBTCC macro: no more userThomas Preud'homme2014-01-081-3/+1
|
* Use GNU triplet prefix for cross tcc compilersThomas Preud'homme2014-01-082-25/+34
| | | | | Compatibility symlinks are put in place in case some script were relying on former names except for CMake since it was added after last release.
* Shared libraries also have entry pointsThomas Preud'homme2014-01-081-1/+1
| | | | This fix commit 32734680cb2a645d48f806edae5a5912e0759a23
* Improve ELF on ARMThomas Preud'homme2014-01-081-1/+7
| | | | | * set whether soft or hardfloat calling convention is used * mark ELF file has having an entry point when there is
* Update elf.hThomas Preud'homme2014-01-082-1094/+2479
|
* Add support for runtime selection of float ABIThomas Preud'homme2014-01-087-70/+113
|
* Explicit that EABI only supports VFP for nowThomas Preud'homme2014-01-072-5/+3
|
* Don't say compiler flags are warning optionsThomas Preud'homme2014-01-071-1/+1
|
* fixed permissions for install on UnixVincent Lefevre2014-01-071-3/+3
| | | | Signed-off-by: Vincent Lefevre <vincent@vinc17.net>
* be stricter with aliasinggrischka2014-01-076-89/+92
| | | | | | | | | | | | | | Refactoring (no logical changes): - use memcpy in tccgen.c:ieee_finite(double d) - use union to store attribute flags in Sym Makefile: "CFLAGS+=-fno-strict-aliasing" basically not necessary anymore but I left it for now because gcc sometimes behaves unexpectedly without. Also: - configure: back to mode 100755 - tcc.h: remove unused variables tdata/tbss_section - x86_64-gen.c: adjust gfunc_sret for prototype
* misc. fixesgrischka2014-01-0610-54/+46
| | | | | | | | | | | | | | | | | | | | | | - tccgen: error out for cast to void, as in void foo(void) { return 1; } This avoids an assertion failure in x86_64-gen.c, also. also fix tests2/03_struct.c accordingly - Error: "memory full" - be more specific - Makefiles: remove circular dependencies, lookup tcctest.c from VPATH - tcc.h: cleanup lib, include, crt and libgcc search paths" avoid duplication or trailing slashes with no CONFIG_MULTIARCHDIR (as from 9382d6f1a0e2d0104a82ed805207d9e742c6b068) - tcc.h: remove ";{B}" from PE search path in ce5e12c2f950052d8109b6b7a56d900547705c08 James Lyon wrote: "... I'm not sure this is the right way to fix this problem." And the answer is: No, please. (copying libtcc1.a for tests instead) - win32/build_tcc.bat: do not move away a versioned file
* tccpe: cleanup "imports per ordinal"grischka2014-01-063-143/+33
| | | | | | | - tccpe.c: avoid conflict with imp_sym->st_value, cleanup - _parseLibs.bat, _tcc.bat: no instructions for usage, removed. from commit 642b6d0f50c6b6a842c9239a102fe34d5619e931
* i386: use __fixdfdi instead of __tcc_cvt_ftolgrischka2014-01-066-80/+84
| | | | | | | | | | | | Variants __fixsfdi/__fixxfdi are not needed for now because the value is converted to double always. Also: - remove __tcc_fpinit for unix as it seems redundant by the __setfpucw call in the startup code - avoid reference to s->runtime_main in cross compilers - configure: fix --with-libgcc help - tcctok.h: cleanup
* Fix struct ret in variadic fct with ARM hardfloatThomas Preud'homme2014-01-067-23/+35
| | | | | | | | | | | | | The procedure calling standard for ARM architecture mandate the use of the base standard for variadic function. Therefore, hgen float aggregate must be returned via stack when greater than 4 bytes and via core registers else in case of variadic function. This patch improve gfunc_sret() to take into account whether the function is variadic or not and make use of gfunc_sret() return value to determine whether to pass a structure via stack in gfunc_prolog(). It also take advantage of knowing if a function is variadic or not move float result value from VFP register to core register in gfunc_epilog().
* Don't call __tcc_fpinit if using libgccThomas Preud'homme2014-01-061-0/+2
|
* Don't enable bound check if libgcc is usedThomas Preud'homme2014-01-062-2/+3
| | | | | Bound check rely on some functions provided by libtcc. It should therefore not be enabled when libgcc is used.
* Relicensing TinyCCDaniel Glöckner2014-01-041-0/+1
| | | | | I'm fine with relicensing all my contributions to files other than arm-gen.c.
* Move logic for if (int value) to tccgen.cThomas Preud'homme2014-01-046-118/+37
| | | | | | | 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.
* Update Changelog from git changelog entriesThomas Preud'homme2014-01-041-1/+63
|
* Relicensing TinyCCDaniel Glöckner2014-01-041-1/+1
|
* Fix negation of 0.0 and -0.0Thomas Preud'homme2014-01-041-2/+15
|
* Provide install-strip target in MakefileThomas Preud'homme2014-01-041-0/+3
|
* Use libtcc.a for static link even with USE_LIBGCCThomas Preud'homme2014-01-032-2/+7
| | | | | | | When statically linking, runtime library should be static as well. tcc could link with libgcc.a but it's in a gcc version specific directory. Another solution, followed by this patch, is to use libtcc.a when statically linking, even if USE_LIBGCC was configured.
* Report error on NaN comparisonThomas Preud'homme2014-01-032-4/+13
| | | | | | | | Use comisd / fcompp for float comparison (except TOK_EQ and TOK_NE) instead of ucomisd / fucompp to detect NaN comparison. Thanks Vincent Lefèvre for the bug report and for also giving the solution.
* Always set *palign in classify_x86_64_argThomas Preud'homme2014-01-031-0/+1
| | | | | | | Set *palign for VT_BITFIELD and VT_ARRAY types in classify_x86_64_arg as else you happen to have in *palign what was already there. This can cause gfunc_call on !PE systems to consider an array as 16 bytes align and trigger the assert if the previous argument was 16 bytes aligned.
* Fix "Add support for struct > 4B returned via registers"grischka2013-12-163-16/+31
| | | | | | | | | | | - avoid assumption "ret_align == register_size" which is false for non-arm targets - rename symbol "sret" to more descriptive "ret_nregs" This fixes commit dcec8673f21da86ae3dcf1ca3e9498127715b795 Also: - remove multiple definitions in win32/include/math.h
* make git ignore lib/arm directoryThomas Preud'homme2013-12-151-0/+1
|
* Fix signed integer division in ARM runtime ABIThomas Preud'homme2013-12-151-9/+21
| | | | | | | | - fix computation of absolute value (clearing the sign bit does not since integers are encoded in 2's complement) - test sign of integer in a more conventional way (binary and with the high bit does not work for long long due to a bug in gtst) - spacing in include
* Add ARM aeabi functions needed to run tcctestThomas Preud'homme2013-12-113-1/+509
| | | | | | | | | | | | Add implementation for float / integer conversion functions: __aeabi_d2lz, __aeabi_d2ulz, __aeabi_f2lz, __aeabi_f2ulz, __aeabi_l2d, __aeabi_l2f, __aeabi_ul2d, __aeabi_ul2f Add implementation for long long helper functions: __aeabi_ldivmod, __aeabi_uldivmod, __aeabi_llsl, __aeabi_llsr, __aeabi_lasr Add implementation for integer division functions: __aeabi_uidiv, __aeabi_uidivmod, __aeabi_idiv, __aeabi_idivmod,
* Support special calling convention for runtime ABIThomas Preud'homme2013-12-111-15/+34
| | | | | | | | Add infrastructure to support special calling convention for runtime ABI function no matter what is the current calling convention. This involve 2 changes: - behave as per base standard in gfunc_call - move result back in VFP register in gen_cvt_itof1
* Define __ARM_EABI__ and __ARMEL__ when applicableThomas Preud'homme2013-11-261-0/+4
|
* Make abitest.c have predictable resultThomas Preud'homme2013-11-251-2/+2
| | | | | | | | stdarg_test in abitest.c relies on a sum of some parameters made by both the caller and the callee to reach the same result. However, the variables used to store the temporary result of the additions are not initialized to 0, leading to uncertainty as to the results. This commit add this needed initialization.
* Add va_* macro implementation for ARMThomas Preud'homme2013-11-251-0/+11
|
* Add comment to explain the code added by 41ce391cThomas Preud'homme2013-11-251-1/+4
| | | | | | Add a comment in arm-gen.c to explain how commit 41ce391c86df135609af33658414d4d452c5beb3 solves the register corruption when passing a structure in a function call.
* Fix structure passing in ARM calling conventionThomas Preud'homme2013-11-251-3/+6
| | | | | | Fix the address on stack where a structure is copied when it is a parameter of a function call. This address must be computed from the stack pointer and a possible padding offset.
* Add support for struct > 4B returned via registersThomas Preud'homme2013-11-225-49/+77
| | | | | | | | On ARM with hardfloat calling convention, structure containing 4 fields or less of the same float type are returned via float registers. This means that a structure can be returned in up to 4 double registers in a structure is composed of 4 doubles. This commit adds support for return of structures in several registers.
* Remove code in arm-gen.c for struct packing in regThomas Preud'homme2013-11-221-21/+3
| | | | | Struct packing in register is now handled since commit 2bbfaf43 by tccgen.c proper.
* Correctly identify homogeneous float aggregateThomas Preud'homme2013-11-221-1/+1
| | | | | First related symbol of a structure justs indicate its size. This first member is the second related symbol.
* Fix counting of VFP regs in ARM's gfunc_prologThomas Preud'homme2013-11-211-1/+2
| | | | | | | | | Fix in gfunc_prolog for ARM the counting of the highest numbered VFP float register used for parameter passing, rounded to 2. It can be computed from the range of VFP float register with the highest range start and adding the number of VFP float register occupied. This ensure that parameter of type struct that spans over more than 2 float registers are correctly taken into account.
* Fix register corruption at function call on ARMThomas Preud'homme2013-11-211-6/+16
| | | | | | | | Prior to this commit, params could use some registers that do not appear in the value stack. Therefore when generating function call, one of such register could be reused, leading to wrong parameter content. This happens when a structure is passed via core register, as only the first register would appear in the value stack.
* Allow thumb transition for R_ARM_PC24Thomas Preud'homme2013-11-181-12/+13
| | | | | Allow bl -> blx conversion in the case of R_ARM_PC24 relocation with instruction being an unconditional bl. Also make spacing more uniform.
* Correctly align and reclaim stack at function callThomas Preud'homme2013-11-171-6/+8
| | | | | | | * Correctly align stack in case of structure split between core registers and stack * Correctly reclaim stack space after function call in the case where the stack needed padding to be aligned at function call.
* Refactor and simplify gfunc_call() on armThomas Preud'homme2013-11-151-296/+328
|