public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Kaz Kylheku" <kaz@zeugmasystems.com>
To: <gcc-help@gcc.gnu.org>
Subject: RE: Gcc+binutils+libc cross-compiling: path to libc.so.6 malformed in  "ld".
Date: Fri, 25 Aug 2006 00:46:00 -0000	[thread overview]
Message-ID: <66910A579C9312469A7DF9ADB54A8B7D365697@exchange.ZeugmaSystems.local> (raw)

> I wrote previously
> I think I just have to figure out the way to configure gcc to do all
> that exactly as it is doing now, but not generate the 
> --sysroot option.
> I really want to avoid patching it.

I hacked up a silly patch in binutils after which it works. I'm now
happily cross-compling core-utils against glibc for MIPS, on an x86 box.
I've looked at older versions of this function and it didn't have the
else. The idea is to try the catenated name with sysroot, and if that
doesn't work, try the uncatenated name.

I really hate this "solution", but it gets me past a hurdle. I already
have a patched kernel and a patched glibc, so what the heck, right?

I think ld expects gcc to feed it absolute paths which are to be
interpreted relative to the sysroot. But that isn't what gcc is doing:
it's feeding absolute paths from the real system root. It would be nice
if I could figure out how to get gcc to feed absolute paths to collect
which /require/ the root to be tacked on. E.g. /usr/lib/crt<whatever>.o
which would be combined with /path/to/sysroot to create
/path/to/sysroot/usr/lib/crt<whatever>.o.

Ah well.

--- binutils-2.17.orig/ld/ldfile.c      2005-05-12 03:32:02.000000000
-0400
+++ binutils-2.17/ld/ldfile.c   2006-08-24 20:38:38.335091736 -0400
@@ -317,7 +317,8 @@
            }
          free (name);
        }
-      else if (ldfile_try_open_bfd (entry->filename, entry))
+
+      if (ldfile_try_open_bfd (entry->filename, entry))
        {
          entry->sysrooted = IS_ABSOLUTE_PATH (entry->filename)
            && is_sysrooted_pathname (entry->filename, TRUE);

 

             reply	other threads:[~2006-08-24 21:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-25  0:46 Kaz Kylheku [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-08-29  4:29 Kaz Kylheku
2006-08-29  8:37 ` Kai Ruottu
2006-08-25 17:56 Kaz Kylheku
2006-08-28  9:18 ` Kai Ruottu
2006-08-28  9:52   ` Kai Ruottu
2006-08-24 19:04 Kaz Kylheku
2006-08-24  5:03 Kaz Kylheku
2006-08-24  9:30 ` Kai Ruottu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=66910A579C9312469A7DF9ADB54A8B7D365697@exchange.ZeugmaSystems.local \
    --to=kaz@zeugmasystems.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).