Thomas Preud'homme wrote: > Le mercredi 13 février 2013 19:08:37, Thomas Preud'homme a écrit : >> Le mercredi 13 février 2013 17:16:28, Thomas Preud'homme a écrit : >>> On Wed, 13 Feb 2013 08:30:14 -0700, arn...@skeeve.com wrote: >>>> "Thomas Preud'homme" <robo...@celest.fr> wrote: >>>>> Why not but strike multiarch from that as I don't see how we could >>>>> detect it by compiling a C program. >>>> >>>> Use the output of ldd to tell you where the C library is. >>> >>> Yep true, I thought about it last night and forgot about it in the >>> morning. However I just pushed a commit using checking where is crti.o >>> before reading your mail. It's a one line test so I think the solution >>> is not too bad but you can prove me wrong of course. >> >> Thanks a lot for the suggestion. Thinking about it a bit I managed to come >> up with a much better patch. It's not totally done though but I have to >> leave. I'll push it tonight. Stay tuned. > > Pushed. And the diffstat from the original situation (before my 2 commits to > reorganize) is also better. See for yourself: >
OK, despite what I said, I fetched commit e298f608 ("Create config-print program to test $cc", 13-02-2013) last night in order to test it. [Sorry for not reporting the results last night, but I desperately needed to get some sleep!] Unfortunately, the news is not good! :( Using ldd has broken the build again and my x86 is apparently a bigendian machine! :-P viz: $ git log --oneline -1 e298f60 Create config-print program to test $cc $ $ make distclean >/dev/null $ ./configure Binary directory /usr/local/bin TinyCC directory /usr/local/lib/tcc Library directory /usr/local/lib Include directory /usr/local/include Manual directory /usr/local/share/man Info directory /usr/local/share/info Doc directory /usr/local/share/doc/tcc Target root prefix Source path /home/ramsay/tinycc C compiler gcc Target OS Linux CPU x86 Big Endian yes gprof enabled no cross compilers no use libgcc no Creating config.mak and config.h $ make >out 2>&1 $ make test make -C tests test make[1]: Entering directory `/home/ramsay/tinycc/tests' ------------ hello-exe ------------ ../tcc -B.. ../examples/ex1.c -o hello || (../tcc -vv; exit 1) && ./hello tcc: error: file 'crt1.o' not found tcc: error: file 'crti.o' not found tcc: error: file 'crtn.o' not found tcc: error: undefined symbol 'printf' tcc version 0.9.25 (i386 Linux) install: /usr/local/lib/tcc/ crt: /usr/lib/tls/i686/cmov libraries: /usr/lib/tls/i686/cmov /lib/tls/i686/cmov /usr/local/lib/tls/i686/cmov include: /usr/local/include /usr/local/include/tls/i686/cmov /usr/include /usr/include/tls/i686/cmov /usr/local/lib/tcc/include make[1]: *** [hello-exe] Error 1 make[1]: Leaving directory `/home/ramsay/tinycc/tests' make: *** [test] Error 2 $ $ cat -n config.h 1 /* Automatically generated by configure - do not modify */ 2 #ifndef CONFIG_TCCDIR 3 # define CONFIG_TCCDIR "/usr/local/lib/tcc" 4 #endif 5 #ifndef CONFIG_MULTIARCHDIR 6 # define CONFIG_MULTIARCHDIR "tls/i686/cmov" 7 #endif 8 #ifndef CONFIG_LDDIR 9 # define CONFIG_LDDIR "lib/tls/i686/cmov" 10 #endif 11 #define GCC_MAJOR 4 12 #define HOST_I386 1 13 #define WORDS_BIGENDIAN 1 14 #define TCC_VERSION "0.9.25" $ NOTE: that an x86 is bigendian! ;-P $ gcc -o config-print config-print.c $ ldd ./config-print linux-gate.so.1 => (0xffffe000) libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7d98000) /lib/ld-linux.so.2 (0xb7ef0000) $ $ ls -l /lib/tls/i686/cmov/libc.so.6 lrwxrwxrwx 1 root root 11 2007-06-24 19:45 /lib/tls/i686/cmov/libc.so.6 -> libc-2.5.so $ $ ls /usr/lib/tls/i686/cmov ls: /usr/lib/tls/i686/cmov: No such file or directory $ ls /lib/tls/i686/cmov/ ld-2.5.so libmemusage.so libnss_nis.so.2@ ld-linux.so.2@ libm.so.6@ libpcprofile.so libanl-2.5.so libnsl-2.5.so libpthread-2.5.so libanl.so.1@ libnsl.so.1@ libpthread.so.0@ libBrokenLocale-2.5.so libnss_compat-2.5.so libresolv-2.5.so libBrokenLocale.so.1@ libnss_compat.so.2@ libresolv.so.2@ libc-2.5.so libnss_dns-2.5.so librt-2.5.so libcidn-2.5.so libnss_dns.so.2@ librt.so.1@ libcidn.so.1@ libnss_files-2.5.so libSegFault.so libcrypt-2.5.so libnss_files.so.2@ libthread_db-1.0.so libcrypt.so.1@ libnss_hesiod-2.5.so libthread_db.so.1@ libc.so.6@ libnss_hesiod.so.2@ libutil-2.5.so libdl-2.5.so libnss_nis-2.5.so libutil.so.1@ libdl.so.2@ libnss_nisplus-2.5.so libm-2.5.so libnss_nisplus.so.2@ $ ls /usr/local/lib/tls/i686/cmov/ ls: /usr/local/lib/tls/i686/cmov/: No such file or directory $ $ find /lib -name crt1.o $ find /usr/lib -name crt1.o /usr/lib/crt1.o $ find /lib -name 'libc.*' /lib/libc.so.6 /lib/tls/i686/cmov/libc.so.6 $ find /usr/lib -name 'libc.*' /usr/lib/xen/libc.a /usr/lib/libc.a /usr/lib/libc.so $ y@ramsay-laptop:$ cat /usr/lib/libc.so /* GNU ld script Use the shared library, but some functions are only in the static library, so try that secondarily. */ OUTPUT_FORMAT(elf32-i386) GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux.so.2 ) ) $ HTH ATB, Ramsay Jones _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel