[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] core dump on FreeBSD with last commit "configure: --t

From: avih
Subject: Re: [Tinycc-devel] core dump on FreeBSD with last commit "configure: --triplet= option, Makefile: cleanup"
Date: Tue, 18 Oct 2016 15:32:35 +0000 (UTC)

Some time ago I also bumped into the lib64 issue, which was apparent when building cross compilers on a 64 system which doesn't use lib64, e.g. Ubuntu 64.

At the time I wrote a patch (which I didn't submit to mob) which decides only at one place (configure) and then uses it everywhere else.
That's the patch: https://github.com/avih/tinycc/commit/65b39fb66657459339fac88f1f4f4cedca4d0ad1

However, with recent clean mob (though I haven't tested with the very latest 2-3 commits as of now) I didn't have this problem anymore. Maybe you should take the patch or a similar approach to what it does.

On Tuesday, October 18, 2016 6:10 PM, Michael Matz <address@hidden> wrote:


On Tue, 18 Oct 2016, grischka wrote:

> Christian Jullien wrote:
> > Get worse as it now core dumps ...
> At least it seems to find the crt*.o now.

But not on linux-x86-64 anymore :-/  I think trying to fix things for a
system one doesn't have access to is futile.  FWIW, your recent patch did,
amongst other things:

-# ifdef TCC_TARGET_X86_64
-#  define CONFIG_LDDIR "lib64"
-# else
-#  define CONFIG_LDDIR "lib"
-# endif
+# define CONFIG_LDDIR "lib"

Okay, so no sensible default setting anymore, which is fine, but now we
rely on configure providing the correct one.  But the same commit also

-      triplet="$($CONFTEST triplet)"
-      if test -f "/usr/lib/$triplet/crti.o" ; then
-      tcc_lddir="lib"
-      multiarch_triplet="$triplet"
-      elif test "$cpu" != "x86" -a -f "/usr/lib64/crti.o" ; then
-      tcc_lddir="lib64"
+      if test -z "$triplet"; then
+        tt="$($CONFTEST triplet)"
+        if test -n "$tt" -a -f "/usr/lib/$tt/crti.o" ; then
+          triplet="$tt"
+        fi
+      fi
+      if test -z "$triplet"; then
+        if test ! -f "/usr/lib/crti.o" -a -f "/usr/lib64/crti.o" ; then
+          tcc_lddir="lib64"
+        fi

That's not correct.  On an x86-64 system I can have both /usr/lib/crti.o
and /usr/lib64/crti.o, namely when one also has a 32bit development
environment (which I have).  Before it was testing if the cpu isn't x86
and differenciated by that.  Now, on my system, tcc_lddir remains unset
and hence runs into the above hunk which has no fallback to lib64 anymore.

Christian: do you have /usr/lib64 as well or only /usr/lib?  If you also
have the former, is there a crti.o in there as well?

I'm tempted to remove the check for /usr/lib/crti.o altogether.  That
would mean to always assume lib64 if no triplet is given but
/usr/lib64/crti.o exists.  That seems sensible to me (on 32 hosts you
won't have lib64, and on 64bit hosts you probably will default to 64bit



Tinycc-devel mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]