Commit Graph

726 Commits

Author SHA1 Message Date
grischka
3ba37e1e3f tccgen: Revert yuanbin's recent patches
This reverts commits 670993..d35138
Maybe these commits fixed something but also seemed to cause problems.
2010-06-21 18:21:44 +02:00
Claudio Bley
433ecdfc9d implemented C99 for loop with variable declaration 2010-06-21 11:57:32 +02:00
grischka
632ee5a540 Revert "Complain for static fct declared w/o file scope"
This reverts commit e9406c09a3.

We don't want errors for static local function pointers, such as:
  {
    static void (*fn)();
    ...
  }
2010-06-15 17:03:23 +02:00
grischka
10b4802869 Fix "Fix bashims in configure ..." for MSYS
Fixes commit dc265feb63
2010-06-15 17:02:35 +02:00
grischka
5fcd1fef1c Fix last commits: remove CRLF, chmod 644 tccgen.c 2010-06-15 17:02:09 +02:00
yuanbin
d351384fdc tccgen: skip ')' in front of ',' for initializer 2010-06-13 14:50:53 +08:00
yuanbin
952e83e0ca tccgen: skip fields from same union 2010-06-13 02:37:28 +08:00
yuanbin
d6ce75b4d6 tccgen.c: skip fields from same union 2010-06-13 01:12:36 +08:00
yuanbin
dd72577759 tccgen: initial the last member of union 2010-06-11 21:18:05 +08:00
yuanbin
6709933d78 tccgen: initial last member of union 2010-06-11 20:48:33 +08:00
Thomas Preud'homme
dc265feb63 Fix bashims in configure and gcctestsuite.sh.
configure and gcctestsuite.sh shell scripts contains bashisms although being
bourne shell script. This patch fixes the following bashisms:
* Use of $RANDOM variable (replaced by reading in /dev/urandom)
* Use == in tests instead of just =
* Use $[] for arithmetic computation istead of $(())
2010-05-26 14:08:29 +02:00
Daniel Glöckner
a867f42597 don't discard SHT_((PRE)INIT|FINI)_ARRAY sections 2010-05-15 01:26:56 +02:00
Daniel Glöckner
128e46f91b ARM: add support for R_ARM_V4BX 2010-05-15 01:23:34 +02:00
Daniel Glöckner
20a1cba286 ARM: implement rt_get_caller_pc 2010-05-14 14:22:32 +02:00
Daniel Glöckner
741841d863 ARM: allow jumps > 32MB on -run
This is needed to reach tinycc's PLT from the compiled program.
2010-05-14 13:07:59 +02:00
Daniel Glöckner
a64727ba7d append ULL to big constants 2010-05-13 22:18:33 +02:00
Daniel Glöckner
3de023b6c6 ARM: use uint32_t for opcodes
fixes cross compiling on x86_64
2010-05-13 22:17:09 +02:00
Daniel Glöckner
6eac6b7254 Revert "tccpp: Allow local labels to start with a dot"
This reverts commit f740485a5a.

It breaks access to structure elements starting with L
2010-05-06 21:42:37 +02:00
Thomas Preud'homme
8eb86ab78d Add nan, snan and inf float constants 2010-05-06 02:20:35 +02:00
Thomas Preud'homme
2220467fcf Don't load libtcc1 on arch where it doesn't exist
ARM architecture doesn't have any libtcc1 implementation but tcc load
libtcc1.a in all case. This patch add a conditional preprocessor
instruction to load libtcc1.a only when there is an implementation for
the target architecture.
2010-05-01 17:20:28 +02:00
Thomas Preud'homme
a28b18fa16 Link alias symbols together
Make sure alias symbols resolve to the same address in program .bss or .data
section. This ensure for example that if a program reference environ (via an
extern char **environ declaration) and the libc change its value via the
__environ alias after the R_ARCH_COPY relocation have been performed, then
the program will see the new value.
2010-05-01 16:45:36 +02:00
Henry Kroll III
036ff17916 reverse another unnecessary change
-m32 is set elsewhere now.
2010-04-29 23:52:20 -07:00
Henry Kroll III
1f62f2253c recursive Makefiles should use $(MAKE), not "make"
add clean: target for lib/tcc1.def
2010-04-29 23:06:23 -07:00
Henry Kroll III
c7a4e11bf1 remove superfluous LIBS=. (leftover from work on --disable-statc) 2010-04-28 16:15:19 -07:00
Henry Kroll III
209caeedee Summary of commits + added some brief comments to Makefile
Summary of what was changed or added so far:
    These won't work on Win32

* --disable-static option builds libtcca.so.1.0 and associated simlinks.
  This replaces libtcca.a, which is a static library with a dynamic one.

* --with-selinux option uses mmap to enable tcc -run to work with Selinux.

* attempt to build tcc1.def on i386 / x86_64 when --enable-cross is used.

  If successful, this gets around the "_start not found" or "_winstart not
  found" messages when i386-win32-tcc is run on these systems. I say "if"
  because it gave me fits of trouble on my system and not all others have
  been tested yet. tcc1.def is not a real .def file by the way, but it works,
  so it's kind of a dancing bear at this point. We're not concerned that
  it's getting the steps wrong. We're just happy it's not eating us for lunch.
2010-04-26 23:20:35 -07:00
Henry Kroll III
ac0b7d82d8 don't build tcc1.def on Windows.
I think the Windows build portion of the Makefile already
provides their own version. If not, we can remove the check.
2010-04-26 01:27:15 -07:00
Henry Kroll III
765992396f Makefile fixup:
* additional make target for lib/tcc1.def on non-win32 builds
  tcc1.def was formerly lib/libtcc1.a but has bee made into its
  own Makefile target, tcc1.def

