aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* makefile: unify cross with native buildsgrischka2017-02-2510-293/+318
| | | | | | | | | | | | | supports building cross compilers on the fly without need for configure --enable-cross $ make cross # all compilers $ make cross-TARGET # only TARGET-compiler & its libtcc1.a with TARGET one from i386 x86_64 i386-win32 x86_64-win32 arm arm64 arm-wince c67 Type 'make help' for more information
* Cygwin Makefile was to aggresive to remove entire lib/Christian Jullien2017-02-241-5/+3
|
* Update Cygwin Makefile for new libtcc1-xx.a layoutChristian Jullien2017-02-241-10/+9
|
* cross-compilers: allow individual configurationgrischka2017-02-2315-242/+365
| | | | | | | | | | | | | | | | | | | | | | | | | | | since configure supports only native configuration a file 'cross-tcc.mak' needs to be created manually. It is included in the Makefile if present. # ---------------------------------------------------- # Example config-cross.mak: # # windows -> i386-linux cross-compiler # (it expects the linux files in <prefix>/i386-linux) ROOT-i386 = {B}/i386-linux CRT-i386 = $(ROOT-i386)/usr/lib LIB-i386 = $(ROOT-i386)/lib:$(ROOT-i386)/usr/lib INC-i386 = {B}/lib/include:$(ROOT-i386)/usr/include DEF-i386 += -D__linux__ # ---------------------------------------------------- Also: - use libtcc1-<target>.a instead of directories - add dummy arm assembler - remove include dependencies from armeabi.c/lib-arm64.c - tccelf/ld_add_file: add SYSROOT (when defined) to absolute filenames coming from ld-scripts
* Add note about native Windows bootstrap using Cygwin.Christian Jullien2017-02-232-0/+2
|
* x86-64-asm: Fix mov im64,rax encodingMichael Matz2017-02-233-13/+33
| | | | | | | the avoidance of mov im32->reg64 wasn't working when reg64 was rax. While fixing this also fix instructions which had the REX prefix hardcoded in opcode and so didn't support extended registers which would have added another REX prefix.
* Update ChangeLogMichael Matz2017-02-201-0/+5
| | | | with more things I remember having done :)
* tcc: re-enable correct option -r supportgrischka2017-02-2018-151/+178
| | | | | | | | | | | | | | | Forgot about it. It allows to compile several sources (and other .o's) to one single .o file; tcc -r -o all.o f1.c f2.c f3.S o4.o ... Also: - option -fold-struct-init-code removed, no effect anymore - (tcc_)set_environment() moved to tcc.c - win32/lib/(win)crt1 minor fix & add dependency - debug line output for asm (tcc -c -g xxx.S) enabled - configure/Makefiles: x86-64 -> x86_64 changes - README: cleanup
* Update cygwin Makefile after recent Windows source changesChristian Jullien2017-02-181-18/+8
|
* tcc -hh: show more optionsgrischka2017-02-183-67/+119
|
* tcctools.c: integrate tiny_libmaker/_impdefgrischka2017-02-1817-913/+994
| | | | | | | | | | | | | | usage: tcc -ar [rcsv] lib files... tcc -impdef lib.dll [-v] [-o lib.def] also: - support more files with -c: tcc -c f1.c f2.c ... - fix a bug which caused tcc f1.c f2.S to produce no asm - allow tcc -ar @listfile too - change prototype: _void_ tcc_set_options(...) - apply -Wl,-whole-archive when a librariy is given as libxxx.a also (not just for -lxxx)
* -Wl, --enable-new-dtags for DT_RUNPATH instead of DT_RPATHSteffen Nurpmeso2017-02-184-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Today by accident i had to deal with linker problems of some software and found an issue that mentioned DT_RUNPATH, which mentioned that DT_RPATH is legacy and searched for $LD_LIBRARY_PATH, whereas the newer DT_RUNPATH is searched thereafter. Completely unencrypted! Well. For what's it worth, i for one am astonished because of course i want to override $LD_LIBRARY_PATH, but it surely has its merites, smart people came to the conclusion, did they. The attached diff below seems to be sufficient to support DT_RUNPATH instead of DT_RPATH with tcc(1). But i have no insight in what --enable-new-dtags is supposed to change in addition, so i wonder. Ciao! --steffen libtcc.c | 2 ++ tcc-doc.texi | 4 ++++ tcc.h | 1 + tccelf.c | 3 ++- 4 files changed, 9 insertions(+), 1 deletion(-)
* win32: adjust new unicode supportgrischka2017-02-1811-47/+55
| | | | | | | | | | | | | | | | | | | - lib/Makefile: add (win)crt1_w.o - crt1.c/_runtmain: return to tcc & only use for UNICODE (because it might be not 100% reliable with for example wildcards (tcc *.c -run ...) - tccrun.c/tccpe.c: load -run startup_code only if called from tcc_run(). Otherwise main may not be defined. See libtcc_test.c - tests2/Makefile: pass extra options in FLAGS to allow overriding TCC Also: - tccpe.c: support weak attribute. (I first tried to solve the problem above by using it but then didn't)
* Temporary remove 76_dollards_in_identifiers when run on Windows as this test ↵Christian Jullien2017-02-181-0/+3
| | | | failes. To be checked why.
* Makefile for Windows native tcc handles recent UNICODE supportChristian Jullien2017-02-181-26/+32
|
* Add support for Unicode entries 'wmain' and 'wWinMain' on WindowsYX Hao2017-02-174-31/+111
| | | | | | '-run' suported. argvs are converted. But don't use compliled Unicode CLI exe-file to get inputs interactively in other codepage! Please add other compliling supports than 'build-tcc.bat' (Who is good at them).
* Add entry to run tests2 testsChristian Jullien2017-02-171-0/+9
|
* tiny_impldef.exe was not built by MakefileChristian Jullien2017-02-161-140/+142
|
* Fix wrong name for 85 test.Christian Jullien2017-02-151-1/+1
|
* win32: build-tcc.bat: figure out correct bitness of cl.exeVlad Vissoultchev2017-02-141-6/+21
|
* Improve cygwin Makefile that now support TARGET=32/64 to force final version ↵Christian Jullien2017-02-142-11/+30
| | | | for 32/64 platform
* updates & cleanups (tcc-doc/Changelog/TODO ...)grischka2017-02-1329-771/+221
| | | | | | | | | | | | | | | - tcc-doc.texi: commandline option info update - Changelog/TODO: update - tests/tcctest.py: removed - tests/Makefile: weaktest fixed - tests/tests2: some files renamed and/or converted to unix LF - configure/Makefile: --enable-static option (no dll on win32) - win32/build-tcc.bat: msvc support - win32/tcc-win32.txt: build info update - win32/vs2015/: VS solution removed - win32/include/tcc/tcc_libm.h: #include statement fixed - tcc.c: -include <file> option help info - .gitignore: cleanup
* mems & leaksgrischka2017-02-134-14/+38
| | | | | | | | | | | | - define_start: set above preprocess_start because now preprocess_start is defining macros. - free "cmd_include_files" - free defines always (after error-longjmps) - close all files (after error-longjmps) - tccpe.c: free imports always - libtcc.c: call tcc_memstats only after all states have been deleted.
* fixes & cleanupsgrischka2017-02-1313-90/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - tccgen.c/tcc.h: allow function declaration after use: int f() { return g(); } int g() { return 1; } may be a warning but not an error see also 76cb1144ef91924c53c57ea71e6f67ce73ce1cc6 - tccgen.c: redundant code related to inline functions removed (functions used anywhere have sym->c set automatically) - tccgen.c: make 32bit llop non-equal test portable (probably not on C67) - dynarray_add: change prototype to possibly avoid aliasing problems or at least warnings - lib/alloca*.S: ".section .note.GNU-stack,"",%progbits" removed (has no effect) - tccpe: set SizeOfCode field (for correct upx decompression) - libtcc.c: fixed alternative -run invocation tcc "-run -lxxx ..." file.c (meant to load the library after file). Also supported now: tcc files ... options ... -run @ arguments ...
* Detect native version from default gcc target.Christian Jullien2017-02-121-8/+9
|
* tccgen: yet another nocode_wanted fixgrischka2017-02-121-4/+2
| | | | | | | | | | | Some code in gen_opl was depending on a gvtst label which in nocode_wanted mode is not set. This was causing vstack leaks and crashes with for example long long ll; if (0) return ll - 10 < 0;
* Add Makefile to build native tcc 32/64 on Windows using cygwinChristian Jullien2017-02-121-0/+130
|
* arm64: Fix 42_function_testMichael Matz2017-02-111-2/+2
| | | | | | Like in 77d7ea04a some relocs need to be handled as possibly needing a PLT/GOT slot in TCC until TCC can transfer dynamic relocs to executables.
* Fix testsuite invocationsMichael Matz2017-02-111-2/+2
| | | | | | The return code of $(FILTER) clobbers the return code of TCC itself. So just prepend messages to the generated output file and ignore return codes.
* libtcc: support multiple -Wl,-rpath=...'sgrischka2017-02-111-7/+11
|
* arm: libtcc1.a needs gcc with -fPICgrischka2017-02-111-7/+3
|
* Add pre-build step in VS2015 projects to generate config.h from VERSIONVlad Vissoultchev2017-02-093-0/+61
|
* update VERSION to 0.9.27grischka2017-02-083-6/+6
| | | | | | | | | Also: - in tests: generate .expect files only if not yet present, because 1) some files were adjusted manually 2) switching git branche might change timestamps and cause unwanted update
* win32: build-tcc.bat: add some optionsgrischka2017-02-081-52/+134
| | | | | | | | | | | | | | | | | | In particular: -c <compiler> : Allow using tcc to compile itself -i <dir> : Create installation in dir Summary: usage: build-tcc.bat [ options ... ] options: -c prog use prog (gcc or tcc) to compile tcc -c "prog options" use prog with options to compile tcc -t 32/64 force 32/64 bit default target -v "version" set tcc version -i dir install tcc into dir -d create tcc-doc.html too (needs makeinfo)
* win32: include/winapi: remove more filesgrischka2017-02-0811-1500/+10
| | | | Also: use _assert, older msvcrt does not have _wassert
* tcc: don't use pstrcpy, fix win32 spanwn quotinggrischka2017-02-083-25/+57
| | | | | | | | | | | | - we're now exporting tcc_prefixed symbols from libtcc only - On windows, the msvcrt startup code would remove backslashes from commandline arguments such as -DFOO=\"foo\" which would appear in argv as -DFOO="foo" Therefor before passing these to spawnvp, we need to restore the backslashes.
* tccgen: factor out gfunc_returngrischka2017-02-085-212/+199
| | | | | | | Also: - on windows i386 and x86-64, structures of size <= 8 are NOT returned in registers if size is not one of 1,2,4,8. - cleanup: put all tv-push/pop/swap/rot into one place
* tccgen: gen_cast: cast FLOAT to DOUBLEgrischka2017-02-051-0/+9
| | | | | ... to avoid precision loss when casting to int, also when saving FLOATs to stack
* Revert "partial revert of the commit 4ad186c5ef61"grischka2017-02-053-23/+0
| | | | | | | | | | | | | | | | | | There seems nothing wrong. With int t1 = 176401255; float f = 0.25; int t2 = t1 * f; // 176401255 * 0.25 = 44100313.75 according to the arithmetic conversion rules, the number 176401255 needs to be converted to float, and the compiler can choose either the nearest higher or nearest lower representable number "in an implementation-defined manner". Which may be 176401248 or 176401264. So as result both 44100312 and 44100313 are correct. This reverts commit 664c19ad5ef16f3463087a33ecfe5d5ac24f81ec.
* tccrun: sort sectionsgrischka2017-02-051-12/+26
| | | | | | | Sort executable before other sections. Also, apply RUN_SECTION_ALIGNMENT=63 for TCC_TARGET_I386 as well.
* tccrun: 'selinux' mmap: use only one mappinggrischka2017-02-051-38/+19
| | | | | | | | In the previous implementation, the rx mapping was never used. Therefor it is assumed that it is not needed. With only one mapping there is no reason to use a real /tmp/.xxxx file either as we can use an anonymous mapping.
* SECTION_ALIGNMENT -> RUN_SECTION_ALIGNMENT, and tweaksDavid Mertens2017-01-081-4/+5
| | | | | | | | | | | | Based on feedback from grischka, this commit (1) updates the name of the alignment constant to be more specific (2) aligns all sections, including the first (which previosly was not aligned) (3) reduces the x86-64 alignment from 512 to 64 bytes. The original x86-64 alignment of 512 bytes was based on testing. After ensuring that the initial section is also aligned, the same tests indicated that 64 bytes is sufficient.
* Architecture-specific section alignmentDavid Mertens2017-01-061-1/+7
| | | | | | | | Tests found excessive cache thrashing on x86-64 architectures. The problem was traced to the alignment of sections. This patch sets up an architecture-specific alignment of 512 bytes for x86-64 and 16 bytes for all others. It uses preprocessor directives that, hopefully, make it easy to tweak for other architectures.
* win32: support "-Wl,--large-address-aware" optionPavlas, Zdenek2016-12-303-0/+4
|
* tests: don't assume $(CC) is gccAvi Halachmi (:avih)2016-12-241-2/+2
| | | | This also allows self hosting + testing when $(CC) is tcc.
* tests: OOT build fixes etc.grischka2016-12-207-23/+36
| | | | | | | | | | | | | | | | | | | | | | tests/Makefile: fix out-of-tree build issues Also: - win64: align(16) MEM_DEBUG user memory on win64 the struct jmp_buf in the TCCState structure which we allocate by tcc_malloc needs alignment 16 because the msvcrt setjmp uses MMX instructions. - libtcc_test.c: win32/64 need __attribute__((dllimport)) for extern data objects - tcctest.c: exclude stuff that gcc does not compile except for relocation_test() the other issues are mostly ASM related. We should probably check GCC versions but I have no idea which mingw/gcc versions support what and which don't. - lib/Makefile: use tcc to compile libtcc1.a (except on arm which needs arm-asm
* Fix pseudo leakMichael Matz2016-12-201-5/+6
| | | | | | Once-allocated buffers (here a string) that aren't explicitely freed at program end but rather freed at _exit about 1 nanosecond later are regarded a leak with MEM_DEBUG, so explicitely free it. Blaeh :-/
* Fix some code suppression falloutMichael Matz2016-12-208-20/+138
| | | | | | | | | | Some more subtle issues with code suppression: - outputting asms but not their operand setup is broken - but global asms must always be output - statement expressions are transparent to code suppression - vtop can't be transformed from VT_CMP/VT_JMP when nocode_wanted Also remove .exe files from tests2 if they don't fail.
* i386-gen: fix USE_EBXgrischka2016-12-192-6/+11
| | | | | | | | | | | | | Restore ebx from *ebp because alloca might change esp. Also disable USE_EBX for upcoming release. Actually the benefit is less than one would expect, it appears that tcc can't do much with more than 3 registers except with extensive use of long longs where the disassembly looks much prettier (and shorter also). Also: tccgen/expr_cond() : fix wrong gv/save_regs order
* libtcc.c: -m option cleanupgrischka2016-12-184-197/+148
| | | | | | | | | | | handle mms-bitfields as sub-options of -m. (-mfloat-abi is still special because it requires arguments) tcc.c: help(): - list -mms-bitfields under 'Target specific options' libtcc.c/MEM_DEBUG - add check for past buffer writes