aboutsummaryrefslogtreecommitdiff
path: root/tccrun.c
Commit message (Collapse)AuthorAgeFilesLines
* i386-gen: preserve fp control word in gen_cvt_ftoigrischka2013-08-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | - Use runtime function for conversion - Also initialize fp with tcc -run on windows This fixes a bug where double x = 1.0; double y = 1.0000000000000001; double z = x < y ? 0 : sqrt (x*x - y*y); caused a bad sqrt because rounding precision for the x < y comparison was different to the one used within the sqrt function. This also fixes a bug where printf("%d, %d", (int)pow(10, 2), (int)pow(10, 2)); would print 100, 99 Unrelated: win32: document relative include & lib lookup win32: normalize_slashes: do not mirror silly gcc behavior This reverts part of commit 8a81f9e1036637e21a47e14fb56bf64133546890 winapi: add missing WINAPI decl. for some functions
* Fix synchronization between data and instr cachesThomas Preud'homme2013-03-191-1/+1
|
* Flush caches before -running programThomas Preud'homme2013-03-181-0/+1
| | | | | | | | | | | | On some architectures, ARM for instance, the data and instruction caches are not coherent with each other. This is a problem for the -run feature since instructions are written in memory, and are thus written in the data cache first and then later flushed to the main memory. If the instructions are executed before they are pushed out of the cache, then the processor will fetch the old content from the memory and not the newly generated code. The solution is to flush from the data cache all the data in the memory region containing the instructions and to invalidate the same region in the instruction cache.
* libtcc: new LIBTCCAPI tcc_set_options(TCCState*, const char*str)grischka2013-02-121-37/+41
| | | | | | | | | | | | | | | | | | | This replaces -> use instead: ----------------------------------- - tcc_set_linker -> tcc_set_options(s, "-Wl,..."); - tcc_set_warning -> tcc_set_options(s, "-W..."); - tcc_enable_debug -> tcc_set_options(s, "-g"); parse_args is moved to libtcc.c (now tcc_parse_args). Also some cleanups: - reorder TCCState members - add some comments here and there - do not use argv's directly, make string copies - use const char* in tcc_set_linker - tccpe: use fd instead of fp tested with -D MEM_DEBUG: 0 bytes left
* tests: cleanupgrischka2013-02-051-2/+1
| | | | | | | | | | | | | | | | tests: - add "hello" to test first basic compilation to file/memory - add "more" test (tests2 suite) - remove some tests tests2: - move into tests dir - Convert some files from DOS to unix LF - remove 2>&1 redirection win32: - tccrun.c: modify exception filter to exit correctly (needed for btest) - tcctest.c: exclude weak_test() (feature does not exist on win32)
* tccrun.c: unify rt_get_caller_pc prototypegrischka2013-02-041-18/+15
|
* portability: fix void* <-> target address conversion confusiongrischka2013-02-041-24/+22
| | | | | | - #define addr_t as ElfW(Addr) - replace uplong by addr_t - #define TCC_HAS_RUNTIME_PLTGOT and use it
* tccrun: another incompatible change to the tcc_relocate APIgrischka2012-09-011-2/+6
| | | | | | We are now compatible with the 0.9,25 version though. A special value for the second (ptr) argument is used to get the simple behavior as with the 0.9.24 version.
* tcc.h: define TCC_IS_NATIVEgrischka2012-03-051-0/+5
| | | | | | - disable tccrun feature for non-native (cross-) compilers - define uplong for target adress size - fix using -Wl,-Ttext=... for Win64 (tccpe: ADDR3264 imagebase)
* Revert "Multiple fixes for 64 bit sections"Andrew Mulbrook2012-03-031-6/+3
| | | | This reverts commit d7a7c3769d0a1dcb8400258cd8adf78a8566de61.
* Multiple fixes for 64 bit sectionsmob2012-02-261-3/+6
| | | | | | | | | | | | | | | This changeset attempts to fix a few problems when giving using the high 32bits of a 64bit section offset. There are likely more issues (or perhaps regressions) lurking in the muck here. In general, this moves a few data type declarations to use uplong. Also, add support for 64bit mingw32 building under cygwin. Because native types are used for 64 bit offsets, this won't fix challenges with cross compiling from 32bit -> 64bit. Tested under cygwin, against binary compiled with -Wl,-Ttext=0xffffff8000000000 Signed-off-by: Andrew Mulbrook <andrew262@gmail.com>
* Patch attempting to build OSX TinyCC.Milutin Jovanovic2012-02-091-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | Applied patch found on stackoverflow (link below). I also found some related changes that looked like logically needed. The stackoverflow changes addressed only two registers which were breaking a compile. However reading the code in the same file shows two other register accesses that, while not breaking the build, should have the same fix. http://stackoverflow.com/questions/3712902/problems-compiling-tcc-on-os-x/3713144#3713144 The test driver was changed by changing 'cp -u' into 'cp' as '-u' is not supported on mac osx. I found that osx build required the WITHOUT_LIBTCC define. I suspect the reason for this is tcc unability to handle mach-o files. In order to properly address this I had to change 'configure' to propagate target os name to Makefile. Current state is that simple tests work, but not the whole 'make test' suite runs. To the best of my knowledge, these changes should not impact other platforms.
* rename error/warning -> tcc_(error/warning)grischka2011-08-111-2/+2
|
* libtcc: minor adjustmentsgrischka2011-08-111-7/+18
| | | | | | | | | | | | | | | | | - 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.
* tccrun: win32: improve exception handlergrischka2011-07-141-28/+29
|
* tccrun: win32: improve rt_get_caller_pcgrischka2011-07-141-18/+13
|
* tccrun: rt_printline: fix no-stabs casegrischka2011-07-141-10/+23
|
* tccrun: improve rt_printline output formatgrischka2011-07-141-16/+18
| | | | | Prefix line with "file:linenumber:" such that editors can easily jump to the source location
* tccrun: win64: add unwind function table for dynamic codegrischka2011-07-141-0/+19
| | | | | This works only when tcc.exe is compiled using MSC. MinGW does something in the startup code that defeats it.
* selinux: correct ftruncate, fix bus error in tcc -runHenry Kroll III2010-10-271-2/+3
|
* Remove ifdef STT_GNU_IFUNC test in tccrun.cThomas Preud'homme2010-10-101-5/+1
| | | | | | STT_GNU_IFUNC is always defined (there is no conditional definition of it) so the ifdef test for STT_GNU_IFUNC in tccrun.c has no reason to be.
* Add support for __FreeBSD_kernel__ kernelThomas Preud'homme2010-09-101-4/+4
| | | | | Add support for kfreebsd-i386 and kfreebsd-amd64 Debian arch with thanks to Pierre Chifflier <chifflier@cpe.fr>.
* Add support for indirect functions as externals.Thomas Preud'homme2010-08-091-1/+5
| | | | Add link support to use indirect functions defined in external modules
* ARM: implement rt_get_caller_pcDaniel Glöckner2010-05-141-0/+44
|
* ARM: allow jumps > 32MB on -runDaniel Glöckner2010-05-141-2/+2
| | | | This is needed to reach tinycc's PLT from the compiled program.
* make --with-selinux work with libtcc, tooHenry Kroll III2010-04-241-34/+26
|
* Use mmap instead of exec mem for Selinux machines. Fixes crash on Fedora.Henry Kroll III2010-04-201-4/+33
|
* build from multiple objects: fix other targetsgrischka2009-12-201-2/+2
|
* win64: add tiny unwind data for setjmp/longjmpgrischka2009-12-201-0/+7
| | | | | | | | | This enables native unwind semantics with longjmp on win64 by putting an entry into the .pdata section for each compiled fuction. Also, the function now use a fixed stack and store arguments into X(%rsp) rather than using push.
* allow tcc be build from separate objectsgrischka2009-12-201-21/+22
| | | | If you want that, run: make NOTALLINONE=1
* win32: enable bounds checker & exception handlergrischka2009-12-191-242/+321
| | | | exception handler borrowed from k1w1. Thanks.
* tcc_relocate: revert to 0.9.24 behaviorgrischka2009-12-191-15/+20
|
* tccrun: new filegrischka2009-12-191-0/+518
factor out -run support