Shinichiro Hamaji [Sun, 5 May 2013 21:55:16 +0000]
Relicensing TinyCC
Thomas Preud'homme [Sun, 5 May 2013 21:51:58 +0000]
Relicensing TinyCC
grischka [Sun, 5 May 2013 21:45:51 +0000]
Relicensing TinyCC
It has been discussed on the list whether it would be good
to relicense TinyCC under a more permissive BSD-like license.
The discussion started here:
http://lists.gnu.org/archive/html/tinycc-devel/2013-04/msg00052.html
Opinions varied but mostly were positive so it appears to
be worth to start the process and see how far we can get.
For that purpose I've committed a new file RELICENSING with the
suggested new license clause and a list for people to confirm
their agreement (or disagreement).
If you have contributed to TinyCC in the past, in particular if
you are one of the copyright owners for an entire file, please
add yourself to that file (rsp. replace the question mark) and
commit the change to the "mob" brancn with log message:
Relicensing TinyCC
Thanks.
Daniel Glöckner [Wed, 1 May 2013 14:17:54 +0000]
ARM hardfloat: fix struct return with float/double args
Fixes the case where the structure is not returned in registers.
grischka [Mon, 29 Apr 2013 22:33:34 +0000]
avoid "decl after statement" please
for compiling tcc with msc
James Lyon [Sat, 27 Apr 2013 19:39:34 +0000]
Improved variable length array support.
VLA storage is now freed when it goes out of scope. This makes it
possible to use a VLA inside a loop without consuming an unlimited
amount of memory.
Combining VLAs with alloca() should work as in GCC - when a VLA is
freed, memory allocated by alloca() after the VLA was created is also
freed. There are some exceptions to this rule when using goto: if a VLA
is in scope at the goto, jumping to a label will reset the stack pointer
to where it was immediately after the last VLA was created prior to the
label, or to what it was before the first VLA was created if the label
is outside the scope of any VLA. This means that in some cases combining
alloca() and VLAs will free alloca() memory where GCC would not.
James Lyon [Fri, 26 Apr 2013 15:42:12 +0000]
Fixed x86-64 long double passing.
long double arguments require 16-byte alignment on the stack, which
requires adjustment when the the stack offset is not an evven number of
8-byte words.
James Lyon [Fri, 26 Apr 2013 00:27:04 +0000]
Fixed silly error in Windows build of tests (abitest-cc not linking to libtcc)
I really should do this when less tired; I keep breaking one platform
while fixing another. I've also fixed some Windows issues with tcctest
since Windows printf() uses different format flags to those on Linux,
and removed some conditional compilation tests in tcctest since they
now should work.
James Lyon [Thu, 25 Apr 2013 23:31:46 +0000]
Fixed i386 calling convention issue and CMake build on i386.
The i386 calling convention expects the callee to pop 1 word of the
stack when performing a struct ret.
James Lyon [Thu, 25 Apr 2013 21:30:53 +0000]
Sorted out CMake on x86-64 and fixed silly XMM# bug introduced when working 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.
James Lyon [Thu, 25 Apr 2013 00:08:18 +0000]
Added cross compilation to CMake build system.
Brings it more into line with make based system. I've tested on 32- and 64-bit
Windows, but not yet Linux.
James Lyon [Wed, 24 Apr 2013 01:19:15 +0000]
64-bit tests now pass (well, nearly).
tcctest1-3 fail, but this appears to be due to bugs in GCC rather than TCC
(from manual inspection of the output).
James Lyon [Sun, 21 Apr 2013 10:20:20 +0000]
Added CMake build system (to facilitate Win64 builds)
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.
James Lyon [Fri, 19 Apr 2013 22:21:33 +0000]
Workaround for MinGWs use of 80-bit long double on Win32.
This is incompatible with MSVC and TCC on Win32.
Bounds checking appears to be broken (test4).
James Lyon [Fri, 19 Apr 2013 21:55:09 +0000]
Fixed 64-bit integer bug introduced by x86-64 ABI work.
Now I need to check that the x86-64 stuff still works.
James Lyon [Fri, 19 Apr 2013 21:05:49 +0000]
Improved x86-64 XMM register argument passing.
Also made XMM0-7 available for use as temporary registers, since they
are not used by the ABI. I'd like to do the same with RSI and RDI but
that's trickier since they can be used by gv() as temporary registers
and there isn't a way to disable that.
James Lyon [Fri, 19 Apr 2013 17:31:24 +0000]
Fixed problems with XMM1 use on Linux/x86-64.
All tests pass. I think I've caught all the cases assuming only XMM0 is
used. I expect that Win64 is horribly broken by this point though,
because I haven't altered it to cope with XMM1.
James Lyon [Fri, 19 Apr 2013 14:33:16 +0000]
Most x86-64 tests now work; only on error in test1-3.
I've had to introduce the XMM1 register to get the calling convention
to work properly, unfortunately this has broken a fair bit of code
which assumes that only XMM0 is used.
James Lyon [Fri, 19 Apr 2013 10:08:12 +0000]
Got test1-3 working on x86-64.
There are probably still issues on x86-64 I've missed.
I've added a few new tests to abitest, which fail (2x long long and 2x double
in a struct should be passed in registers).
James Lyon [Thu, 18 Apr 2013 23:40:48 +0000]
x86-64 ABI fixes.
abitest now passes; however test1-3 fail in init_test. All other tests
pass. I need to re-test Win32 and Linux-x86.
I've added a dummy implementation of gfunc_sret to c67-gen.c so it
should now compile, and I think it should behave as before I created
gfunc_sret.
James Lyon [Thu, 18 Apr 2013 16:55:00 +0000]
Added some additional tests to abitest.c
This is just to ensure that I haven't (and don't) really mess anything up.
James Lyon [Thu, 18 Apr 2013 16:27:34 +0000]
Tests in abitest.c now work on Win32.
I expect that Linux-x86 is probably fine. All other architectures
except ARM are definitely broken since I haven't yet implemented
gfunc_sret for these, although replicating the current behaviour
should be straightforward.
James Lyon [Wed, 17 Apr 2013 20:51:51 +0000]
Added ABI compatibility tests with native compiler using libtcc.
Only one test so far, which fails on Windows (with MinGW as the native
compiler - I've tested the MinGW output against MSVC and it appears the
two are compatible).
I've also had to modify tcc.h so that tcc_set_lib_path can point to the
directory containing libtcc1.a on Windows to make the libtcc dependent
tests work. I'm not sure this is the right way to fix this problem.
James Lyon [Wed, 17 Apr 2013 19:32:07 +0000]
Fixed tests on Windows (including out-of-tree problems)
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.
James Lyon [Wed, 17 Apr 2013 16:31:18 +0000]
Fixed out of tree build problem on Windows.
Some files installed are not generated so need to be copied from the
source tree rather than the build tree.
I also switched texi2html for makeinfo --html since texi2html is
apparently unmaintained.
Thomas Preud'homme [Mon, 8 Apr 2013 21:26:27 +0000]
Fix building instruction wrt make/gmake
Revert building instruction to mention the use of make instead of gmake
but add a note to tell FreeBSD and OSX users to use gmake instead of
make.
Jov [Mon, 25 Mar 2013 14:51:52 +0000]
Update README,add x86_64/arm,FreeBSD/OSX etc.
Change make to gmake because make will not be gnu make in some OS like
FreeBSD
Thomas Preud'homme [Tue, 19 Mar 2013 13:03:15 +0000]
Fix synchronization between data and instr caches
Thomas Preud'homme [Thu, 28 Feb 2013 15:40:18 +0000]
Flush caches before -running program
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.
Thomas Preud'homme [Thu, 14 Mar 2013 17:15:32 +0000]
Fix configure script on FreeBSD
* x86-64 architectures are reported as amd64 by uname -r
* FreeBSD platform don't need -ldl for linking
Thomas Preud'homme [Mon, 11 Mar 2013 21:31:59 +0000]
Update .gitignore with regards to test changes
Urs Janssen [Wed, 20 Feb 2013 13:23:44 +0000]
document $CPATH, $C_INCLUDE_PATH, $LIBRARY_PATH
Urs Janssen [Tue, 19 Feb 2013 13:41:58 +0000]
don't confuse LD_LIBRARY_PATH (run time) with LIBRARY_PATH (link time)
Andrew Aladjev [Tue, 19 Feb 2013 11:47:36 +0000]
added CPATH, C_INCLUDE_PATH and LD_LIBRARY_PATH
Urs Janssen [Mon, 18 Feb 2013 14:44:18 +0000]
remove doubled prototype
fix documentation about __TINYC__
define __STDC_HOSTED__ like __STDC__
Thomas Preud'homme [Mon, 18 Feb 2013 10:53:00 +0000]
Fix GNU Hurd interpreter path
Thomas Preud'homme [Mon, 18 Feb 2013 10:41:34 +0000]
Add support for KfreeBSD 64bits
Roy [Mon, 18 Feb 2013 00:32:03 +0000]
libtcc: tcc_define_symbol() uses strings, fix segfault
Thomas Preud'homme [Sun, 17 Feb 2013 21:13:41 +0000]
Define __STDC_HOSTED__ to a sane value
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.
Thomas Preud'homme [Sun, 17 Feb 2013 18:44:55 +0000]
Define __STDC_HOSTED__
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)"
Urs Janssen [Sat, 16 Feb 2013 23:48:51 +0000]
add version number to manpage
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)
Thomas Preud'homme [Thu, 14 Feb 2013 14:56:40 +0000]
Release TinyCC 0.9.26
Urs Janssen [Fri, 15 Feb 2013 12:04:39 +0000]
fixed pasto in in
108b2876; background for the additional $CC test is:
GCC_MAJOR may be set even is $CC not realy gcc (but i.e. clang, which (as
of 3.1) requires an addtional CFLAG to accept the non portable (gnuisms all
over the place; try to cimpile tcc with Sun^HOracle, Intel, Pathscale, ...
compiler) code).
Urs Janssen [Fri, 15 Feb 2013 11:48:33 +0000]
- document -dumpversion
- fixed a broken prototype
Urs Janssen [Thu, 14 Feb 2013 23:53:33 +0000]
- don't use GCC_MAJOR to see if we're not using gcc as GCC_MAJOR might be set
during configure even with --cc=notgcc as long as gcc is installed.
Thomas Preud'homme [Thu, 14 Feb 2013 22:52:11 +0000]
Revert "Don't search libgcc_s.so.1 on /lib64"
This reverts commit
b9f089fc4a3c852858bbc8e60c5ac19b7736d7a9.
grischka [Thu, 14 Feb 2013 20:15:56 +0000]
configure: detect ARM variants
Using gnu make's variable variable-names.
Thomas Preud'homme [Thu, 14 Feb 2013 17:02:56 +0000]
Don't search libgcc_s.so.1 on /lib64
It seems libgcc_s.so.1 is systematically on /lib/ (whether
/lib/$triplet for multiarch systems or just /lib for other systems).
grischka [Thu, 14 Feb 2013 16:43:24 +0000]
configure: pass CONFIG_xxxDIR/PATH options via commandline
- except for CONFIG_SYSROOT and CONFIG_TCCDIR
Strictly neccessary it is only for CONFIG_MULTIARCHDIR
because otherwise if it's in config.h it is impossible to
leave it undefined.
But it is also nicer not to use these definitions for
cross-compilers.
- Also:
lib/Makefile : include ../Makefile for CFLAGS
lib/libtcc1.c : fix an issue compiling tcc with tcc on x64
Thomas Preud'homme [Thu, 14 Feb 2013 15:56:40 +0000]
Add missing heading slash to detect /lib64 systems
Thomas Preud'homme [Thu, 14 Feb 2013 15:40:16 +0000]
Add arm ABI detection in conftest.c
Thomas Preud'homme [Thu, 14 Feb 2013 14:39:35 +0000]
Another attempt to "detect" multiarch
Urs Janssen [Thu, 14 Feb 2013 07:24:51 +0000]
- make clang accept unportable code in libtcc1.c
- add -dumpversion cmd.line opt
grischka [Thu, 14 Feb 2013 05:53:07 +0000]
configure: cleanup
- 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.
Thomas Preud'homme [Wed, 13 Feb 2013 21:35:36 +0000]
Create config-print program to test $cc
Create a helper program called config-print to print informations
relative to the BUILD/HOST environment in the case of native
compilation.
Thomas Preud'homme [Wed, 13 Feb 2013 21:28:41 +0000]
Various fixes for
f9ac2013
Thomas Preud'homme [Wed, 13 Feb 2013 19:14:13 +0000]
Detect multiarch triplet and lddir from ldd output
Thomas Preud'homme [Wed, 13 Feb 2013 16:58:14 +0000]
Thomas Preud'homme [Wed, 13 Feb 2013 16:01:53 +0000]
Improve multiarch detection
* Detect multiarch at configure time
* Detect based on the place where crti.o is
* Define multiarch triplet in tcc.h
grischka [Tue, 12 Feb 2013 18:13:28 +0000]
libtcc: new LIBTCCAPI tcc_set_options(TCCState*, const char*str)
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
grischka [Sun, 10 Feb 2013 19:39:05 +0000]
tcc --help: update option summary
tcc-doc.texi: also
grischka [Sat, 9 Feb 2013 23:38:40 +0000]
tcc -vv/--print-search-dirs: print more info
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
grischka [Fri, 8 Feb 2013 18:07:11 +0000]
tcc.h: declare CValue.tab[LDOUBLE_SIZE/4]
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.
Thomas Preud'homme [Fri, 8 Feb 2013 10:07:05 +0000]
Fix fn_dirname in configure script
Use ${parameter%word} construct to fix fn_dirname in configure script.
Bonus: on less fork.
grischka [Wed, 6 Feb 2013 18:01:07 +0000]
lib/Makefile: use CC, add bcheck to libtcc1.a
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)
grischka [Tue, 5 Feb 2013 20:18:29 +0000]
tccelf: fix debug section relocation
With:
tcc -g hello.c
gdb a.out
b main
gdb refused to know "main" because of broken dwarf info.
This partially reverts commit
0d598aca087e46ea67f97dda50df3eed522d5e7a.
I don't remember what the problem was but it was the wrong way
to fix it.
grischka [Tue, 5 Feb 2013 13:27:38 +0000]
tests: cleanup
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)
grischka [Tue, 5 Feb 2013 12:22:36 +0000]
tests2: move into tests
Thomas Preud'homme [Tue, 5 Feb 2013 09:35:12 +0000]
Align on 4n bytes when copying fct args on stack
When copying function arguments on stack in prolog, use multiple of 4
bytes for alignment.
grischka [Mon, 4 Feb 2013 19:57:57 +0000]
portability: make tcc_get_symbol() available for non-native
For consistency with tcc_add_symbol().
Use uintptr_t here also.
Thomas Preud'homme [Mon, 4 Feb 2013 16:58:24 +0000]
Slightly improved support for !gcc compilers
Hack before a complete solution after 0.9.26's release to be able to
compile tcc with clang.
grischka [Mon, 4 Feb 2013 16:58:37 +0000]
win32: Honor "-Wl,-subsystem=console/gui" option
grischka [Mon, 4 Feb 2013 16:24:03 +0000]
tccrun.c: unify rt_get_caller_pc prototype
grischka [Mon, 4 Feb 2013 16:10:47 +0000]
Makefile: fix "allow CONFIG_LDDIR=lib64 configuration"
I forgot the commas.
grischka [Mon, 4 Feb 2013 15:08:06 +0000]
portability: fix void* <-> target address conversion confusion
- #define addr_t as ElfW(Addr)
- replace uplong by addr_t
- #define TCC_HAS_RUNTIME_PLTGOT and use it
grischka [Mon, 4 Feb 2013 15:11:17 +0000]
Makefile: allow CONFIG_LDDIR=lib64 configuration
grischka [Mon, 4 Feb 2013 15:12:17 +0000]
win32: wincrt1.c: include stdlib.h for exit()
grischka [Mon, 4 Feb 2013 14:10:08 +0000]
c67: remove global #define's for TRUE/FALSE/BOOL
Also use uppercase TRUE/FALSE instead of true/false
Thomas Preud'homme [Mon, 4 Feb 2013 10:01:58 +0000]
arm-gen.c: fix var initialization in gfunc_call
Fix initialization of args_size before doing register allocation.
When adding hardfloat calling convention the initialization stopped
being performed when !defined (TCC_ARM_EABI).
Daniel Glöckner [Mon, 4 Feb 2013 08:17:01 +0000]
arm: force rounding towards zero on cast to integer with VFP
Cast to integer should not be affected by the current rounding mode
as set by fesetround.
Daniel Glöckner [Sun, 3 Feb 2013 22:47:52 +0000]
arm: fix conversion from float/double to signed integer with VFP
The signed flag was not encoded in the instruction.
Daniel Glöckner [Sun, 3 Feb 2013 16:51:33 +0000]
arm: fix conversion from integer to float/double with VFP
The source register was not encoded in the instruction.
Thomas Preud'homme [Thu, 31 Jan 2013 12:42:00 +0000]
Revert "Add predictability in CType initialization."
This reverts commit
93785149ed61b7165510ff30149f297cf0821c88.
Thomas Preud'homme [Thu, 31 Jan 2013 12:41:58 +0000]
Revert "Don't call elf_hash on NULL value"
This reverts commit
505329b5b3ee4cb47d0a3590ccd62a65dbf83fc9.
grischka [Thu, 31 Jan 2013 10:29:45 +0000]
safety: replace occurrences of strcpy by pstrcpy
Thomas Preud'homme [Thu, 31 Jan 2013 12:02:04 +0000]
Revert "Check whether structure fields have a type"
This reverts commit
981eb84d8ab91aafe73d5eeb218ffe31d28b1014.
Thomas Preud'homme [Thu, 31 Jan 2013 11:32:31 +0000]
Check whether structure fields have a type
Domingo Alvarez Duarte [Thu, 31 Jan 2013 11:05:11 +0000]
Don't call elf_hash on NULL value
Make sur elf_hash is never invoked with a NULL value.
Signed-off-by: Thomas Preud'homme <robotux@celest.fr>
Domingo Alvarez Duarte [Thu, 31 Jan 2013 10:30:23 +0000]
Add predictability in CType initialization.
Initialize the ref field to 0 when manipulating a CType.
Signed-off-by: Thomas Preud'homme <robotux@celest.fr>
Thomas Preud'homme [Wed, 30 Jan 2013 18:39:29 +0000]
Fix cross-compilation out-of-tree build
Add tcc.c as a prerequesite of the %-tcc$(EXESUF) target and compile $<
instead of tcc.c to make sure tcc.c is search in directories specified
by VPATH.
grischka [Wed, 30 Jan 2013 17:50:02 +0000]
Changelog: cleanup
grischka [Wed, 30 Jan 2013 16:45:21 +0000]
arm: define TCC_ARM_VERSION for cross compiler
grischka [Sat, 22 Dec 2012 17:06:17 +0000]
tccpe: no debug, no stabs
grischka [Wed, 30 Jan 2013 17:39:09 +0000]
configure: use relative paths for in-tree build
Also
- move CPPFLAGS to Makefile
- Use top_srcdir in lib/Makefile
Thomas Preud'homme [Wed, 30 Jan 2013 16:34:19 +0000]
Add my copyright for changes in arm-gen.c
Thomas Preud'homme [Wed, 30 Jan 2013 16:13:40 +0000]
Changelog update
Thomas Preud'homme [Wed, 30 Jan 2013 16:02:35 +0000]
Update Changelog
Thomas Preud'homme [Tue, 29 Jan 2013 17:13:08 +0000]
Favor arm hardfloat over arm softfloat.
Favor ARM hardfloat over ARM softfloat calling convention. In
particular, this solve the problem of the raspbian distribution where
the softfloat ld.so pathname (lib/ld-linux.so.3) is actually a symlink
to the hardfloat ld.so pathname (/lib/arm-linux-gnueabihf/ld-2.13.so).
Thomas Preud'homme [Mon, 28 Jan 2013 18:13:25 +0000]
Fix overflow detection in ARM relocation
Fix overflow detection for R_ARM_CALL, R_ARM_PC24, R_ARM_JUMP24 and
R_ARM_PLT32 relocations on ARM. 26 bits means 25 bits for positive and
negative offsets !
Thomas Preud'homme [Sun, 27 Jan 2013 00:08:01 +0000]
Fix stack alignment on 8 bytes at function call
Ensure stack pointer is correctly adjusted in prolog to be aligned on 8
bytes after the change of frame linking.