[coroutine] errors compiling with clang 3.2
Hi boost-users, As reported by Eugene Yakubovich[1], I am seeing problems compiling boost coroutine with clang 3.1 on debian testing. I got my sources from git://gitorious.org/boost-dev/boost-dev.git at commit c083660c54b88ca1ce9a940f4a71bc6c3ab89003. The error I get is: /boost/coroutine/detail/coroutine_object.hpp:54:46: error: expected expression Context * ctx( hldr->data.get().get< 0 >() ); ^ The same code compiles and runs fine with gcc 4.7. In both cases I'm using C++11. I just want to double-check that this is some kind of problem with clang - since 3.2 is on the wings I was wondering if this would be resolved by the upgrade. If anyone has managed to get it working with 3.1 I'd appreciate some pointers. Many thanks for your time, Marco -- So young, and already so unknown -- Pauli blog: http://mcraveiro.blogspot.com [1] http://boost.2283326.n4.nabble.com/Review-Coroutine-reviewstarts-today-Septe...
compiles with clang 3.2 ( new commit) - but fails in unwind_stack()
Am 13.11.2012 15:44 schrieb "Marco Craveiro"
Hi boost-users,
As reported by Eugene Yakubovich[1], I am seeing problems compiling boost coroutine with clang 3.1 on debian testing. I got my sources from git://gitorious.org/boost-dev/boost-dev.git at commit c083660c54b88ca1ce9a940f4a71bc6c3ab89003. The error I get is:
/boost/coroutine/detail/coroutine_object.hpp:54:46: error: expected expression Context * ctx( hldr->data.get().get< 0 >() ); ^ The same code compiles and runs fine with gcc 4.7. In both cases I'm using C++11. I just want to double-check that this is some kind of problem with clang - since 3.2 is on the wings I was wondering if this would be resolved by the upgrade.
If anyone has managed to get it working with 3.1 I'd appreciate some pointers.
Many thanks for your time,
Marco -- So young, and already so unknown -- Pauli
blog: http://mcraveiro.blogspot.com
[1] http://boost.2283326.n4.nabble.com/Review-Coroutine-reviewstarts-today-Septe... _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
compiles with clang 3.2 ( new commit) - but fails in unwind_stack()
ah excellent, thanks Oliver. I won't worry about our build for now then, and start tracking your branch more closely for fixes. While we're at it, we're also investigating a break on MinGW/gcc 4.7 on windows: CMakeFiles/daemon.dir/objects.a(main.cpp.obj):main.cpp:(.text+0x6da): undefined reference to `_make_fcontext' CMakeFiles/daemon.dir/objects.a(main.cpp.obj):main.cpp:(.text+0x7d0): undefined reference to `_jump_fcontext' ... do you happen to have any pointers for this one? Many thanks for your time, and for the prompt response. Marco -- So young, and already so unknown -- Pauli blog: http://mcraveiro.blogspot.com
Am 13.11.2012 16:39, schrieb Marco Craveiro:
compiles with clang 3.2 ( new commit) - but fails in unwind_stack() ah excellent, thanks Oliver. I won't worry about our build for now
then, and start tracking your branch more closely for fixes. While we're at it, we're also investigating a break on MinGW/gcc 4.7 on windows: CMakeFiles/daemon.dir/objects.a(main.cpp.obj):main.cpp:(.text+0x6da): undefined reference to `_make_fcontext' CMakeFiles/daemon.dir/objects.a(main.cpp.obj):main.cpp:(.text+0x7d0): undefined reference to `_jump_fcontext' ...
win64? on win7 32bit all unit-tests are OK.
CMakeFiles/daemon.dir/objects.a(main.cpp.obj):main.cpp:(.text+0x6da): undefined reference to `_make_fcontext' CMakeFiles/daemon.dir/objects.a(main.cpp.obj):main.cpp:(.text+0x7d0): undefined reference to `_jump_fcontext' ...
win64? on win7 32bit all unit-tests are OK.
It is XP 32-bit actually. I'm linking against context (libboost_context-mgw47-mt-1_52.dll to be precise). What could cause these undefined references do you think? I must be missing something at the linker level, perhaps a windows library? Cheers Marco -- So young, and already so unknown -- Pauli blog: http://mcraveiro.blogspot.com
Am 13.11.2012 23:19, schrieb Marco Craveiro:
CMakeFiles/daemon.dir/objects.a(main.cpp.obj):main.cpp:(.text+0x6da): undefined reference to `_make_fcontext' CMakeFiles/daemon.dir/objects.a(main.cpp.obj):main.cpp:(.text+0x7d0): undefined reference to `_jump_fcontext' ...
win64? on win7 32bit all unit-tests are OK. It is XP 32-bit actually. I'm linking against context (libboost_context-mgw47-mt-1_52.dll to be precise). What could cause
these undefined references do you think? I must be missing something at the linker level, perhaps a windows library?
on Win7 I change in libs/context/example Jamfile.v2: <link>static in <link>shared bjam toolset=msvc-10.0 link=shared was successful bjam toolset=gcc link=shared failed with the same error message : undefined reference to `_imp_make_fcontext` some lines above the output contains: crreating library file: ...\gcc-mingw-4.6.2\debug\libboost_context-mgw46-d-1_50.dll.a Warning: .drectve /EXPORT:_make_fcontext unrecognized EXPORT is a directive on MASM which is used to compile the assembler file - but the linker used by mingw does not know EXPORT - so it seams to me a mingw issue Oliver
Am 13.11.2012 16:39, schrieb Marco Craveiro:
compiles with clang 3.2 ( new commit) - but fails in unwind_stack() ah excellent, thanks Oliver. I won't worry about our build for now
then, and start tracking your branch more closely for fixes.
I've added a simple example demonstrating stack unwinding. It is interessting that stack unwinding works for this example (and all others because stack unwinding is the default in boost.coroutine) using clang 3.2. The unit test in directory test is aborted because an assertion is violated, e.g. postconditon (flag stack unwounded) in coroutine_object<>::unwind_stack_() failed. In a gdb session I fgured out that 1.) jump_fcontext() is not invoked inside unwind_stack_() 2.) I see two stack_frames of ~coroutine_object() even if the destruct has a simple body I think this is a strange issue of clang. so long, Oliver
participants (2)
-
Marco Craveiro
-
Oliver Kowalke