mirror of
https://github.com/TinyCC/tinycc.git
synced 2025-11-16 12:34:45 +00:00
In build systems, this is used to automatically collect target
dependencies, e.g.
---- 8< (hello.c) ----
#include "hello.h"
#include <stdio.h>
int main()
{
printf("Hello World!\n");
return 0;
}
$ tcc -MD -c hello.c # -> hello.o, hello.d
$ cat hello.d
hello.o : \
hello.c \
hello.h \
/usr/include/stdio.h \
/usr/include/features.h \
/usr/include/bits/predefs.h \
/usr/include/sys/cdefs.h \
/usr/include/bits/wordsize.h \
/usr/include/gnu/stubs.h \
/usr/include/bits/wordsize.h \
/usr/include/gnu/stubs-32.h \
/home/kirr/local/tcc/lib/tcc/include/stddef.h \
/usr/include/bits/types.h \
/usr/include/bits/wordsize.h \
/usr/include/bits/typesizes.h \
/usr/include/libio.h \
/usr/include/_G_config.h \
/usr/include/wchar.h \
/home/kirr/local/tcc/lib/tcc/include/stdarg.h \
/usr/include/bits/stdio_lim.h \
/usr/include/bits/sys_errlist.h \
NOTE: gcc supports -MD only for .c -> .o, but in tcc, we generate
dependencies for whatever action is being taken. E.g. for .c -> exe, the
result will be:
$ tcc -MD -o hello hello.c # -> hello, hello.d
hello: \
/usr/lib/crt1.o \
/usr/lib/crti.o \
hello.c \
hello.h \
/usr/include/stdio.h \
/usr/include/features.h \
/usr/include/bits/predefs.h \
/usr/include/sys/cdefs.h \
/usr/include/bits/wordsize.h \
/usr/include/gnu/stubs.h \
/usr/include/bits/wordsize.h \
/usr/include/gnu/stubs-32.h \
/home/kirr/local/tcc/lib/tcc/include/stddef.h \
/usr/include/bits/types.h \
/usr/include/bits/wordsize.h \
/usr/include/bits/typesizes.h \
/usr/include/libio.h \
/usr/include/_G_config.h \
/usr/include/wchar.h \
/home/kirr/local/tcc/lib/tcc/include/stdarg.h \
/usr/include/bits/stdio_lim.h \
/usr/include/bits/sys_errlist.h \
/usr/lib/libc.so \
/lib/libc.so.6 \
/usr/lib/ld-linux.so.2 \
/lib/ld-linux.so.2 \
/usr/lib/libc_nonshared.a \
/lib/libc.so.6 \
/usr/lib/libc_nonshared.a \
/home/kirr/local/tcc/lib/tcc/libtcc1.a \
/usr/lib/crtn.o \
So tcc dependency generator is a bit more clever than one used in gcc :)
Also, I've updated TODO and Changelog (in not-yet-released section).
v2:
(Taking inputs from grischka and me myself)
- put code to generate deps file into a function.
- used tcc_fileextension() instead of open-coding
- generate deps only when compilation/preprocessing was successful
v3:
- use pstrcpy instead of snprintf(buf, sizeof(buf), "%s", ...)
95 lines
3.3 KiB
Plaintext
95 lines
3.3 KiB
Plaintext
TODO list:
|
|
|
|
Bugs:
|
|
|
|
- fix macro substitution with nested definitions (ShangHongzhang)
|
|
- FPU st(0) is left unclean (kwisatz haderach). Incompatible with
|
|
optimized gcc/msc code
|
|
|
|
- constructors
|
|
- cast bug (Peter Wang)
|
|
- define incomplete type if defined several times (Peter Wang).
|
|
- configure --cc=tcc (still one bug in libtcc1.c)
|
|
- test binutils/gcc compile
|
|
- tci patch + argument.
|
|
- see -lxxx bug (Michael Charity).
|
|
- see transparent union pb in /urs/include/sys/socket.h
|
|
- precise behaviour of typeof with arrays ? (__put_user macro)
|
|
but should suffice for most cases)
|
|
- handle '? x, y : z' in unsized variable initialization (',' is
|
|
considered incorrectly as separator in preparser)
|
|
- transform functions to function pointers in function parameters
|
|
(net/ipv4/ip_output.c)
|
|
- fix function pointer type display
|
|
- check lcc test suite -> fix bitfield binary operations
|
|
- check section alignment in C
|
|
- fix invalid cast in comparison 'if (v == (int8_t)v)'
|
|
- finish varargs.h support (gcc 3.2 testsuite issue)
|
|
- fix static functions declared inside block
|
|
- fix multiple unions init
|
|
- sizeof, alignof, typeof can still generate code in some cases.
|
|
- Fix the remaining libtcc memory leaks.
|
|
- make libtcc fully reentrant (except for the compilation stage itself).
|
|
|
|
Bound checking:
|
|
|
|
- '-b' bug.
|
|
- fix bound exit on RedHat 7.3
|
|
- setjmp is not supported properly in bound checking.
|
|
- fix bound check code with '&' on local variables (currently done
|
|
only for local arrays).
|
|
- bound checking and float/long long/struct copy code. bound
|
|
checking and symbol + offset optimization
|
|
|
|
Missing features:
|
|
|
|
- disable-asm and disable-bcheck options
|
|
- __builtin_expect()
|
|
- improve '-E' option.
|
|
- atexit (Nigel Horne)
|
|
- packed attribute
|
|
- C99: add variable size arrays (gcc 3.2 testsuite issue)
|
|
- C99: add complex types (gcc 3.2 testsuite issue)
|
|
- postfix compound literals (see 20010124-1.c)
|
|
|
|
Optimizations:
|
|
|
|
- suppress specific anonymous symbol handling
|
|
- more parse optimizations (=even faster compilation)
|
|
- memory alloc optimizations (=even faster compilation)
|
|
- optimize VT_LOCAL + const
|
|
- better local variables handling (needed for other targets)
|
|
|
|
Not critical:
|
|
|
|
- C99: fix multiple compound literals inits in blocks (ISOC99
|
|
normative example - only relevant when using gotos! -> must add
|
|
boolean variable to tell if compound literal was already
|
|
initialized).
|
|
- add PowerPC or ARM code generator and improve codegen for RISC (need
|
|
to suppress VT_LOCAL and use a base register instead).
|
|
- interactive mode / integrated debugger
|
|
- fix preprocessor symbol redefinition
|
|
- better constant opt (&&, ||, ?:)
|
|
- add portable byte code generator and interpreter for other
|
|
unsupported architectures.
|
|
- C++: variable declaration in for, minimal 'class' support.
|
|
- win32: __intxx. use resolve for bchecked malloc et al.
|
|
check exception code (exception filter func).
|
|
- handle void (__attribute__() *ptr)()
|
|
|
|
Fixed (probably):
|
|
|
|
- bug with defines:
|
|
#define spin_lock(lock) do { } while (0)
|
|
#define wq_spin_lock spin_lock
|
|
#define TEST() wq_spin_lock(a)
|
|
- typedefs can be structure fields
|
|
- see bugfixes.diff + improvement.diff from Daniel Glockner
|
|
- long long constant evaluation
|
|
- add alloca()
|
|
- gcc '-E' option.
|
|
- #include_next support for /usr/include/limits ?
|
|
- function pointers/lvalues in ? : (linux kernel net/core/dev.c)
|
|
- win32: add __stdcall, check GetModuleHandle for dlls.
|