Opened 11 years ago

Closed 9 years ago

#5610 closed Bugs (fixed)

boost.thread doesn't build for mingw64 target.

Reported by: pluto@… Owned by: viboes
Milestone: To Be Determined Component: thread
Version: Boost 1.49.0 Severity: Showstopper
Keywords: Cc: phprus@…

Description

boost-1.46.1 cross-compilation for mingw64 fails with following errors:

o" "libs/thread/src/win32/thread.cpp"

In file included from ./boost/thread/win32/basic_timed_mutex.hpp:14:0,
                 from ./boost/thread/win32/mutex.hpp:8,
                 from ./boost/thread/mutex.hpp:14,
                 from ./boost/thread/detail/thread.hpp:13,
                 from ./boost/thread/thread.hpp:22,
                 from libs/thread/src/win32/thread.cpp:10:
./boost/thread/win32/interlocked_read.hpp: In function 'void* boost::detail::interlocked_read_acquire(void* volatile*)':
./boost/thread/win32/interlocked_read.hpp:63:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
./boost/thread/win32/interlocked_read.hpp: In function 'void boost::detail::interlocked_write_release(void* volatile*, void*)':
./boost/thread/win32/interlocked_read.hpp:71:13: error: cast from 'void*' to 'long int' loses precision [-fpermissive]
./boost/thread/win32/interlocked_read.hpp:71:13: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
In file included from ./boost/thread/win32/mutex.hpp:8:0,
                 from ./boost/thread/mutex.hpp:14,
                 from ./boost/thread/detail/thread.hpp:13,
                 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:39: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
In file included from ./boost/thread/win32/mutex.hpp:8:0,
                 from ./boost/thread/mutex.hpp:14,
                 from ./boost/thread/detail/thread.hpp:13,
                 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::get_event()':
./boost/thread/win32/basic_timed_mutex.hpp:183:43: error: cast from 'void*' to 'long int' loses precision [-fpermissive]
./boost/thread/win32/basic_timed_mutex.hpp:183:43: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
In file included from ./boost/thread/once.hpp:14:0,
                 from libs/thread/src/win32/thread.cpp:17:
./boost/thread/win32/once.hpp: In function 'void boost::call_once(boost::once_flag&, Function)':
./boost/thread/win32/once.hpp:136:20: error: '_InterlockedCompareExchange' is not a member of 'boost::detail'
./boost/thread/win32/once.hpp:136:20: note: suggested alternative:
/local/devel/toolchain46/x86_64-pc-mingw32.host64/lib/gcc/x86_64-pc-mingw32/4.6.1/../../../../x86_64-pc-mingw32/include/winnt.h:1385:23: note:   '_InterlockedCompareExchange'
./boost/thread/win32/once.hpp:152:25: error: '_InterlockedIncrement' is not a member of 'boost::detail'
./boost/thread/win32/once.hpp:152:25: note: suggested alternative:
/local/devel/toolchain46/x86_64-pc-mingw32.host64/lib/gcc/x86_64-pc-mingw32/4.6.1/../../../../x86_64-pc-mingw32/include/winnt.h:1336:23: note:   '_InterlockedIncrement'
./boost/thread/win32/once.hpp:155:21: error: '_InterlockedExchange' is not a member of 'boost::detail'
./boost/thread/win32/once.hpp:155:21: note: suggested alternative:
/local/devel/toolchain46/x86_64-pc-mingw32.host64/lib/gcc/x86_64-pc-mingw32/4.6.1/../../../../x86_64-pc-mingw32/include/winnt.h:1352:23: note:   '_InterlockedExchange'
./boost/thread/win32/once.hpp:169:21: error: '_InterlockedExchange' is not a member of 'boost::detail'
./boost/thread/win32/once.hpp:169:21: note: suggested alternative:
/local/devel/toolchain46/x86_64-pc-mingw32.host64/lib/gcc/x86_64-pc-mingw32/4.6.1/../../../../x86_64-pc-mingw32/include/winnt.h:1352:23: note:   '_InterlockedExchange'
./boost/thread/win32/once.hpp:184:17: error: '_InterlockedIncrement' is not a member of 'boost::detail'
./boost/thread/win32/once.hpp:184:17: note: suggested alternative:
/local/devel/toolchain46/x86_64-pc-mingw32.host64/lib/gcc/x86_64-pc-mingw32/4.6.1/../../../../x86_64-pc-mingw32/include/winnt.h:1336:23: note:   '_InterlockedIncrement'

as you can see there're invalid void* -> long casts (on win64 long == 32 bits, void* == 64 bits) and other incompatibilites in Interlocked* decls.

ps). i'm using mingw64-headers from: https://mingw-w64.svn.sourceforge.net/svnroot/mingw-w64/trunk/mingw-w64-headers

Change History (8)

comment:1 by anonymous, 11 years ago

Component: Nonethread
Owner: set to Anthony Williams

comment:2 by Vladislav <phprus@…>, 11 years ago

Cc: phprus@… added

comment:3 by anonymous, 11 years ago

seems to work in 1.47.0 release. please close as fixed.

comment:4 by viboes, 11 years ago

Milestone: To Be Determined
Resolution: fixed
Status: newclosed

Closed as suggested. Could someone add what was done to solve this issue? See also http://lists.boost.org/Archives/boost/2011/06/182834.php.

comment:5 by jmichae3@…, 9 years ago

Resolution: fixed
Status: closedreopened
Version: Boost 1.46.1Boost 1.54.0

broken again in 1.54.0, jam build system refuses to run on windows (file extension not recognised and no exe provided). also, how to build is unclear. had to guess, guess I was wrong.

comment:6 by jmichae3@…, 9 years ago

Version: Boost 1.54.0Boost 1.49.0

oops, sorry, last commend and reopen was wrong bug. this should stay closed, I misread the title. I know how folks are about wanting you to re-use existing bugs and searching existing bug reports. I misfired. setting milestone back to 1.49.0

comment:7 by viboes, 9 years ago

Milestone: To Be Determined
Owner: changed from Anthony Williams to viboes
Status: reopenednew

comment:8 by viboes, 9 years ago

Resolution: fixed
Status: newclosed

Closed as suggested.

Note: See TracTickets for help on using tickets.