[Boost-bugs] [Boost C++ Libraries] #5610: boost.thread doesn't build for mingw64 target.

Subject: [Boost-bugs] [Boost C++ Libraries] #5610: boost.thread doesn't build for mingw64 target.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-06-14 20:04:51


#5610: boost.thread doesn't build for mingw64 target.
------------------------------+---------------------------------------------
 Reporter: pluto@… | Owner:
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: None
  Version: Boost 1.46.1 | Severity: Showstopper
 Keywords: |
------------------------------+---------------------------------------------
 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]

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5610>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:06 UTC