* use mv instead of cp on config.h
  this fixes a mistake I made which caused Makefile to rebuild
  all targets every time

* make links from libtcc.so.1.0 to libtcc.so.1 and libtcc.so
2010-04-25 13:34:02 -07:00
Henry Kroll III
07eb850608 make --enable-cross work properly on x86_64
merge more changes from Fedora spec file into Makefile
I did a lot of reading on Makefiles. It should be a lot less hacked now that I got rid of my temporary cross-build script. I had to build i386-win32-tcc as 32 bit in order to use it to build the windows version of libtcc1.a and move that into lib directory. Still testing, but it does build windows fib.exe smoothly now and generates shard lib, libtcc.so.1.0 and test links against it.
2010-04-25 00:35:25 -07:00
Henry Kroll III
1a8e7d9fbb Merge branch 'mob' of ssh://repo.or.cz/srv/git/tinycc into makefile 2010-04-25 00:32:10 -07:00
Henry Kroll III
239fdf0b87 remove make_libtcc1_win32.sh shell script
and merge commands into Makefile
2010-04-24 22:16:39 -07:00
Henry Kroll III
eb78e94300 reverse make win32 version of libtcc1.a patch 2010-04-24 21:58:12 -07:00
Henry Kroll III
80b4c698c2 make win32 version of libtcc1.a for cross-compiler on x86 / x86_64 2010-04-24 13:27:56 -07:00
Henry Kroll III
b0b29d8013 put tcc in /usr/lib64/tcc on distros that have it 2010-04-24 03:30:46 -07:00
Henry Kroll III
2ab42855cb make --with-selinux work with libtcc, too 2010-04-24 03:28:54 -07:00
Henry Kroll III
a4ed587f61 add --disable-static option to build libtcc.so instead of libtcc.a
for distros that want static libs
2010-04-24 02:35:43 -07:00
Henry Kroll III
1578322b06 fix typo in configure 2010-04-24 02:32:41 -07:00
Henry Kroll III
4686236091 i386-win32-tcc fails to build a valid win32 executable if built
on x86_64 using --enable-cross. The easiest way to fix this is
to put -m32 in the Makefile.

Committer: Henry Kroll <henry@comptune.com>

Committer: Henry Kroll <henry@comptune.com>
2010-04-23 18:36:12 -07:00
Henry Kroll III
be7e339d8a Use mmap instead of exec mem for Selinux machines. Fixes crash on Fedora. 2010-04-20 23:43:02 -07:00
Thomas Preud'homme
a64a6f36a0 Replace malloc+strcpy by tcc_strdup in ld_load_file_list 2010-04-20 22:25:16 +02:00
Thomas Preud'homme
6525a15919 Fix "already done" test in libname_to_filename()
if "(libname == '\0')" should be instead "if (libname != '\0')"
2010-04-20 16:21:13 +02:00
Thomas Preud'homme
4d5fcfb971 Delete unused vtop_saved variable in unary_type 2010-04-20 16:12:41 +02:00
Thomas Preud'homme
3ad3168125 Clean changes introduced by 47abdbd
* Replace the save/load_buffer_state by a dynarray approach:
  - Filename and libname are added to a dynarray when first encountered
  - Load repeatedly the files in the dynarray until no new undefined
    symbol are encountered
* Replace snprintf by sprintf in libname_to_filename
* Use tcc_fileextension in filename_to_libname
* Introduce a tcc_strcpy_part fonction to copy only a subset of a
  string
* Move new_undef_syms declaration from tcc.h to tccelf.c
2010-04-20 16:02:42 +02:00
Timo VJ Lahde
809f489662 WinCE PE subsystem 2010-04-19 16:34:59 +03:00
Timo VJ Lahde
2cb1fd6a10 PE ARM: jump IAT arm code 2010-04-19 15:50:22 +03:00
Sergei Trofimovich
83b0bd3095 libtcc.c: fix compilation failure (inconsistent tcc_add_file_internal)
gcc -o libtcc1.o -c lib/libtcc1.c -O2 -Wall
libtcc.c: At top level:
libtcc.c:1063: error: static declaration of 'tcc_add_file_internal' follows non-static declaration
tccelf.c:2915: note: previous implicit declaration of 'tcc_add_file_internal' was here

Signed-off-by: Sergei Trofimovich <st@anti-virus.by>
2010-04-19 11:46:36 +03:00
Thomas Preud'homme
e4ed4e7f4f Support more arm EABI compatible architectures
Add support for:
  - armv5tel
  - armv6j
  - armv7a
2010-04-18 19:29:11 +02:00
Thomas Preud'homme
e9406c09a3 Complain for static fct declared w/o file scope
Error out on static function without file scope and give an explaination
to the user
2010-04-15 19:33:47 +02:00
Thomas Preud'homme
47abdbd3d5 Better handle ld scripts
* search file from INPUT and GROUP commands in the library path in
  addition to the current directory
* handle libraries specified by -lfoo options
* Search lib in GROUP command repeatedly
2010-04-15 19:30:00 +02:00
Thomas Preud'homme
6d4166df61 Don't prefix $prefix with $(DESTDIR) in configure
Prefixing $prefix with $(DESTDIR) is an error as it could lead for
example to mandir being equal to $(DESTDIR)$prefix/man where
$prefix itself is equal to $(DESTDIR)/usr/local which make man be equal
to $(DESTDIR)$(DESTDIR)/usr/local/man
2010-04-15 19:10:59 +02:00
Thomas Preud'homme
8de9b7a631 Correctly support all unary expression with sizeof
Unary expression can start with a parenthesis. Thus, the current test
to detect which sizeof form is being parsed is inaccurate. This patch
makes tcc able to handle things like sizeof (x)[1] where x is declared
as char x[5]; wich is a valid unary expression
2010-04-15 19:05:53 +02:00