Re: [Boost-bugs] [Boost C++ Libraries] #10767: Regression of #10296 when address-model=32 in mingw

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10767: Regression of #10296 when address-model=32 in mingw
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-11-17 00:15:48


#10767: Regression of #10296 when address-model=32 in mingw
---------------------------------------+------------------------
  Reporter: Brian Jack <gau_veldt@…> | Owner: ned14
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: thread
   Version: Boost 1.57.0 | Severity: Regression
Resolution: | Keywords:
---------------------------------------+------------------------

Comment (by Brian Jack <gau_veldt@…>):

 If I comment out test_main and test_thread definitions the project builds
 and runs.
 With the two uncommented the errors resulting are posted after the example
 code.

 Test:
 {{{
 #include <windows.h>
 #include <iostream>
 #include "protocol.hpp"
 #include <boost/thread.hpp>

 /*
 This part is included for reference.
 My project builds sucessfully with this part included
 via protocol.cpp/protocol.hpp if test_main and test_thread
 definitions are commented out.

 Obviously I'm paring this down to the specific problem.

 define in protocol.cpp:
 boost::mutex cout_mutex;

 defined like this protocol.hpp:
 class scoped_cout_lock {
     std::ios state;
 public:
     scoped_cout_lock() : state(NULL) {
         cout_mutex.lock();
         state.copyfmt(std::cout);
     }
     virtual ~scoped_cout_lock() {
         std::cout.flush();
         std::cout.copyfmt(state);
         cout_mutex.unlock();
     }
 };
 #define LOCK_COUT {scoped_cout_lock __scl;
 #define UNLOCK_COUT }
 */

 void test_thread() {
     LOCK_COUT
     std::cout << "Thread 2 says, \"Hello, World!\"" << std::endl;
     UNLOCK_COUT
 }

 int test_main(int argc,char **argv) {
     boost::thread test(test_thread);
     LOCK_COUT
     std::cout << "Thread 1 says, \"Hello, World!\"" << std::endl;
     UNLOCK_COUT
     test.join();
     return 0;
 }
 }}}

 Result:

 mingw32-g++.exe -LC:\Minetest-Blockiverse\Minetest-
 Blockiverse\irrlicht-1.8.1\lib\Win32-gcc -LC:\Boost\lib
 -L..\zlib125dll\dll32 -L..\OpenAL\libs\Win32 -L..\libvorbis-1.3.4\win32
 -L..\libogg-1.3.2\win32\VS2010 -o bin\blockiverse.exe
 obj\Debug\blockiverse\client.o obj\Debug\blockiverse\main.o
 obj\Debug\blockiverse\protocol.o obj\Debug\blockiverse\rsa\BigInt.o
 obj\Debug\blockiverse\rsa\Key.o obj\Debug\blockiverse\rsa\KeyPair.o
 obj\Debug\blockiverse\rsa\PrimeGenerator.o obj\Debug\blockiverse\rsa\RSA.o
 obj\Debug\blockiverse\server.o obj\Debug\blockiverse\settings.o
 obj\Debug\blockiverse\sha1.o -lwsock32 -lws2_32 -lIrrlicht -lopengl32
 -lglu32 -lgdi32 -lzlibwapi ..\OpenAL\libs\Win32\OpenAL32.lib -lvorbis
 -lvorbisfile -logg -lboost_system-mgw47-mt-d-1_57 -lboost_chrono-
 mgw47-mt-d-1_57 -lboost_date_time-mgw47-mt-d-1_57 -lboost_atomic-
 mgw47-mt-d-1_57 -lboost_random-mgw47-mt-d-1_57 -lboost_thread-
 mgw47-mt-d-1_57
 C:\Boost\lib/libboost_thread-mgw47-mt-d-1_57.a(thread.o): In function
 `ZN5boost6detail5win3223GetTickCount64emulationEv_at_0':
 C:\Minetest-Blockiverse\Minetest-
 Blockiverse\boost_1_57_0/./boost/thread/win32/thread_primitives.hpp:247:
 undefined reference to `_InterlockedCompareExchange'
 C:\Minetest-Blockiverse\Minetest-
 Blockiverse\boost_1_57_0/./boost/thread/win32/thread_primitives.hpp:255:
 undefined reference to `_InterlockedCompareExchange'
 C:\Minetest-Blockiverse\Minetest-
 Blockiverse\boost_1_57_0/./boost/thread/win32/thread_primitives.hpp:278:
 undefined reference to `_InterlockedCompareExchange'
 C:\Boost\lib/libboost_thread-mgw47-mt-d-1_57.a(thread.o): In function
 `ZN5boost6detail24interlocked_read_acquireEPVl':
 C:\Minetest-Blockiverse\Minetest-
 Blockiverse\boost_1_57_0/./boost/thread/win32/interlocked_read.hpp:56:
 undefined reference to `_InterlockedCompareExchange'
 C:\Boost\lib/libboost_thread-mgw47-mt-d-1_57.a(thread.o): In function
 `ZN5boost6detail25interlocked_write_releaseEPVll':
 C:\Minetest-Blockiverse\Minetest-
 Blockiverse\boost_1_57_0/./boost/thread/win32/interlocked_read.hpp:64:
 undefined reference to `_InterlockedExchange'
 C:\Boost\lib/libboost_thread-mgw47-mt-d-1_57.a(thread.o): In function
 `ZN5boost6detail21intrusive_ptr_releaseEPNS0_19basic_cv_list_entryE':
 C:\Minetest-Blockiverse\Minetest-
 Blockiverse\boost_1_57_0/./boost/thread/win32/condition_variable.hpp:115:
 undefined reference to `_InterlockedDecrement'
 C:\Boost\lib/libboost_thread-mgw47-mt-d-1_57.a(thread.o): In function
 `ZN5boost6detail17enter_once_regionERNS_9once_flagERNS0_12once_contextE':
 C:\Minetest-Blockiverse\Minetest-
 Blockiverse\boost_1_57_0/./boost/thread/win32/once.hpp:180: undefined
 reference to `_InterlockedCompareExchange'
 C:\Boost\lib/libboost_thread-mgw47-mt-d-1_57.a(thread.o): In function
 `ZN5boost6detail18commit_once_regionERNS_9once_flagERNS0_12once_contextE':
 C:\Minetest-Blockiverse\Minetest-
 Blockiverse\boost_1_57_0/./boost/thread/win32/once.hpp:199: undefined
 reference to `_InterlockedIncrement'
 C:\Minetest-Blockiverse\Minetest-
 Blockiverse\boost_1_57_0/./boost/thread/win32/once.hpp:202: undefined
 reference to `_InterlockedExchange'
 C:\Boost\lib/libboost_thread-mgw47-mt-d-1_57.a(thread.o): In function
 `ZN5boost6detail20rollback_once_regionERNS_9once_flagERNS0_12once_contextE':
 C:\Minetest-Blockiverse\Minetest-
 Blockiverse\boost_1_57_0/./boost/thread/win32/once.hpp:215: undefined
 reference to `_InterlockedExchange'
 C:\Boost\lib/libboost_thread-mgw47-mt-d-1_57.a(thread.o): In function
 `ZN5boost9call_onceERNS_9once_flagEPFvvE':
 C:\Minetest-Blockiverse\Minetest-
 Blockiverse\boost_1_57_0/./boost/thread/win32/once.hpp:738: undefined
 reference to `_InterlockedIncrement'
 collect2.exe: error: ld returned 1 exit status
 Process terminated with status 1 (0 minute(s), 30 second(s))
 11 error(s), 0 warning(s) (0 minute(s), 30 second(s))

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10767#comment:12>
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:17 UTC