History

update

bellard committed 24 years ago

Commit b0b2d5d1 parent 2694c107 files · +49 −62Browse files

Unified · Split

7 files
  1. Makefile +20 −10
  2. README +7 −42
  3. TODO +7 −7
  4. stdbool.h +10 −0
  5. stddef.h +2 −1
  6. tcc-doc.texi +2 −2
  7. tcclib.h +1 −0
Makefile+20−10
@@ -5,13 +5,13 @@ prefix=/usr/local · 4 unmodified lines
55
66 CFLAGS=-O2 -g -Wall -Wno-parentheses -Wno-missing-braces -I.
77 LIBS=-ldl
8−#CFLAGS=-O2 -g -Wall -Wno-parentheses -I. -pg -static -DPROFILE
9−#LIBS=
8+CFLAGS_P=$(CFLAGS) -pg -static -DCONFIG_TCC_STATIC
9+LIBS_P=
1010
1111 CFLAGS+=-m386 -malign-functions=0
1212 DISAS=objdump -D -b binary -m i386
1313 INSTALL=install
14−VERSION=0.9.1
14+VERSION=0.9.2
1515
1616 all: tcc
1717
@@ -21,7 +21,7 @@ test: test.ref test.out · 3 unmodified lines
2121 @if diff -u test.ref test.out ; then echo "Auto Test OK"; fi
2222
2323 prog.ref: prog.c
24− gcc $(CFLAGS) -o $@ $<
24+ gcc3 $(CFLAGS) -o $@ $<
2525
2626 test.ref: prog.ref
2727 ./prog.ref > $@
@@ -33,12 +33,12 @@ run: tcc prog.c · 5 unmodified lines
3333 ./tcc -I. prog.c
3434
3535 # iterated test2 (compile tcc then compile prog.c !)
36−test2: tcc tcc.c prog.c
36+test2: tcc tcc.c prog.c test.ref
3737 ./tcc -I. tcc.c -I. prog.c > test.out2
3838 @if diff -u test.ref test.out2 ; then echo "Auto Test2 OK"; fi
3939
4040 # iterated test3 (compile tcc then compile tcc then compile prog.c !)
41−test3: tcc tcc.c prog.c
41+test3: tcc tcc.c prog.c test.ref
4242 ./tcc -I. tcc.c -I. tcc.c -I. prog.c > test.out3
4343 @if diff -u test.ref test.out3 ; then echo "Auto Test3 OK"; fi
4444
@@ -57,7 +57,7 @@ ex3: ex3.c · 12 unmodified lines
5757
5858 # Tiny C Compiler
5959
60−tcc_g: tcc.c Makefile
60+tcc_g: tcc.c i386-gen.c Makefile
6161 gcc $(CFLAGS) -o $@ $< $(LIBS)
6262
6363 tcc: tcc_g
@@ -66,11 +66,15 @@ tcc: tcc_g · 2 unmodified lines
6666 install: tcc
6767 $(INSTALL) -m755 tcc $(prefix)/bin
6868 mkdir -p $(prefix)/lib/tcc
69− $(INSTALL) -m644 stdarg.h stddef.h tcclib.h $(prefix)/lib/tcc
69+ $(INSTALL) -m644 stdarg.h stddef.h float.h tcclib.h $(prefix)/lib/tcc
7070
7171 clean:
7272 rm -f *~ *.o tcc tcc1 tcct tcc_g prog.ref *.bin *.i ex2 \
73− core gmon.out test.out test.ref a.out
73+ core gmon.out test.out test.ref a.out tcc_p
74+
75+# profiling version
76+tcc_p: tcc.c Makefile
77+ gcc $(CFLAGS_P) -o $@ $< $(LIBS_P)
7478
7579 # target for development
7680
@@ -78,6 +82,9 @@ clean: · 1 unmodified line
7882 ./tcc -o $@ -I. $<
7983 $(DISAS) $@
8084
85+instr: instr.o
86+ objdump -d instr.o
87+
8188 instr.o: instr.S
8289 gcc -O2 -Wall -g -c -o $@ $<
8390
@@ -88,6 +95,9 @@ tar: · 4 unmodified lines
8895 cp -r ../tcc /tmp/$(FILE)
8996 ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz \
9097 $(FILE)/Makefile $(FILE)/README $(FILE)/TODO $(FILE)/COPYING \
91− $(FILE)/tcc.c $(FILE)/stddef.h $(FILE)/stdarg.h $(FILE)/tcclib.h \
98+ $(FILE)/Changelog $(FILE)/tcc-doc.html \
99+ $(FILE)/tcc.c $(FILE)/i386-gen.c \
100+ $(FILE)/stddef.h $(FILE)/stdarg.h $(FILE)/stdbool.h $(FILE)/float.h \
101+ $(FILE)/tcclib.h \
92102 $(FILE)/ex*.c $(FILE)/prog.c )
93103 rm -rf /tmp/$(FILE)
README+7−42
@@ -5,7 +5,7 @@ Features: · 4 unmodified lines
55 --------
66
77 - SMALL! You can compile and execute C code everywhere, for example on
8− rescue disks (29KB for x86 TCC executable).
8+ rescue disks.
99
1010 - FAST! tcc generates optimized x86 code. No byte code
1111 overhead. Compiles, assemble and link about 7 times faster than 'gcc
@@ -27,7 +27,7 @@ Documentation: · 15 unmodified lines
2727
2828 1) Installation
2929
30−***TCC currently only work on Linux x86***.
30+***TCC currently only works on Linux x86***.
3131
3232 Type 'make install' to compile and install tcc in /usr/local/bin and
3333 /usr/local/lib/tcc.
@@ -60,8 +60,8 @@ default ones are: /usr/include, /usr/lib/tcc, /usr/local/lib/tcc. · 26 unmodified lines
6060 libxxx.so. Standard library paths are checked, including those
6161 specificed with LD_LIBRARY_PATH.
6262
63−Only one source code can be compiled. If you have multiple source
64−files, add one which includes all your sources.
63+'-i file' : compile C source 'file' before main C source. With this
64+command, multiple C files can be compiled and linked together.
6565
6666 4) Examples
6767
@@ -84,44 +84,9 @@ generator. · 16 unmodified lines
8484 prog.c: auto test for TCC which tests many subtle possible bugs. Used
8585 when doing 'make test'.
8686
87−Exact differences with ANSI C:
88−-----------------------------
87+5) Full Documentation
8988
90−- Preprocessor: the preprocessor tokens are the same as C. It means
91− that in some rare cases, preprocessed numbers are not handled
92− exactly as in ANSI C. This approach has the advantage of being
93− simpler and FAST!
94−
95−- Types: floating point numbers are not supported yet.
96−
97−- Bit fields are not supported.
98−
99−- Linking: extern variables must appear in a referenced dll and cannot
100− appear in current source.
101−
102−Supported ANSI C extensions:
103−---------------------------
104−
105−- 'inline' keyword is ignored (ISOC99).
106−
107−- 'restrict' keyword is ignored (ISOC99).
108−
109−- '__func__' is a string variable containing the current function name (ISOC99).
110−
111−- Variadic macros: __VA_ARGS__ can be used for function-like macros (ISOC99):
112− #define dprintf(level, __VA_ARGS__) printf(__VA_ARGS__).
113−
114−- Declarations can appear anywhere in a block (ISOC99).
115−
116−- Array and struct/union elements can be initialized in any order by
117− using designators (.e.g. { [0].x = 1 }) (ISOC99).
118−
119−- Compound initializers are supported (e.g. int *p = (int []){ 1, 2,
120− 3}) (ISOC99).
121−
122−- '#!' at the start of a line is ignored to allow scripting.
123−
124−- Binary digits can be entered ('0b101' instead of '5').
89+Please read tcc-doc.html to have all the features of TCC.
12590
12691 Technical Description:
12792 ---------------------
@@ -162,7 +127,7 @@ License: · 34 unmodified lines
162127 TCC is distributed under the GNU General Public License (see COPYING
163128 file).
164129
165−I accept only patches where you give your copyright explictely to me
130+I accept only patches where you give your copyright explicitely to me
166131 to simplify licensing issues.
167132
168133 Fabrice Bellard - Nov 17, 2001.
TODO+7−7
@@ -1,21 +1,21 @@
11 TODO list:
22
33 Critical:
4−
5−- add float/double support (should be as small as possible while being
6− usable for RISC code generator too).
4+- finish float/double support. add function type convertion.
5+- section generation and GNUC __attributte__ handling.
6+- D option with '=' handling
77 - 0 is pointer - fix type compare
8−- add message if external function or variable not found.
98 - To check: 'sizeof' may not work if too complex expression is given.
10−- fix 'char' and 'short' casts (in function parameters and in assignment).
11−- function pointers to forward reference (patch code generator).
9+- fix 'char' and 'short' casts (only in function parameters and in
10+ assignment).
1211
1312 Not critical:
1413
14+- interactive mode
1515 - fix multiple compound literals inits in blocks (ISOC99 normative
1616 example - only relevant when using gotos! -> must add boolean
1717 variable to tell if compound literal was already initialized).
18−- fix L"\x1234" wide string case (need to store them as ints ?) */
18+- fix L"\x1234" wide string case (need to store them as utf8 ?)
1919 - fix preprocessor symbol redefinition
2020 - better constant opt (&&, ||, ?:)
2121 - add ELF executable and shared library output option (would be needed
stdbool.h+10−0
@@ -0,0 +1,10 @@
1+#ifndef _STDBOOL_H
2+#define _STDBOOL_H
3+
4+/* ISOC99 boolean */
5+
6+#define bool _Bool
7+#define true 1
8+#define false 0
9+
10+#endif /* _STDBOOL_H */
stddef.h+2−1
@@ -1,9 +1,10 @@
11 #ifndef _STDDEF_H
22 #define _STDDEF_H
33
4−/* TCC include file */
54 #define NULL ((void *)0)
65 typedef unsigned int size_t;
76 typedef int wchar_t;
7+typedef int ptrdiff_t;
8+#define offsetof(type, field) ((size_t) &((type *)0)->field)
89
910 #endif
tcc-doc.texi+2−2
@@ -29,8 +29,8 @@ it was an executable. · 28 unmodified lines
2929
3030 <h2>Exact differences with ANSI C</h2>
3131
32−TCC implements almost all the ANSI C standard, except floating point
33−and long long numbers.
32+TCC implements almost all the ANSI C standard, except floating points
33+numbers.
3434
3535 <ul>
3636 <li> The preprocessor tokens are the same as C. It means that in some
tcclib.h+1−0
@@ -4,6 +4,7 @@ · 3 unmodified lines
44 * only for your convenience so that you do not need to put the whole
55 * glibc include files on your floppy disk
66 */
7+
78 #include <stddef.h>
89 #include <stdarg.h>
910

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t