[Top][All Lists]

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

Re: Libtool attempts to link 64-bit lib on a -m32 compile (using Pathsca

From: Coleman Kane
Subject: Re: Libtool attempts to link 64-bit lib on a -m32 compile (using Pathscale C++)
Date: Thu, 12 Mar 2009 14:22:31 -0400

Something (probably in is picking up your lib64 path and
adding it to your LIBS or LDFLAGS. This is typically done by (broken?)
autoconf m4 macros that get included (such as older sdl.m4 versions) or
from using the wrong PKG_CONFIG_PATH in your environment.

I'd suggest making sure that PKG_CONFIG_PATH points to pkgconfig
directories that are for the 32-bit versions of your packages.

You should scan config.log and the generated Makefile's in your project
to see where it is getting these paths from.

Libtool doesn't perform much low-level investigation of the library file
types, nor does it rewrite paths to accommodate the 20-million different
ways that vendors install 32/64-bit libraries on the same system. 

Additionally, there may be legitimate cases where you actually want to
link 32 and 64-bit objects together. You just don't want to do this in
your example case here.

I am not an expert on pathCC, however the -m32 option (or -m64) is
supposed to modify the default search paths that are used to #include
and to link libraries and executables, in addition to generating 32-bit
(or 64-bit) code. If you (the developer) add more -L or -I paths to your
command line that have 64-bit (or 32-bit) code that is not compatible,
then GCC typically considers this to be "your fault" and doesn't make an
attempt to recognize "user errors" such as this.

It isn't a bug in libtool (because we want libtool to "act" like the
compiler/linker to a great extent), but I think it warrants further
documentation because this problem comes up a lot for me (FreeBSD/amd64)
when I am not paying enough attention to my environment.

Specifically, you are linking in "/usr/lib64/" by absolute
file name, which is considered to be in the categories of "user error".
You need to find out what package is adding that 64-bit static library
to your LDFLAGS, LIBS, or similar linker flags.

On Thu, 2009-03-12 at 11:25 -0500, Ethan Mallove wrote:
> Hello,
> Libtool is trying to link in 64-bit libs on a -m32 compile with the
> Pathscale C++ compiler. E.g., 
>   /bin/sh ../../../libtool --tag=CXX   --mode=link pathCC  -O3 -DNDEBUG -Wall 
> -m32 -Wundef -Wno-long-long -finline-functions -fexceptions -pthread  
> -export-dynamic  -fexceptions  -o -rpath 
> /opt/SUNWhpc/HPC8.2/pathscale/lib mpicxx.lo intercepts.lo comm.lo datatype.lo 
> win.lo file.lo ../../../ompi/ -lnsl -lutil  -lm                 
> libtool: link: pathCC -shared -nostdlib   .libs/mpicxx.o .libs/intercepts.o 
> .libs/comm.o .libs/datatype.o .libs/win.o .libs/file.o   -Wl,-rpath 
> -Wl,/home/emallove/v1.3/ompi/.libs -Wl,-rpath 
> -Wl,/home/emallove/v1.3/orte/.libs -Wl,-rpath 
> -Wl,/home/emallove/v1.3/opal/.libs -Wl,-rpath 
> -Wl,/opt/SUNWhpc/HPC8.2/pathscale/lib -L/home/emallove/v1.3/orte/.libs 
> -L/home/emallove/v1.3/opal/.libs ../../../ompi/.libs/ 
> /home/emallove/v1.3/orte/.libs/ 
> /home/emallove/v1.3/opal/.libs/ -ldl -lnsl -lutil 
> -L/ws/ompi-tools/pathscale/3.2/lib/3.2/32 
> -L/usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3/32 
> -L/usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3 
> -L/usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3/../../../../x86_64-suse-linux/lib/../lib
> -L/usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3/../../../../x86_64-suse-linux/lib
>  -L/usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3/../../../../lib 
> -L/usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3/../../.. -L/lib/../lib 
> -L/usr/lib/../lib -lpthread -lpscrt -lmv -lmpath /usr/lib64/ 
> -lgcc_s -lm -lc -lgcc_s_32 
> /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3/../../../../lib/crti.o 
> /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3/32/crtbeginS.o 
> /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3/32/crtendS.o 
> /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3/../../../../lib/crtn.o  -m32 
> -pthread   -pthread -Wl,-soname -Wl, -o 
> .libs/
>   /usr/lib64/ could not read symbols: Invalid operation
>   collect2: ld returned 1 exit status
>   make: *** [] Error 1
>   $ pathCC --version
>   PathScale(TM) Compiler Suite: Version 3.2
>   Built on: 2008-06-16 16:45:36 -0700
>   Thread model: posix
>   GNU gcc version 3.3.1 (PathScale 3.2 driver)
>   $ uname -a
>   Linux burl-ct-v20z-13 2.6.5-7.308-smp #1 SMP Mon Dec 10 11:36:40 UTC 2007 
> x86_64 x86_64 x86_64 GNU/Linux
>   $ cat /etc/SuSE-release
>   SUSE LINUX Enterprise Server 9 (x86_64)
>   VERSION = 9
> Is this a bug?
> -Ethan

Coleman Kane

reply via email to

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