aboutsummaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* libtcc1.a while "configure --enable-cross"seyko2015-03-201-1/+1
| | | | | build and install libtcc1.a for i386, x86_64 and arm64 (libtcc1.a for x86_64 was not installed on i386)
* "configure --enable-cross" on x86: build a libtcc1.a for x86_64seyko2015-03-191-4/+2
|
* lib/Makefile: Partial revert of 896a0c881ac3.Edmund Grimley Evans2015-03-101-1/+0
| | | | lib/lib-arm64.c must be compiled by tcc.
* don't use a *-tcc to compile *.S files for ARM*seyko2015-03-101-0/+2
| | | | | A tcc for ARM* don't have an assembler. This is partial reverse of the commit build-libtcc1-by-tcc: use a new tcc to compile a libtcc1.c and alloca.S
* x86-64: Fix stdarg for large non-float structsMichael Matz2015-03-091-4/+3
| | | | | | | | | | Some structs are passed in registers. When they need more than one the implementation of __va_arg on x86-64 didn't correctly account for this. This fixes only the cases where the structs consist of integer types, as there the register save area is consecutive. Fixes some tests from 73_arm64.c, but still leaves those failing that use floating point in the large-but-regpassed structs.
* arm64: Implement __clear_cache.Edmund Grimley Evans2015-03-081-1/+1
| | | | | | __clear_cache is defined in lib-arm64.c with a single call to __arm64_clear_cache, which is the real built-in function and is turned into inline assembler by gen_clear_cache in arm64-gen.c
* partial revert of the commit 4ad186c5ef61seyko2015-03-041-0/+14
| | | | | | | | | | | | | | | A test program: /* result of the new version inroduced in 4ad186c5ef61: t2a = 44100312 */ #include<stdio.h> int main() { int t1 = 176401255; float f = 0.25f; int t2a = (int)(t1 * f); // must be 44100313 int t2b = (int)(t1 * (float)0.25f); printf("t2a=%d t2b=%d \n",t2a,t2b); return 0; }
* gcc options and mingw: move a gcc options detection from a makefile to the ↵seyko2015-03-041-3/+3
| | | | | | | | configure + define XCC and XAR if mingw32 defined + use XCC and XAR in lib/Makefile if defined Try "./configure --enable-mingw32; make". This must work
* an unification of the tcc cross names for a windowsseyko2015-03-041-5/+5
| | | | | | | | | | | | | | | | | | | | | | produce a i386-win-mingw32-tcc i386-win-tcc x86_64-win-mingw32-tcc x86_64-win-tcc arm-win-mingw32ce-tcc arm-win-tcc instead of the i386-w64-mingw32-tcc i386-win32-tcc x86_64-w64-mingw32-tcc x86_64-win32-tcc arm-wince-mingw32ce-tcc arm-win32-tcc Replacing a *-win32 directory names with a *-win names because this names are based on the names of the tcc x86_64-win32-tcc, i386-win32-tcc
* build-libtcc1-by-tcc: use a new tcc to compile a libtcc1.c and alloca.Sseyko2015-03-041-7/+0
| | | | | | | This will allow to build a libtcc1.a even if a bootstrap compiler don't support a target arch. There was alrady this feature but only for OS Darwin.
* x86_64-tcc and libtcc1.c: size_t definition is needed for a x86_64-tcc to ↵seyko2015-03-031-1/+2
| | | | parse memset()
* remove a gcc warning for bcheck on x86_64 arch: conversion to pointer from ↵seyko2015-03-031-2/+4
| | | | integer of different size
* Add arm64 (AArch64) as a target architecture.Edmund Grimley Evans2015-02-233-0/+1174
|
* Don't build libtcc1 with -fstack-protector-strongMatteo Cypriani2014-09-071-0/+4
| | | | | | | Prevent libtcc1.a to be compiled with -fstack-protector-strong, so that linking with tcc doesn't fail because symbol '__stack_chk_fail_local' is not present in libtcc1.a. This is useful only if the CFLAGS passed from the main Makefile contain this flag.
* Fix mistake. Change jb by jbe. tiny c round (INT_MAX = 0x7FFFFFFF) to a ↵Carlos Montiers2014-07-103-3/+3
| | | | DWORD boundary and it becomes 0x80000000. Jle treats as -214783648, but Jbe treats as 214783648. Thanks to Jason Hood for explain me this.
* Fix problem using alloca function, executable crashed even with a exception ↵Carlos Montiers2014-07-103-6/+6
| | | | handler function, when try to allocate INT_MAX. Patch provided by Jason Hood in private e-mail, when I ask to him for help. He say: Feel free to pass it on to the mailing list.
* Specify license of lib/armeabi.cThomas Preud'homme2014-07-011-0/+21
|
* build: add initial NetBSD support.minux2014-04-121-2/+2
| | | | | | | | | | | | Not able to generate ELF files on NetBSD yet (lacks the note and crt1.o is actually named crt0.o on NetBSD), but -run works with these extra defines: -D__lint__ -D"__symbolrename(x)=asm(#x)" -D__NetBSD__ The -D__lint__ is an ugly hack, TCC should be able to emulate GCC just fine, but it seems TCC doesn't support __builtin_va_list yet? typedef __builtin_va_list __va_list; /usr/include/sys/ansi.h:72: error: ';' expected (got "__va_list")
* Corrected spelling mistakes in comments and stringsVincent Lefevre2014-04-071-1/+1
|
* win32: libtcc1.a needs to be built with tccgrischka2014-04-071-2/+5
| | | | | gcc/mingw produces msvc compatible pecoff objects, tcc only knows ELF.
* arm: Provide alloca()Michael Matz2014-04-052-2/+13
| | | | | | This provides a simple implementation of alloca for ARM (and enables the associated testcase). As tcc for ARM doesn't contain an assembler, we'll have to resort using gcc for compiling it.
* shared libs: Build libtcc1.a with -fPICMichael Matz2014-04-021-1/+5
| | | | | TCCs runtime library must be compiled as position independend code, so it can be linked into shared libraries.
* Create bcheck region for argv and arge argumentThomas Preud'homme2014-03-291-0/+7
| | | | | | | | | | | For program manipulating argv or arge as pointer with construct such as: (while *argv++) { do_something_with_argv; } it is necessary to have argv and arge inside a region. This patch create regions argv and arge) if main is declared with those parameters.
* New implementation of va_list/va_start/var_copy that do not use dynamic ↵mingodad2014-03-281-21/+9
| | | | memory, with this when compiling fossil-scm with tcc on linux X86_64 it works fine.
* Fix __clear_cache implementationThomas Preud'homme2014-03-111-1/+2
| | | | Forgot to give the parameters to syscall function, doh!
* Use intptr_t to cast pointerThomas Preud'homme2014-03-091-1/+3
|
* Undefine __va* in libtcc1 to avoid errors w/ clangThomas Preud'homme2014-03-091-0/+5
|
* Make condition in libtcc1 based on targetThomas Preud'homme2014-03-091-5/+5
| | | | | | Prior to this commit runtime library was compiled according to the host because of the macro used to detec what architecture to choose. This commit fixes this by using the TARGET_* macro instead.
* Round mode of ll -> float conversion to nearestThomas Preud'homme2014-02-051-5/+20
| | | | | Change rounding mode of long long to float conversion to nearest in libtcc1.
* Fix negative long long to float conversion on ARMThomas Preud'homme2014-02-051-2/+2
|
* Fix float to long long conversion on ARMThomas Preud'homme2014-02-051-8/+8
| | | | | Fix float to long long conversion on ARM when the result would fit in an int.
* misc. fixesgrischka2014-01-061-3/+0
| | | | | | | | | | | | | | | | | | | | | | - 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
* i386: use __fixdfdi instead of __tcc_cvt_ftolgrischka2014-01-061-18/+21
| | | | | | | | | | | | 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 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-112-1/+442
| | | | | | | | | | | | 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,
* Add __clear_cache implementation in libtcc1Thomas Preud'homme2013-11-052-1/+34
| | | | Add __clear_cache function for flushing caches to libtcc1.
* libtcc1.c: Fix __asm__() in __tcc_fpinit and __tcc_cvt_ftolRamsay Jones2013-09-091-3/+3
| | | | Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
* i386-gen: preserve fp control word in gen_cvt_ftoigrischka2013-08-281-6/+17
| | | | | | | | | | | | | | | | | | | | | | | - Use runtime function for conversion - Also initialize fp with tcc -run on windows This fixes a bug where double x = 1.0; double y = 1.0000000000000001; double z = x < y ? 0 : sqrt (x*x - y*y); caused a bad sqrt because rounding precision for the x < y comparison was different to the one used within the sqrt function. This also fixes a bug where printf("%d, %d", (int)pow(10, 2), (int)pow(10, 2)); would print 100, 99 Unrelated: win32: document relative include & lib lookup win32: normalize_slashes: do not mirror silly gcc behavior This reverts part of commit 8a81f9e1036637e21a47e14fb56bf64133546890 winapi: add missing WINAPI decl. for some functions
* Fixed x86-64 long double passing.James Lyon2013-04-261-1/+3
| | | | | | long double arguments require 16-byte alignment on the stack, which requires adjustment when the the stack offset is not an evven number of 8-byte words.
* Sorted out CMake on x86-64 and fixed silly XMM# bug introduced when working ↵James Lyon2013-04-251-0/+7
| | | | | | | | | on Win64 stdargs. I removed the XMM6/7 registers from the register list because they are not used on Win64 however they are necessary for parameter passing on x86-64. I have now restored them but not marked them with RC_FLOAT so they will not be used except for parameter passing.
* Added cross compilation to CMake build system.James Lyon2013-04-251-7/+3
| | | | | Brings it more into line with make based system. I've tested on 32- and 64-bit Windows, but not yet Linux.
* Fixed tests on Windows (including out-of-tree problems)James Lyon2013-04-171-0/+3
| | | | | | | | | | | Modified tcctest.c so that it uses 'double' in place of 'long double' with MinGW since this is what TCC does, and what Visual C++ does. Added an option -norunsrc to tcc to allow argv[0] to be set independently of the compiled source when using tcc -run, which allows tests that rely on the value of argv[0] to work in out-of-tree builds. Also added Makefile rules to automatically update out-of-tree build Makefiles when in-tree Makefiles have changed.
* Flush caches before -running programThomas Preud'homme2013-03-181-0/+11
| | | | | | | | | | | | On some architectures, ARM for instance, the data and instruction caches are not coherent with each other. This is a problem for the -run feature since instructions are written in memory, and are thus written in the data cache first and then later flushed to the main memory. If the instructions are executed before they are pushed out of the cache, then the processor will fetch the old content from the memory and not the newly generated code. The solution is to flush from the data cache all the data in the memory region containing the instructions and to invalidate the same region in the instruction cache.
* add version number to manpageUrs Janssen2013-02-171-2/+2
| | | | | | | avoid c++/c99 style comments in preprocessor directives avoid leadings whitespaces in preprocessor directives mention implemented variable length arrays in documentation fixed ambiguous option in texi2html call (Austin English)
* - document -dumpversionUrs Janssen2013-02-151-1/+1
| | | | - fixed a broken prototype
* configure: pass CONFIG_xxxDIR/PATH options via commandlinegrischka2013-02-142-3/+8
| | | | | | | | | | | | | | | - except for CONFIG_SYSROOT and CONFIG_TCCDIR Strictly neccessary it is only for CONFIG_MULTIARCHDIR because otherwise if it's in config.h it is impossible to leave it undefined. But it is also nicer not to use these definitions for cross-compilers. - Also: lib/Makefile : include ../Makefile for CFLAGS lib/libtcc1.c : fix an issue compiling tcc with tcc on x64
* tcc -vv/--print-search-dirs: print more infogrischka2013-02-101-1/+1
| | | | | | | | | | | | | | tests/Makefile: - print-search-dirs when 'hello' fails - split off hello-run win32/include/_mingw.h: - fix for compatibility with mingw headers (While our headers in win32 are from mingw-64 and don't have the problem) tiny_libmaker: - don't use "dangerous" mktemp
* tcc.h: declare CValue.tab[LDOUBLE_SIZE/4]grischka2013-02-081-2/+1
| | | | | | | | Should fix some warnings wrt. access out of array bounds. tccelf.c: fix "static function unused" warning x86_64-gen.c: fix "ctype.ref uninitialzed" warning and cleanup tcc-win32.txt: remove obsolete limitation notes.
* lib/Makefile: use CC, add bcheck to libtcc1.agrischka2013-02-062-21/+26
| | | | | | | | Also: - fix "make tcc_p" (profiling version) - remove old gcc flags: -mpreferred-stack-boundary=2 -march=i386 -falign-functions=0 - remove test "hello" for Darwin (cannot compile to file)
* configure: use relative paths for in-tree buildgrischka2013-01-301-2/+2
| | | | | | Also - move CPPFLAGS to Makefile - Use top_srcdir in lib/Makefile