aboutsummaryrefslogtreecommitdiff
path: root/tcc.c
Commit message (Collapse)AuthorAgeFilesLines
...
* make: create native tcc from separate objectsgrischka2011-07-141-3/+3
| | | | | | | | | | | | | | | | | | | | | | | This was already possible using make NOTALLINONE=1 and is now the default. To build as previously from one big source, use make ONE_SOURCE=1 Cross compilers are still build from one source because using separate objects requires separate build directories one per platform which currently is not (yet) supported by the makefile. We could probably use gnu-makeish target variables like $(I386_CROSS): OUTDIR=build/i386 $(X64_CROSS): OUTDIR=build/x86-64 and so on ... Also NEED_FLOAT_TYPES for arm-gen is removed. It was about variables that are referenced from outside (libtcc, tccgen). We could declare them in tcc.h (as with reg_classes) or have them twice in arm-gen.c. I chose option 2.
* tcc: add sysinclude path with -B, like gcc doesJoe Soroka2011-02-021-1/+7
|
* add -isystem cmdline optionJoe Soroka2011-02-011-0/+5
|
* tcc.c: fix an error when you build an object file with '-pthread' key setSergei Trofimovich2011-01-041-5/+11
| | | | | | | | | | | | | | | | | | | The problem was partially fixed by Henry in the following patch: tcc.c: skip -lpthread when -c option specified But that patch had one brawback: it is sensitive to argument order, as decision is taken during commandline parsing: $ tcc -c a.c -o a.o -pthread # 1. works fine tcc: error: file 'a.c' not found $ tcc -pthread -c a.c -o a.o # 2. blows tcc: error: cannot specify libraries with -c This patch fixes case 2. Signed-off-by: Sergei Trofimovich <st@anti-virus.by>
* tcc: add unsupported option -pedanticHenry Kroll III2010-12-201-0/+2
|
* tcc: -m32 prefix "win32-" when file extension is presentHenry Kroll III2010-12-131-4/+14
|
* tcc: fix format string in error handlerHenry Kroll III2010-12-081-4/+4
|
* tcc: oops, error handler does not accept format stringsHenry Kroll III2010-12-081-4/+4
|
* tcc: fix -m32 and add -m64 optionHenry Kroll III2010-12-081-25/+61
|
* tcc: move undef out of if blockHenry Kroll III2010-12-061-1/+1
|
* tcc: add -m32 option to x86_64 cross compilersHenry Kroll III2010-12-061-1/+34
|
* trim unnecessary bits from my previous 3 commitsHenry Kroll III2010-12-051-2/+0
|
* tcc: add option -s for gcc compatibility (ignored)Henry Kroll III2010-12-041-1/+5
|
* tcc.c: skip -lpthread when -c option specifiedHenry Kroll III2010-11-301-2/+4
|
* tcc: Linux -pthread option sets -D_REENTRANT and -lpthreadHenry Kroll III2010-11-241-0/+9
|
* tccmain: simplify option helpgrischka2010-09-081-4/+4
|
* tcc: Explicitly require -l<lib> for librariesKirill Smelkov2010-06-211-1/+1
| | | | | Previously it was possible to specify e.g. -q<lib> and still link with lib. Avoid such behaviour by checking for '-l' instead of '-l.'
* tcc: Draft suppoprt for -MD/-MF optionsKirill Smelkov2010-06-211-6/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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", ...)
* tcc: Refactor "compute default outfile name" into libtcc functionKirill Smelkov2010-06-201-25/+4
| | | | | | | | | | | | | | | | Since for upcoming -MD support default _compile_ output file be needed even when preprocesssing (tcc -E), let's move this code out of one particular condition block into a common function, so that we could use it in deps generation code too. v2: - As suggested by grischka, moved into libtcc function instead of always computing near start of main() - There is a FIXME about how to return result - I don't want to bother callers with allocating temp buffers, not I think it will be a good idea to hook default_target to TCCState. Clearly, I'm to used to things like std::string and python's str...
* Add input files/libs and reloc_output switch to TCCStateKirill Smelkov2010-06-201-0/+1
| | | | | | | | | | | | | | | | | files[0], and reloc_outpu will be needed for (upcoming in the next patch) "compute default outfile name" refactored into libtcc function. Also, since for symmetry and from libification point of view, it makes some sense to also put all information about what was given as input to compilation into TCCState, let's not only put files[0], but all files and all libraries given explicitely by user. One point: I've used bitfield for reloc_output & trimmed down output_type to 8 bits so that TCCState stays the same in size, and also access to output_type is (hopefully) is not slower. By the way -- as of today, sizeof(TCCState) on i686-pc-linux-gnu is 2884 bytes...
* tcc: Fix typo in error (it's '%s', not '%s)Kirill Smelkov2010-06-161-1/+1
|
* libtcc: Detect (but ignore) -init and -fini for -WlDetlef Riekenberg2010-04-051-1/+1
| | | | | -- By by ... Detlef
* libtcc: Allow multiple options for -Wl separated with ','Detlef Riekenberg2010-04-051-83/+2
| | | | | | | I moved the code to libtcc to prepare for a later tiny_ld -- By by ... Detlef
* Add support for --helpDetlef Riekenberg2010-01-261-0/+1
|
* Recognize -Wl,-BsymbolicDetlef Riekenberg2010-01-261-0/+2
| | | | | | | | | | | | | | | Without -Bsymbolic, a symbol/function in a *.so can be overridden by a symbol/function in the main module. That is the default search order, but not supported by tcc. With -Bsymbolic, the linker tries to resolve a symbol/function in the current module first. The loader in tcc implements this search order. We do not distinguish -Bsymbolic and -Bsymbolic-function -- By by ... Detlef
* allow tcc be build from separate objectsgrischka2009-12-201-16/+16
| | | | If you want that, run: make NOTALLINONE=1
* tcc: add "-Wl,-rpath=path" option (library search path)grischka2009-12-191-0/+2
|
* ARM: first support for arm-pe targetFrederic Feret2009-11-131-0/+3
|
* various fixes and new options for PE formatFrederic Feret2009-11-131-0/+39
|
* tcc: optionally build using libtccgrischka2009-07-181-0/+4
|
* tccpe: set tcc_lib_path from DLLgrischka2009-07-181-3/+1
|
* bcheck: restore malloc hooks when donegrischka2009-07-181-16/+12
|
* accept option -x <lang>grischka2009-06-171-0/+4
|
* enable making tcc using libtccgrischka2009-05-111-6/+4
|
* move static prototypes to libtcc.cgrischka2009-05-111-1/+1
|
* move some global variables into TCCStategrischka2009-05-111-20/+10
|
* make tcc from tcc.c and libtcc from libtcc.cgrischka2009-05-051-3/+0
|
* move minor things from libtcc.c to other filesgrischka2009-05-051-21/+38
|
* move libtcc interface and helper functions to libtcc.cgrischka2009-05-051-2281/+1
|
* move parser/generator to tccgen.cgrischka2009-05-051-5102/+1
|
* move preprocessor to tccpp.cgrischka2009-05-051-2642/+1
|
* move declarations to tcc.hgrischka2009-05-051-935/+1
|
* enable backtrace only when it's supportedgrischka2009-04-181-8/+15
|
* libtcc: new api tcc_set_lib_pathgrischka2009-04-181-6/+11
|
* tcc_relocate: return error and remove unused codegrischka2009-04-181-18/+5
|
* Call relocate_sym() before we return the offset, so user doesn't need to ↵Shinichiro Hamaji2009-04-181-5/+5
| | | | check the return value twice.
* tcc -E: fix pasting empty tokensgrischka2009-04-181-23/+13
| | | | | | | | | | | /* test case */ #define t(x,y,z) x ## y ## z int j[] = { t(1,2,3), t(,4,5), t(6,,7), t(8,9,), t(10,,), t(,11,), t(,,12), t(,,) }; tcc -E: xpected result: int j[] = { 123, 45, 67, 89, 10, 11, 12, };
* tcc -E: preserve spaces, alternative solutiongrischka2009-04-181-43/+73
| | | | | | | | | | | | /* test case */ #define STR(x) #x #define MKSTR(x) STR(x) MKSTR(-A-) MKSTR(+ B +) tcc -E: expected result: "-A-" "+ B +"
* CONFIG_TCC_STATIC: add dummy for dlclosegrischka2009-04-181-0/+4
|
* avoid warning uninitializedgrischka2009-04-181-1/+1
|