| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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 ...
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Also ...
tcctest.c:
- exclude stuff that gcc doesn't compile on windows.
libtcc.c/tccpp.c:
- use unsigned for memory sizes to avoid printf format warnings
- use "file:line: message" to make IDE error parsers happy.
tccgen.c: fix typo
|
| |
|
|
| |
the last one wins, i.e. "-O2 -O0" does _not_ set __OPTIMIZ__.
|
| |
|
|
|
| |
This disables generation of any SSE instructions (in particular
in stdarg function prologues). Necessary for kernel compiles.
|
| |
|
|
|
| |
Our architectures don't need anything special for this
builtin, just pass through the argument.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The return value of statement expressions might refer to local
symbols, so those can't be popped. The old error message always
was just a band-aid, and since disabling it for pointer types it
wasn't effective anyway. It also never considered that also the
vtop->sym member might have referred to such symbols (see the
testcase with the local static, that used to segfault).
For fixing this (can be seen better with valgrind and SYM_DEBUG)
simply leave local symbols of stmt exprs on the stack.
|
| |
|
|
|
|
|
| |
These are preprocessor cmdline arguments, but even in GCC they
aren't specified but rather left as being subject to changes.
Nobody should use them, but let's to a half-assed attempt
at accepting them.
|
| | |
|
| |
|
|
|
|
| |
This option includes a file as if '#include "file"' is the first
line of compiled files. It's processed after all -D/-U options
and is processed per input file.
|
| |
|
|
|
|
|
|
| |
gen_inline_functions uses the macro facilities of the preprocessor,
which would interact when macros would still be defined in a
different pre-processor implementation I'm working on.
So always free defines before generating inline functions, they
are all macro expanded already.
|
| |
|
|
|
|
|
|
|
|
| |
- generate and use SYM@PLT for plt addresses
- get rid of patch_dynsym_undef hack (no idea what it did on FreeBSD)
- use sym_attrs instead of symtab_to_dynsym
- special case for function pointers into .so on i386
- libtcc_test: test tcc_add_symbol with data object
- move target specicic code to *-link.c files
- add R_XXX_RELATIVE (needed for PE)
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
add_elf_sym is a confusing name because it is not clear what the
function does compared to put_elf_sym. As a matter of fact, put_elf_sym
also adds a symbol in a symbol table. Besides, "add_elf_sym" fails to
convey that the function can be used to update a symbol (for instance
its value). "set_elf_sym" seems like a more appropriate name: it will
set a symbol to a given set of properties (value, size, etc.) and create
a new one if non exist for that name as one would expect.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
- call RtlDeleteFunctionTable
(important for multiple compilations)
- the RUNTIME_FUNCTION* is now at the beginning of the
runtime memory. Therefor when tcc_relocate is called
with user memory, this should be done manually before
it is free'd:
RtlDeleteFunctionTable(*(void**)user_mem);
[ free(user_mem); ]
- x86_64-gen.c: expand char/short return values to int
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
FreeBSDs system headers contain unconditional usage of
macros like __aligned(x), which are only conditionally defined
in sys/cdefs.h (conditional on __GNUC__ or __INTEL_COMPILER).
Bug in FreeBSD, but as work-around we can define __GNUC__ which
picks up these defs.
[This also moves back the glibc defines we had before into the
non-BSD ifdef branch]
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
__GNUC__ nowadays as macro seems to mean the "GNU C dialect"
rather than the compiler itself. See also
http://gcc.gnu.org/ml/gcc/2008-07/msg00026.html
This patch will probably cause problems of various kinds but
maybe we should try nonetheless.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
| |
#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).
|
| |
|
|
| |
... and other minor cosmetic fixes
|
| |
|
|
|
|
|
| |
Too much code. gcc 3.x doesn't have that either.
This reverts commit 41785a0bf9d505a3647a10ddc330417f52fd4528.
This reverts commit 21665f433890e2038626f0b3123b189a62a67dc9.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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)
|
| |
|
|
| |
- taking advantage of previous commit "incremental -Wl parsing"
|
| |
|
|
| |
parse -Wl linker options immediately
|
| |
|
|
|
|
|
|
|
| |
-- 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.
|
| |
|
|
|
|
|
| |
tccelf.c : force linking bcheck by adding elf symbol __bound_init
bcheck.c : use (size_t)1 for x86_64
Fixes 7e7e6148fdb4adbda936f80b5d4ac3d738908d95
|
| |
|
|
| |
- does not change signature of tcc_add_file
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- "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
|
| |
|
|
|
|
|
|
|
| |
Also:
- allow more than one item per line
- respect "quoted items" and escaped quotes \"
(also for LIBTCCAPI tcc_setoptions)
- cleanup some copy & paste
|
| |
|
|
|
| |
Abusing filename[0] as type is just too much of a hack.
-- From 05364072042ff37904a7b0b14cdd85a1ea1ca11d
|
| |
|
|
|
|
|
| |
copy & paste coding, twisted control flow
This reverts commit a13f183e4c2c4b4d1d40e142b57a4298672dfd2c.
Also, set linker args for DLLs also.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
... 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
|
| |
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
| | |
|
| | |
|
| |
|
|
| |
PUB_FUNC to allow tcc.exe build again.
|
| |\
| |
| |
| | |
Add Visual Studio processor identification
|
| | | |
|
| |/ |
|