|
Boost Users : |
Subject: Re: [Boost-users] bjam cross compile linking with wrong libs
From: Dane Springmeyer (blake_at_[hidden])
Date: 2010-07-11 04:01:52
Mark,
I don't know the answer, but I'm keen to know the right approach as well (basically to preference user-installed libraries in /usr/local/lib over system libraries in /usr/lib). I have repeated run into the problem of /usr/lib coming first in the linker line.
What I see is where boost_regex will compile against /usr/local/include ICU headers, but link to /usr/lib. My only solution has been to patch the boost_regex jamfile by moving /usr/local/lib in front of /usr/lib.
Dane
On Jul 9, 2010, at 10:48 AM, Mark Freeman wrote:
> Hi,
>
> I'm trying to cross compile a simple program using libtorrent but falling foul of some settings in the boost build system. I am totally green at using boost so please excuse me if the answer is obvious.
>
> The problem is that the link line emitted by the boost build system appears to include a hard coded reference to a NATIVE lib (/usr/lib/libdl.so) and not the one for the TARGET build system. Below is the output from the bjam command:
>
>
>
> BOOST_ROOT = /projects/externals/libtorrent/boost_1_43_0
> OS = LINUX
> gcc.link bin/gcc-arm/debug/boost-source/link-static/threading-multi/enum_if
>
> "${CROSS_COMPILE}gcc" -Wl,-R -Wl,"/usr/lib" -o "bin/gcc-arm/debug/boost-source/link-static/threading-multi/enum_if" -Wl,--start-group "bin/gcc-arm/debug/boost-source/link-static/threading-multi/enum_if.o" "../bin/gcc-arm/debug/boost-source/link-static/threading-multi/libtorrent.a" "/projects/externals/libtorrent/boost_1_43_0/bin.v2/libs/thread/build/gcc-arm/debug/boost-source/link-static/threading-multi/libboost_thread.a" "/projects/externals/libtorrent/boost_1_43_0/bin.v2/libs/filesystem/build/gcc-arm/debug/boost-source/link-static/threading-multi/libboost_filesystem.a" "/projects/externals/libtorrent/boost_1_43_0/bin.v2/libs/system/build/gcc-arm/debug/boost-source/link-static/threading-multi/libboost_system.a" "/usr/lib/libdl.so" -Wl,-Bstatic -lssl -lcrypto -Wl,-Bdynamic -lrt -Wl,--end-group -g -pthread -export-dynamic
>
>
> /usr/lib/libdl.so: could not read symbols: File in wrong format
> collect2: ld returned 1 exit status
> ...failed updating 1 target...
>
>
>
> (CROSS_COMPILE has been set to the prefix for the toolset)
>
> I did add a <linkflags> entry to the GCC entry in usr-config.jam and sure enough this did appear in the emitted link line however /usr/lib was still there too and seemed to take precedence. Does anyone know what I have to do to remove this?
>
> Cheers,
>
> Mark.
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net