| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* tell a right line number in error message
if a #line directive is wrong
* don't print an error message if we preprocess a .S file
and #line directive is wrong. This is the case of
the
# 4026 bytes
comment in *.S file.
* preprocess_skip: skip a line with
if (parse_flags & PARSE_FLAG_ASM_COMMENTS)
p = parse_line_comment(p);
if line starts with # and a preprocessor command not found.
A test program:
#if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
# This repeats until either a device doesn't exist, or until
#endif
* remove a second definition of the TOK_FLAG_* and PARSE_FLAG_*
from the tccpp.c
|
| | |
|
| |
|
|
| |
And a new console demo program: taxi and passengers simulator
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* define targetos=Windows when --enable-tcc32-mingw, --enable-cygwin, ...
* use TARGETOS insteed HOST_OS when selecting PROGS
* use "$(tccdir)" insteed $(tccdir) on install (spaces in path)
* install tcc.exe too
* produce bcheck.o when cross-compiling too (lib/Makefile)
* force bcheck.o linking by compiling inside tcc_set_output_type()
a dummy program with local array. Otherwise bcheck.o may be not linked.
* replace %xz format specifier with %p in bcheck (don't supported on
Windows)
* call a __bound_init when __bound_ptr_add, __bound_ptr_indir,
__bound_new_region, __bound_delete_region called.
This is because a __bound_init inside ".init" section is not called
on Windows for unknown reason.
* print on stderr a message when an illegal pointer is returned:
there is no segmentation violation on Windows for a program
compiled with "tcc -b"
* remove "C:" subdir on clean if $HOST_OS = "Linux"
* default CFLAGS="-Wall -g -O0" insteed CFLAGS="-Wall -g -O2"
to speed up compilation and more precise debugging.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
tcc w/o -g option generate an executable file which format
is not recognized by binutils. It is like stripped one but
binutils don't think so. Solution: generate not stripped
file which can be correctly stripped by external utils.
may be there is a need to handle a -s option and call
a sstrip/strip program to do a job.
|
| |
|
|
|
|
|
|
|
|
| |
------------ libtest ------------
./libtcc_test lib_path=..
<string>:11: warning: implicit declaration of function 'printf'
<string>:13: warning: implicit declaration of function 'add'
------------ test3 ------------
tcctest.c:1982: warning: implicit declaration of function 'putchar'
tcctest.c:2133: warning: implicit declaration of function 'strlen'
|
| |
|
|
|
|
| |
- a warning: unnamed struct/union that defines no instances
- allow a nested named struct declaration w/o identifier
only when option -fms-extensions is used
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Adjusted Makefile to make it Darwin (Mac OS X 10.10)-friendly for cross-compilers
by removing the creation of arm64 cross-compilers on this platform.
|
| | |
|
| |
|
|
|
|
| |
replacing (addr > e->size) with (addr >= e->size)
was correct only in one place, a second replacing
is reversed by this commit.
|
| |
|
|
|
| |
Miccrosoft Visual Sudio (Express) 2008 and 2010 do not accept variable
definitions C99 style, reported by Fabio <oldfaber@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- care about __attribute__ redefinition in the system headers
- an invalid pointer must be returned when (addr >= e->size),
and not (addr > e->size)
A test program:
#include <stdio.h>
#include <stdlib.h>
int main ()
{
int v[10];
fprintf(stderr, "&v[0] = %p\n", &v[0]);
fprintf(stderr, "&v[10] = %p\n", &v[10]);
exit(1);
return 0;
}
// tcc -b test.c
The output before a patch:
&v[0] = 0xbf929d8c
&v[10] = 0xbf929db4
The output after a patch:
&v[0] = 0xbff6e33c
&v[10] = 0xfffffffe
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
/usr/local/lib/tcc/i386/bcheck.o: error: '__bound_error_msg' defined twice
#include <stdio.h>
int main ()
{
#if 1
int v[10];
v[10] = 0;
fprintf(stderr, "is bounds error catched?\n");
#endif
return 0;
}
// tcc -b test.c
|
| | |
|
| |
|
|
|
|
| |
On Linux 32: sizeof(long)=32 == sizeof(void *)=32
on Linux 64: sizeof(long)=64 == sizeof(void *)=64
on Windows 64: sizeof(long)=32 != sizeof(void *)=64
|
| | |
|
| |
|
|
|
| |
fixes a crash for the empry program (tcc -b empty.c)
empty.c: int main() { return 0; }
|
| |
|
|
|
|
|
|
|
| |
The following program (errno.c) reports errno=2 when run
using "tcc -run errno.c"
#include <errno.h>
#include <stdio.h>
int main(void) { printf("errno=%d\n", errno); return 0; }
|
| |
|
|
|
|
|
| |
Options must be sorted and a long one must preceed a short one.
What was before:
tcc -dumpversion
tcc: error: invalid option -- '-dumpversion'
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A test program (must be compiled by the above version of the tcc):
/* Tickle a bug in TinyC on 64-bit systems:
* the LSB of the top word or ARGP gets set
* for no obvious reason.
*
* Source: a legacy language interpreter which
* has a little stack / stack pointer for arguments.
*
* Output is: 0x8049620 0x10804961c
* Should be: 0x8049620 0x804961c
*/
#include <stdio.h>
#define NARGS 20000
int ARG[NARGS];
int *ARGSPACE = ARG;
int *ARGP = ARG - 1;
main() { printf("%p %p\n", ARGSPACE, ARGP); }
|
| |
|
|
| |
mark a constant as long long (or -std=gnu99 is needed)
|
| |
|
|
|
|
|
| |
properly
because a tcc handle now -2147483648 properly. Look a commit:
Make integer constant parsing C99 compliant
|
| |
|
|
|
| |
Parse a type if there is only one '(' before a type token.
Otherwise a recursion will perform a job.
|
| |
|
|
| |
A right solution for this problem will follow.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Force to use a NATIVE_DEFINES insteed of the DEFINES for the
native tcc. After this change we have on debian/ubuntu
# ./x86_64-tcc -vv
tcc version 0.9.26 (x86-64, Linux)
install: /usr/local/lib/tcc
crt:
/usr/lib/x86_64-linux-gnu
libraries:
/usr/lib/x86_64-linux-gnu
/usr/lib
/lib/x86_64-linux-gnu
/lib
/usr/local/lib/x86_64-linux-gnu
/usr/local/lib
include:
/usr/local/include/x86_64-linux-gnu
/usr/local/include
/usr/include/x86_64-linux-gnu
/usr/include
/usr/local/lib/tcc/include
elfinterp:
/lib64/ld-linux-x86-64.so.2
Before this change the output was
# ./x86_64-tcc -vv
tcc version 0.9.26 (x86-64, Linux)
install: /usr/local/lib/tcc
crt:
/usr/lib
libraries:
/usr/lib
/lib
/usr/local/lib
include:
/usr/local/include
/usr/include
/usr/local/lib/tcc/include
elfinterp:
/lib64/ld-linux-x86-64.so.2
This change don't fix a cross compilers
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes i386-tcc on CentOS 7. After patch
[root@centos7 tinycc]# ./i386-tcc -vv
tcc version 0.9.26 (i386, Linux)
install: /usr/local/lib/tcc
crt:
/usr/lib
libraries:
/usr/lib
/lib
/usr/local/lib
Before patch:
[root@centos7 tinycc]# ./i386-tcc -vv
tcc version 0.9.26 (i386, Linux)
install: /usr/local/lib/tcc
crt:
/usr/lib64
libraries:
/usr/lib64
/lib64
/usr/local/lib64
|
| | |
|
| |
|
|
|
|
|
|
| |
The following check in tccgen.c is removed
if (nocode_wanted)
tcc_error("statement expression in global scope");
This check is introduced in commit 5bcc3eed7b93 and breaks compilation
of the linux 2.4.26 kernel.
|
| |
|
|
| |
use "x86-64" as a directory name for the libtcc1.a installation when cross-compiling.
|
| |
|
|
|
| |
build and install libtcc1.a for i386, x86_64 and arm64
(libtcc1.a for x86_64 was not installed on i386)
|
| | |
|
| |
|
|
|
| |
move call to print_defines() from tcc.c to the libtcc.c
define a print_defines() as a ST_FUNC
|
| |
|
|
|
|
|
|
| |
perl -i -pe 'use Text::Iconv;
$c1 = Text::Iconv->new("utf-8", "utf-8");
$c2 = Text::Iconv->new("iso-8859-1", "utf-8");
if (!$c1->convert($_)) { $_ = $c2->convert($_); }' \
`find * -type f`
|
| | |
|
| | |
|
| |
|
|
|
|
| |
int i = i++ causes a segfault because of missing guard. Looking
recursively at all backend functions called from middle end several more
guard appeared to be missing.
|
| |
|
|
| |
lib/lib-arm64.c must be compiled by tcc.
|
| |
|
|
|
| |
keep revert (check SHF_ALLOC) only for x86 target and keep a grishka patch for
other targets
|
| |
|
|
|
| |
A tcc for ARM* don't have an assembler. This is partial reverse of the commit
build-libtcc1-by-tcc: use a new tcc to compile a libtcc1.c and alloca.S
|
| |
|
|
|
| |
i386-tcc.exe is a compiler for i386 Linux. A HOST_OS variable in Makefile is
introduced and used to select a native compiler (which one to name as tcc.exe)
|
| |
|
|
|
|
|
|
|
|
| |
Some structs are passed in registers. When they need more than
one the implementation of __va_arg on x86-64 didn't correctly account
for this. This fixes only the cases where the structs consist of
integer types, as there the register save area is consecutive.
Fixes some tests from 73_arm64.c, but still leaves those failing
that use floating point in the large-but-regpassed structs.
|
| |
|
|
| |
Not the code was confused, I was :)
|
| |
|
|
| |
The directory is called "arm", not "ARM".
|
| |
|
|
|
|
|
|
|
| |
The common code to move a returned structure packed into
registers into memory on the caller side didn't take the
register size into account when allocating local storage,
so sometimes that lead to stack overwrites (e.g. in 73_arm64.c),
on x86_64. This fixes it by generally making gfunc_sret also return
the register size.
|
| |
|
|
|
|
| |
__clear_cache is defined in lib-arm64.c with a single call to
__arm64_clear_cache, which is the real built-in function and is
turned into inline assembler by gen_clear_cache in arm64-gen.c
|
| | |
|