2
0
mirror of https://github.com/boostorg/context.git synced 2026-01-19 16:12:17 +00:00

121 Commits

Author SHA1 Message Date
Oliver Kowalke
e721688e1a C++03 2021-12-29 18:33:17 +01:00
Oliver Kowalke
c55b58bf0a Merge branch 'develop' into mips 2021-08-06 07:41:02 +02:00
Oliver Kowalke
8f69d9d03c Merge pull request #178 from eschnett/eschnett/macho-gcc
Allow building asm_sources with GCC on 64-bit MACH-O
2021-07-15 06:44:59 +02:00
Erik Schnetter
cee39879a3 Allow building asm_sources with GCC on 64-bit MACH-O 2021-07-14 17:24:44 -04:00
Nikita Kniazev
8425e830ea Cease dependence on Thread
On C++11 static local variables are initialized in thread-safe manner, but even on C++03 it should not be a problem because in our case variables are of trivial types, which means double initialization is not an issue, and they are initialized with the same value in every thread.
2021-06-12 22:23:08 +03:00
Ilia K
e97864875b Use /safeseh asmflags for MSVC x86 2021-04-16 07:54:44 +02:00
Oliver Kowalke
575dc2b7be Merge pull request #140 from eldiener/develop
Changes for Embarcadero C++ clang-based compilers, targeting Boost 1.74
2020-06-28 17:05:44 +02:00
EGuesnet
8d1c3fbe19 Update Jamfile.v2 2020-06-25 08:46:02 +02:00
EGuesnet
5c0adf0b84 split-stack flag for GCC
-fsplit-stack flag  available only on Linux for GCC
2020-06-24 10:45:44 +02:00
Edward Diener
2dbaa73de2 Setup fpr Embarcadero bcc64 64-bit assembler, the Embarcadero 32-bit assembler, and the Bprland 32-bit assembler. The syntactical difference between the Embarcqadero 32-bit assembler and the Borland 32-bit assembler is simply that the embarcadero toolset uses clang-based command lines, while the bporland toolset uses bcc32 based command lines. Otherwise both use tasm32 to assemble assembly files. 2020-05-13 18:58:37 -04:00
YunQiang Su
19f2351124 Use OSPLAT MIPS32/MIPS64 to set different ABI
We should set abi for 64bit as n64, and 32bit for o32.
This patch depends on the patch of boost/build.
2019-12-18 03:33:18 -08:00
George Koehler
df8fb6b528 Fix ppc32 on Linux musl, NetBSD, OpenBSD; fixes #120
This fixes fcontext on my PowerBook G4 running Void Linux
ppc-musl-20190901, NetBSD/macppc 8.1, or OpenBSD/macppc 6.6-current,
all with g++.  These systems use fcontext for *ppc32_sysv_elf*
(PowerPC 32-bit System V ELF).  The assembly code was wrong for BSD
and crashing on Linux musl.

Linux returns a transfer_t in memory (through a hidden pointer in R3),
but other systems (at least NetBSD and OpenBSD) return a transfer_t in
registers R3:R4.  jump_fcontext() and ontop_fcontext() were always
using the hidden pointer.  Add checks for `#ifdef__linux__`; start
using R3:R4 on other systems.

make_fcontext() was calling _exit(0) through the insecure BSS PLT.
Set R30 to use the secure PLT.  This prevents a crash when musl's
ld.so loads the executable; musl seems to require the secure PLT.

Fix ontop_fcontext() to restore the hidden pointer on Linux.  It was
passing the wrong context's hidden pointer to the ontop-function fn(),
so fn() returned a transfer_t to the wrong stack.  When fn() was
context_exit() in <boost/context/continuation_fcontext.hpp>, it freed
the old stack, then returned `transfer_t{ nullptr, nullptr }` to free
memory.  This crashed on Linux musl.

Now that ontop_fcontext() restores the hidden pointer, it must stop
abusing the same pointer to pass a transfer_t argument to fn().  Add a
new ontop_fcontext_tail() in C++, which takes arguments in registers
and allocates a transfer_t.  The code is in C++ so it can free the
transfer_t argument if fn() throws a C++ exception.

Rearrange the context frame to shrink it from 244 to 240 bytes.  This
fixes the stack alignment: the ABI requires R1 % 16 == 0, and
make_fcontext() respects this, but jump_fcontext() was adding 244 to
R1, so the new context ran with a misaligned stack (244 % 16 == 4).

Remove R13 from the context frame, so new contexts stop loading R13
with garbage.  The ABI uses R13 to point to the executable's small
data, so R13 should have the same value in every context.

