Hello,

I'm happy to see that some recent commit fixed the '#include_next' problems 
(mentioned here: 
http://lists.nongnu.org/archive/html/tinycc-devel/2015-12/msg00018.html ), and 
latest TCC (rev  aa1ed61) can almost compile GNU coreutils (at least - 
continues beyond the above mentioned '#include_next' issue).

But,
it now segfaults like so:

    $ git clone git://git.sv.gnu.org/coreutils.git && cd coreutils
    $ ./bootstrap
    $ ./configure --without-selinux CC=tcc
    $ make V=1
    ...
    make[2]: Entering directory `/tmp/foo/coreutils'
    source='src/timeout.c' object='src/timeout.o' libtool=no \
        DEPDIR=.deps depmode=tcc /bin/bash ./build-aux/depcomp \
        tcc  -I. -I./lib  -Ilib -I./lib -Isrc -I./src    -g -c -o src/timeout.o 
src/timeout.c
    tcc: x86_64-gen.c:421: load: Assertion `((ft & 0x000f) == 0) || ((ft & 0x000f) == 12) 
|| ((ft & 0x000f) == 4) || ((ft & 0x000f) == 5) || ((ft & 0x000f) == 6)' failed.
    ./build-aux/depcomp: line 173:  6389 Aborted                 (core dumped) "$@" -MD 
-MF "$tmpdepfile"
    make[2]: *** [src/timeout.o] Error 134

The offending code is a complex struct initialization, perhaps related to 
recent discussion:
  http://lists.nongnu.org/archive/html/tinycc-devel/2016-03/msg00042.html

from src/timeout.c:137 ( 
http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/timeout.c#n135 ):
===
  struct timespec ts = dtotimespec (duration);
  struct itimerspec its = { {0, 0}, ts };
===

When changing the initialization to:
    struct itimerspec its = { {0, 0} };
The compilation succeeds (though of course the struct is not initialized 
properly)

regards,
 - assaf


_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to