[Boost-bugs] [Boost C++ Libraries] #1055: boost build system uses wrong `ar` for cross compilation.

Subject: [Boost-bugs] [Boost C++ Libraries] #1055: boost build system uses wrong `ar` for cross compilation.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2007-06-16 07:48:37


#1055: boost build system uses wrong `ar` for cross compilation.
---------------------------------+------------------------------------------
 Reporter: pluto_at_[hidden] | Type: Bugs
   Status: new | Milestone: To Be Determined
Component: Building Boost | Version:
 Severity: Showstopper | Keywords:
---------------------------------+------------------------------------------
 for cross compilation i'm using a custom user-config.jam like this:

 import toolset : using ;
 using gcc : 4.1 : x86_64-gnu-linux-g++ ;

 with such config the boost build system always uses hardcoded `ar`
 for creating archives which can create wrong archive in some cases.
 i have a RHEL4(i686) builder with old preinstalled toolchain:
 gcc-3.4.5-2, binutils-2.15.92.0.2-18. on this machine i'm building
 boost for i486, x86_64, sparc and sparc64 with custom toolchain
 based on gcc-4.1.x and binutils-2.17.50.0.12.

 boost uses system-wide `ar` which creates different archive than
 $crosstarget-ar and finally breaks linking of the custom application.

 example, libboost_filesystem for x86_64 target:

 $ pwd
 /local/devel/buildenv41-
 src/boost_1_34_0/bin.v2/libs/filesystem/build/gcc-4.1/release/inlining-on/
 link-static/threading-multi

 $ rm *.a
 $ ar rc x.a *.o <- boost uses this.
 $ x86_64-gnu-linux-ar rc y.a *.o <- i want this.
 $ ls -l *.a

 103670 Jun 16 09:41 x.a
 114776 Jun 16 09:41 y.a

 the library created by boost can't be used with my cross toolchain
 anymore:

 x86_64-gnu-linux-g++ x.a
 x.a: could not read symbols: Archive has no index; run ranlib to add one
 collect2: ld returned 1 exit status

 while the other one works fine:

 x86_64-gnu-linux-g++ y.a
 /local/devel/toolchain41/x86_64-gnu-linux/usr/lib/../lib64/crt1.o: In
 function `_start':
 (.text+0x20): undefined reference to `main'
 collect2: ld returned 1 exit status

--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1055>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.


This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:55 UTC