aboutsummaryrefslogtreecommitdiff
path: root/libtcc.c
Commit message (Collapse)AuthorAgeFilesLines
* tccgen/tccelf: move code from libtcc.cgrischka2016-10-151-442/+96
|
* Add more OpenBSD support.Christian Jullien2016-10-151-1/+4
|
* Misc. fixesgrischka2016-10-051-9/+13
| | | | | | | | | | | | | | | | | | | | Makefile : - do not 'uninstall' peoples /usr/local/doc entirely libtcc.c : - MEM_DEBUG : IDE-friendly output "file:line: ..." - always ELF for objects tccgen.c : - fix memory leak in new switch code - move static 'in_sizeof' out of function profiling : - define 'static' to empty resolve_sym() : - replace by dlsym() win32/64: fix R_XXX_RELATIVE fixme - was fixed for i386 already in 8e4d64be2fc1d707c7800c5096f6e0ea22cbd - do not -Lsystemdir if compiling to .o
* tccpp: no cache for include if #elif seengrischka2016-10-041-2/+0
| | | | | | | | #ifndef guards are cached, however after #elif on the same level, the file must be re-read. Also: preprocess asm as such even when there is no assembler (arm).
* configure: fix tcc_lddir, cpugrischka2016-10-031-3/+5
| | | | ... and other minor cosmetic fixes
* Revert "-fnormalize-inc-dirs"grischka2016-10-011-93/+0
| | | | | | | Too much code. gcc 3.x doesn't have that either. This reverts commit 41785a0bf9d505a3647a10ddc330417f52fd4528. This reverts commit 21665f433890e2038626f0b3123b189a62a67dc9.
* build: revert Makefiles to 0.9.26 state (mostly)grischka2016-10-011-3/+3
| | | | | | | | | | | | Except - that libtcc1.a is now installed in subdirs i386/ etc. - the support for arm and arm64 - some of the "Darwin" fixes - tests are mosly unchanged Also - removed the "legacy links for cross compilers" (was total mess) - removed "out-of-tree" build support (was broken anyway)
* libtcc: reimplement option -Wl,[-no]-whöle-archivegrischka2016-10-011-82/+69
| | | | - taking advantage of previous commit "incremental -Wl parsing"
* libtcc: -Wl,... incremental parsinggrischka2016-10-011-34/+27
| | | | parse -Wl linker options immediately
* Revert "output all sections if we produce an executable file"grischka2016-10-011-2/+1
| | | | | | | | | -- Not a fix This reverts commit 089ce6235c99638ad4542a57af4d09e2be0efc88. Revert "handle a -s option by executing sstrip/strip program" -- related, not a fix. This reverts commit 5cd4393a542ef4c64df7dcbb3fbe3a629666239d.
* Revert part of "fix installation amd bcheck for Windows"grischka2016-10-011-10/+0
| | | | | | | tccelf.c : force linking bcheck by adding elf symbol __bound_init bcheck.c : use (size_t)1 for x86_64 Fixes 7e7e6148fdb4adbda936f80b5d4ac3d738908d95
* libtcc: filetype cleanupgrischka2016-10-011-39/+36
| | | | - does not change signature of tcc_add_file
* tccpp: cleanupgrischka2016-10-011-2/+0
| | | | | | | | | | | | | | | | - "utf8 in identifiers" from 936819a1b90f2618bb3f86730189cf2895948ba0 - CValue: remove member str.data_allocated - make tiny allocator private to tccpp - allocate macro_stack objects on heap because otherwise it could crash after error/setjmp in preprocess_delete():end_macro() - mov "TinyAlloc" defs to tccpp.c - define_push: take int* str again
* libtcc: cleanup @listfilegrischka2016-10-011-127/+100
| | | | | | | | | Also: - allow more than one item per line - respect "quoted items" and escaped quotes \" (also for LIBTCCAPI tcc_setoptions) - cleanup some copy & paste
* libtcc: cleanup -x<filetype> switch codegrischka2016-10-011-21/+18
| | | | | Abusing filename[0] as type is just too much of a hack. -- From 05364072042ff37904a7b0b14cdd85a1ea1ca11d
* Revert "ability to compile multiple *.c files with -c switch"grischka2016-10-011-16/+5
| | | | | | | copy & paste coding, twisted control flow This reverts commit a13f183e4c2c4b4d1d40e142b57a4298672dfd2c. Also, set linker args for DLLs also.
* tccpp: restore -D symbols for multiple sourcesgrischka2016-10-011-8/+2
| | | | | | | | | | | | | | | ... also for built-in defines The case: $ tcc -D FOO a.c b.c with // a.c #undef FOO // b.c #ifndef FOO # error -D FOO has been lost #endif
* Revert "--whole-archive support"grischka2016-10-011-13/+1
| | | | | | | | | | | | - would parse linker args in two different places - would mess up "tcc -v ..." output: tcc -v test.c -> test.c +> test.c - would use function "tcc_load_alacarte()" to do the contrary of what its name suggests. This reverts commit 19a169ceb896f78205bc23b847938c58f14d1dda.
* Prevent tail spin crash when option -pthread is used.Jean-Claude Beaudoin2016-09-291-2/+4
|
* Rein in unintended external functions on Windows.Jean-Claude Beaudoin2016-09-271-2/+2
|
* pstrcpy looks to be needed by Windows win32/win64 builds. Reverted as ↵Christian Jullien2016-09-261-1/+1
| | | | PUB_FUNC to allow tcc.exe build again.
* Merge branch 'mob' of git://repo.or.cz/tinycc into mypatchChristian Jullien2016-09-261-6/+6
|\ | | | | | | Add Visual Studio processor identification
| * Rein in unintended external functions.Jean-Claude Beaudoin2016-09-251-6/+6
| |
* | Add Microsoft processor identificationChristian Jullien2016-09-261-0/+6
|/
* Improve __*LP*__ predefined macrosChristian Jullien2016-09-251-2/+9
|
* Redo "fix line number in macro redefined message"grischka2016-05-251-1/+1
| | | | | | Smaller change to fix more cases This reverts commit 0f36f60faa05da7e250a4b4eebd4b534e8a2b537.
* --whole-archive supportseyko2016-05-201-1/+13
| | | | | | | | | | | | | | | A patch is implemented as suggested in tinycc-devel mail list. From: Reuben Thomas Date: Thu, 31 Jul 2014 16:52:53 +0100 Subject: [PATCH] Add --{no,}-whole-archive support I resurrected the patch supplied to the mailing list in 2009 Since --whole-archive is a useful flag to get tcc working with autotools, and of course in its own right, I suggest you have a look at the patch and see if it is acceptable. I cannot see any suggestion that it was actively rejected last time round, just no evidence that it was ever added.
* memory model macros __{L,}LP64__seyko2016-05-151-0/+2
| | | | | | | a patch from tcc bugzilla. From: Reuben Thomas Date: Thu, 31 Jul 2014 13:50:13 +0100 Subject: [PATCH] libtcc.c: add memory model macros __{L,}LP64__
* tccpp: cleanup options -dD -dM, remove -Cgrischka2016-05-051-36/+14
| | | | | | | The lexer is for reading files, not for writing. Also : - macro_is_equal(): avoid crash if redefining __FILE__
* tccgen: scope levels for local symbolsgrischka2016-05-051-1/+0
| | | | | | | | | | | | | | | | | | ... for fast redeclaration checks Also, check function parameters too: void foo(int a) { int a; ... } Also, try to fix struct/union/enum's on different scopes: { struct xxx { int x; }; { struct xxx { int y; }; ... }} and some (probably not all) combination with incomplete declarations "struct xxx;" Replaces 2bfedb18675228c3837c23fa523231f55e102c12 and 07d896c8e5d1b46bf4aebd403c78e5f7ffebe02a Fixes cf95ac399cbce1ea8a519f91dd36a5cfd4ea7943
* -fno-type-redefinition-checkseyko2016-05-041-0/+1
| | | | | | | | | | | | | don't catch redefinition for local vars. With this option on tcc accepts the following code: int main() { int a = 0; long a = 0; } But if you shure there is no problem with your local variables, then a compilation speed can be improved if you have a lots of the local variables (50000+)
* section alignmentseyko2016-04-221-1/+1
| | | | | | Alignment of unknown sections changed from 32 to PTR_SIZE This is gcc/pcc default value. This helps to use tcc as linux kernel compiler.
* Improve hash performanceVlad Vissoultchev2016-04-171-7/+8
| | | | | | | | | | | | - better `TOK_HASH_FUNC` - increases `hash_ident` initial size to 16k (from 8k) - `cstr_cat` uses single `realloc` + `memcpy` - `cstr_cat` can append terminating zero - `tok_str_realloc` initial size to 16 (from 8) - `parse_define` uses static `tokstr_buf` - `next` uses static `tokstr_buf` - fixes two latent bugs (wrong deallocations in libtcc.c:482 and tccpp.c:2987)
* allow to compile tcc by pccseyko2016-04-151-1/+1
| | | | | * pcc have only __linux__ macro (and no __linux) * pcc don't have __clear_cache proc
* preprocessor oprtion -C (keep comments)seyko2016-04-151-0/+20
| | | | | This is done by impression of the pcc -C option. Usual execution path and speed are not changed.
* Simplify @listfiles parsingVlad Vissoultchev2016-04-131-39/+17
| | | | This moves listfiles parsing inline in `tcc_parse_args1`
* Allow tcc arguments to be read from @listfilesseyko2016-04-131-27/+84
| | | | | | | | | | | | | | | | | From: Vlad Vissoultchev Date: Tue, 12 Apr 2016 20:43:15 +0300 Subject: Allow tcc arguments to be read from @listfiles This allows all @ prefixed arguments to be treated as listfiles containing list of source files or tcc options where each one is on a separate line. Can be used to benchmark compilation speed with non-trivial amount of source files. The impl of `tcc_parse_args` had to be moved to a new function that is able to be called recursively w/ the original one remaining as a driver of the new one. Listfiles parsing happens in a new `args_parser_add_listfile` function that uses `tcc_open`/`tcc_close/inp` for buffered file input.
* Implement -dM preprocessor option as in gccVlad Vissoultchev2016-04-061-2/+4
| | | | | | There was already support for -dD option but in contrast -dM dumps only `#define` directives w/o actual preprocessor output. The original -dD output differs from gcc output by additional comment in front of `#define`s so this quirk is left for -dM as well.
* -fnormalize-inc-dirsseyko2016-04-031-0/+93
| | | | | | remove non-existent or duplicate directories from include paths if -fnormalize-inc-dirs is specified. This will help to compile current coreutils package
* tccpp: cleanup #include_nextgrischka2015-11-201-92/+0
| | | | | | | | | | | | | | | | tcc_normalize_inc_dirs: normally no problem to be absolutly gcc compatible as long as it can be done the tiny way. This reverts to the state before recent related commits and reimplements a (small) part of it to fix the reported problem. Also: Revert "parsing "..." sequence" c3975cf27c792d493e76a2058a1eaf588324053e && p[1] == '.' is not a reliable way to lookahead
* tccgen: asm_label cleanupgrischka2015-11-201-1/+1
| | | | | | | - avoid memory allocation by using its (int) token number - avoid additional function parameter by using Attribute Also: fix some strange looking error messages
* Trivial changes to avoid some compiler warnings.Edmund Grimley Evans2015-11-191-1/+1
|
* libtcc.c: Completely replace tcc_normalize_inc_dirs.Edmund Grimley Evans2015-11-111-73/+26
|
* win: include dirs: add some docs, minor refactorAvi Halachmi (:avih)2015-11-081-4/+18
|
* 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.
* normalize inc dirs, symplify include_nextseyko2015-11-051-0/+80
| | | | | | | | | 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
* Define __WINT_TYPE__ as int in NetBSDKamil Rytarowski2015-10-111-1/+1
|
* Add support for -D__NetBSD__Kamil Rytarowski2015-10-111-0/+5
|