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 $(())
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.
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.
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.
* 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
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.
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>
* 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
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>
* 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
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
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
Error out with an explicit message when trying to initialize a
character array with something that's not a literal (optionally
enclosed in braces) as per C99 6.7.8:14; thanks to Antti-Juhani
Kaijanaho <ajk@debian.org> who did all the work.