#3393 closed Bugs (invalid)
Thread compilation skipped when cross compiled from ubuntu to windows
Reported by: | Owned by: | viboes | |
---|---|---|---|
Milestone: | Component: | thread | |
Version: | Boost 1.40.0 | Severity: | Problem |
Keywords: | cross compile thread skipp | Cc: | viboes |
Description
Hie, I did trie to cross compile boost libs with that conf (i am on ubuntu uname -a: Linux nephertari 2.6.28-15-generic #49-Ubuntu SMP Tue Aug 18 18:40:08 UTC 2009 i686 GNU/Linux, and i want to compile for a windows plateform)
########################################################
jp@nephertari:/opt/boost_1_40_0$ cat /home/jp/user-config.jam import option ; import feature ; # Compiler configuration. This definition will be used unless # you already have defined some toolsets in your user-config.jam # file. if ! gcc in [ feature.values <toolset> ] { using gcc : : i586-mingw32msvc-g++ ; } project : default-build <toolset>gcc <target-os>windows <variant>release <cxxflags>-I/usr/src/svn-checkouts/wesnoth-mingw32/win-deps/include <linkflags>-L/usr/src/svn-checkouts/wesnoth-mingw32/win-deps/lib ;
# Options specified on the command line completely # override this variable. libraries = ; # These settings are equivivalent to corresponding command-line # options. option.set prefix : /usr/src/svn-checkouts/wesnoth-mingw32/win-deps/ ; option.set layout : system ; jp@nephertari:/opt/boost_1_40_0$
########################################################
But as you can see, that part of compilation is skipped:
########################################################
jp@nephertari:/opt/boost_1_40_0$ bjam link=static runtime-link=static threading=multi install --prefix=WIN32_ --with-thread --with-signals --with-iostreams target-os=windows -sNO_BZIP2=1 -sNO_ZLIB=1 Trying to build Boost.Thread with pthread support. If you need pthread you should specify the paths. You can specify them in site-config.jam, user-config.jam or in the environment. For example: PTW32_INCLUDE=C:\Program Files\ptw32\Pre-built2\include PTW32_LIB=C:\Program Files\ptw32\Pre-built2\lib Skipping build of: libs/thread/build/boost_thread <build>no in common properties ...patience... ...found 15024 targets... ...updating 3 targets... gcc.archive bin.v2/libs/iostreams/build/gcc-mingw-4.2.1/release/link-static/runtime-link-static/target-os-windows/threading-multi/libboost_iostreams.lib common.copy WIN32_/lib/libboost_iostreams.lib ...updated 3 targets...
########################################################
on irc someone told me this: "Well, I looked at libs/thread/build/Jamfile.v2 and it checks for 'if [ os.name ] = "NT" { api = win32 ; }'. That will cause an epic fail if you are cross-compiling." and told me to use option " try adding threadapi=win32. The api detection of Boost.Thread does not honour "target-os=windows". And please file a bug report."
so that compilation has been successfull:
########################################################
jp@nephertari:/opt/boost_1_40_0$ bjam link=static runtime-link=static threading=multi install --prefix=WIN32_ --with-thread --with-signals --with-iostreams target-os=windows -sNO_BZIP2=1 -sNO_ZLIB=1 threadapi=win32 ...patience... ...found 15213 targets... ...updating 32 targets... common.mkdir bin.v2/libs/iostreams/build/gcc-mingw-4.2.1/release/link-static/runtime-link-static/target-os-windows/threadapi-win32 common.mkdir bin.v2/libs/iostreams/build/gcc-mingw-4.2.1/release/link-static/runtime-link-static/target-os-windows/threadapi-win32/threading-multi gcc.compile.c++ bin.v2/libs/iostreams/build/gcc-mingw-4.2.1/release/link-static/runtime-link-static/target-os-windows/threadapi-win32/threading-multi/file_descriptor.o gcc.compile.c++ bin.v2/libs/iostreams/build/gcc-mingw-4.2.1/release/link-static/runtime-link-static/target-os-windows/threadapi-win32/threading-multi/mapped_file.o gcc.archive bin.v2/libs/iostreams/build/gcc-mingw-4.2.1/release/link-static/runtime-link-static/target-os-windows/threadapi-win32/threading-multi/libboost_iostreams.lib common.copy WIN32_/lib/libboost_iostreams.lib common.mkdir bin.v2/libs/signals/build/gcc-mingw-4.2.1/release/link-static/runtime-link-static/target-os-windows/threadapi-win32 common.mkdir bin.v2/libs/signals/build/gcc-mingw-4.2.1/release/link-static/runtime-link-static/target-os-windows/threadapi-win32/threading-multi gcc.compile.c++ bin.v2/libs/signals/build/gcc-mingw-4.2.1/release/link-static/runtime-link-static/target-os-windows/threadapi-win32/threading-multi/trackable.o gcc.compile.c++ bin.v2/libs/signals/build/gcc-mingw-4.2.1/release/link-static/runtime-link-static/target-os-windows/threadapi-win32/threading-multi/connection.o gcc.compile.c++ bin.v2/libs/signals/build/gcc-mingw-4.2.1/release/link-static/runtime-link-static/target-os-windows/threadapi-win32/threading-multi/named_slot_map.o gcc.compile.c++ bin.v2/libs/signals/build/gcc-mingw-4.2.1/release/link-static/runtime-link-static/target-os-windows/threadapi-win32/threading-multi/signal_base.o gcc.compile.c++ bin.v2/libs/signals/build/gcc-mingw-4.2.1/release/link-static/runtime-link-static/target-os-windows/threadapi-win32/threading-multi/slot.o gcc.archive bin.v2/libs/signals/build/gcc-mingw-4.2.1/release/link-static/runtime-link-static/target-os-windows/threadapi-win32/threading-multi/libboost_signals.lib common.copy WIN32_/lib/libboost_signals.lib common.mkdir bin.v2/libs/thread/build/gcc-mingw-4.2.1 common.mkdir bin.v2/libs/thread/build/gcc-mingw-4.2.1/release common.mkdir bin.v2/libs/thread/build/gcc-mingw-4.2.1/release/link-static common.mkdir bin.v2/libs/thread/build/gcc-mingw-4.2.1/release/link-static/runtime-link-static common.mkdir bin.v2/libs/thread/build/gcc-mingw-4.2.1/release/link-static/runtime-link-static/target-os-windows common.mkdir bin.v2/libs/thread/build/gcc-mingw-4.2.1/release/link-static/runtime-link-static/target-os-windows/threadapi-win32 common.mkdir bin.v2/libs/thread/build/gcc-mingw-4.2.1/release/link-static/runtime-link-static/target-os-windows/threadapi-win32/threading-multi common.mkdir bin.v2/libs/thread/build/gcc-mingw-4.2.1/release/link-static/runtime-link-static/target-os-windows/threadapi-win32/threading-multi/win32 gcc.compile.c++ bin.v2/libs/thread/build/gcc-mingw-4.2.1/release/link-static/runtime-link-static/target-os-windows/threadapi-win32/threading-multi/win32/thread.o In file included from ./boost/thread/win32/mutex.hpp:8,
from ./boost/thread/mutex.hpp:14, from ./boost/thread/detail/thread.hpp:11, from ./boost/thread/thread.hpp:22, from libs/thread/src/win32/thread.cpp:10:
./boost/thread/win32/basic_timed_mutex.hpp: In member function ‘void boost::detail::basic_timed_mutex::destroy()’: ./boost/thread/win32/basic_timed_mutex.hpp:46: warning: dereferencing type-punned pointer will break strict-aliasing rules ./boost/thread/win32/basic_timed_mutex.hpp: In member function ‘void* boost::detail::basic_timed_mutex::get_event()’: ./boost/thread/win32/basic_timed_mutex.hpp:152: warning: dereferencing type-punned pointer will break strict-aliasing rules libs/thread/src/win32/thread.cpp: In static member function ‘static unsigned int boost::thread::hardware_concurrency()’: libs/thread/src/win32/thread.cpp:306: warning: missing braces around initializer for ‘_SYSTEM_INFO::<anonymous union>’ libs/thread/src/win32/thread.cpp: In function ‘LARGE_INTEGER boost::this_thread::<unnamed>::get_due_time(const boost::detail::timeout&)’: libs/thread/src/win32/thread.cpp:329: warning: missing braces around initializer for ‘_LARGE_INTEGER::<anonymous struct>’ libs/thread/src/win32/thread.cpp:351: warning: dereferencing type-punned pointer will break strict-aliasing rules gcc.compile.c++ bin.v2/libs/thread/build/gcc-mingw-4.2.1/release/link-static/runtime-link-static/target-os-windows/threadapi-win32/threading-multi/win32/exceptions.o gcc.compile.c++ bin.v2/libs/thread/build/gcc-mingw-4.2.1/release/link-static/runtime-link-static/target-os-windows/threadapi-win32/threading-multi/win32/tss_dll.o gcc.compile.c++ bin.v2/libs/thread/build/gcc-mingw-4.2.1/release/link-static/runtime-link-static/target-os-windows/threadapi-win32/threading-multi/win32/tss_pe.o gcc.archive bin.v2/libs/thread/build/gcc-mingw-4.2.1/release/link-static/runtime-link-static/target-os-windows/threadapi-win32/threading-multi/libboost_thread_win32.lib common.copy WIN32_/lib/libboost_thread_win32.lib ...updated 32 targets...
Attachments (1)
Change History (12)
comment:1 by , 12 years ago
Milestone: | Boost.Jam 4.0.0 → To Be Determined |
---|
comment:2 by , 12 years ago
Cc: | added |
---|
comment:3 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:4 by , 11 years ago
follow-up: 8 comment:7 by , 10 years ago
Milestone: | To Be Determined |
---|---|
Resolution: | → invalid |
Status: | assigned → closed |
If I'm not wrong the way to cross compile Boost.Thread is using threadapi feature. Please reopen it if it doesn't work with threadapi=posix.
follow-up: 9 comment:8 by , 10 years ago
Replying to viboes:
If I'm not wrong the way to cross compile Boost.Thread is using threadapi feature. Please reopen it if it doesn't work with threadapi=posix.
Maybe target-os should be used to determine a default threadapi if one is not set?
comment:9 by , 10 years ago
Replying to tvaneerd@…:
Replying to viboes:
If I'm not wrong the way to cross compile Boost.Thread is using threadapi feature. Please reopen it if it doesn't work with threadapi=posix.
Maybe target-os should be used to determine a default threadapi if one is not set?
We have tried a lot of things (See Ticket #7706), and currently we are unable to make dependent the default threadapi of target-os. Of course if someone knows how to do this a patch is welcome.
Note that currently the user is able to choose its threadapi for the same target-os.
comment:10 by , 5 years ago
Hi again, would the following work
https://github.com/boostorg/thread/pull/160/commits/2fb41edf1adea22c61d78f42f4ec6b7f6c87e025
?
comment:11 by , 5 years ago
Hi again, would the following work
https://github.com/boostorg/thread/pull/160/commits/2fb41edf1adea22c61d78f42f4ec6b7f6c87e025
?
Do someone know how to make threadapi dependent on target-os and not on os?
I have tried
But this doesn't works.