Boost logo

Boost :

Subject: [boost] [context] build and warning fixes for gcc on Windows
From: (lukester_null_at_[hidden])
Date: 2012-06-07 16:19:52


Posting here as there's no context component in trac yet.

This specifically relates to boost.context and cygwin's
mingw64-x64_64_gcc toolchain with ml and ml64 from Visual Studio 2010.

The patch attached is against trunk (rev 78752) for the following warnings:

* ..\..\../boost/context/detail/fcontext_x86_64_win.hpp:20:0: warning:
ignoring #pragma warning

* ..\src\seh.cpp:36:87: warning: format %08lX expects type long unsigned
int, but argument 5 has type ULONG_PTR (I'm guessing %p used in the
patch is probably not the best solution for cross-platformness)

* ..\src\seh.cpp:39:53: warning: deprecated conversion from string
constant to char*

The last issue I've had is with jump_fcontext and make_fcontext exports:

Warning: .drectve `/EXPORT:jump_fcontext /EXPORT:make_fcontext 3'

Which seems to cause:

collect2: ld terminated with signal 6 [Aborted], core dumped

Removing the EXPORT directive in the asm file results in a successful
build, but naturally the symbols aren't exported.

I hacked around this by changing the asm functions to jump_fcontext_impl
and make_fcontext_impl, and provided an extern C jump_fcontext and
make_fcontext in fcontext.cpp that forward to them. I'm sure there are
far nicer ways to force the symbols to be exported so I've not attached
the patch for this.

With these changes, I can more-or-less successfully use context which is
great! (A slight issue with exceptions; possibly crossing dll boundaries
and/or due to this gcc's exception implementation using setjmp/longjmp.)

Finally, is there any technical reason why gas assembly couldn't be
provided for use with gcc on Windows? Having to have masm available
seems a shame, aside from the issues above. I had a very quick go at it
without success but could possibly have another attempt ...

Thanks for the library and regards,

Luke Elliott.

Boost list run by bdawes at, gregod at, cpdaniel at, john at