bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/7061] New: cross ld configured with --with-sysroot doesn't searc


From: f dot knauf at mmkf dot de
Subject: [Bug ld/7061] New: cross ld configured with --with-sysroot doesn't search all relevant library directories
Date: 2 Dec 2008 05:42:40 -0000

I was building a cross-compiler from i686 linux to sparc solaris 2.8. Binutils
were configured as

../binutils-2.19/configure --target=sparc-sun-solaris2.8 \
  --with-sysroot=/usr/local/sysroots/sparc-sun-solaris2.8

Where /usr/local/sysroots/sparc-sun-solaris2.8 contains the /usr/include and
/usr/lib directories from a solaris2.8/sparc machine. 

It worked for the most part, but when I was done building gcc, I noticed that
the linker does not search /usr/local/sparc-sun-solaris2.8/lib (called $tool_lib
from now on) when linking 32 bit applications. These would thus not link unless
I passed -rpath-link=$tool_lib to the linker, complaining libgcc_s.so.1 and
libstdc++.so.6 could not be found. 64 bit applications link fine, however.

The problem lies in the builtin linker scripts. Where the
${builddir}/ld/ldscripts/elf64_sparc.x* linker scripts (and consequently
ld/eelf64_sparc.c) are generated including $tool_lib/sparcv9 (but not $tool_lib)
in the SEARCH_DIRs, the elf32_sparc.x* scripts don't have $tool_lib; their
relevant line is

SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/usr/ccs/lib"); SEARCH_DIR("=/lib");
SEARCH_DIR("=/usr/lib");

Manually patching eelf32_sparc.c, then compiling ld solves the problem.

I believe the relevant piece of code is in ${sourcedir}/ld/genscripts.sh, lines
155 to 164, where $tool_lib is added to $libs _unless_ binutils are configured
with --with-sysroot - in which case they are, however, also needed there.

-- 
           Summary: cross ld configured with --with-sysroot doesn't search
                    all relevant library directories
           Product: binutils
           Version: 2.19
            Status: NEW
          Severity: minor
          Priority: P2
         Component: ld
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: f dot knauf at mmkf dot de
                CC: bug-binutils at gnu dot org
 GCC build triplet: i686-linux-gnu
  GCC host triplet: i686-linux-gnu
GCC target triplet: sparc-sun-solaris2.8


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

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