Hi Bruno, Bruno Haible <br...@clisp.org> writes:
>> 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 > > Well, this is still not going to work for me. On Linux bi-arch systems, 64-bit > libraries are found in /lib64 and /usr/lib64. This line is not going to help > about it: > > -e's|tcc_add_library_path(s, CONFIG_SYSROOT > "/lib");|tcc_add_library_path(s, "${stdenv.glibc}/lib");|g; Right. >> > 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--- > > I can reproduce it like this: > > ---------------- stdlib.h -------------------- > #include <stdlib.h> > ---------------- foo.c ----------------------- > #include <stdlib.h> > ---------------------------------------------- > $ /arch/x86-linux/gnu-inst-tcc/0.9.25/bin/tcc -c -I. -I. foo.c > In file included from foo.c:1: > In file included from ./stdlib.h:1: [...] > ./stdlib.h:1: #include recursion too deep Hmm but you get the same behavior with gcc. Did you mean #include_next? >> > 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: > > Indeed, the problem was already at configuration time: > > checking whether nextafter can be used without linking with libm... no > checking whether nextafter can be used with libm... no > > Fixing it through the patch below. Great, thanks. BTW, TinyCC compiles all the configure tests and Gnulib files in Guile. It eventually bails out because Libtool insists on invoking it with ‘-rpath’, which it doesn’t support: <http://hydra.nixos.org/job/gnu/guile-master/build_tinycc>. Thanks, Ludo’.