Boost logo

Boost Users :

From: Pfligersdorffer, Christian (Christian.Pfligersdorffer_at_[hidden])
Date: 2007-08-20 04:11:31


Hello Bruce!

I cannot say if things got easier with bjam-v.2 but using v.1 I had lots
of troubles cross-compiling. Although it is possible to specify the
compiler name and include-directories directly the same is not true for
the minor tools involved in the linking process.

The solution I came up with was to create a directory containing default
named links (like g++, ld, ar, objcopy) to my ppc-binaries (ppc_6xx-g++,
ppc_6xx-ld, ppc_6xx-ar, ppc_6xx-objcopy) and include that directory into
the path before system's native binaries.

Even if this solution works I do not like it and would appreciate if
some of the experts could point out the proper way to do it. I am aware
I could write my own toolset and I was told to do so before but I find
it very hard to deal with the internals and see no real need since I am
using a gcc.

Christian Pfligersdorffer

PS: The first thing to do is examine the object files and shared
libraries using the 'file'-command. It tells you which architecture the
files are compiled for and thus you may tell what part of your tool
chain is failing.

boost-users-bounces_at_[hidden] wrote:
> I am trying to use linux-x86 platform to cross-build for
> linux-ppc. I have followed Vladimir's suggestion to specify
> my cross-compiler/archiver by updating user-config.jam with:
>
> using gcc : : /path/to/my/linux-ppc-g++ :
> <archiver>/path/to/my/linux-ppc-ar ;
>
> I have confirmed this works IF I build one of the
> [header-only] example programs. This proves that
> user-config.jam (located in my home directory) is being
> found, and the compiler/archiver are specified correctly,
> since the resulting executable runs on the correct target (ppc)
> platform.
>
> However, when attempting to apply the same user-config.jam
> file to build boost/serialization, it appears my
> cross-compiler/archiver directives are ignored, and the
> resulting libraries are in the native x86 format, since
> attempting to build a program with one of them using my
> ppc-g++ compiler produces a spew of link errors. Modifying my
> makefile to use the native g++ compiler permits a successful
> linkage with the boost/serialization library, and the
> resulting executable runs fine on the x86 platform.
>
> The command I used to build boost/serialization is:
>
> bjam --toolset=gcc --with-serialization
> --prefix=/my/prefix/path --exec-prefix=/my/exec-prefix/path/linux_ppc
> --libdir=/my/exec-prefix/path/linux_ppc/lib install
>
> I also saved the output from the build, but can't see any
> clues to explain where things went wrong. Any ideas why I
> seem to be so close, but still cannot produce boost library
> binaries for the desired target platform?
>
>
> _______________________________________________
> 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