[Top][All Lists]

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

Use of compiler_lib_search_path when cross-compiling

From: Marc Singer
Subject: Use of compiler_lib_search_path when cross-compiling
Date: Tue, 6 Sep 2005 16:22:03 -0700
User-agent: Mutt/1.5.6+20040907i

I'm still tracking a problem where libtool adds native libraries to
the link when cross-compiling.  I've upgraded to 1.5.20, just to make
sure that this hasn't yet been fixed.  Here's what I've found.

There appear to be two factors at play.  First is the postdeps:

  # Dependencies to place after the objects being linked to create a
  # shared library.
  postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"

This is where the explicit inclusion of libstdc++ is entering into the
link.  The second,

  # The library search path used internally by the compiler when linking
  # a shared library.

is where the path to native libraries is being referenced such that
libtool can search them.

Then, comes this:

 if test "$linkmode" = lib; then
    libs="$predeps $libs $compiler_lib_search_path $postdeps"

which explicitly adds $postdeps and $compiler_lib_search_path to the
link.  The result is that /usr/lib/ is added to the
library dependency list of an .la file.  Later, when an application
links with this library, the link fails because the wrong architecture
is being used.

So, the question is this.  Do I need to build a special version of
libtool for cross compiling which is separate from the version used to
build native packages?

reply via email to

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