aboutsummaryrefslogtreecommitdiff
path: root/tcc.h
Commit message (Collapse)AuthorAgeFilesLines
...
* rename error/warning -> tcc_(error/warning)grischka2011-08-111-3/+3
|
* libtcc: minor adjustmentsgrischka2011-08-111-11/+26
| | | | | | | | | | | | | | | | | - use {B} to substitute tcc_lih_path (instead of \b) - expand CONFIG_TCC_CRTPREFIX in CONFIG_TCC_LIBPATHS which fixes duplicate CONFIG_SYSROOT. - put default CONFIG_SYSROOT ("") into tcc.h - remove hack from commit db6fcce78f4d8ea25036dd6643e9fa83d8e52e5a because $(tccdir)/include is already in sysincludes - configure: error out for unrecognized options. - win32/build-tcc.bat: put libtcc into base dir where it will find lib/include automatically, and build libtcc_test example.
* libtcc: support more than one crtprefixgrischka2011-08-061-4/+4
| | | | Looks like gcc has that. Oh Deer!
* libtcc: cleanup the 'gen_makedeps' stuffgrischka2011-08-061-6/+3
|
* tcc: fix -m32/64 & simplifygrischka2011-08-061-1/+0
| | | | | | | | | | This cleans up the mess from commit 8f985736580926ac53dc367fc293524bf2810cbb and preceeding. - make tcc -m64 work on windows - execvp on windows returns 0 always, replace by spawnvp - remove bizarre support for i386-win32-tcc -m64
* x86-64: fix flags and zero-pad long doublesgrischka2011-08-061-9/+8
| | | | | | | | | | This fixes a bug introduced in commit 8d107d9ffd8126d82b1c56be47431a6bcef39f08 that produced wrong code because of interference between 0x10 bits VT_CONST and x86_64-gen.c:TREG_MEM Also fully zero-pad long doubles on x86-64 to avoid random bytes in output files which disturb file comparison.
* configure: add switches to set search pathsgrischka2011-08-061-19/+50
| | | | | | | | | | | | | | | | | | | --sysincludepaths=.. specify system include paths, colon separated" Sets CONFIG_TCC_SYSINCLUDEPATHS --libpaths=... specify system library paths, colon separated" Sets CONFIG_TCC_LIBPATHS --crtprefix=... specify location of crt?.o" Sets CONFIG_TCC_CRTPREFIX --elfinterp=... specify elf interpreter" Sets CONFIG_TCC_ELFINTERP Also the CONFIG_TCC_XXX were renamed to make them look more consistent. Also move the elf_interp definitions to tcc.h.
* Revert "Add a --multiarch-triplet switch to configure"Thomas Preud'homme2011-08-031-3/+31
| | | | This reverts commit 76adc5770f4ab5b1aaa2e5dde6104efc06431fe2.
* Add a --multiarch-triplet switch to configureThomas Preud'homme2011-08-021-31/+3
| | | | | | | | | | | | | Add a --multiarch-triplet switch to configure. The switch will allow files to be search for each default path in path/<triplet> and then path. Default paths handled that way: - CONFIG_TCC_SYSINCLUDE_PATHS - CONFIG_TCC_LIBPATH - path to crt*.o - path to libgcc_s.so.1 Path missing: elf interpreter path (will be handled in another commit)
* Set CONFIG_TCC_CRT_PREFIX relative to CONFIG_SYSROOTThomas Preud'homme2011-08-011-2/+2
| | | | | Set CONFIG_TCC_CRT_PREFIX relative to CONFIG_SYSROOT for consistency with CONFIG_TCC_LDDIR.
* Accept colon separated paths with -L and -Igrischka2011-08-011-12/+35
| | | | | | | | | | | | | | | | | | This allows passing colon separated paths to tcc_add_library_path tcc_add_sysinclude_path tcc_add_include_path Also there are new configure variables CONFIG_TCC_LIBPATH CONFIG_TCC_SYSINCLUDE_PATHS which define the lib/sysinclude paths all in one and can be overridden from configure/make For TCC_TARGET_PE semicolons (;) are used as separators Also, \b in the path string is replaced by s->tcc_lib_path (CONFIG_TCCDIR rsp. -B option)
* win64: va_arg with structuresgrischka2011-07-141-7/+9
|
* tccpe: cleanup ELFW() macros etc.grischka2011-07-141-0/+18
|
* tccrun: win64: add unwind function table for dynamic codegrischka2011-07-141-4/+5
| | | | | This works only when tcc.exe is compiled using MSC. MinGW does something in the startup code that defeats it.
* make: create native tcc from separate objectsgrischka2011-07-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | 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.
* win32: add -Wl,--stack=xxx switchgrischka2011-07-111-0/+1
| | | | | | | | For example: $ tcc -Wl,--stack=4194309 which means 4 MB. Default is 1 MB.
* Add configuration of include subdirectoriesThomas Preud'homme2011-07-071-0/+3
| | | | | | | | Add the possibility to search headers in several subdirectories of /usr/local/include and /usr/include. A possible use case would be for tcc to search for headers in /usr/local/include/x86_64-linux-gnu, /usr/local/include, /usr/include/x86_64-linux-gnu and /usr/include in turn.
* Add multiarch dirs to linker search pathThomas Preud'homme2011-07-051-6/+7
| | | | | | | | | | | By default, tcc search libraries in /lib and /usr/local/lib while crt*.o files are searched in /usr/lib and ld.so is searched in /lib. Unfortunetely the path are hardcoded in source code. This patch allow tcc to look in an other directory and also to look in extra directories. It's then possible to make tcc search libraries in /lib/x86_64-linux-gnu and /usr/local/lib/x86_64-linux-gnu while crt*.o files are searched in /usr/lib/x86_64-linux-gnu and ld.so is searched in /lib/x86_64-linux-gnu.
* VLA fix [3/3]: store VLA sizeofs in anonymous runtime stack varsJoe Soroka2011-04-091-1/+0
|
* re-apply VLA by Thomas Preud'hommeJoe Soroka2011-04-061-1/+3
|
* revert complicated & broken flexible array member handlingJoe Soroka2011-03-181-3/+1
|
* partially revert e23194aJoe Soroka2011-03-081-1/+0
| | | | see http://lists.nongnu.org/archive/html/tinycc-devel/2011-03/msg00002.html
* support c99 for-loop init declsJoe Soroka2011-03-071-0/+1
|
* tccgen: handle __attribute((alias("target")))Joe Soroka2011-03-031-0/+1
|
* fix another static struct init issue (arrays with unknown size at end)Jaroslav Kysela2011-02-221-1/+3
|
* Fix fct asm label: only valid for declarationThomas Preud'homme2011-02-091-1/+1
| | | | | | | | | - Fix function assembly label mechanism introduced in commit 9b09fc376e8c212a767c875e71ca003e3b9a0d2e to only accept alternative name for function declaration. - merge the code with the one introduced in commit 264a103610e3ee86b27b8cbb0e4ec81cd654d980. - Don't memorize token for asm label but directly the asm label.
* revert "update VT_STRUCT_SHIFT for new VT_VLA"Joe Soroka2011-02-041-1/+1
|
* Revert "Implement C99 Variable Length Arrays"Thomas Preud'homme2011-02-051-2/+0
| | | | This reverts commit a5a50eaafeea0d3ca47bc8fb6baf983743470c60.
* Revert "Reorder increasingly VT_* constants in tcc.h"Thomas Preud'homme2011-02-051-12/+12
| | | | This reverts commit 7f00523e2e1938fc3558164521fe3ecefd9e1747.
* update VT_STRUCT_SHIFT for new VT_VLAJoe Soroka2011-02-041-1/+1
|
* Reorder increasingly VT_* constants in tcc.hThomas Preud'homme2011-02-041-12/+12
|
* Implement C99 Variable Length ArraysThomas Preud'homme2011-02-041-0/+2
| | | | | | | Implement C99 Variable Length Arrays in tinycc: - Support VLA with multiple level (nested vla) - Update documentation with regards to VT_VLA - Add a testsuite in tcctest.c
* tccpp: fix bug in handling of recursive macrosJoe Soroka2011-02-011-0/+1
|
* tccasm: support .weak labelsJoe Soroka2011-02-011-0/+1
|
* support weak attribute on variablesJoe Soroka2011-02-011-3/+3
|
* tcc: add -m32 option to x86_64 cross compilersHenry Kroll III2010-12-061-0/+1
|
* libtcc: new function tcc_open_bf to create BufferedFilegrischka2010-11-251-2/+5
| | | | | | | | Use it in: - tcc_open - tcc_compile_string - tcc_define_symbol - tcc_assemble_inline
* x86_64: fix --with-libgcc and simplify biarch pathsHenry Kroll III2010-11-251-0/+3
|
* Move asm label functions from tccasm.c to tccgen.cThomas Preud'homme2010-09-141-2/+1
| | | | | | | | | | * Move functions parse_asm_str and asm_label_instr from tccasm.c to tccgen.c * Remove CONFIG_TCC_ASM_LABEL macro as asm label are available on all archs. See: http://lists.nongnu.org/archive/html/tinycc-devel/2010-09/msg00026.html for the rationale.
* Add support for __FreeBSD_kernel__ kernelThomas Preud'homme2010-09-101-1/+2
| | | | | Add support for kfreebsd-i386 and kfreebsd-amd64 Debian arch with thanks to Pierre Chifflier <chifflier@cpe.fr>.
* Add support for GNU/HurdThomas Preud'homme2010-09-101-0/+4
| | | | | + Add i686-AT386 to the list of x86 platform + Define SA_SIGINFO is not defined
* Add support of asm label for functions.Thomas Preud'homme2010-09-101-0/+3
| | | | | | Add support for asm labels for functions, that is the ability to rename a function at assembly level with __asm__ ("newname") appended in function declaration.
* tcc: Draft suppoprt for -MD/-MF optionsKirill Smelkov2010-06-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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", ...)
* Add input files/libs and reloc_output switch to TCCStateKirill Smelkov2010-06-201-1/+8
| | | | | | | | | | | | | | | | | 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...
* ARM: allow jumps > 32MB on -runDaniel Glöckner2010-05-141-1/+1
| | | | This is needed to reach tinycc's PLT from the compiled program.
* ARM: use uint32_t for opcodesDaniel Glöckner2010-05-131-1/+1
| | | | fixes cross compiling on x86_64
* make --with-selinux work with libtcc, tooHenry Kroll III2010-04-241-0/+4
|
* Clean changes introduced by 47abdbdThomas Preud'homme2010-04-201-2/+0
| | | | | | | | | | | | * Replace the save/load_buffer_state by a dynarray approach: - Filename and libname are added to a dynarray when first encountered - Load repeatedly the files in the dynarray until no new undefined symbol are encountered * Replace snprintf by sprintf in libname_to_filename * Use tcc_fileextension in filename_to_libname * Introduce a tcc_strcpy_part fonction to copy only a subset of a string * Move new_undef_syms declaration from tcc.h to tccelf.c
* libtcc.c: fix compilation failure (inconsistent tcc_add_file_internal)Sergei Trofimovich2010-04-191-0/+1
| | | | | | | | | gcc -o libtcc1.o -c lib/libtcc1.c -O2 -Wall libtcc.c: At top level: libtcc.c:1063: error: static declaration of 'tcc_add_file_internal' follows non-static declaration tccelf.c:2915: note: previous implicit declaration of 'tcc_add_file_internal' was here Signed-off-by: Sergei Trofimovich <st@anti-virus.by>
* Better handle ld scriptsThomas Preud'homme2010-04-151-0/+2
| | | | | | | * search file from INPUT and GROUP commands in the library path in addition to the current directory * handle libraries specified by -lfoo options * Search lib in GROUP command repeatedly