On Sep 13, 2006, at 11:34 PM, Bob Friesenhahn wrote:
On Wed, 13 Sep 2006, Kate Minola wrote:
On my x86_64-unknown-linux-gnu system, the m4 macro
AC_LIBTOOL_SYS_DYNAMIC_LINKER in libtool.m4
uses "gcc -print-search-dirs" to set sys_lib_search_path_spec.
Unfortunately, -print-search-dirs lists -m32 library directories,
but gcc is in (default) -m64 mode on my system. Consequently
libtool
tries to link with the wrong library (32 bit when it should be
using 64 bit).
The particular error message I get is
I think that this is really a GCC bug. I have the same problem
under Solaris. Libtool should work around the GCC bug by
detecting 64-bit compilation and expanding the search path to look
in the 64-bit library directories first.
Hi Bob,
As far as I'm aware there is not going to be a fix for this in gcc,
so yes, we need to fix it.
Perhaps something like:
echo "int main(){return 0;}" > conftest.c
search_path=`$CC $CFLAGS -c conftest.c 2>&1 | awk 'BEGIN {RS=" "} /^
[\"]?-L/ {sub ("-L","");print $0};'`
rm -f conftest.c conftest.o