aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* x86_64: fix loading of LLOCAL floatsgrischka2012-03-052-5/+9
| | | | | | | | See also commit 9527c4949fd94adb2567229413c70c19b663a118 On x86_64 we need to extend the reg_classes array because load() is called for (at least) R11 too, which was not part of reg_classes previously.
* tcc.h: define TCC_IS_NATIVEgrischka2012-03-054-20/+34
| | | | | | - disable tccrun feature for non-native (cross-) compilers - define uplong for target adress size - fix using -Wl,-Ttext=... for Win64 (tccpe: ADDR3264 imagebase)
* Fix assumption of 32bit long on portions of ElfAndrew Mulbrook2012-03-033-18/+19
| | | | | | | | | Modify tcc to accept convert full 64bits of specified text section when converting on Win64. Write high bytes to the elf section address as well. This allows creation of elf binaries located in offsets using full 64 bit addresses. Signed-off-by: Andrew Mulbrook <andrew262@gmail.com>
* Revert "Multiple fixes for 64 bit sections"Andrew Mulbrook2012-03-036-41/+24
| | | | This reverts commit d7a7c3769d0a1dcb8400258cd8adf78a8566de61.
* Add __REDIRECT needed for Large File Support API on linuxRamsay Jones2012-02-291-0/+1
| | | | | | | | | | | | | | | Since commit 9b09fc3 ("Add support of asm label for functions", 05-09-2010) tcc has had the capability to rename functions at the assembly level. This capability was subsequently used by commit 2596273 ("Add support for __REDIRECT_NTH needed with eglibc", 11-09-2010) to redirect long double functions on platforms which did not support long double. Here we add the companion macro __REDIRECT which is used (along with __REDIRECT_NTH) in the glibc headers on Linux to support the Large File API (when _FILE_OFFSET_BITS is set to 64). Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
* Multiple fixes for 64 bit sectionsmob2012-02-266-24/+41
| | | | | | | | | | | | | | | 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>
* Attempt to fix 32 bit OSX build. The fix consists of adding -m32 and -m64Milutin Jovanovic2012-02-162-4/+9
| | | | | | | | to the appropriate CFLAGS. In addition, memory hooks are very different on OSX, so build of bcheck.c had to be disabled for now. Change of the CFLAGS does affect builds on other platforms, and this needs to be tested.
* Patch attempting to build OSX TinyCC.Milutin Jovanovic2012-02-095-5/+24
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* i386: fix loading of LLOCAL floatsDaniel Glöckner2012-01-231-1/+3
| | | | These loads clobbered ebx as TinyCC wanted to load the address into st0.
* Error out when assigning void value.Thomas Preud'homme2012-01-221-0/+2
| | | | | | | | tcc should now error out when compiling code like: VOID ExitProcess(UINT uExitCode); (…) retCode = ExitProcess(pi.dwProcessId);
* s/derefencing/dereferencing/ in i386-gen.cThomas Preud'homme2012-01-081-1/+1
|
* Compile tccasm.c conditionally (TCC_CONFIG_ASM)Thomas Preud'homme2012-01-061-0/+2
| | | | | Only compile the content of tccasm.c if inline assembly is supported for this architecture by testing the presence of macro TCC_CONFIG_ASM.
* Fix linkage of named file in loader script.Thomas Preud'homme2012-01-041-44/+9
| | | | | | Remove the previous logic to link a named file with a loader script by using tcc_add_dll instead. Hence, all files can be linked, not only files ending in .so/.def.
* libtcc: add missing tcc_enable_debug()Nicolas Limare2011-10-031-0/+6
|
* Don't define strtold and strtof on *BSD + uClibcThomas Preud'homme2011-08-121-12/+0
| | | | | | | | | | | | | | Don't define strtold and strtof on *BSD and uClibc as they are already defined there since: * 2001 (FreeBSD 4.4) * 2009 (OpenBSD 4.5) * 2009 (DragonFlyBSD) * 2002 (uClibc) See http://lists.nongnu.org/archive/html/tinycc-devel/2011-07/msg00025.html for a bit more details.
* Fix problem with PLT and GOT relocs on armel.Daniel Glöckner2011-08-121-3/+12
| | | | | | | | | | | | | TinyCC fails to link correctly to libraries when both R_ARM_PLT32 and R_ARM_GOT32 relocation to a same symbol exist (see http://lists.nongnu.org/archive/html/tinycc-devel/2010-05/msg00032.html for more details). The patch marks all undefined weak symbols found in external libraries as strong. The value of all remaining weak symbols is set to zero just before the section is output. Note by Thomas Preud'homme: it's been 2 months in Debian without any new bug report, hence commiting.
* rename error/warning -> tcc_(error/warning)grischka2011-08-1115-285/+275
|
* libtcc: minor adjustmentsgrischka2011-08-1110-97/+96
| | | | | | | | | | | | | | | | | - 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.
* dll build + small adjustmentsGabriel Corneanu2011-08-101-4/+5
|
* libtcc: support more than one crtprefixgrischka2011-08-065-45/+39
| | | | Looks like gcc has that. Oh Deer!
* libtcc: cleanup the 'gen_makedeps' stuffgrischka2011-08-064-55/+30
|
* tcc: fix -m32/64 & simplifygrischka2011-08-062-75/+53
| | | | | | | | | | 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
* tcctest: switch weak_toolate proto with implgrischka2011-08-061-1/+1
| | | | gcc -O0 didn't like this.
* x86-64: fix flags and zero-pad long doublesgrischka2011-08-062-10/+13
| | | | | | | | | | 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-065-91/+117
| | | | | | | | | | | | | | | | | | | --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.
* Remove semicolon in x86-64 va_arg definition.Thomas Preud'homme2011-08-051-1/+1
|
* Revert "Add a --multiarch-triplet switch to configure"Thomas Preud'homme2011-08-034-153/+74
| | | | This reverts commit 76adc5770f4ab5b1aaa2e5dde6104efc06431fe2.
* Add a --multiarch-triplet switch to configureThomas Preud'homme2011-08-024-74/+153
| | | | | | | | | | | | | 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-013-5/+5
| | | | | Set CONFIG_TCC_CRT_PREFIX relative to CONFIG_SYSROOT for consistency with CONFIG_TCC_LDDIR.
* Accept colon separated paths with -L and -Igrischka2011-08-015-132/+111
| | | | | | | | | | | | | | | | | | 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)
* Revert "Force const. expr. in expr_cond outside function"Thomas Preud'homme2011-07-311-1/+1
| | | | | This reverts commit b2f5ee9b2de40e26ba3d92cf3950be6da7766b7d as it's useless on mob.
* Force const. expr. in expr_cond outside functionThomas Preud'homme2011-07-311-1/+1
| | | | | | Since no code should be generated outside a function, force expr_cond to only consider constant expression when outside a function since the generic code can generate some code.
* fixed Makefile test targetsJoe Soroka2011-07-222-2/+2
|
* re-added negative-array-size testcase and fixed fix for itJoe Soroka2011-07-222-3/+5
|
* Revert "better constant handling for expr_cond"grischka2011-07-162-6/+1
| | | | | It produced wrong code with one of my test projects. This reverts commit cd3d1a45f34be3c9a358f1743bcaf8aac897992e.
* elf.h: define SHF_MERGE etc.grischka2011-07-141-0/+11
|
* win64: va_arg with structuresgrischka2011-07-143-41/+51
|
* tccpe: cleanup ELFW() macros etc.grischka2011-07-145-59/+44
|
* 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-146-53/+79
| | | | | This works only when tcc.exe is compiled using MSC. MinGW does something in the startup code that defeats it.
* tccgen: reset aligned attribute for next typegrischka2011-07-141-0/+1
| | | | | | | | | | | | Basically, with: typedef __attribute__((aligned(16))) struct _xyz { ... } xyz, *pxyz; we want the struct aligned but not the pointer. FIXME: This patch is a hack, waiting for someone in the knowledge of correct __attribute__ semantics.
* make: create native tcc from separate objectsgrischka2011-07-147-17/+18
| | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix array_test: move params to local varsThomas Preud'homme2011-07-121-2/+2
| | | | | | | | | | array_test is declared and called with no parameters but defined with one parameter. Compilation succeed (definition is after the use so the compiler consider the declaration) as well as link (the function exist and has the right name) but running the test segfault on i386 platforms. This patch moves the parameter to local variable. If the intention was to call it with an array parameter then feel free to fix it again.
* win32: add -Wl,--stack=xxx switchgrischka2011-07-113-6/+7
| | | | | | | | For example: $ tcc -Wl,--stack=4194309 which means 4 MB. Default is 1 MB.
* win32/include: enable _timezone etc variables.grischka2011-07-113-15/+13
| | | | | | | | | which live in msvcrt.dll and need __declspec(import) which works by now. Also: - _mingw.h: conditionally define WIN32_LEAN_AND_MEAN - malloc.h: don't undef alloca
* allow defining sysroot at compile-timeJoe Soroka2011-07-111-0/+2
|
* handle arrays with a flexible member but no initializerJoe Soroka2011-07-112-2/+4
|