Crossbuild, on linux using mingw32 for win32
What is the best way to crossbuild on linux, using mingw32, to win32? I dont see no description about such configuration on http://boost.org/more/getting_started.html mingw executable is: i586-mingw32msvc-g++
What is the best way to crossbuild on linux, using mingw32, to win32?
I dont see no description about such configuration on http://boost.org/more/getting_started.html
mingw executable is: i586-mingw32msvc-g++
If you follow the links to the description of the gcc (or mingw) toolset you'll see that the environment variable GXX can be set to the name of the executable to use, you'll need to set that in addition to the usual mingw setup options described in http://www.boost.org/tools/build/v1/mingw-tools.html John.
John Maddock wrote:
mingw executable is: i586-mingw32msvc-g++
If you follow the links to the description of the gcc (or mingw) toolset you'll see that the environment variable GXX can be set to the name of the executable to use, you'll need to set that in addition to the usual mingw setup options described in http://www.boost.org/tools/build/v1/mingw-tools.html
I executed (long lines wrapped) boost_1_33_1$ bjam -sTOOLS="mingw" -sMINGW_ROOT_DIRECTORY="/usr/i586-mingw32msvc" -sGCC="i586-mingw32msvc-gcc" -sGXX="i586-mingw32msvc-g++" and I got: Building Boost.Regex with the optional Unicode/ICU support disabled. Please refer to the Boost.Regex documentation for more information (and if you don't know what ICU is then you probably don't need it). **** wide char i/o not supported by the mingw standard library **** **** skipping build of <@boost!libs!serialization!build>libboost_wserialization.a; toolset= mingw variant= debug **** **** wide char i/o not supported by the mingw standard library **** **** skipping build of <@boost!libs!serialization!build>libboost_wserialization.a; toolset= mingw variant= debug **** **** wide char i/o not supported by the mingw standard library **** **** skipping build of <@boost!libs!serialization!build>libboost_wserialization.a; toolset= mingw variant= release **** **** wide char i/o not supported by the mingw standard library **** **** skipping build of <@boost!libs!serialization!build>libboost_wserialization.a; toolset= mingw variant= release **** **** wide char i/o not supported by the mingw standard library **** **** skipping build of <@boost!libs!serialization!build>libboost_wserialization.so; toolset= mingw variant= debug **** **** wide char i/o not supported by the mingw standard library **** **** skipping build of <@boost!libs!serialization!build>libboost_wserialization.so; toolset= mingw variant= debug **** **** wide char i/o not supported by the mingw standard library **** **** skipping build of <@boost!libs!serialization!build>libboost_wserialization.so; toolset= mingw variant= release **** **** wide char i/o not supported by the mingw standard library **** **** skipping build of <@boost!libs!serialization!build>libboost_wserialization.so; toolset= mingw variant= release **** ...found 10441 targets... ...updating 1234 targets... gcc-C++-action and then: bin/boost/libs/test/build/libboost_prg_exec_monitor.so/mingw/debug/shared-linkable-true/execution_monitor.o /home/raf256/cre.ext/boost_1_33_1/libs/test/build/../src/execution_monitor.cpp:1: warning: -fPIC ignored for target (all code is position independent) /usr/bin/objcopy: bin/boost/libs/test/build/libboost_prg_exec_monitor.so/mingw/debug/shared-linkable-true/execution_monitor.o: File format not recognized set -e "/usr/i586-mingw32msvc/bin/i586-mingw32msvc-g++" -c -Wall -ftemplate-depth-255 -DBOOST_TEST_NO_AUTO_LINK=1 -g -O0 -fno-inline -fPIC -mno-cygwin -I"bin/boost/libs/test/build" -I "/home/raf256/cre.ext/boost_1_33_1" -o "bin/boost/libs/test/build/libboost_prg_exec_monitor.so/mingw/debug/shared-linkable-true/execution_monitor.o" "/home/raf256/cre.ext/boost_1_33_1/libs/test/build/../src/execution_monitor.cpp" "/usr/bin/objcopy" --set-section-flags .debug_str=contents,debug "bin/boost/libs/test/build/libboost_prg_exec_monitor.so/mingw/debug/shared-linkable-true/execution_monitor.o" ...failed gcc-C++-action bin/boost/libs/test/build/libboost_prg_exec_monitor.so/mingw/debug/shared-linkable-true/execution_monitor.o... ...removing bin/boost/libs/test/build/libboost_prg_exec_monitor.so/mingw/debug/shared-linkable-true/execution_monitor.o gcc-C++-action bin/boost/libs/test/build/libboost_prg_exec_monitor.so/mingw/debug/shared-linkable-true/cpp_main.o /home/raf256/cre.ext/boost_1_33_1/libs/test/build/../src/cpp_main.cpp:1: warning: -fPIC ignored for target (all code is position independent) /usr/bin/objcopy: bin/boost/libs/test/build/libboost_prg_exec_monitor.so/mingw/debug/shared-linkable-true/cpp_main.o: File format not recognized set -e "/usr/i586-mingw32msvc/bin/i586-mingw32msvc-g++" -c -Wall -ftemplate-depth-255 -DBOOST_TEST_NO_AUTO_LINK=1 -g -O0 -fno-inline -fPIC -mno-cygwin -I"bin/boost/libs/test/build" -I "/home/raf256/cre.ext/boost_1_33_1" -o "bin/boost/libs/test/build/libboost_prg_exec_monitor.so/mingw/debug/shared-linkable-true/cpp_main.o" "/home/raf256/cre.ext/boost_1_33_1/libs/test/build/../src/cpp_main.cpp" "/usr/bin/objcopy" --set-section-flags .debug_str=contents,debug "bin/boost/libs/test/build/libboost_prg_exec_monitor.so/mingw/debug/shared-linkable-true/cpp_main.o" ...failed gcc-C++-action bin/boost/libs/test/build/libboost_prg_exec_monitor.so/mingw/debug/shared-linkable-true/cpp_main.o... ...removing bin/boost/libs/test/build/libboost_prg_exec_monitor.so/mingw/debug/shared-linkable-true/cpp_main.o ...skipped <@boost!libs!test!build/libboost_prg_exec_monitor.so/mingw/debug/shared-linkable-true>libboost_prg_exec_monitor-mgw-d-1_33_1.so for lack of <@boost!libs!test!build/libboost_prg_exec_monitor.so/mingw/debug/shared-linkable-true>execution_monitor.o... gcc-C++-action bin/boost/libs/test/build/libboost_prg_exec_monitor.so/mingw/debug/shared-linkable-true/threading-multi/execution_monitor.o i586-mingw32msvc-g++: unrecognized option `-pthread' /home/raf256/cre.ext/boost_1_33_1/libs/test/build/../src/execution_monitor.cpp:1: warning: -fPIC ignored for target (all code is position independent) /usr/bin/objcopy: bin/boost/libs/test/build/libboost_prg_exec_monitor.so/mingw/debug/shared-linkable-true/threading-multi/execution_monitor.o: File format not recognized set -e "/usr/i586-mingw32msvc/bin/i586-mingw32msvc-g++" -c -Wall -ftemplate-depth-255 -DBOOST_TEST_NO_AUTO_LINK=1 -g -O0 -fno-inline -pthread -fPIC -mno-cygwin -I"bin/boost/libs/test/build" -I "/home/raf256/cre.ext/boost_1_33_1" -o "bin/boost/libs/test/build/libboost_prg_exec_monitor.so/mingw/debug/shared-linkable-true/threading-multi/execution_monitor.o" "/home/raf256/cre.ext/boost_1_33_1/libs/test/build/../src/execution_monitor.cpp" "/usr/bin/objcopy" --set-section-flags .debug_str=contents,debug "bin/boost/libs/test/build/libboost_prg_exec_monitor.so/mingw/debug/shared-linkable-true/threading-multi/execution_monitor.o" ...failed gcc-C++-action bin/boost/libs/test/build/libboost_prg_exec_monitor.so/mingw/debug/shared-linkable-true/threading-multi/execution_monitor.o... ...removing bin/boost/libs/test/build/libboost_prg_exec_monitor.so/mingw/debug/shared-linkable-true/threading-multi/execution_monitor.o gcc-C++-action bin/boost/libs/test/build/libboost_prg_exec_monitor.so/mingw/debug/shared-linkable-true/threading-multi/cpp_main.o i586-mingw32msvc-g++: unrecognized option `-pthread' /home/raf256/cre.ext/boost_1_33_1/libs/test/build/../src/cpp_main.cpp:1: warning: -fPIC ignored for target (all code is position independent) /usr/bin/objcopy: bin/boost/libs/test/build/libboost_prg_exec_monitor.so/mingw/debug/shared-linkable-true/threading-multi/cpp_main.o: File format not recognized Why bjam is trying to create .so instead of .dll's? And what about the problem with -fPIC?
Rafał Maj Raf256 wrote:
I executed (long lines wrapped)
boost_1_33_1$ bjam -sTOOLS="mingw" -sMINGW_ROOT_DIRECTORY="/usr/i586-mingw32msvc" -sGCC="i586-mingw32msvc-gcc" -sGXX="i586-mingw32msvc-g++"
and I got:
Building Boost.Regex with the optional Unicode/ICU support disabled. Please refer to the Boost.Regex documentation for more information (and if you don't know what ICU is then you probably don't need it). **** wide char i/o not supported by the mingw standard library **** **** skipping build of <@boost!libs!serialization!build>libboost_wserialization.a; toolset=
When building on normal windows + mingw then it worked simmilar to this point now the error:
bin/boost/libs/test/build/libboost_prg_exec_monitor.so/mingw/debug/shared-linkable-true/execution_monitor.o /home/raf256/cre.ext/boost_1_33_1/libs/test/build/../src/execution_monitor.cpp:1: warning: -fPIC ignored for target (all code is position independent) /usr/bin/objcopy: bin/boost/libs/test/build/libboost_prg_exec_monitor.so/mingw/debug/shared-linkable-true/execution_monitor.o: File format not recognized
So perhaps the objcopy utility used is wrong? raf256@lore:~$ /usr/bin/objcopy -V GNU objcopy 2.16.91 20060118 Debian GNU/Linux Copyright 2005 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License. This program has absolutely no warranty. I dont have no objcopy in mingw, only objdump raf256@lore:~$ /usr/i586-mingw32msvc/bin/objdump -V GNU objdump 2.16.91 20050827 Copyright 2005 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License. This program has absolutely no warranty. perhaps missing objcopy is causing mingw-running-on-linux to fail? Can that be fixed in bjam, like by using other tool or telling linux objcopy how to work with crossbuilded objects? The cmd line that worked fine on win32 was: setting path to: D:\WINDOWS\system32;D:\WINDOWS;D:\WINDOWS\system32\WBEM; C:\bjam;C:\mingw;c:\mingw\bin; (in one line) or simmilar, then: C:\boost_1_33_1>bjam -sTOOLS="mingw" -sMINGW_ROOT_DIRECTORY="c:/mingw" install
participants (2)
-
John Maddock
-
Rafał Maj Raf256