Boost C++ Libraries: Ticket #1055: boost build system uses wrong `ar` for cross compilation. https://svn.boost.org/trac10/ticket/1055 <p> for cross compilation i'm using a custom user-config.jam like this: </p> <p> import toolset : using ; using gcc : 4.1 : x86_64-gnu-linux-g++ ; </p> <p> with such config the boost build system always uses hardcoded <code>ar</code> 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. </p> <p> boost uses system-wide <code>ar</code> which creates different archive than $crosstarget-ar and finally breaks linking of the custom application. </p> <p> example, libboost_filesystem for x86_64 target: </p> <p> $ pwd /local/devel/buildenv41-src/boost_1_34_0/bin.v2/libs/filesystem/build/gcc-4.1/release/inlining-on/link-static/threading-multi </p> <p> $ rm *.a $ ar rc x.a *.o &lt;- boost uses this. $ x86_64-gnu-linux-ar rc y.a *.o &lt;- i want this. $ ls -l *.a </p> <p> 103670 Jun 16 09:41 x.a 114776 Jun 16 09:41 y.a </p> <p> the library created by boost can't be used with my cross toolchain anymore: </p> <p> 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 </p> <p> while the other one works fine: </p> <p> 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 </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1055 Trac 1.4.3 anonymous Thu, 28 Jun 2007 17:04:05 GMT <link>https://svn.boost.org/trac10/ticket/1055#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1055#comment:1</guid> <description> <p> one could the "archiver" option as a workaround: </p> <p> using gcc : 3.4.5_mingw : mingw32-g++ : &lt;archiver&gt;mingw32-ar ; </p> <p> maybe somebody could provide a full MinGW example please </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Eric Niebler</dc:creator> <pubDate>Wed, 11 Jul 2007 02:04:27 GMT</pubDate> <title>owner set https://svn.boost.org/trac10/ticket/1055#comment:2 https://svn.boost.org/trac10/ticket/1055#comment:2 <ul> <li><strong>owner</strong> set to <span class="trac-author">Vladimir Prus</span> </li> </ul> Ticket Vladimir Prus Wed, 18 Jul 2007 10:08:11 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1055#comment:3 https://svn.boost.org/trac10/ticket/1055#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> This bug was fixed by Rene in CVS HEAD. It remains a mistery to me how 'ar' can be incompatible between versions -- I though it's completely dump. </p> Ticket