aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* A right fix for the array in struct initialization w/o '{'seyko2015-03-234-21/+116
| | | | | Parse a type if there is only one '(' before a type token. Otherwise a recursion will perform a job.
* Revert of the commit: fix for the array in struct initialization w/o '{', case 2seyko2015-03-231-16/+9
| | | | A right solution for this problem will follow.
* quick fix for the native tcc on debian/ubuntuseyko2015-03-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Force to use a NATIVE_DEFINES insteed of the DEFINES for the native tcc. After this change we have on debian/ubuntu # ./x86_64-tcc -vv tcc version 0.9.26 (x86-64, Linux) install: /usr/local/lib/tcc crt: /usr/lib/x86_64-linux-gnu libraries: /usr/lib/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib /usr/local/lib/x86_64-linux-gnu /usr/local/lib include: /usr/local/include/x86_64-linux-gnu /usr/local/include /usr/include/x86_64-linux-gnu /usr/include /usr/local/lib/tcc/include elfinterp: /lib64/ld-linux-x86-64.so.2 Before this change the output was # ./x86_64-tcc -vv tcc version 0.9.26 (x86-64, Linux) install: /usr/local/lib/tcc crt: /usr/lib libraries: /usr/lib /lib /usr/local/lib include: /usr/local/include /usr/include /usr/local/lib/tcc/include elfinterp: /lib64/ld-linux-x86-64.so.2 This change don't fix a cross compilers
* configure: don't output CONFIG_LDDIR when build_cross = "yes"seyko2015-03-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | This fixes i386-tcc on CentOS 7. After patch [root@centos7 tinycc]# ./i386-tcc -vv tcc version 0.9.26 (i386, Linux) install: /usr/local/lib/tcc crt: /usr/lib libraries: /usr/lib /lib /usr/local/lib Before patch: [root@centos7 tinycc]# ./i386-tcc -vv tcc version 0.9.26 (i386, Linux) install: /usr/local/lib/tcc crt: /usr/lib64 libraries: /usr/lib64 /lib64 /usr/local/lib64
* skip 73_arm64,test on ARCH=x86-64: it fails on this ARCHseyko2015-03-201-0/+3
|
* restore a linux 2.4.26 kernel compilation (commit 5bcc3eed7b93 correction)seyko2015-03-201-1/+5
| | | | | | | | The following check in tccgen.c is removed if (nocode_wanted) tcc_error("statement expression in global scope"); This check is introduced in commit 5bcc3eed7b93 and breaks compilation of the linux 2.4.26 kernel.
* correction for the previous commitseyko2015-03-201-2/+2
| | | | use "x86-64" as a directory name for the libtcc1.a installation when cross-compiling.
* libtcc1.a while "configure --enable-cross"seyko2015-03-202-7/+10
| | | | | 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-192-5/+3
|
* fix to allow build tcc by build-tcc.batseyko2015-03-194-4/+4
| | | | | move call to print_defines() from tcc.c to the libtcc.c define a print_defines() as a ST_FUNC
* Convert some lines from ISO-8859-1 to UTF-8.Edmund Grimley Evans2015-03-114-10/+10
| | | | | | | | perl -i -pe 'use Text::Iconv; $c1 = Text::Iconv->new("utf-8", "utf-8"); $c2 = Text::Iconv->new("iso-8859-1", "utf-8"); if (!$c1->convert($_)) { $_ = $c2->convert($_); }' \ `find * -type f`
* .gitignore: Add lib/arm64.Edmund Grimley Evans2015-03-101-0/+1
|
* tccgen.c: (!nocode_wanted) -> (nocode_wanted) in arm64 part.Edmund Grimley Evans2015-03-101-2/+2
|
* Add some missing nocode_wanted guardThomas Preud'homme2015-03-104-16/+30
| | | | | | int i = i++ causes a segfault because of missing guard. Looking recursively at all backend functions called from middle end several more guard appeared to be missing.
* lib/Makefile: Partial revert of 896a0c881ac3.Edmund Grimley Evans2015-03-101-1/+0
| | | | lib/lib-arm64.c must be compiled by tcc.
* A correction for the commit: revert a grischka patch: gdb refused to know "main"seyko2015-03-101-0/+7
| | | | | keep revert (check SHF_ALLOC) only for x86 target and keep a grishka patch for other targets
* 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
* A native tcc for MSYS (Windows) must be i386-win-tcc.exe and not i386-tcc.exeseyko2015-03-102-1/+17
| | | | | i386-tcc.exe is a compiler for i386 Linux. A HOST_OS variable in Makefile is introduced and used to select a native compiler (which one to name as tcc.exe)
* 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.
* Remove incorrect commentMichael Matz2015-03-091-2/+0
| | | | Not the code was confused, I was :)
* Find libtcc1.a on arm32Michael Matz2015-03-091-1/+1
| | | | The directory is called "arm", not "ARM".
* Fix stack overwrite on structure returnMichael Matz2015-03-097-17/+26
| | | | | | | | | The common code to move a returned structure packed into registers into memory on the caller side didn't take the register size into account when allocating local storage, so sometimes that lead to stack overwrites (e.g. in 73_arm64.c), on x86_64. This fixes it by generally making gfunc_sret also return the register size.
* arm64: Implement __clear_cache.Edmund Grimley Evans2015-03-085-1/+63
| | | | | | __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
* tests/Makefile: Quote to avoid: /bin/sh: 1: [: !=: unexpected operatorEdmund Grimley Evans2015-03-071-1/+1
|
* arm64: Optimise some integer operations with a constant operand.Edmund Grimley Evans2015-03-073-2/+243
|
* tccgen.c: Optimise 0<<x, 0>>x, -1>>x, x&0, x*0, x|-1, x%1.Edmund Grimley Evans2015-03-071-10/+25
| | | | | | | | | More precisely, treat (0 << x) and so on as constant expressions, but not if const_wanted as we do not want to allow "case (x*0):", ... Do not optimise (0 / x) and (0 % x) here as x might be zero, though for an architecture that does not generate an exception for division by zero the back end might choose to optimise those.
* arm64-gen.c: In load(), do not sign-extend 32-bit VT_CONST.Edmund Grimley Evans2015-03-071-2/+2
|
* fix for the array in struct initialization w/o '{', case 2seyko2015-03-071-9/+16
| | | | | | | | | | | | | | a test program: struct { int a[2], b[2]; } cases[] = { { ((int)0), (((int)0)) }, ((int)0), (((int)0)) /* error: ',' expected (got ")") */ }; int main() { return 0; } This commit allow to skip ')' in the decl_initializer() and to see ','
* Add __builtin_return_address.Edmund Grimley Evans2015-03-062-1/+14
| | | | | | Implementation is mostly shared with __builtin_frame_address. It seems to work on arm64, i386 and x86_64. It may need to be adapted for other targets.
* Makefile: install tcc$(EXESUF) as symlink to the $(ARCH)-tccseyko2015-03-061-4/+2
|
* Makefile: add dependencies for $($(I386_CROSS)_LINK), ...seyko2015-03-061-8/+7
| | | | | This is another solution for the make process. Commit 4b92dbf9237c is reverted.
* Makefile leftover of rev 44c6e99Roy2015-03-061-2/+2
|
* fixing decl_initializer() for size_only: don't eat ')'seyko2015-03-051-2/+8
| | | | | | | | | | a test program: struct { int c[1]; } s1[] = { (int)0 }; /* OK */ struct { int c[1]; } s2[] = { { ((int)0) } }; /* OK */ struct { int c[1]; } s3[] = { 0 }; /* OK */ struct { int c[1]; } sx[] = { ((int)0) }; /* error: ')' expected (got "}") */ int main() { return 0; }
* Add a dependency for a PROGS and TCCLIBS to a Makefileseyko2015-03-051-0/+2
| | | | | Simply assume this is all *.c and *.h files in a tcc top directory. Now a tcc compiler is recompiled if any of this files is changed.
* Fix compiling in MinGW/MSYSRoy2015-03-051-2/+2
|
* tccelf.c: File path component is "arm64", not "ARM64".Edmund Grimley Evans2015-03-041-1/+1
|
* partial revert of the commit 4ad186c5ef61seyko2015-03-043-0/+41
| | | | | | | | | | | | | | | 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; }
* --enable-tcc32-mingw option: build windows version on linux with i386-win-tccseyko2015-03-041-1/+9
| | | | --enable-tcc64-mingw option: build windows version on linux with x86_64-win-tcc
* gcc options and mingw: move a gcc options detection from a makefile to the ↵seyko2015-03-043-18/+20
| | | | | | | | 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
* install-clean-tuningseyko2015-03-041-16/+26
| | | | | | | | | | | | | | | | * 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. * Build/install i386-tcc/x86_64-tcc and not a tcc * Build/install i386-win-tcc/x86_64-win-tcc and not a i386-win-mingw32-tcc/... * DEFINES = -DTCC_TARGET_I386... also for i386-tcc and i386-win-tcc * Make a symlink tcc to the i386-tcc/x86_64-tcc for a "make test" * Build a $(ARCH) directory with a symlink to the libtcc1.a for a "make test" * Remove a /usr/local/lib/tcc directory on uninstall * Remove a /usr/local/share/doc/tcc directory on uninstall * Remove a $(ARCH) directory on "make clean" * Remove a *-tcc files on "make clean"
* an unification of the tcc cross names for a windowsseyko2015-03-042-21/+21
| | | | | | | | | | | | | | | | | | | | | | 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.
* a libraries pathsseyko2015-03-041-7/+21
| | | | | | | | | | | | * x86_64-tcc: use /usr/lib64,.. instead of /usr/lib,.. * don't set tcc_lddir="lib64" if cpu="x86" * put a definition of the CONFIG_LDDIR into config.h instead of the config.mak Otherwise a "lib" string may be used by default. This is a usual case when building a x86_64-tcc (there was no -DCONFIG_LDDIR building this binary). * suppress -Wdeprecated-declarations for gcc which complain on malloc hooks in bcheck.c if glibc is quite new.
* reverse a commit a6149c6dbb41: Set CONFIG_MULTIARCHDIR for cross compilers.seyko2015-03-041-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set CONFIG_MULTIARCHDIR for cross compilers. Chances a cross-compiler will find a working crt*.o in /usr/lib are more or less 0. This commit breaks x86 / x86_64 compilres for linux. A solution for the crt*.o must be discussed. must be: # ./x86_64-tcc -vv tcc version 0.9.26 (x86-64, Linux) install: /usr/local/lib/tcc crt: /usr/lib64 libraries: /usr/lib64 /lib64 /usr/local/lib64 include: /usr/local/include /usr/include /usr/local/lib/tcc/include elfinterp: /lib64/ld-linux-x86-64.so.2 and with MULTIARCH we have: # ./x86_64-tcc -vv tcc version 0.9.26 (x86-64 Linux) install: /usr/local/lib/tcc/ crt: /usr/lib/x86_64-linux-gnu ??????????????????? libraries: /usr/lib/x86_64-linux-gnu /usr/lib ??????????????????? /lib/x86_64-linux-gnu /lib ??????????????????? /usr/local/lib/x86_64-linux-gnu /usr/local/lib ??????????????????? include: /usr/local/include/x86_64-linux-gnu /usr/local/include /usr/include/x86_64-linux-gnu /usr/include /usr/local/lib/tcc/include elfinterp: /lib64/ld-linux-x86-64.so.2 And CONFIG_MULTIARCHDIR don't handle C67. On Linux x86 we have: # ./c67-tcc -vv tcc version 0.9.26 (C67, Linux) install: /usr/local/lib/tcc crt: /usr/lib libraries: /usr/lib /lib /usr/local/lib include: /usr/local/include /usr/include /usr/local/lib/tcc/include elfinterp: /lib/ld-linux.so.2
* 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.