bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/4966] New: linker incorrectly prepends sysroot to absolute path


From: springl-binutils at bfw-online dot de
Subject: [Bug ld/4966] New: linker incorrectly prepends sysroot to absolute path
Date: 28 Aug 2007 07:11:26 -0000

While trying to compile gcc (HEAD of 2007-08-27) for a sysrooted environment in
/tmp/gc where glibc 2.6.1 is already installed there, ld complains:
/usr/i686-pc-linux-gnulibc2/lib/gcc-lib/i686-pc-linux-gnulibc2/3.3.3/../../../../i686-pc-linux-gnulibc2/bin/ld:
cannot find /tmp/gc/lib/libc.so.6 inside /tmp/gc.
The file /tmp/gc/lib/libc.so.6 is perfectly there.

This is what I did exactly:
-  use linux kernel source 2.6.22.5, configure and
   make INSTALL_HDR_PATH=/tmp/gc headers_install
-  configure glibc-2.6.1 with
   CFLAGS=-march=i486 ../configure --prefix=/tmp/gc \
    --disable-nls --enable-add-ons
   and install
-  configure gcc (from svn 2007-08-27) with
   configure --prefix=/tmp/gc --disable-nls --enable-shared \
     --with-sysroot=/tmp/gc --enable-languages=c i686-pc-linux-gnulibc2

The version of ld used was 2.17.50.0.18.20070731 from kernel.org.  However,
in all versions of ld between 2.17 and 2.18.50.20070828 that I looked at, the
code mentioned below is the same.

The following patch fixes the problem for us:

commit 0f7df4f0f32312588d77f3e8dc26193cf8db2d81
Author: Stephan Springl <address@hidden>
Date:   Mon Aug 27 23:43:27 2007 +0200

    ld: do not prepend ld_sysroot to absolute paths

diff --git a/ld/ldfile.c b/ld/ldfile.c
index c9414ff..800c60e 100644
--- a/ld/ldfile.c
+++ b/ld/ldfile.c
@@ -308,7 +308,7 @@ ldfile_open_file_search (const char *arch,
      directory first.  */
   if (! entry->is_archive)
     {
-      if (entry->sysrooted && IS_ABSOLUTE_PATH (entry->filename))
+      if (entry->sysrooted && !IS_ABSOLUTE_PATH (entry->filename))
        {
          char *name = concat (ld_sysroot, entry->filename,
                               (const char *) NULL);

-- 
           Summary: linker incorrectly prepends sysroot to absolute path
           Product: binutils
           Version: 2.18
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: springl-binutils at bfw-online dot de
                CC: bug-binutils at gnu dot org
 GCC build triplet: i686-pc-linux-gnulibc2
  GCC host triplet: i686-pc-linux-gnulibc2
GCC target triplet: i686-pc-linux-gnulibc2


http://sourceware.org/bugzilla/show_bug.cgi?id=4966

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




reply via email to

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