[Top][All Lists]

[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:
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, 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 from kernel.org.  However,
in all versions of ld between 2.17 and 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


------- 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]