[Boost-bugs] [Boost C++ Libraries] #13297: Coroutine-Context linker error on Cygwin, but not on Linux

Subject: [Boost-bugs] [Boost C++ Libraries] #13297: Coroutine-Context linker error on Cygwin, but not on Linux
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-11-15 10:59:19


#13297: Coroutine-Context linker error on Cygwin, but not on Linux
--------------------------+---------------------
 Reporter: lars@… | Owner: olli
     Type: Bugs | Status: new
Milestone: Boost 1.65.0 | Component: context
  Version: Boost 1.65.0 | Severity: Problem
 Keywords: |
--------------------------+---------------------
 Hi,

 I'm attempting to port a inherited project from Linux to Cygwin on
 Windows. Even though I'm using Boost 1.65.1 on both systems (both compiled
 from source), I seem to get a Linker error on Cygwin, but not on Linux.
 The only difference I can see between my two system setups is the
 compiler:

 Cygwin runs g++ 6.4.0, x86_64-pc-cygwin.
 Linux runs g++ 6.3.0, x86_64-linux-gnu.

 Both compiled the boost library with the following commands:

 {{{
 ./bootstrap.sh --prefix=compiled
 ./b2 cxxflags="-std=c++11"
 ./b2 install
 }}}

 I've reduced my project to only the troublesome code module, and scrapped
 as much as possible, you can find it attached to this ticket as well.
 Compiling is performed with:

 {{{
 g++ -std=c++11 main.cpp -I/usr/local/include/ -L/usr/local/lib/ -lm
 -lboost_context -lboost_regex -lboost_coroutine -lboost_system
 -lboost_chrono -lboost_thread
 }}}

 The two latter libraries (chrono and thread), only seem to be necessary
 for the Linux-version. The output from above command on Linux is non-
 existent, since it succeeds. The output on Cygwin however informs me of a
 linker error:

 {{{
 /tmp/ccOwuqNr.o:main.cpp:(.text$_ZN5boost11coroutines26detail14push_coroutineIvEC1IZN4TaskC4ERKSt8functionIFvvEEEUlRNS1_14pull_coroutineIvEEE_vEEOT_[_ZN5boost11coroutines26detail14push_coroutineIvEC1IZN4TaskC4ERKSt8functionIFvvEEEUlRNS1_14pull_coroutineIvEEE_vEEOT_]+0x11):
 undefined reference to `boost::context::stack_traits::default_size()'
 /tmp/ccOwuqNr.o:main.cpp:(.text$_ZN5boost11coroutines26detail14push_coroutineIvEC1IZN4TaskC4ERKSt8functionIFvvEEEUlRNS1_14pull_coroutineIvEEE_vEEOT_[_ZN5boost11coroutines26detail14push_coroutineIvEC1IZN4TaskC4ERKSt8functionIFvvEEEUlRNS1_14pull_coroutineIvEEE_vEEOT_]+0x11):
 relocation truncated to fit: R_X86_64_PC32 against undefined symbol
 `boost::context::stack_traits::default_size()'
 collect2: error: ld returned 1 exit status
 }}}

 To me it seems that the linking between coroutine and context failed at
 some point. Since the error message is not entirely obvious as to what has
 gone wrong, I'm not sure if this is a bug within Cygwin or boost. Maybe
 it's not a bug at all, and I've just missed some configuration step for
 Cygwin. Any help investigating this would be appreciated!

-- 
Ticket URL: <https://svn.boost.org/trac10/boost/ticket/13297>
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-11-15 11:05:50 UTC