[Mono-dev] libtool problem cross compiling

Casey Marshall casey.s.marshall at gmail.com
Fri Sep 19 18:08:08 EDT 2008


On Fri, Sep 19, 2008 at 8:57 AM, GrahamNewton
<graham.newton at peavey-eu.com> wrote:
>
> Hello
> I am trying to cross compile mono onto another x86 linux distribution and I
> am having a problem with libtool inserting wrong library paths.  An example
> is in mono/metadata where libtool converts the command line
>
> /bin/sh ../../libtool --tag=CC   --mode=link 586-gcc  -g -O2
> -fno-strict-aliasing -Wdeclaration-after-statement -g -Wall -Wunused
> -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes
> -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual
> -Wcast-align -Wwrite-strings -mno-tls-direct-seg-refs   -o pedump pedump.o
> libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
> ../../libgc/libmonogc.la -pthread
> -L/opt/montavista/pro/devkit/x86/586/target/usr/lib -lgthread-2.0 -lglib-2.0
> -lm -ldl -lpthread -lm
>
> to
>
> 586-gcc -g -O2 -fno-strict-aliasing -Wdeclaration-after-statement -g -Wall
> -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes
> -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual
> -Wcast-align -Wwrite-strings -mno-tls-direct-seg-refs -o pedump pedump.o
> -pthread  ./.libs/libmonoruntime.a ../io-layer/.libs/libwapi.a
> ../utils/.libs/libmonoutils.a ../../libgc/.libs/libmonogc.a
> -L/opt/montavista/pro/devkit/x86/586/target/usr/lib
> /usr/lib/libgthread-2.0.so /usr/lib/libglib-2.0.so -ldl -lpthread -lm
>
> note the /usr/lib in front of libglib2.0 and libgthread-2.0 . The problem is
> something to do with the .0 extension to the lib filenamesas the other lib
> filenames have been handled correctly.
> I am currently using libtool version 1.5.24 (1.1220.2.455 2007/06/24
> 02:13:29) on openSUSE 10.
> Does anyone know of any solutions to this problem or of a libtool version
> that they know works.
>

It's probably the libtool library files (the .la files) for your
cross-compiled gthread and glib: they were probably configured to live
in /usr, and so the .la file says that the .so is in /usr/lib, which
is wrong when you're staging the files.

This http://metastatic.org/text/libtool.html is an explanation of
issues like this, and offers some workarounds.


More information about the Mono-devel-list mailing list