aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Tidy typename parsing a bitMichael Matz2017-05-021-26/+16
|
* Tidy arg parsing for builtinsMichael Matz2017-05-021-76/+52
| | | | Saves some lines of code.
* Clarify that the CIL target code is deadMichael Matz2017-05-021-0/+2
| | | | | This backend doesn't work anymore since a long time. Don't remove it yet, it might be an inspiration.
* Remove VT_REFMichael Matz2017-05-023-12/+3
| | | | | | The canonical way to describe a local variable that actually holds the address of an lvalue is VT_LLOCAL. Remove the last user of VT_REF, and handling of it, thereby freeing a flag for SValue.r.
* Fix bogus check for VT_LLOCAL typesMichael Matz2017-05-021-4/+8
| | | | | | VT_LLOCAL is a flag on .r, not on type.t. Fixing this requires minor surgery for compound literals which accidentally happened to be subsumed by the bogus test.
* elf: Tidy section headersMichael Matz2017-05-021-2/+51
| | | | | | | Don't emit useless section headers and also sort them in allocated order. Doesn't change behaviour except makes the resulting files a tiny bit smaller (though at the expense of some very tiny compile time and code size increase of tcc itself; not 100% it's worth it).
* fix __builtin_expectMichael Matz2017-05-021-25/+2
| | | | | | | | the second argument can be an arbitrary expression (including side-effects), not just a constant. This removes the last user of expr_lor_const and hence also that function (and expr_land_const). Also the argument to __builtin_constant_p can be only a non-comma expression (like all functions arguments).
* Fix more bitfield corner casesMichael Matz2017-05-012-0/+9
| | | | | | | Our code generation assumes that it can load/store with the bit-fields base type, so bit_pos/bit_size must be in range for this. We could change the fields type or adjust offset/bit_pos; we do the latter.
* Fix last changeMichael Matz2017-05-011-1/+1
| | | | | Skipping anonymous bit-fields is correct, but not other anonymous ones like unions or structs.
* Remove a bit-field TODOMichael Matz2017-04-293-1/+9
| | | | | | Checked the lcc testsuite for bitfield stuff (in cq.c and fields.c), fixed one more error in initializing unnamed members (which have to be skipped), removed the TODO.
* Fix char bitfields corner caseMichael Matz2017-04-292-1/+7
| | | | See testcase.
* arm: Fix build_got_entriesThomas Stalder2017-04-271-1/+5
|
* Add -static to be in sync with Windows bat.Christian Jullien2017-04-271-1/+1
|
* configure: fix permissionsgrischka2017-04-261-0/+0
| | | | | There must be something with git on windows that it messes up x permissions sometimes.
* Simple-minded fix for bug #50847Larry Doolittle2017-04-253-1/+4
| | | | | | bug #50847: #line directive corrupts #include search path Keep a second copy of the filename, that isn't changed by the #line directive, and use that on the initial search path for #include files.
* final adjustments for releasegrischka2017-04-2513-159/+158
| | | | | | | | | | | | | | | | | | | | | - configure/Makefiles: minor adjustments - build-tcc.bat: add -static to gcc options (avoids libgcc_s*.dll dependency with some mingw versions) - tccpe.c/tcctools.c: eliminate MAX_PATH (not available for cross compilers) - tccasm.c: use uint64_t/strtoull in unary() (unsigned long sometimes is only uint32_t, as always on windows) - tccgen.c: Revert (f077d16c) "tccgen: gen_cast: cast FLOAT to DOUBLE" Was a rather experimental, tentative commit, not really necessary and somewhat ugly too. - cleanup recent osx support: - Makefile/libtcc.c: cleanup copy&paste code - tccpp.c: restore deleted function
* tcc: report Darwin when building for Mach-O binaries.Andrei Warkentin2017-04-251-0/+2
| | | | | | | Somewhat revert c4c3f50, but key off the config, not host system. Signed-off-by: Andrei Warkentin <andrey.warkentin@gmail.com>
* tcc: fixup clang warningsAndrei Warkentin2017-04-2510-45/+17
| | | | | | | | | | | The O(xxx) stuff in i386-asm.c had me scratching my head. Extracting the macro and trying it out in a separate program doesn't give me any warnings, so I'm confused about what could be going on there. Any cast will make things happy. I used a uint64_t to catch actual cases of overflow, which will still cause a -Wconstant-conversion warning. Signed-off-by: Andrei Warkentin <andrey.warkentin@gmail.com>
* tcc: early OSX native supportAndrei Warkentin2017-04-254-4/+48
| | | | | | | | | | | | - build scripts - working '-run' mode, e.g.: ./tcc -B. -I./include -I. -I.. -D_ANSI_SOURCE -run examples/ex1.c Note: we don't bother parsing Mach-O/Fat images yet. We blindly dlopen the image. Signed-off-by: Andrei Warkentin <andrey.warkentin@gmail.com>
* Add support of musl-libcMarc Vertes2017-04-208-6/+33
| | | | The port is functional. Bound checking is not supported yet.
* tccpp: Fix corner case of fnlike macro invocationMichael Matz2017-04-153-2/+22
| | | | | | | Arg substitution leaves placeholder marker in the stream for empty arguments. Those need to be skipped when searching for a fnlike macro invocation in the replacement list itself. See testcase.
* tccgen/win32: let __declspec(dllimport) imply externgrischka2017-04-047-170/+166
| | | | | | | | | | | | | | | | | | | | | | | Also, retain storage qualifiers in type_decl, in particular also for function pointers. This allows to get rid of this very early hack in decl() type.t |= (btype.t & VT_STATIC); /* Retain "static". */ which was to fix the case of int main() { static int (*foo)(); ... Also: - missing __declspec(dllimport) is an error now - except if the symbol is "_imp__symbol" - demonstrate export/import of data in the dll example (while 'extern' isn't strictly required with dllimport anymore) - new function 'patch_storage()' replaces 'weaken_symbol()' and 'apply_visibility()' - new function 'update_storage()' applies storage attributes to Elf symbols. - put_extern_sym/2 accepts new pseudo section SECTION_COMMON - add -Wl,-export-all-symbols as alias for -rdynamic - add -Wl,-subsystem=windows for mingw compatibility - redefinition of 'sym' error for initialized global data
* Even on Darwin, tcc should display LinuxChristian Jullien2017-02-261-2/+0
|
* win: tests Makefile: fix global pathAvi Halachmi (:avih)2017-02-261-1/+1
| | | | | | | | | | Commit bb93064 changed the path seperator from ':' to ';', which was likely accidental. While path seperator on Windows is generally ';', the Makefile clearly expects a posix-y shell, and in such environments the separator is ':'. This fixes the test run in MSYS2 and MSYS(1) environments, which got broken on bb93064 .
* Linux was incorrectly identified in banner when compiled on macOS DarwinChristian Jullien2017-02-261-0/+2
|
* 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
|