bjam cross compilation using mingw32 doesn't use mingw32-ar ?

I'm trying to cross-compile boost using mingw32, doing the following steps: echo "using gcc : : mingw32-g++ ;" >> user-config.jam bjam target-os=windows threading=multi threadapi=win32 link=static runtime-link=static --prefix=../../usr-mingw --includedir=../../usr-mingw/include --libdir=../../usr-mingw/lib install this goes down fine. but when I'm trying to link to one of the boost libraries, I get the following: mingw32-g++ -m32 -g -L../../usr-mingw/lib -o tests test_plane_position.o test_position_recorder.o test_position_player.o plane_position.o position_recorder.o position_player.o tests.o -llibboost_test_exec_monitor-mgw41-mt-s-1_38 -llibboost_unit_test_framework-mgw41-mt-s-1_38 ../../usr-mingw/lib/libboost_test_exec_monitor-mgw41-mt-s-1_38.lib: could not read symbols: Archive has no index; run ranlib to add one collect2: ld returned 1 exit status make: *** [tests] Error 1 where: $ file ../../usr-mingw/lib/libboost_unit_test_framework-mgw41-mt-s-1_38.lib ../../usr-mingw/lib/libboost_unit_test_framework-mgw41-mt-s-1_38.lib: current ar archive I did some search, and one suggestion was that the build process didn't use mingw32-ar for creating the libraries? if so, how could I make bjam use mingw32-ar instead of just ar? or is something else the issue? Akos (of course I could just run ranlib on these libs, but my expectation was that the boost build / install process would produce libraries that one could link to right away)

Hi Ákos, On Sunday 22 February 2009, Ákos Maróy wrote:
I'm trying to cross-compile boost using mingw32, doing the following steps:
echo "using gcc : : mingw32-g++ ;" >> user-config.jam
I did some search, and one suggestion was that the build process didn't use mingw32-ar for creating the libraries? if so, how could I make bjam use mingw32-ar instead of just ar?
The same problem here, I use the following: using gcc : 4.2 : /usr/bin/i586-mingw32msvc-g++ : # options <rc>i586-mingw32msvc-windres <archiver>i586-mingw32msvc-ar ; You need to explicitly state <rc>, too. Else Boost.Build will simply use the "null" fallback using an empty object file. Yours, Jürgen -- * Dipl.-Math. Jürgen Hunold ! Ingenieurgesellschaft für * voice: ++49 511 262926 57 ! Verkehrs- und Eisenbahnwesen mbH * fax : ++49 511 262926 99 ! Lister Straße 15 * juergen.hunold@ivembh.de ! www.ivembh.de * * Geschäftsführer: ! Sitz des Unternehmens: Hannover * Prof. Dr.-Ing. Thomas Siefer ! Amtsgericht Hannover, HRB 56965 * PD Dr.-Ing. Alfons Radtke !

Juergen Hunold wrote:
Hi Ákos,
On Sunday 22 February 2009, Ákos Maróy wrote:
I'm trying to cross-compile boost using mingw32, doing the following steps:
echo "using gcc : : mingw32-g++ ;" >> user-config.jam
I did some search, and one suggestion was that the build process didn't use mingw32-ar for creating the libraries? if so, how could I make bjam use mingw32-ar instead of just ar?
The same problem here, I use the following:
using gcc : 4.2 : /usr/bin/i586-mingw32msvc-g++ : # options <rc>i586-mingw32msvc-windres <archiver>i586-mingw32msvc-ar ;
You need to explicitly state <rc>, too. Else Boost.Build will simply use the "null" fallback using an empty object file.
Is there a bug report about this in some tracker? - Volodya

Hi Volodya ! On Sunday 22 February 2009, Vladimir Prus wrote:
using gcc : 4.2 : /usr/bin/i586-mingw32msvc-g++
: # options
<rc>i586-mingw32msvc-windres <archiver>i586-mingw32msvc-ar ;
You need to explicitly state <rc>, too. Else Boost.Build will simply use the "null" fallback using an empty object file.
Is there a bug report about this in some tracker?
No. And I'm not sure if this is actually a bug :-)) I had a hard time tracking this one, but it the end it was a classic "read and understand the docs" issue. You just have to do some more work for cross-compilation. Anyway, I think my user-config.jam entry should be put into the Boost.Build docs. And without the path: using gcc : 4.2 : i586-mingw32msvc-g++ : # options <rc>i586-mingw32msvc-windres <archiver>i586-mingw32msvc-ar ; The key to all this might be related to my old friends "address-model" and "architecture" :-)): How to detect the target platform and which things to trigger . In my case: detect that "i586-mingw32msvc-g++" is indeed a cross compiler, forcing "target-os=windows". And detecting the rest of the toolchain with prefix "i586-mingw32msvc-" and adjusting the toolset to do the right thing. And I think that this is quite hard at the moment while using bjam's limited regex engine. And remember: There are at least two packages involved: gcc and binutils. And in theory, you can configure both to use _different_ prefixes. But I doubt anyone will actually do this. Yours, Jürgen -- * Dipl.-Math. Jürgen Hunold ! Ingenieurgesellschaft für * voice: ++49 511 262926 57 ! Verkehrs- und Eisenbahnwesen mbH * fax : ++49 511 262926 99 ! Lister Straße 15 * juergen.hunold@ivembh.de ! www.ivembh.de * * Geschäftsführer: ! Sitz des Unternehmens: Hannover * Prof. Dr.-Ing. Thomas Siefer ! Amtsgericht Hannover, HRB 56965 * PD Dr.-Ing. Alfons Radtke !
participants (3)
-
Juergen Hunold
-
Vladimir Prus
-
Ákos Maróy