Add the backchain to the context frame; make room by moving LR to the
caller's frame.  Order CR, R14 to R31, F14 to F31 at the frame's end,
as is typical for this ABI.  Provide 8-byte alignment for FPSCR and
F14 to F31, to avoid a misalignment penalty.
2019-10-19 14:06:24 -04:00
Naveenaidu
adecfdc88c S390x: Add Support for s390x arch 2019-09-06 20:08:10 +05:30
Oliver Kowalke
0c754f90c5 execution_context removed 2019-08-29 13:42:03 +02:00
Oliver Kowalke
9c772a7830 Revert "S390x Implementation: WIP" 2019-08-03 08:33:17 +02:00
Naveenaidu
cc71b90db6 Jamfile.v2: Fix binary format s390x 2019-08-03 09:27:55 +05:30
Naveenaidu
2d56804025 Jamfile.v2: Add s390x arch 2019-07-22 22:53:43 +05:30
Andreas Schwab
c8fb4a42f3 Add support for RISC-V LP64D 2019-04-09 14:15:31 +02:00
Jiaxun Yang
6edc8184a7 Switch mips1 to mips 2018-12-02 13:07:18 +08:00
Jiaxun Yang
e3f744a186 Implement mips64 n64 elf
n64 ABI is very different from o32 ABI
2018-11-28 15:13:56 +08:00
Théo DELRIEU
d8830fedff remove useless lines in Jamfile.v2
The gcc toolset is responsible of building assembly files.
This patch removes what seems to be old remnants.
2018-11-09 13:43:12 +01:00
Peter Dimov
554ed190ae The clang-win toolset (clang-cl.exe) uses masm from the underlying msvc 2018-10-27 15:56:32 +03:00
Brian Kuhl
09584e9f5b Duplicate alias should be missing GCC alias
Turn duplicate sysv-power-32-elf-clang alias into missing sysv-power-32-elf-gcc alias
2018-09-14 01:16:05 -04:00
Oliver Kowalke
ac99b9bf25 prevent compiling compilation units for non-C++11 compilers 2018-03-12 12:14:50 +01:00
Oliver Kowalke
a0433d1c72 execution_context without depended compilation
- execution_context v1 in namecpase v1
- execution_context v2 in inlined namespace v2
2018-02-05 19:34:35 +01:00
Oliver Kowalke
51ea6b583d re-introduce continuation - fix conflicts 2018-02-05 13:31:35 +01:00
Oliver Kowalke
10d3264f7b implementation of fibers without scheduler according to P0876R0 2018-02-05 13:31:32 +01:00
SSE4
0660558a39 - define asm sources for Clang on Windows 2017-09-03 12:50:02 +07:00
Oliver Kowalke
fa890b1c4d adapt Jamfiles for new properties 2017-06-04 20:27:03 +02:00
Oliver Kowalke
a72f69607f support WinFibers in callcc() 2017-06-04 20:27:03 +02:00
Oliver Kowalke
4b8a730919 support ucontext_t in callcc() 2017-06-01 18:20:02 +02:00
Oliver Kowalke
81f44fc948 rename property: htm { tsx } 2017-04-26 06:34:15 +02:00
Oliver Kowalke
d3f02dbe2f support for TSX
(cherry picked from commit 8f9c379e83a21e7e9aef32dcc41f16846190f799)
2017-04-14 12:39:45 +02:00
oliver Kowalke
cc309abdba rename toolset to 'clang-win' for Windows 2017-02-07 14:23:11 +01:00
oliver Kowalke
b4be67d81f Revert "build: apply defect macro tests"
This reverts commit f8c1f30c92.

boost.context must still build for boost.coroutine
2016-09-19 09:32:41 +02:00
oliver Kowalke
f8c1f30c92 build: apply defect macro tests 2016-09-15 08:54:13 +02:00
Oliver Kowalke
29bf77b057 build with Intel C++ compiler for MacOS
- fixes #12242
2016-05-31 21:23:09 +02:00
Kohei Takahashi
469dc955cb Don't use Boost.Config build-time configure target.
In some cases it doesn't respect config macros.
2016-03-25 18:03:51 +09:00
Oliver Kowalke
9f2584ea81 experimental X32 support 2016-02-26 17:08:15 +01:00
Oliver Kowalke
5fbefd55cc specialize Jamfile for clang on Windows
- specialization lets use clangs assembler tool
2016-02-17 16:54:15 +01:00
Kohei Takahashi
01d3c901e4 Don't link boost.thread if <mutex> is available.
Linking boost.thread is unnecessary if the std library supports
std::call_once.
2016-02-05 10:48:09 +09:00
Oliver Kowalke
8710b4f928 introduction of property context-switch
- property context-switch is used to determine if captured_context
  or execution_context is used
2016-01-04 17:43:47 +01:00
Oliver Kowalke
ba357205a9 class captured_context added 2016-01-01 22:03:18 +01:00
Oliver Kowalke
f2ef6326b6 remove files related SPARC
- asm for SPARC architecture not working
2015-10-28 14:24:18 +01:00
Oliver Kowalke
df2012d99d add support for CYGWIN 2015-10-11 08:58:18 +02:00
Oliver Kowalke
6431d27506 fix #11604: Assembler Error A1010 with Intel Compiler 16.0 (win7 64bit) 2015-08-31 21:20:41 +02:00
Oliver Kowalke
b48f92384e define BOOST_DISABLE_ASSERTS in Jamfile
- for variant=release or optimization=speed define BOOST_DISABLE_ASSERTS
2015-06-13 08:00:39 +02:00
Oliver Kowalke
fcb2283c76 first guess for support of MinGW 2015-06-05 15:00:36 +02:00
Inseok Lee
4818164601 Do not export symbols for static build on PE builds.
Symbols incorrectly marked for export on static libraries exported on final executable. This change make symbols not to be marked as export on static builds.
2015-04-25 11:30:24 +09:00
Oliver Kowalke
39ccd9687e Lift architecture detection 2015-03-08 17:42:48 +01:00