[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] isnan: Add support for TinyCC
From: |
Ludovic Courtès |
Subject: |
Re: [PATCH] isnan: Add support for TinyCC |
Date: |
Sat, 16 Oct 2010 13:07:21 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Hi Bruno,
Bruno Haible <address@hidden> writes:
> With tcc 0.9.25 on i386-linux-gnu (I can't even build it for x86_64) I also
> get other errors (with a testdir of all posix-modules):
Actually, it’s 0.9.25 plus a couple of patches adding ‘alloca’ support (!)
and a bit of sed to point it to the right libc:
https://svn.nixos.org/repos/nix/nixpkgs/trunk/pkgs/development/compilers/tinycc/default.nix
> 1) In the gltests directory I get this:
>
> /arch/x86-linux/gnu-inst-tcc/0.9.25/bin/tcc -DHAVE_CONFIG_H -I.
> -DGNULIB_STRICT_CHECKING=1 -I. -I. -I.. -I./.. -I../gllib -I./../gllib -c
> -o test-_Exit.o test-_Exit.c
> In file included from test-_Exit.c:21:
[...]
> In file included from ./../gllib/stdlib.h:35:
> ./../gllib/stdlib.h:35: #include recursion too deep
>
> It's apparently a bug in the #include_next handling, triggered by the
> use of multiple equivalent -I options (like -I../gllib -I./../gllib).
I can’t reproduce it with, e.g.:
--8<---------------cut here---------------start------------->8---
echo '#include <chop/chop.h>' | \
tcc -I ~/soft/include/ -I ~/soft/include/../include/ \
-I ~/soft/include/./. -c -
--8<---------------cut here---------------end--------------->8---
> 2) nextafter not supported
>
> /arch/x86-linux/gnu-inst-tcc/0.9.25/bin/tcc -o test-nextafter
> test-nextafter.o ../gllib/libgnu.a
> tcc: undefined symbol 'nextafter'
> make[4]: *** [test-nextafter] Error 1
I can’t reproduce it with this stripped down case:
--8<---------------cut here---------------start------------->8---
#include <math.h>
#include <assert.h>
#define ASSERT assert
volatile double x;
double y;
int
main ()
{
/* A particular value. */
x = 1.628947572;
/* Towards 0. */
y = nextafter (x, 0);
ASSERT (y < x);
ASSERT (y > 1.628947571);
y = nextafter (y, x + x);
ASSERT (y == x);
/* Towards infinity. */
y = nextafter (x, x + x);
ASSERT (y > x);
ASSERT (y < 1.628947573);
y = nextafter (y, 0);
ASSERT (y == x);
/* Towards itself. */
y = nextafter (x, x);
ASSERT (y == x);
return 0;
}
--8<---------------cut here---------------end--------------->8---
Then:
--8<---------------cut here---------------start------------->8---
tcc nextafter.c -lm -run ; echo $?
--8<---------------cut here---------------end--------------->8---
> 3) bug in the preprocessor
>
> /arch/x86-linux/gnu-inst-tcc/0.9.25/bin/tcc -DHAVE_CONFIG_H -I.
> -DGNULIB_STRICT_CHECKING=1 -I. -I.. -I../gllib -c -o test-sigaction.o
> test-sigaction.c
> test-sigaction.c:68: field not found: __sigaction_handler
> make[4]: *** [test-sigaction.o] Error 1
>
> After #define sa_handler __sigaction_handler.sa_handler
> (from /usr/include/bits/sigaction.h) the token sa_handler expands to
> __sigaction_handler.__sigaction_handler.sa_handler
> instead of
> __sigaction_handler.sa_handler
Indeed, reported at <https://savannah.nongnu.org/bugs/index.php?31349>.
[...]
> 5) 22 test failures:
Ouch, I haven’t investigated these.
Thanks,
Ludo’.