aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* libtcc.c: Completely replace tcc_normalize_inc_dirs.Edmund Grimley Evans2015-11-111-73/+26
|
* arm64-gen.c: Avoid some cases of undefined behaviour.Edmund Grimley Evans2015-11-091-44/+55
| | | | Also make some functions more portable.
* tccelf.c: Avoid two trivial instances of undefined behaviour.Edmund Grimley Evans2015-11-091-2/+4
|
* win: include dirs: add some docs, minor refactorAvi Halachmi (:avih)2015-11-081-4/+18
|
* lib/Makefile: filter-out -b flag from XFLAGSseyko2015-11-081-1/+1
| | | | | to build tcc with bound checking ./configure --cc=tcc --extra-cflags-b
* fix tcc_mormalize_inc_dirs namingseyko2015-11-081-2/+2
|
* win: fix incorrect directory detectionAvi Halachmi (:avih)2015-11-081-1/+2
| | | | Allow other flags too...
* win: fix dir comparison during include dirs processingAvi Halachmi (:avih)2015-11-081-16/+60
| | | | Use native Windows API via wrapper with stat-like API.
* win: libm: add implementation for round/fmin/fmax and variantsAvi Halachmi (:avih)2015-11-071-0/+113
| | | | | | | | | | | | | | | | | | | | round and fmin/fmax are relatively commonly used functions but were not implemented anywhere in the tcc Windows distribution package. Newer mingw(64) math.h stil doesn't include these implementations. Add C implementations for these functions and place it as inline functions at win32/include/tcc/tcc_libm.h - which is already included from math.h . The code is mostly taken from musl-libc rs-1.0 (MIT) [*], musl-libc: http://git.musl-libc.org/cgit/musl/tree/src/math?h=rs-1.0 license: http://git.musl-libc.org/cgit/musl/tree/COPYRIGHT?h=rs-1.0 Potential enhancements: - Check how many useful libm implementations are still missing and consider adding them (some of them already work via the MS runtime). - Consider putting libm implementations in an actual libm.a file, or add a dummy one such that build processes which try to link with libm will not fail.
* win: math.h: fix fpclassify/signbit/etc - use C instead of broken asmAvi Halachmi (:avih)2015-11-072-22/+97
| | | | | | | | | | | | | | | | The asm code cannot currently be used with tcc since tcc doesn't support 't' constraint. Use inline C implementation instead, place it win32/include/tcc/tcc_libm.h, and include it from win32/include/math.h. Since fpclassify now works, it also fixes few other macros which depend on it. Implicitly fixed: isfinite, isinf, isnan, isnormal. The implementations were taken from musl-libc rs-1.0 (MIT license). musl-libc: http://git.musl-libc.org/cgit/musl/tree/src/math?h=rs-1.0 license: http://git.musl-libc.org/cgit/musl/tree/COPYRIGHT?h=rs-1.0
* win: math.h: isnan: use macro, similar to others (still broken)Avi Halachmi (:avih)2015-11-071-32/+1
| | | | | | It was broken due to tcc not able to compile asm with 't' constraint, and it's still broken because fpclassify on which it now depends has the same issue. Next commit will fix this.
* Revert "win32/include/math.h: remoing a "t" modifier usage"Avi Halachmi (:avih)2015-11-071-31/+10
| | | | | | This reverts commit 45bc50596874ec7cb26aac3dca3339ba25086436. The new asm code did not work as expected. Coordinated with seiko.
* TOK_INCLUDE: fix for the "normalize inc dirs"seyko2015-11-061-1/+1
| | | | A case for the absolute path: prevent an error after openening
* TOK_INCLUDE: streamlineseyko2015-11-061-12/+5
| | | | goto removed
* tcctok.h: Put TOK_memmove in the correct places (I hope).Edmund Grimley Evans2015-11-051-1/+2
| | | | This should have been part of b051549. Someone should test on ARM.
* tcctok.h: Revert 41408f2, which moved TOK_memmove.Edmund Grimley Evans2015-11-051-1/+1
|
* tcc.h: remove CONFIG_TCCBOOT partseyko2015-11-051-7/+0
| | | | | | curremtly no one will try to compile a linux kernel from the boot loader. With current tcc it is not possible w/o additional tuning.
* fix for the "tccgen.c: Use memmove for struct assignment"seyko2015-11-051-1/+1
| | | | | | | | | | | ./configure --enable-cross make tcc -o i386-tcc tcc.c tcc -o x86_64-tcc tcc.c tcc -o i386-win-tcc tcc.c In file included from tcc.c:22: In file included from libtcc.c:39: tccgen.c:2580: error: 'TOK_memmove' undeclared
* fix for the previous commitseyko2015-11-051-0/+1
| | | | | a cross-compilation from unix to win32 need a "sys/stat.h" include file
* normalize inc dirs, symplify include_nextseyko2015-11-053-71/+97
| | | | | | | | | include dirs are prepared as in gcc - for each duplicate path keep just the first one - remove each include_path that exists in sysinclude_paths include_next streamlined by introducing inc_path_index in the BufferedFile
* win32/include/math.h: remoing a "t" modifier usageseyko2015-11-051-10/+31
| | | | | replaced by loading a float argument from memory and using the "m" modifier
* lib/libtcc1.c: Replace "long" with "unsigned int" in union float_long.Edmund Grimley Evans2015-11-041-1/+1
|
* tccpp.c: In TOK_GET, add comment warning about illegal cast.Edmund Grimley Evans2015-11-041-8/+11
| | | | | | Also, in tok_str_add2, use memcpy instead of the illegal cast. Unfortunately, I can't see an easy way of fixing the bug.
* tccpp.c: Define and use tok_last for checking if last token is space.Edmund Grimley Evans2015-11-041-1/+16
|
* tccgen.c: Use memmove for struct assignment: dest and src may be equal.Edmund Grimley Evans2015-11-041-1/+2
|
* tccgen.c: Fix memory leak involving asm_label.Edmund Grimley Evans2015-11-041-5/+9
|
* tests/tcctest.c: Fix up format strings.Edmund Grimley Evans2015-11-041-28/+28
|
* Enable variable-length arrays on arm64.Edmund Grimley Evans2015-10-312-5/+12
| | | | | arm64-gen.c: Implement gen_vla_sp_save, gen_vla_sp_restore, gen_vla_alloc. tests/Makefile: Run vla_test on arm64.
* defined twice: revertseyko2015-10-291-1/+1
| | | | An error message is changed to suggest -fcommon
* comment out tcc_error_noabort("'%s' defined twice"...seyko2015-10-251-1/+1
| | | | | | | | | | | gcc-3.4.6 don't give such error by default example file1 char __version_303_xxxxxxxx; void func1() {} example file2 char __version_303_xxxxxxxx; void func2() {} int main() { return 0; }
* include/stddef.h: define NULL only if undefinedseyko2015-10-251-0/+3
|
* tcc help output for the -xc -xa - optionsseyko2015-10-241-0/+2
|
* fix for the #include_next, v4 (final)seyko2015-10-201-19/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This version looks rigth. Comparing to the original algorithm: 1) Loop breaking. We remember a start point after wich we can try next path. Do not search include stack after this. 2) But compare next file patch with the start point. Skip if it the same. Remove "./" before comparing. PS: a problems with compaling a coreutils-8.24.51-8802e remain. There are errors messages like: src/chgrp src/chown-core.c:42: multiple definition of `make_timespec' src/chgrp.c:42: first defined here A problem is in the lib/config.h #define _GL_INLINE_ extern inline // gcc #define _GL_INLINE_ inline // tcc A long description from the lib/config.h * suppress extern inline with HP-UX cc, as it appears to be broken * suppress extern inline with Sun C in standards-conformance mode * suppress extern inline on configurations that mistakenly use 'static inline' to implement functions or macros in standard C headers like <ctype.h>. GCC and Clang are excluded from this list. Why not tcc?
* fix for the #include_next, v3seyko2015-10-191-14/+4
| | | | | | | | | | don't give an error and simply ingnore directive if we detect a loop of the #include_next. With this aproach coreutils-8.24.51-8802e compiles, but with errors: lib/libcoreutils.a: error: 'xnmalloc' defined twice lib/libcoreutils.a: error: 'xnrealloc' defined twice
* fix for the #include_next, v2seyko2015-10-171-1/+15
| | | | | | | | | A more correct fix. This one don't break old logic. But if include file is not found, we try to search again with the new compare rule. A description of the problem: http://permalink.gmane.org/gmane.comp.compilers.tinycc.devel/2769
* reverse a previous patchseyko2015-10-171-1/+3
| | | | a next version of the patch will follow
* fix for the #include_nextseyko2015-10-171-3/+1
| | | | skip include file only if include_file_name=current_file_name
* parsing "..." sequenceseyko2015-10-171-3/+1
| | | | | | | | | don't panic with error: '.' expected if there is only two '.' chars. Return tok='.' in such case. An asm code to test: jz do_move0 # .. then we have a normal low # .. or else we have a high
* tccelf.c: Reset sym after call to build_got.Edmund Grimley Evans2015-10-161-1/+3
| | | | | | | | The call to build_got can cause symtab_section->data to be reallocated (build_got -> add_elf_sym -> put_elf_sym -> section_ptr_add -> section_realloc -> tcc_realloc). This is not obvious on a cursory inspection, but fortunately Valgrind spotted it immediately. Are there other, similar bugs that Valgrind did not detect?
* tccpp.c: Avoid infinite loop on: printf '/**' | ./tcc -Edmund Grimley Evans2015-10-151-0/+2
|
* tccgen.c: Remove undefined shift of negative signed value.Edmund Grimley Evans2015-10-151-3/+4
|
* Correct prototype: void __clear_cache(void *, void *).Edmund Grimley Evans2015-10-153-4/+4
|
* Define CONFIG_TCC_ELFINTERP on NetBSD as /usr/libexec/ld.elf_soKamil Rytarowski2015-10-111-0/+2
|
* Define __WINT_TYPE__ as int in NetBSDKamil Rytarowski2015-10-111-1/+1
|
* Add support for -D__NetBSD__Kamil Rytarowski2015-10-111-0/+5
|
* win32: UUID typedef addedseyko2015-09-251-0/+5
|
* a number as a field name (part 2)seyko2015-09-251-0/+2
| | | | | | | | | | | | | | | | don't crash a test program: ================ typedef struct X { int len; } X; #define init(s,len) s.len = len; int main(void) { X myX; init(myX,10); return 0; } ================ After a patch: error: field name expected
* a number as a field nameseyko2015-09-251-2/+4
| | | | | | | | | | | | | | | | a test program: ======== typedef struct X { int len; } X; int main(void) { X myX; myX.10 = 10; return 0; } ======== Error message before a patch: error: ';' expected (got "(null)") After a patch: error: field name expected
* SSE opcodes to TCC assembler (i386, x86_64)seyko2015-09-232-2/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | patch from Anaƫl Seghezzi a test program: ============================ #include <stdio.h> struct fl4{ float x, y, z, w; }; void asm_test(void) { struct fl4 v1, v2, v3; v1.x = 0.1; v1.y = 0.2; v1.z = 0.4; v1.w = 0.3; v2.x = 0.11; v2.y = 0.0; v2.z = 0.01; v2.w = 0.04; asm volatile ( "movups %0, %%xmm0;" "movups %1, %%xmm1;" "addps %%xmm1, %%xmm0;" "movups %%xmm0, %2" :: "g" (v1), "g" (v2), "g" (v3) : "memory"); printf("sse fl4 add : %f %f %f %f\n", v3.x, v3.y, v3.z, v3.w); printf("expected : %f %f %f %f\n", v1.x+v2.x, v1.y+v2.y, v1.z+v2.z, v1.w+v2.w); } int main() { asm_test(); } /* sse fl4 add : 0.210000 0.200000 0.410000 0.340000 expected : 0.210000 0.200000 0.410000 0.340000 */ ============================
* Adding two more people to the RELICENSING file.gus knight2015-07-311-0/+2
| | | | They also responded to my mail with a YES.