aboutsummaryrefslogtreecommitdiff
path: root/libtcc.c
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Win: Enable use "*.def + *.c" files as library instead of *.a by ↵Thomas Coudray2014-06-201-9/+2
| | | | | | "-l" option" This reverts commit 7a3f6d49415fd5f1fa99d25aba40c7884d5774a4.
* Win: Enable use "*.def + *.c" files as library instead of *.a by "-l" optionYX Hao2014-06-161-2/+9
| | | | | | | | example: "-lshell32" will try "shell32.def + shell32.c" Add lib type "%s/%s.c" for tcc_add_library() ('-l' option parse) So tcc can use all files as scripts.
* Considering the effect of CH_EOF on line_numjiang2014-05-281-1/+1
|
* The number of rows to display warning is wrongjiang2014-05-231-2/+5
| | | | | | | | For example: #define TOK_ASM_weak TOK_WEAK1 #define TOK_ASM_weak TOK_WEAK Output: C8.c:3: warning: TOK_ASM_weak redefined
* clean '\t'jiang2014-05-141-3/+3
|
* restore 2dd8587c2f32d17a2cd0443a60a614a3fa9bbe29jiang2014-05-131-1/+5
|
* win64: try to fix linkagegrischka2014-05-081-1/+0
| | | | | | | | | - revert to R_X86_64_PC32 for near calls on PE - revert to s1->section_align set to zero by default Untested. Compared to release_0_9_26 the pe-image looks back to normal. There are some differences in dissassembly (r10/r11 usage) but maybe that's ok.
* Return to: e20c1eb99e1003c1e59522c136dbb15c52d7cc7cjiang2014-05-041-7/+3
| | | | | | | | | | | | | | | | | | | | | | | 1: The new patch for the other machines still have the problem. 2: libcrt Rename (what if gcc had libcrt as well) 3: parse_number exact problem 4: VT_VLS is to allow tcc Compile the following int b = 9; struct st { int a; int b [b] }; struct st st1; st1.b [8] = 9; printf ("% d \ n", st1.b [8]); tcc a problem. Due to problems in front, and now can not be improved 5: they commit much, bug difficult to lock, you can not let other people help develop. 6: ('\ t') too Thanks to Michael and Ray Their criticism I have benefited!
* Fixes include the double quotes bugjiang2014-05-021-1/+5
| | | | | Added push_macro, pop_macro support Fix pack bug, when output with-E will pack the bug
* rename i386-tok.h i386-asm.c, add PRINTF_ASM_CODEjiang2014-04-301-2/+2
|
* tccpe: adjust for new 'hidden' symbols featuregrischka2014-04-171-7/+5
| | | | | in order to avoid conflicts with windows specific (ab)usage of the Elf32_Sym -> st_other field.
* Parse assembler .hidden directiveMichael Matz2014-04-141-0/+3
| | | | | This makes TCCs assembler understand the '.hidden symbol' directive (and emits a STV_HIDDEN ELF symbol then).
* tcc, libtcc: fix build on windows with latest mingw.minux2014-04-111-1/+1
|
* tests2: cleanupgrischka2014-04-071-8/+1
| | | | | | | | | - remove -norunsrc switch Meaning and usage (-run -norun...???) look sort of screwed. Also general usefulness is unclear, so it was actually to support exactly one (not even very interesting) test This partially reverts e31579b0769e1f9c0947d12e83316d1149307b1a
* Declare wint_t in <stddef.h> when neededMichael Matz2014-04-071-0/+9
| | | | | Some old glibcs <wctype.h> require <stddef.h> to provide wint_t, accomodate them.
* Remove the fix from my last commit, it was pointed by scan-build and is a ↵mingodad2014-03-281-1/+1
| | | | false positive, thanks to grischka for pointing it.
* Fix a incorrect size for malloc.mingodad2014-03-271-1/+1
|
* A possible fix for the memory leak reported by valgrind when running ↵mingodad2014-03-251-0/+2
| | | | tcctest.c with tcc.
* libtcc: ignore linker optizimization and as-needed options. This allows ↵Austin English2014-03-061-0/+4
| | | | compiling some packages from Gentoo's portage
* Add support for runtime selection of float ABIThomas Preud'homme2014-01-081-2/+21
|
* be stricter with aliasinggrischka2014-01-071-4/+4
| | | | | | | | | | | | | | Refactoring (no logical changes): - use memcpy in tccgen.c:ieee_finite(double d) - use union to store attribute flags in Sym Makefile: "CFLAGS+=-fno-strict-aliasing" basically not necessary anymore but I left it for now because gcc sometimes behaves unexpectedly without. Also: - configure: back to mode 100755 - tcc.h: remove unused variables tdata/tbss_section - x86_64-gen.c: adjust gfunc_sret for prototype
* misc. fixesgrischka2014-01-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | - tccgen: error out for cast to void, as in void foo(void) { return 1; } This avoids an assertion failure in x86_64-gen.c, also. also fix tests2/03_struct.c accordingly - Error: "memory full" - be more specific - Makefiles: remove circular dependencies, lookup tcctest.c from VPATH - tcc.h: cleanup lib, include, crt and libgcc search paths" avoid duplication or trailing slashes with no CONFIG_MULTIARCHDIR (as from 9382d6f1a0e2d0104a82ed805207d9e742c6b068) - tcc.h: remove ";{B}" from PE search path in ce5e12c2f950052d8109b6b7a56d900547705c08 James Lyon wrote: "... I'm not sure this is the right way to fix this problem." And the answer is: No, please. (copying libtcc1.a for tests instead) - win32/build_tcc.bat: do not move away a versioned file
* Define __ARM_EABI__ and __ARMEL__ when applicableThomas Preud'homme2013-11-261-0/+4
|
* struct variable behind guard, proper macro check, and remove some whitespace.Joseph Poirier2013-11-081-37/+39
| | | | | | | Wrap runtime_main as per its declaration in tcc.h. Fix preprocessor check for TCC_ARM_EABI macro definition. Signed-off-by: Joseph Poirier <jdpoirier@gmail.com>
* Revert "Add support for thread-local storage variables"Thomas Preud'homme2013-11-031-4/+1
| | | | | | | | | | TLS support in tinyCC is absolutely not ready: - segment register not select in load and store - no relocation added for computing offset of per-thread symbol - no support for TLS-specific relocations - no program header added as per Drepper document about TLS This reverts commit 1c4afd13501f07a673aed5f130166f2ee0f30927.
* Add support for thread-local storage variablesThomas Preud'homme2013-10-291-1/+4
|
* set the user-defined library search paths firstVittorio Giovara2013-09-231-3/+1
|
* i386-gen: preserve fp control word in gen_cvt_ftoigrischka2013-08-281-11/+4
| | | | | | | | | | | | | | | | | | | | | | | - 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
* Define __ARM_PCS_VFP in hardfloat compilation modeThomas Preud'homme2013-06-151-0/+3
|
* Sorted out CMake on x86-64 and fixed silly XMM# bug introduced when working ↵James Lyon2013-04-251-0/+2
| | | | | | | | | on Win64 stdargs. I removed the XMM6/7 registers from the register list because they are not used on Win64 however they are necessary for parameter passing on x86-64. I have now restored them but not marked them with RC_FLOAT so they will not be used except for parameter passing.
* Added CMake build system (to facilitate Win64 builds)James Lyon2013-04-211-3/+10
| | | | | | Win32 build and tests work under CMake, however I haven't added install code yet. Win64 build fails due to chkstk.S failing to assemble.
* Fixed tests on Windows (including out-of-tree problems)James Lyon2013-04-171-1/+8
| | | | | | | | | | | Modified tcctest.c so that it uses 'double' in place of 'long double' with MinGW since this is what TCC does, and what Visual C++ does. Added an option -norunsrc to tcc to allow argv[0] to be set independently of the compiled source when using tcc -run, which allows tests that rely on the value of argv[0] to work in out-of-tree builds. Also added Makefile rules to automatically update out-of-tree build Makefiles when in-tree Makefiles have changed.
* don't confuse LD_LIBRARY_PATH (run time) with LIBRARY_PATH (link time)Urs Janssen2013-02-191-2/+2
|
* added CPATH, C_INCLUDE_PATH and LD_LIBRARY_PATHAndrew Aladjev2013-02-191-0/+18
|
* remove doubled prototypeUrs Janssen2013-02-181-2/+3
| | | | | fix documentation about __TINYC__ define __STDC_HOSTED__ like __STDC__
* libtcc: tcc_define_symbol() uses strings, fix segfaultRoy2013-02-181-1/+1
|
* Define __STDC_HOSTED__ to a sane valueThomas Preud'homme2013-02-171-1/+1
| | | | | | | Define __STDC_HOSTED__ to one as the correct values should be either 1 or 0. Since tinycc is hosted, it should be set to 1. Thanks Christian Jullien for the report.
* Define __STDC_HOSTED__Thomas Preud'homme2013-02-171-0/+1
| | | | | | | | | Quoting Michael Matz on tinycc-devel: "__STDC_HOSTED__ : not set (incorrectly, it should probably be set to 1 given that tcc assumes a normal main() and that the rest of the provided facilities is provided by the C library not under tcc control)"
* add version number to manpageUrs Janssen2013-02-171-1/+1
| | | | | | | avoid c++/c99 style comments in preprocessor directives avoid leadings whitespaces in preprocessor directives mention implemented variable length arrays in documentation fixed ambiguous option in texi2html call (Austin English)
* - don't use GCC_MAJOR to see if we're not using gcc as GCC_MAJOR might be setUrs Janssen2013-02-151-1/+1
| | | | during configure even with --cc=notgcc as long as gcc is installed.
* - make clang accept unportable code in libtcc1.cUrs Janssen2013-02-141-0/+5
| | | | - add -dumpversion cmd.line opt
* configure: cleanupgrischka2013-02-141-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - add quotes: eval opt=\"$opt\" - use $source_path/conftest.c for OOT build - add fn_makelink() for OOT build - do not check lddir etc. on Windows/MSYS - formatting config-print.c - rename to conftest.c (for consistency) - change option e to b - change output from that from "yes" to "no" - remove inttypes.h dependency - simpify version output Makefile: - improve GCC warning flag checks tcc.h: - add back default CONFIG_LDDIR - add default CONFIG_TCCDIR also (just for fun) tccpp.c: - fix Christian's last warning tccpp.c: In function ‘macro_subst’: tccpp.c:2803:12: warning: ‘*((void *)&cval+4)’ is used uninitialized in this function [-Wuninitialized] That the change fixes the warning doesn't make sense but anyway. libtcc.c: - tcc_error/warning: print correct source filename/line for token :paste: (also inline :asm:) lddir and multiarch logic still needs fixing.
* libtcc: new LIBTCCAPI tcc_set_options(TCCState*, const char*str)grischka2013-02-121-208/+423
| | | | | | | | | | | | | | | | | | | 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
* tcc -vv/--print-search-dirs: print more infogrischka2013-02-101-14/+64
| | | | | | | | | | | | | | tests/Makefile: - print-search-dirs when 'hello' fails - split off hello-run win32/include/_mingw.h: - fix for compatibility with mingw headers (While our headers in win32 are from mingw-64 and don't have the problem) tiny_libmaker: - don't use "dangerous" mktemp
* tcc.h: declare CValue.tab[LDOUBLE_SIZE/4]grischka2013-02-081-9/+2
| | | | | | | | Should fix some warnings wrt. access out of array bounds. tccelf.c: fix "static function unused" warning x86_64-gen.c: fix "ctype.ref uninitialzed" warning and cleanup tcc-win32.txt: remove obsolete limitation notes.
* lib/Makefile: use CC, add bcheck to libtcc1.agrischka2013-02-061-0/+4
| | | | | | | | Also: - fix "make tcc_p" (profiling version) - remove old gcc flags: -mpreferred-stack-boundary=2 -march=i386 -falign-functions=0 - remove test "hello" for Darwin (cannot compile to file)
* portability: fix void* <-> target address conversion confusiongrischka2013-02-041-6/+6
| | | | | | - #define addr_t as ElfW(Addr) - replace uplong by addr_t - #define TCC_HAS_RUNTIME_PLTGOT and use it
* c67: remove global #define's for TRUE/FALSE/BOOLgrischka2013-02-041-2/+2
| | | | Also use uppercase TRUE/FALSE instead of true/false
* safety: replace occurrences of strcpy by pstrcpygrischka2013-01-311-1/+1
|
* Revert "Added what I call virtual io to tinycc this way we can make a ↵Thomas Preud'homme2013-01-141-85/+20
| | | | | | | | monolitic executable or library that contains all needed to compile programs, truly tinycc portable." This reverts commit 59e18aee0e509a3ca75dbe6f909e18c1d17893d1. tcc is being stabilized now in order to do a new release soon. Therefore, such a change is not appropriate now.