diff options
author | xantares | 2015-09-23 19:52:20 +0200 |
---|---|---|
committer | xantares | 2015-09-23 19:52:20 +0200 |
commit | 24b623dfe4780768bcb7361f2c1e0a834acdfc35 (patch) | |
tree | ab7c3647d3aa11d0bf62e1e61f92ec37e380dde5 | |
parent | 61f5a35816cccb726773c9b567ba7e8342f0ccb8 (diff) | |
download | aur-24b623dfe4780768bcb7361f2c1e0a834acdfc35.tar.gz |
re-enable context & serialization
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | PKGBUILD | 18 | ||||
-rw-r--r-- | boost-mingw-1.59.0-serialization.patch | 133 | ||||
-rw-r--r-- | boost-mingw.patch | 673 |
4 files changed, 218 insertions, 612 deletions
@@ -1,7 +1,7 @@ pkgbase = mingw-w64-boost pkgdesc = Free peer-reviewed portable C++ source libraries (mingw-w64) pkgver = 1.59.0 - pkgrel = 1 + pkgrel = 2 url = http://www.boost.org/ arch = any license = custom @@ -17,8 +17,10 @@ pkgbase = mingw-w64-boost options = staticlibs source = http://downloads.sourceforge.net/boost/boost/1.59.0/boost_1_59_0.tar.bz2 source = boost-mingw.patch + source = boost-mingw-1.59.0-serialization.patch md5sums = 6aa9a5c6a4ca1016edd0ed1178e3cb87 - md5sums = 01f5f0d6b915d3b04dbabfd6db40f1e9 + md5sums = 349127a0f1bcddfc189c56219bf39853 + md5sums = db4ed93452debd15b2cd165c438f9911 pkgname = mingw-w64-boost @@ -3,7 +3,7 @@ pkgname=mingw-w64-boost pkgver=1.59.0 _boostver=${pkgver//./_} -pkgrel=1 +pkgrel=2 pkgdesc="Free peer-reviewed portable C++ source libraries (mingw-w64)" arch=('any') url="http://www.boost.org/" @@ -11,10 +11,12 @@ license=('custom') depends=('mingw-w64-crt' 'mingw-w64-zlib' 'mingw-w64-bzip2') makedepends=('mingw-w64-gcc' 'bzip2' 'zlib' 'python2') options=(!strip !buildflags staticlibs) -source=("http://downloads.sourceforge.net/boost/boost/${pkgver}/boost_${_boostver}.tar.bz2" boost-mingw.patch) +source=("http://downloads.sourceforge.net/boost/boost/${pkgver}/boost_${_boostver}.tar.bz2" + boost-mingw.patch + boost-mingw-1.59.0-serialization.patch) md5sums=('6aa9a5c6a4ca1016edd0ed1178e3cb87' - '01f5f0d6b915d3b04dbabfd6db40f1e9') - + '349127a0f1bcddfc189c56219bf39853' + 'db4ed93452debd15b2cd165c438f9911') _architectures="32:i686-w64-mingw32 64:x86_64-w64-mingw32" @@ -24,9 +26,9 @@ prepare() { # https://svn.boost.org/trac/boost/ticket/7262 patch -Np0 -i "${srcdir}"/boost-mingw.patch - # disabled context, coroutine: https://github.com/boostorg/context/issues/16 - - # disabled serialization: http://lists.boost.org/Archives/boost/2015/07/224242.php + # see issue: https://github.com/boostorg/serialization/pull/19 + # patch from http://pkgs.fedoraproject.org/cgit/mingw-boost.git/tree/ + patch -p1 -i "${srcdir}"/boost-mingw-1.59.0-serialization.patch cd "${srcdir}" for _arch in ${_architectures}; do @@ -61,8 +63,6 @@ package() { --user-config=user-config.jam \ --without-python \ --without-mpi --without-graph_parallel \ - --without-context --without-coroutine --without-coroutine2 \ - --without-serialization \ cxxflags="-std=c++11 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4" \ address-model=${_arch:0:2} \ architecture=x86 \ diff --git a/boost-mingw-1.59.0-serialization.patch b/boost-mingw-1.59.0-serialization.patch new file mode 100644 index 000000000000..a564d060945f --- /dev/null +++ b/boost-mingw-1.59.0-serialization.patch @@ -0,0 +1,133 @@ +diff --git a/include/boost/archive/archive_exception.hpp b/include/boost/archive/archive_exception.hpp +index 1159d27..fabcdb5 100644 +--- a/boost/archive/archive_exception.hpp ++++ b/boost/archive/archive_exception.hpp +@@ -87,6 +87,7 @@ class BOOST_SYMBOL_VISIBLE archive_exception : + const char * e1 = NULL, + const char * e2 = NULL + ) BOOST_NOEXCEPT; ++ BOOST_ARCHIVE_DECL archive_exception(archive_exception const &) BOOST_NOEXCEPT ; + virtual BOOST_ARCHIVE_DECL ~archive_exception() BOOST_NOEXCEPT_OR_NOTHROW ; + virtual BOOST_ARCHIVE_DECL const char * what() const BOOST_NOEXCEPT_OR_NOTHROW ; + }; +diff --git a/boost/archive/detail/basic_oarchive.hpp b/boost/archive/detail/basic_oarchive.hpp +index 702c560..03ad17b 100644 +--- a/boost/archive/detail/basic_oarchive.hpp ++++ b/boost/archive/detail/basic_oarchive.hpp +@@ -61,9 +61,7 @@ class BOOST_SYMBOL_VISIBLE basic_oarchive : + protected: + BOOST_ARCHIVE_DECL basic_oarchive(unsigned int flags = 0); + BOOST_ARCHIVE_DECL boost::archive::detail::helper_collection & +- get_helper_collection(){ +- return *this; +- } ++ get_helper_collection(); + // account for bogus gcc warning + #if defined(__GNUC__) + virtual +diff --git a/boost/archive/polymorphic_iarchive.hpp b/boost/archive/polymorphic_iarchive.hpp +index 7f19410..b465bb1 100644 +--- a/boost/archive/polymorphic_iarchive.hpp ++++ b/boost/archive/polymorphic_iarchive.hpp +@@ -44,7 +44,7 @@ namespace serialization { + namespace archive { + namespace detail { + class BOOST_ARCHIVE_DECL basic_iarchive; +- class BOOST_ARCHIVE_DECL basic_iarchive; ++ class BOOST_ARCHIVE_DECL basic_iserializer; + } + + class polymorphic_iarchive; +diff --git a/boost/archive/xml_archive_exception.hpp b/boost/archive/xml_archive_exception.hpp +index b07f9a0..82c53ef 100644 +--- a/boost/archive/xml_archive_exception.hpp ++++ b/boost/archive/xml_archive_exception.hpp +@@ -45,6 +45,8 @@ class BOOST_SYMBOL_VISIBLE xml_archive_exception : + const char * e1 = NULL, + const char * e2 = NULL + ); ++ BOOST_ARCHIVE_DECL xml_archive_exception(xml_archive_exception const &) ; ++ virtual BOOST_ARCHIVE_DECL ~xml_archive_exception() BOOST_NOEXCEPT_OR_NOTHROW ; + }; + + }// namespace archive +diff --git a/libs/serialization/src/archive_exception.cpp b/libs/serialization/src/archive_exception.cpp +index b850f89..5ff4b5f 100644 +--- a/libs/serialization/src/archive_exception.cpp ++++ b/libs/serialization/src/archive_exception.cpp +@@ -14,6 +14,7 @@ + + #include <exception> + #include <string> ++#include <cstring> + + #define BOOST_ARCHIVE_SOURCE + #include <boost/archive/archive_exception.hpp> +@@ -21,6 +22,7 @@ + namespace boost { + namespace archive { + ++BOOST_ARCHIVE_DECL + unsigned int + archive_exception::append(unsigned int l, const char * a){ + while(l < (sizeof(m_buffer) - 1)){ +@@ -109,13 +111,23 @@ archive_exception::archive_exception( + break; + } + } ++ ++BOOST_ARCHIVE_DECL ++archive_exception::archive_exception(archive_exception const & oth) BOOST_NOEXCEPT : ++ std::exception(oth), ++ code(oth.code) ++{ ++ std::memcpy(m_buffer,oth.m_buffer,sizeof m_buffer); ++} ++ + BOOST_ARCHIVE_DECL + archive_exception::~archive_exception() BOOST_NOEXCEPT_OR_NOTHROW {} + + BOOST_ARCHIVE_DECL const char * +-archive_exception::what( ) const BOOST_NOEXCEPT_OR_NOTHROW { ++archive_exception::what() const BOOST_NOEXCEPT_OR_NOTHROW { + return m_buffer; + } ++ + BOOST_ARCHIVE_DECL + archive_exception::archive_exception() BOOST_NOEXCEPT : + code(no_exception) +diff --git a/libs/serialization/src/basic_oarchive.cpp b/libs/serialization/src/basic_oarchive.cpp +index c99baeb..18522af 100644 +--- a/libs/serialization/src/basic_oarchive.cpp ++++ b/libs/serialization/src/basic_oarchive.cpp +@@ -454,6 +454,11 @@ BOOST_ARCHIVE_DECL void + basic_oarchive::end_preamble(){ + } + ++BOOST_ARCHIVE_DECL helper_collection & ++basic_oarchive::get_helper_collection(){ ++ return *this; ++} ++ + } // namespace detail + } // namespace archive + } // namespace boost +diff --git a/libs/serialization/src/xml_archive_exception.cpp b/libs/serialization/src/xml_archive_exception.cpp +index c1431e2..f4bf896 100644 +--- a/libs/serialization/src/xml_archive_exception.cpp ++++ b/libs/serialization/src/xml_archive_exception.cpp +@@ -51,6 +51,14 @@ xml_archive_exception::xml_archive_exception( + break; + } + } ++ ++BOOST_ARCHIVE_DECL ++xml_archive_exception::xml_archive_exception(xml_archive_exception const & oth) : ++ archive_exception(oth) ++ { ++ } ++ ++BOOST_ARCHIVE_DECL xml_archive_exception::~xml_archive_exception() BOOST_NOEXCEPT_OR_NOTHROW {} + + } // archive + } // boost diff --git a/boost-mingw.patch b/boost-mingw.patch index 98df9ac438da..4b45819bcf71 100644 --- a/boost-mingw.patch +++ b/boost-mingw.patch @@ -1,607 +1,78 @@ +--- libs/thread/build/Jamfile.v2.mingw 2012-12-04 15:05:00.027057650 +0100 ++++ libs/thread/build/Jamfile.v2 2012-12-04 15:05:22.488292220 +0100 +@@ -101,7 +101,8 @@ + local rule default_threadapi ( ) + { + local api = pthread ; +- if [ os.name ] = "NT" { api = win32 ; } ++ #if [ os.name ] = "NT" { api = win32 ; } ++ api = win32 ; + return $(api) ; + } + --- libs/context/build/Jamfile.v2.orig 2013-03-03 13:39:59.684868916 +0100 +++ libs/context/build/Jamfile.v2 2013-03-03 15:09:09.893232829 +0100 -@@ -282,6 +284,17 @@ - ; +@@ -27,9 +27,10 @@ + local rule default_binary_format ( ) + { + local tmp = elf ; +- if [ os.name ] = "MACOSX" { tmp = mach-o ; } +- if [ os.name ] = "NT" { tmp = pe ; } +- if [ os.name ] = "AIX" { tmp = xcoff ; } ++# if [ os.name ] = "MACOSX" { tmp = mach-o ; } ++# if [ os.name ] = "NT" { tmp = pe ; } ++# if [ os.name ] = "AIX" { tmp = xcoff ; } ++ tmp = pe ; + return $(tmp) ; + } - alias asm_context_sources -+ : asm/make_i386_ms_pe_gas.S -+ asm/jump_i386_ms_pe_gas.S -+ dummy.cpp -+ : <address-model>32 -+ <architecture>x86 -+ <binary-format>pe -+ <target-os>windows -+ <toolset>gcc -+ ; -+ -+alias asm_context_sources - : asm/make_i386_ms_pe_masm.asm - asm/jump_i386_ms_pe_masm.asm - dummy.cpp -@@ -379,6 +392,17 @@ - ; +@@ -46,9 +47,10 @@ + local rule default_abi ( ) + { + local tmp = sysv ; +- if [ os.name ] = "NT" { tmp = ms ; } +- else if [ os.platform ] = "ARM" { tmp = aapcs ; } +- else if [ os.platform ] = "MIPS" { tmp = o32 ; } ++# if [ os.name ] = "NT" { tmp = ms ; } ++# else if [ os.platform ] = "ARM" { tmp = aapcs ; } ++# else if [ os.platform ] = "MIPS" { tmp = o32 ; } ++ tmp = ms ; + return $(tmp) ; + } - alias asm_context_sources -+ : asm/make_x86_64_ms_pe_gas.S -+ asm/jump_x86_64_ms_pe_gas.S -+ dummy.cpp -+ : <address-model>64 -+ <architecture>x86 -+ <binary-format>pe -+ <target-os>windows -+ <toolset>gcc -+ ; -+ -+alias asm_context_sources - : asm/make_x86_64_ms_pe_masm.asm - asm/jump_x86_64_ms_pe_masm.asm - dummy.cpp ---- libs/context/src/asm/make_i386_ms_pe_gas.S.orig 2013-03-03 13:41:28.645502113 +0100 -+++ libs/context/src/asm/make_i386_ms_pe_gas.S 2013-03-03 14:39:27.590477410 +0100 -@@ -0,0 +1,115 @@ -+/* -+ Copyright Oliver Kowalke 2009. -+ Copyright Thomas Sailer 2013. -+ Distributed under the Boost Software License, Version 1.0. -+ (See accompanying file LICENSE_1_0.txt or copy at -+ http://www.boost.org/LICENSE_1_0.txt) -+*/ -+ -+/******************************************************************** -+ * * -+ * -------------------------------------------------------------- * -+ * | 0 | 1 | 2 | 3 | 4 | 5 | * -+ * -------------------------------------------------------------- * -+ * | 0h | 04h | 08h | 0ch | 010h | 014h | * -+ * -------------------------------------------------------------- * -+ * | EDI | ESI | EBX | EBP | ESP | EIP | * -+ * -------------------------------------------------------------- * -+ * -------------------------------------------------------------- * -+ * | 6 | 7 | 8 | | * -+ * -------------------------------------------------------------- * -+ * | 018h | 01ch | 020h | | * -+ * -------------------------------------------------------------- * -+ * | sp | size | limit | | * -+ * -------------------------------------------------------------- * -+ * -------------------------------------------------------------- * -+ * | 9 | | * -+ * -------------------------------------------------------------- * -+ * | 024h | | * -+ * -------------------------------------------------------------- * -+ * |fc_execpt| | * -+ * -------------------------------------------------------------- * -+ * -------------------------------------------------------------- * -+ * | 10 | | * -+ * -------------------------------------------------------------- * -+ * | 028h | | * -+ * -------------------------------------------------------------- * -+ * |fc_strage| | * -+ * -------------------------------------------------------------- * -+ * -------------------------------------------------------------- * -+ * | 11 | 12 | | * -+ * -------------------------------------------------------------- * -+ * | 02ch | 030h | | * -+ * -------------------------------------------------------------- * -+ * | fc_mxcsr|fc_x87_cw| | * -+ * -------------------------------------------------------------- * -+ * * -+ * *****************************************************************/ -+ -+.file "make_i386_ms_pe_gas.S" -+.text -+.p2align 4,,15 -+.globl _make_fcontext -+.def _make_fcontext; .scl 2; .type 32; .endef -+_make_fcontext: -+ movl 0x04(%esp), %eax /* load 1. arg of make_fcontext, pointer to context stack (base) */ -+ leal -0x34(%eax),%eax /* reserve space for fcontext_t at top of context stack */ -+ -+ /* shift address in EAX to lower 16 byte boundary */ -+ /* == pointer to fcontext_t and address of context stack */ -+ andl $-16, %eax -+ -+ movl 0x04(%esp), %ecx /* load 1. arg of make_fcontext, pointer to context stack (base) */ -+ movl %ecx, 0x18(%eax) /* save address of context stack (base) in fcontext_t */ -+ movl 0x08(%esp), %edx /* load 2. arg of make_fcontext, context stack size */ -+ movl %edx, 0x1c(%eax) /* save context stack size in fcontext_t */ -+ negl %edx /* negate stack size for LEA instruction (== substraction) */ -+ leal (%ecx,%edx),%ecx /* compute bottom address of context stack (limit) */ -+ movl %ecx, 0x20(%eax) /* save address of context stack (limit) in fcontext_t */ -+ movl 0x0c(%esp), %ecx /* load 3. arg of make_fcontext, pointer to context function */ -+ movl %ecx, 0x14(%eax) /* save address of context function in fcontext_t */ -+ -+ stmxcsr 0x02c(%eax) /* save MMX control word */ -+ fnstcw 0x030(%eax) /* save x87 control word */ -+ -+ leal -0x1c(%eax),%edx /* reserve space for last frame and seh on context stack, (ESP - 0x4) % 16 == 0 */ -+ movl %edx, 0x10(%eax) /* save address in EDX as stack pointer for context function */ -+ -+ movl $finish, %ecx /* abs address of finish */ -+ movl %ecx, (%edx) /* save address of finish as return address for context function */ -+ /* entered after context function returns */ -+ -+ /* traverse current seh chain to get the last exception handler installed by Windows */ -+ /* note that on Windows Server 2008 and 2008 R2, SEHOP is activated by default */ -+ /* the exception handler chain is tested for the presence of ntdll.dll!FinalExceptionHandler */ -+ /* at its end by RaiseException all seh andlers are disregarded if not present and the */ -+ /* program is aborted */ -+ movl %fs:(0x18), %ecx /* load NT_TIB into ECX */ -+ -+walk: -+ movl (%ecx), %edx /* load 'next' member of current SEH into EDX */ -+ incl %edx /* test if 'next' of current SEH is last (== 0xffffffff) */ -+ jz found -+ decl %edx -+ xchgl %ecx, %edx /* exchange content; ECX contains address of next SEH */ -+ jmp walk /* inspect next SEH */ -+ -+found: -+ movl 0x04(%ecx), %ecx /* load 'handler' member of SEH == address of last SEH handler installed by Windows */ -+ movl 0x10(%eax), %edx /* load address of stack pointer for context function */ -+ movl %ecx, 0x18(%edx) /* save address in ECX as SEH handler for context */ -+ movl $0xffffffff,%ecx /* set ECX to -1 */ -+ movl %ecx, 0x14(%edx) /* save ECX as next SEH item */ -+ leal 0x14(%edx), %ecx /* load address of next SEH item */ -+ movl %ecx, 0x24(%eax) /* save next SEH */ -+ -+ ret -+ -+finish: -+ /* ESP points to same address as ESP on entry of context function + 0x4 */ -+ xorl %eax, %eax -+ movl %eax, (%esp) /* exit code is zero */ -+ call __exit /* exit application */ -+ hlt -+ -+.def __exit; .scl 2; .type 32; .endef /* standard C library function */ ---- libs/context/src/asm/jump_i386_ms_pe_gas.S.orig 2013-03-03 13:41:34.332670479 +0100 -+++ libs/context/src/asm/jump_i386_ms_pe_gas.S 2013-03-03 14:35:35.634611625 +0100 -@@ -0,0 +1,108 @@ -+/* -+ Copyright Oliver Kowalke 2009. -+ Copyright Thomas Sailer 2013. -+ Distributed under the Boost Software License, Version 1.0. -+ (See accompanying file LICENSE_1_0.txt or copy at -+ http://www.boost.org/LICENSE_1_0.txt) -+*/ -+ -+/******************************************************************** -+ * * -+ * -------------------------------------------------------------- * -+ * | 0 | 1 | 2 | 3 | 4 | 5 | * -+ * -------------------------------------------------------------- * -+ * | 0h | 04h | 08h | 0ch | 010h | 014h | * -+ * -------------------------------------------------------------- * -+ * | EDI | ESI | EBX | EBP | ESP | EIP | * -+ * -------------------------------------------------------------- * -+ * -------------------------------------------------------------- * -+ * | 6 | 7 | 8 | | * -+ * -------------------------------------------------------------- * -+ * | 018h | 01ch | 020h | | * -+ * -------------------------------------------------------------- * -+ * | sp | size | limit | | * -+ * -------------------------------------------------------------- * -+ * -------------------------------------------------------------- * -+ * | 9 | | * -+ * -------------------------------------------------------------- * -+ * | 024h | | * -+ * -------------------------------------------------------------- * -+ * |fc_execpt| | * -+ * -------------------------------------------------------------- * -+ * -------------------------------------------------------------- * -+ * | 10 | | * -+ * -------------------------------------------------------------- * -+ * | 028h | | * -+ * -------------------------------------------------------------- * -+ * |fc_strage| | * -+ * -------------------------------------------------------------- * -+ * -------------------------------------------------------------- * -+ * | 11 | 12 | | * -+ * -------------------------------------------------------------- * -+ * | 02ch | 030h | | * -+ * -------------------------------------------------------------- * -+ * | fc_mxcsr|fc_x87_cw| | * -+ * -------------------------------------------------------------- * -+ * * -+ * *****************************************************************/ -+ -+.file "jump_i386_ms_pe_gas.S" -+.text -+.p2align 4,,15 -+.globl _jump_fcontext -+.def _jump_fcontext; .scl 2; .type 32; .endef -+_jump_fcontext: -+ movl 0x04(%esp), %ecx /* load address of the first fcontext_t arg */ -+ movl %edi, (%ecx) /* save EDI */ -+ movl %esi, 0x04(%ecx) /* save ESI */ -+ movl %ebx, 0x08(%ecx) /* save EBX */ -+ movl %ebp, 0x0c(%ecx) /* save EBP */ -+ -+ movl %fs:(0x18), %edx /* load NT_TIB */ -+ movl (%edx), %eax /* load current SEH exception list */ -+ movl %eax, 0x24(%ecx) /* save current exception list */ -+ movl 0x04(%edx), %eax /* load current stack base */ -+ movl %eax, 0x18(%ecx) /* save current stack base */ -+ movl 0x08(%edx), %eax /* load current stack limit */ -+ movl %eax, 0x20(%ecx) /* save current stack limit */ -+ movl 0x10(%edx), %eax /* load fiber local storage */ -+ movl %eax, 0x28(%ecx) /* save fiber local storage */ -+ -+ leal 0x04(%esp), %eax /* exclude the return address */ -+ movl %eax, 0x10(%ecx) /* save as stack pointer */ -+ movl (%esp), %eax /* load return address */ -+ movl %eax, 0x14(%ecx) /* save return address */ -+ -+ movl 0x08(%esp), %edx /* load address of the second fcontext_t arg */ -+ movl (%edx), %edi /* restore EDI */ -+ movl 0x04(%edx), %esi /* restore ESI */ -+ movl 0x08(%edx), %ebx /* restore EBX */ -+ movl 0x0c(%edx), %ebp /* restore EBP */ -+ -+ movl 0x10(%esp), %eax /* check if fpu enve preserving was requested */ -+ testl %eax, %eax -+ je 1f -+ -+ stmxcsr 0x2c(%ecx) /* save MMX control word */ -+ fnstcw 0x30(%ecx) /* save x87 control word */ -+ ldmxcsr 0x2c(%edx) /* restore MMX control word */ -+ fldcw 0x30(%edx) /* restore x87 control word */ -+1: -+ movl %edx, %ecx -+ movl %fs:(0x18), %edx /* load NT_TIB */ -+ movl 0x24(%ecx), %eax /* load SEH exception list */ -+ movl %eax, (%edx) /* restore next SEH item */ -+ movl 0x18(%ecx), %eax /* load stack base */ -+ movl %eax, 0x04(%edx) /* restore stack base */ -+ movl 0x20(%ecx), %eax /* load stack limit */ -+ movl %eax, 0x08(%edx) /* restore stack limit */ -+ movl 0x28(%ecx), %eax /* load fiber local storage */ -+ movl %eax, 0x10(%edx) /* restore fiber local storage */ -+ -+ movl 0x0c(%esp), %eax /* use third arg as return value after jump */ -+ -+ movl 0x10(%ecx), %esp /* restore ESP */ -+ movl %eax, 0x04(%esp) /* use third arg as first arg in context function */ -+ movl 0x14(%ecx), %ecx /* fetch the address to return to */ -+ -+ jmp *%ecx /* indirect jump to context */ ---- libs/context/src/asm/make_x86_64_ms_pe_gas.S.orig 2013-03-03 13:43:03.137299031 +0100 -+++ libs/context/src/asm/make_x86_64_ms_pe_gas.S 2013-03-03 14:54:16.036775106 +0100 -@@ -0,0 +1,132 @@ -+/* -+ Copyright Oliver Kowalke 2009. -+ Copyright Thomas Sailer 2013. -+ Distributed under the Boost Software License, Version 1.0. -+ (See accompanying file LICENSE_1_0.txt or copy at -+ http://www.boost.org/LICENSE_1_0.txt) -+*/ -+ -+/**************************************************************************************** -+ * * -+ * ---------------------------------------------------------------------------------- * -+ * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | * -+ * ---------------------------------------------------------------------------------- * -+ * | 0x0 | 0x4 | 0x8 | 0xc | 0x10 | 0x14 | 0x18 | 0x1c | * -+ * ---------------------------------------------------------------------------------- * -+ * | R12 | R13 | R14 | R15 | * -+ * ---------------------------------------------------------------------------------- * -+ * ---------------------------------------------------------------------------------- * -+ * | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | * -+ * ---------------------------------------------------------------------------------- * -+ * | 0x20 | 0x24 | 0x28 | 0x2c | 0x30 | 0x34 | 0x38 | 0x3c | * -+ * ---------------------------------------------------------------------------------- * -+ * | RDI | RSI | RBX | RBP | * -+ * ---------------------------------------------------------------------------------- * -+ * ---------------------------------------------------------------------------------- * -+ * | 16 | 17 | 18 | 19 | | * -+ * ---------------------------------------------------------------------------------- * -+ * | 0x40 | 0x44 | 0x48 | 0x4c | | * -+ * ---------------------------------------------------------------------------------- * -+ * | RSP | RIP | | * -+ * ---------------------------------------------------------------------------------- * -+ * ---------------------------------------------------------------------------------- * -+ * | 20 | 21 | 22 | 23 | 24 | 25 | | * -+ * ---------------------------------------------------------------------------------- * -+ * | 0x50 | 0x54 | 0x58 | 0x5c | 0x60 | 0x64 | | * -+ * ---------------------------------------------------------------------------------- * -+ * | sp | size | limit | | * -+ * ---------------------------------------------------------------------------------- * -+ * ---------------------------------------------------------------------------------- * -+ * | 26 | 27 | | * -+ * ---------------------------------------------------------------------------------- * -+ * | 0x68 | 0x6c | | * -+ * ---------------------------------------------------------------------------------- * -+ * | fbr_strg | | * -+ * ---------------------------------------------------------------------------------- * -+ * ---------------------------------------------------------------------------------- * -+ * | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | * -+ * ---------------------------------------------------------------------------------- * -+ * | 0x70 | 0x74 | 0x78 | 0x7c | 0x80 | 0x84 | 0x88 | 0x8c | * -+ * ---------------------------------------------------------------------------------- * -+ * | fc_mxcsr|fc_x87_cw| fc_xmm | SEE registers (XMM6-XMM15) | * -+ * ---------------------------------------------------------------------------------- * -+ * ---------------------------------------------------------------------------------- * -+ * | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | * -+ * ---------------------------------------------------------------------------------- * -+ * | 0x90 | 0x94 | 0x98 | 0x9c | 0xa0 | 0xa4 | 0xa8 | 0xac | * -+ * ---------------------------------------------------------------------------------- * -+ * | SEE registers (XMM6-XMM15) | * -+ * ---------------------------------------------------------------------------------- * -+ * ---------------------------------------------------------------------------------- * -+ * | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | * -+ * ---------------------------------------------------------------------------------- * -+ * | 0xb0 | 0xb4 | 0xb8 | 0xbc | 0xc0 | 0xc4 | 0xc8 | 0xcc | * -+ * ---------------------------------------------------------------------------------- * -+ * | SEE registers (XMM6-XMM15) | * -+ * ---------------------------------------------------------------------------------- * -+ * ---------------------------------------------------------------------------------- * -+ * | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | * -+ * ---------------------------------------------------------------------------------- * -+ * | 0xd0 | 0xd4 | 0xd8 | 0xdc | 0xe0 | 0xe4 | 0xe8 | 0xec | * -+ * ---------------------------------------------------------------------------------- * -+ * | SEE registers (XMM6-XMM15) | * -+ * ---------------------------------------------------------------------------------- * -+ * ---------------------------------------------------------------------------------- * -+ * | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | * -+ * ---------------------------------------------------------------------------------- * -+ * | 0xf0 | 0xf4 | 0xf8 | 0xfc | 0x100 | 0x104 | 0x108 | 0x10c | * -+ * ---------------------------------------------------------------------------------- * -+ * | SEE registers (XMM6-XMM15) | * -+ * ---------------------------------------------------------------------------------- * -+ * ---------------------------------------------------------------------------------- * -+ * | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | * -+ * ---------------------------------------------------------------------------------- * -+ * | 0x110 | 0x114 | 0x118 | 0x11c | 0x120 | 0x124 | 0x128 | 0x12c | * -+ * ---------------------------------------------------------------------------------- * -+ * | SEE registers (XMM6-XMM15) | * -+ * ---------------------------------------------------------------------------------- * -+ * * -+ * *************************************************************************************/ -+ -+.file "make_x86_64_ms_pe_gas.S" -+.text -+.p2align 4,,15 -+.globl make_fcontext -+.def make_fcontext; .scl 2; .type 32; .endef -+.seh_proc make_fcontext -+make_fcontext: -+.seh_endprologue -+ leaq -0x130(%rcx),%rax /* reserve space for fcontext_t at top of context stack */ -+ -+ /* shift address in RAX to lower 16 byte boundary */ -+ /* == pointer to fcontext_t and address of context stack */ -+ andq $-16, %rax -+ -+ movq %r8, 0x48(%rax) /* save address of context function in fcontext_t */ -+ movq %rdx, 0x58(%rax) /* save context stack size in fcontext_t */ -+ movq %rcx, 0x50(%rax) /* save address of context stack pointer (base) in fcontext_t */ -+ -+ negq %rdx /* negate stack size for LEA instruction (== substraction) */ -+ leaq (%rcx,%rdx),%rcx /* compute bottom address of context stack (limit) */ -+ movq %rcx, 0x60(%rax) /* save bottom address of context stack (limit) in fcontext_t */ -+ -+ stmxcsr 0x70(%rax) /* save MMX control and status word */ -+ fnstcw 0x74(%rax) /* save x87 control word */ -+ -+ leaq -0x28(%rax),%rdx /* reserve 32byte shadow space + return address on stack, (RSP - 0x8) % 16 == 0 */ -+ movq %rdx, 0x40(%rax) /* save address in RDX as stack pointer for context function */ -+ -+ leaq finish(%rip),%rcx /* compute abs address of label finish */ -+ movq %rcx,(%rdx) /* save address of finish as return address for context function */ -+ /* entered after context function returns */ -+ -+ ret -+ -+finish: -+ /* RSP points to same address as RSP on entry of context function + 0x8 */ -+ xorq %rcx, %rcx /* exit code is zero */ -+ call _exit /* exit application */ -+ hlt -+.seh_endproc -+ -+.def _exit; .scl 2; .type 32; .endef /* standard C library function */ ---- libs/context/src/asm/jump_x86_64_ms_pe_gas.S.orig 2013-03-03 13:42:57.753139784 +0100 -+++ libs/context/src/asm/jump_x86_64_ms_pe_gas.S 2013-03-03 15:06:08.269856857 +0100 -@@ -0,0 +1,189 @@ -+/* -+ Copyright Oliver Kowalke 2009. -+ Copyright Thomas Sailer 2013. -+ Distributed under the Boost Software License, Version 1.0. -+ (See accompanying file LICENSE_1_0.txt or copy at -+ http://www.boost.org/LICENSE_1_0.txt) -+*/ -+ -+/**************************************************************************************** -+ * * -+ * ---------------------------------------------------------------------------------- * -+ * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | * -+ * ---------------------------------------------------------------------------------- * -+ * | 0x0 | 0x4 | 0x8 | 0xc | 0x10 | 0x14 | 0x18 | 0x1c | * -+ * ---------------------------------------------------------------------------------- * -+ * | R12 | R13 | R14 | R15 | * -+ * ---------------------------------------------------------------------------------- * -+ * ---------------------------------------------------------------------------------- * -+ * | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | * -+ * ---------------------------------------------------------------------------------- * -+ * | 0x20 | 0x24 | 0x28 | 0x2c | 0x30 | 0x34 | 0x38 | 0x3c | * -+ * ---------------------------------------------------------------------------------- * -+ * | RDI | RSI | RBX | RBP | * -+ * ---------------------------------------------------------------------------------- * -+ * ---------------------------------------------------------------------------------- * -+ * | 16 | 17 | 18 | 19 | | * -+ * ---------------------------------------------------------------------------------- * -+ * | 0x40 | 0x44 | 0x48 | 0x4c | | * -+ * ---------------------------------------------------------------------------------- * -+ * | RSP | RIP | | * -+ * ---------------------------------------------------------------------------------- * -+ * ---------------------------------------------------------------------------------- * -+ * | 20 | 21 | 22 | 23 | 24 | 25 | | * -+ * ---------------------------------------------------------------------------------- * -+ * | 0x50 | 0x54 | 0x58 | 0x5c | 0x60 | 0x64 | | * -+ * ---------------------------------------------------------------------------------- * -+ * | sp | size | limit | | * -+ * ---------------------------------------------------------------------------------- * -+ * ---------------------------------------------------------------------------------- * -+ * | 26 | 27 | | * -+ * ---------------------------------------------------------------------------------- * -+ * | 0x68 | 0x6c | | * -+ * ---------------------------------------------------------------------------------- * -+ * | fbr_strg | | * -+ * ---------------------------------------------------------------------------------- * -+ * ---------------------------------------------------------------------------------- * -+ * | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | * -+ * ---------------------------------------------------------------------------------- * -+ * | 0x70 | 0x74 | 0x78 | 0x7c | 0x80 | 0x84 | 0x88 | 0x8c | * -+ * ---------------------------------------------------------------------------------- * -+ * | fc_mxcsr|fc_x87_cw| fc_xmm | SEE registers (XMM6-XMM15) | * -+ * ---------------------------------------------------------------------------------- * -+ * ---------------------------------------------------------------------------------- * -+ * | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | * -+ * ---------------------------------------------------------------------------------- * -+ * | 0x90 | 0x94 | 0x98 | 0x9c | 0xa0 | 0xa4 | 0xa8 | 0xac | * -+ * ---------------------------------------------------------------------------------- * -+ * | SEE registers (XMM6-XMM15) | * -+ * ---------------------------------------------------------------------------------- * -+ * ---------------------------------------------------------------------------------- * -+ * | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | * -+ * ---------------------------------------------------------------------------------- * -+ * | 0xb0 | 0xb4 | 0xb8 | 0xbc | 0xc0 | 0xc4 | 0xc8 | 0xcc | * -+ * ---------------------------------------------------------------------------------- * -+ * | SEE registers (XMM6-XMM15) | * -+ * ---------------------------------------------------------------------------------- * -+ * ---------------------------------------------------------------------------------- * -+ * | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | * -+ * ---------------------------------------------------------------------------------- * -+ * | 0xd0 | 0xd4 | 0xd8 | 0xdc | 0xe0 | 0xe4 | 0xe8 | 0xec | * -+ * ---------------------------------------------------------------------------------- * -+ * | SEE registers (XMM6-XMM15) | * -+ * ---------------------------------------------------------------------------------- * -+ * ---------------------------------------------------------------------------------- * -+ * | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | * -+ * ---------------------------------------------------------------------------------- * -+ * | 0xf0 | 0xf4 | 0xf8 | 0xfc | 0x100 | 0x104 | 0x108 | 0x10c | * -+ * ---------------------------------------------------------------------------------- * -+ * | SEE registers (XMM6-XMM15) | * -+ * ---------------------------------------------------------------------------------- * -+ * ---------------------------------------------------------------------------------- * -+ * | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | * -+ * ---------------------------------------------------------------------------------- * -+ * | 0x110 | 0x114 | 0x118 | 0x11c | 0x120 | 0x124 | 0x128 | 0x12c | * -+ * ---------------------------------------------------------------------------------- * -+ * | SEE registers (XMM6-XMM15) | * -+ * ---------------------------------------------------------------------------------- * -+ * * -+ * *************************************************************************************/ -+ -+.file "jump_x86_64_ms_pe_gas.S" -+.text -+.p2align 4,,15 -+.globl jump_fcontext -+.def jump_fcontext; .scl 2; .type 32; .endef -+.seh_proc jump_fcontext -+jump_fcontext: -+.seh_endprologue -+ movq %r12, (%rcx) /* save R12 */ -+ movq %r13, 0x08(%rcx) /* save R13 */ -+ movq %r14, 0x10(%rcx) /* save R14 */ -+ movq %r15, 0x18(%rcx) /* save R15 */ -+ movq %rdi, 0x20(%rcx) /* save RDI */ -+ movq %rsi, 0x28(%rcx) /* save RSI */ -+ movq %rbx, 0x30(%rcx) /* save RBX */ -+ movq %rbp, 0x38(%rcx) /* save RBP */ -+ -+ movq %gs:(0x30), %r10 /* load NT_TIB */ -+ movq 0x08(%r10), %rax /* load current stack base */ -+ movq %rax, 0x50(%rcx) /* save current stack base */ -+ movq 0x10(%r10), %rax /* load current stack limit */ -+ movq %rax, 0x60(%rcx) /* save current stack limit */ -+ movq 0x18(%r10), %rax /* load fiber local storage */ -+ movq %rax, 0x68(%rcx) /* save fiber local storage */ -+ -+ testq %r9, %r9 -+ je 1f -+ -+ stmxcsr 0x70(%rcx) /* save MMX control and status word */ -+ fnstcw 0x74(%rcx) /* save x87 control word */ -+ /* save XMM storage */ -+ /* save start address of SSE register block in R10 */ -+ leaq 0x90(%rcx), %r10 -+ /* shift address in R10 to lower 16 byte boundary */ -+ /* == pointer to SEE register block */ -+ andq $-16, %r10 -+ -+ movaps %xmm6, (%r10) -+ movaps %xmm7, 0x10(%r10) -+ movaps %xmm8, 0x20(%r10) -+ movaps %xmm9, 0x30(%r10) -+ movaps %xmm10, 0x40(%r10) -+ movaps %xmm11, 0x50(%r10) -+ movaps %xmm12, 0x60(%r10) -+ movaps %xmm13, 0x70(%r10) -+ movaps %xmm14, 0x80(%r10) -+ movaps %xmm15, 0x90(%r10) -+ -+ ldmxcsr 0x70(%rdx) /* restore MMX control and status word */ -+ fldcw 0x74(%rdx) /* restore x87 control word */ -+ /* restore XMM storage */ -+ /* save start address of SSE register block in R10 */ -+ leaq 0x90(%rdx), %r10 -+ /* shift address in R10 to lower 16 byte boundary */ -+ /* == pointer to SEE register block */ -+ andq $-16, %r10 -+ -+ movaps (%r10), %xmm6 -+ movaps 0x10(%r10), %xmm7 -+ movaps 0x20(%r10), %xmm8 -+ movaps 0x30(%r10), %xmm9 -+ movaps 0x40(%r10), %xmm10 -+ movaps 0x50(%r10), %xmm11 -+ movaps 0x60(%r10), %xmm12 -+ movaps 0x70(%r10), %xmm13 -+ movaps 0x80(%r10), %xmm14 -+ movaps 0x90(%r10), %xmm15 -+ -+1: -+ leaq 0x08(%rsp), %rax /* exclude the return address */ -+ movq %rax, 0x40(%rcx) /* save as stack pointer */ -+ movq (%rsp), %rax /* load return address */ -+ movq %rax, 0x48(%rcx) /* save return address */ -+ -+ movq (%rdx), %r12 /* restore R12 */ -+ movq 0x08(%rdx), %r13 /* restore R13 */ -+ movq 0x10(%rdx), %r14 /* restore R14 */ -+ movq 0x18(%rdx), %r15 /* restore R15 */ -+ movq 0x20(%rdx), %rdi /* restore RDI */ -+ movq 0x28(%rdx), %rsi /* restore RSI */ -+ movq 0x30(%rdx), %rbx /* restore RBX */ -+ movq 0x38(%rdx), %rbp /* restore RBP */ -+ -+ movq %gs:(0x30), %r10 /* load NT_TIB */ -+ movq 0x50(%rdx), %rax /* load stack base */ -+ movq %rax, 0x08(%r10) /* restore stack base */ -+ movq 0x60(%rdx), %rax /* load stack limit */ -+ movq %rax, 0x10(%r10) /* restore stack limit */ -+ movq 0x68(%rdx), %rax /* load fiber local storage */ -+ movq %rax, 0x18(%r10) /* restore fiber local storage */ -+ -+ movq 0x40(%rdx), %rsp /* restore RSP */ -+ movq 0x48(%rdx), %r10 /* fetch the address to returned to */ -+ -+ movq %r8, %rax /* use third arg as return value after jump */ -+ movq %r8, %rcx /* use third arg as first arg in context function */ -+ -+ jmp *%r10 /* indirect jump to caller */ -+.seh_endproc ---- boost/detail/interlocked.hpp.orig 2013-09-16 16:41:36.011550612 +0200 -+++ boost/detail/interlocked.hpp 2013-09-16 16:41:50.762550741 +0200 -@@ -7,6 +7,10 @@ - # pragma once - #endif +--- libs/context/src/asm/jump_i386_ms_pe_gas.asm.mingw 2015-09-02 16:03:06.406321632 +0200 ++++ libs/context/src/asm/jump_i386_ms_pe_gas.asm 2015-09-02 16:04:17.632915315 +0200 +@@ -138,3 +138,6 @@ + + /* indirect jump to context */ + jmp *%edx ++ ++.section .drectve ++.ascii " -export:\"jump_fcontext\"" +--- libs/context/src/asm/jump_x86_64_ms_pe_gas.asm.mingw 2015-09-02 16:03:13.495380721 +0200 ++++ libs/context/src/asm/jump_x86_64_ms_pe_gas.asm 2015-09-02 16:04:12.488872439 +0200 +@@ -223,3 +223,6 @@ + /* indirect jump to context */ + jmp *%r10 + .seh_endproc ++ ++.section .drectve ++.ascii " -export:\"jump_fcontext\"" +--- libs/context/src/asm/make_i386_ms_pe_gas.asm.mingw 2015-09-02 16:03:22.486455662 +0200 ++++ libs/context/src/asm/make_i386_ms_pe_gas.asm 2015-09-02 16:04:32.409038476 +0200 +@@ -122,3 +122,6 @@ + hlt + + .def __exit; .scl 2; .type 32; .endef /* standard C library function */ ++ ++.section .drectve ++.ascii " -export:\"make_fcontext\"" +--- libs/context/src/asm/make_x86_64_ms_pe_gas.asm.mingw 2015-09-02 16:03:30.631523552 +0200 ++++ libs/context/src/asm/make_x86_64_ms_pe_gas.asm 2015-09-02 16:04:27.433997008 +0200 +@@ -149,3 +149,6 @@ + .seh_endproc -+#ifndef BOOST_USE_WINDOWS_H -+#define BOOST_USE_WINDOWS_H -+#endif + .def _exit; .scl 2; .type 32; .endef /* standard C library function */ + - // - // boost/detail/interlocked.hpp - // ++.section .drectve ++.ascii " -export:\"make_fcontext\"" |