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

1149 Commits

Author SHA1 Message Date
Rene Rivera
2c1409c17a Switch to library requirements instead of source. As source puts extra source in install targets. 2024-03-29 21:15:58 -05:00
René Ferdinand Rivera Morell
d6c700636a Merge branch 'boostorg:develop' into modular 2024-03-11 10:53:41 -05:00
Claudio Jeker
79bfdc584b Add the BOOST_CONTEXT_USE_MAP_STACK logic to test_fcontext.cpp
Without this test_fcontext.cpp fails on OpenBSD with a not-on-stack OS error.
2024-03-11 08:51:26 -05:00
Oliver Kowalke
625bcb96ab update documentation 2024-03-11 08:51:26 -05:00
Claudio Jeker
d2109fdc2e Implement the fcontext asm for sparc64
This implements the required asm functions for sparc64_sysv_elf and
was tested on an OpenBSD/sparc64 system.

Jump_fcontext uses an extra C call frame to store the frame-pointer and
return address. Because of this the code is simply a save (to new reg
window), then forcing a window flush and finally switch stack and restore
from there.

Since jump_fcontext() uses a register window and stack frame, make_fcontext()
reserves two call frames on the stack (one for jump_fcontext() and the other
for the callback function).

OpenBSD/sparc64 uses stackghost which prevents userland from overriding the
return-address on the stack. Because of this make_fcontext() uses an extra
trampoline to implement the _exit(0) call if the callback returns.

All tests pass with this on OpenBSD/sparc64 (also the tests for fiber,
coroutine and coroutine2).
2024-03-11 08:51:26 -05:00
Oliver Kowalke
d81d611fa2 support gcc for ARM64 on mac OS X
- #255
2024-03-11 08:51:26 -05:00
Rene Rivera
9170c51c98 Make the library modular usable. 2024-03-11 08:31:17 -05:00
Oliver Kowalke
1bde50e400 Merge branch 'develop' boost-1.86.0.beta1 boost-1.86.0 boost-1.85.0.beta1 boost-1.85.0 2024-03-10 20:25:58 +01:00
Oliver Kowalke
f5d062c939 Merge pull request #250 from cjeker/fix_test_fcontext_for_map_stack
Add the BOOST_CONTEXT_USE_MAP_STACK logic to test_fcontext.cpp
2024-03-10 20:23:04 +01:00
Oliver Kowalke
d811245d08 update documentation 2024-03-10 20:20:54 +01:00
Oliver Kowalke
d9bea79b09 Merge pull request #251 from cjeker/sparc64_asm_support
Implement the fcontext asm for sparc64
2024-03-10 20:18:12 +01:00
Oliver Kowalke
99be0a678d support gcc for ARM64 on mac OS X
- #255
2024-03-10 20:07:00 +01:00
Claudio Jeker
17945a28a2 Implement the fcontext asm for sparc64
This implements the required asm functions for sparc64_sysv_elf and
was tested on an OpenBSD/sparc64 system.

Jump_fcontext uses an extra C call frame to store the frame-pointer and
return address. Because of this the code is simply a save (to new reg
window), then forcing a window flush and finally switch stack and restore
from there.

Since jump_fcontext() uses a register window and stack frame, make_fcontext()
reserves two call frames on the stack (one for jump_fcontext() and the other
for the callback function).

OpenBSD/sparc64 uses stackghost which prevents userland from overriding the
return-address on the stack. Because of this make_fcontext() uses an extra
trampoline to implement the _exit(0) call if the callback returns.

All tests pass with this on OpenBSD/sparc64 (also the tests for fiber,
coroutine and coroutine2).
2024-02-13 11:16:42 +01:00
Claudio Jeker
22be4b1570 Add the BOOST_CONTEXT_USE_MAP_STACK logic to test_fcontext.cpp
Without this test_fcontext.cpp fails on OpenBSD with a not-on-stack OS error.
2024-02-13 10:57:26 +01:00
Oliver Kowalke
77de3d527c Merge pull request #248 from devnexen/fix_solaris_build
fix solaris/illumos build on make/jump assembly directives.
2024-02-04 16:58:50 +01:00
David Carlier
a2dd396dd9 fix solaris/illumos build on make/jump assembly directives.
on those platforms, albeit being 64 bits, they produce 32 bits binaries by default.
2024-02-04 08:07:39 +00:00
Oliver Kowalke
08679361bd Merge pull request #247 from SoapGentoo/fix-x32
Fix x32 build on x86-64
2024-01-23 16:52:32 +01:00
David Seifert
922e033fa1 Fix x32 build on x86-64 2024-01-23 13:23:29 +01:00
Oliver Kowalke
e9c3e56a33 Merge pull request #245 from boostorg/develop
Suppressing -Wsign-conversion warnings
boost-1.84.0.beta1 boost-1.84.0
2023-11-08 09:07:13 +01:00
Oliver Kowalke
0bf820bbd6 Merge pull request #244 from the-moisrex/develop
Suppressing -Wsign-conversion warnings
2023-11-08 08:34:40 +01:00
Mohammad Bahoosh
dcf037830b Suppressing -Wsign-conversion warnings 2023-10-28 21:02:03 -08:00
Oliver Kowalke
51ba6ff480 Merge branch 'develop' 2023-10-01 17:03:41 +02:00
Oliver Kowalke
033ea19511 PPC64 file was accidentally commented out 2023-10-01 16:49:31 +02:00
Oliver Kowalke
0108919724 Merge pull request #240 from Felix-El/develop
CMake: Fix assembler `--defsym` format issue (qcc/qnx)
2023-10-01 16:30:11 +02:00
Oliver Kowalke
eb779a96c4 Merge pull request #236 from iv-m/fix-mac-os-condition
Fix check for BOOST_OS_MACOS
2023-10-01 16:29:29 +02:00
Felix L
1a7562348d CMake: Fix assembler --defsym format issue (qcc/qnx)
Adjust compile definitions to adhere to KEY=VALUE (where VALUE is empty string) so it builds with qcc.
2023-09-06 13:46:42 +02:00
Ivan A. Melnikov
0405a69432 Fix check for BOOST_OS_MACOS
BOOST_OS_MACOS is always defined; when we're not compiling
for Mac OS, it's just defined as zero. So, the correct
check is `#if BOOST_OS_MACOS`, because `#ifdef BOOST_OS_MACOS`
is true on any operating system.

Fixes: cc106be672
Reported-by: Ilya Kurdyukov <ilyakurdyukov@altlinux.org>
2023-08-18 15:57:26 +04:00
Oliver Kowalke
6fa6d5c50d Merge pull request #234 from iv-m/fix-build-on-riscv64
Fix ABI detection for empty 'os.platform'
2023-08-18 06:55:52 +02:00
Ivan A. Melnikov
819c2d6423 Fix ABI detection for empty 'os.platform'
`in` operator in bjam always returns true if its first
argument has no elements[1]. This means that if `os.platform`
is empty (not detected), the construction introduced
in commit d039c8e4da sets
ABI to `aapcs` on all platforms where `os.platform` is
empty, including, e.g. riscv64, and breaks build there.

This commit refactors the condition to use '=' operator,
to make sure that when `os.platform` is empty we get
the default ABI value, and thus fixes build on riscv64.

[1] https://www.boost.org/doc/libs/1_83_0/tools/build/doc/html/index.html#jam.language.flow_of_control

Fixes: d039c8e4da
2023-08-17 14:15:03 +04:00
Oliver Kowalke
65b179db28 Revert "Select assembly sources via preprocessor"
This reverts commit 2fb0373629.
boost-1.83.0
2023-07-22 17:23:17 +02:00
Nikita Kniazev
2fb0373629 Select assembly sources via preprocessor
Fixes cross-compilation abi and binformat detection.
`abi` and `binary-format` are now optional but can be used
to override autodetection.
boost-1.83.0.beta1
2023-06-14 16:57:32 +03:00
Oliver Kowalke
61e150ed88 Merge pull request #226 from ltrk2/bugfix/s390x-entry-point-arguments
Improve ABI conformance of s390x fcontext
2023-06-05 08:19:03 +02:00
Oliver Kowalke
eb11ac6a63 Merge pull request #225 from barracuda156/jamfile
Jamfile: sort out macOS ppc asm_sources
2023-06-05 08:18:33 +02:00
ltrk2
3bedb2d779 Improve ABI conformance of s390x fcontext 2023-05-15 12:47:56 -07:00
Sergey Fedorov
d57d28640d Jamfile: sort out macOS ppc asm_sources 2023-05-15 16:51:54 +08:00
Oliver Kowalke
f1adb9261f Merge pull request #224 from ltrk2/bugfix/s390x-entry-point-arguments
Store entry point arguments in fibre's own stack (s390x)
2023-05-12 06:32:55 +02:00
ltrk2
e4e3014f3e Store entry point arguments in fibre's own context (s390x) 2023-05-11 12:14:47 -07:00
Oliver Kowalke
6ee7363738 fix missing include for BOOST_ASSERT
- #212

In the version of protected_fixedsize_stack the include for BOOST_ASSERT was missing.
2023-03-24 13:17:40 +01:00
Oliver Kowalke
06864b9638 Merge pull request #221 from Kojoley/fix-arm-detection
Fix arm64 detection broken by recent B2 change
2023-03-24 13:05:32 +01:00
Nikita Kniazev
d039c8e4da Fix arm64 detection broken by recent B2 change 2023-03-23 16:23:07 +03:00
Oliver Kowalke
072846b698 Merge pull request #219 from nielsdos/fix-i386-alignment-2
Make sure the i386 sysv stack is aligned
2023-01-28 08:54:14 +01:00
Niels Dossche
0eb4263705 Make sure the i386 sysv stack is aligned
The previous fix had a typo in which the wrong offset was used which
meant that the alignment still wasn't correct. Fix this properly now.
2023-01-27 23:36:15 +01:00
Oliver Kowalke
be937bd602 Merge pull request #218 from nielsdos/fix-i386-alignment
Make sure the i386 sysv stack is aligned
2023-01-26 06:48:25 +01:00
Niels Dossche
e286649f08 Make sure the i386 sysv stack is aligned
SysV ABI requires a stack alignment of 16 bytes. Currently, for i386
with SysV ABI, the trampoline function is entered with an unaligned
stack. This causes problems for the context-function that is jumped to
as its stack is also unaligned. This causes a crash for our use-case
because the context function contains an SSE instruction which reads
from the stack. The SSE instruction requires the correct alignment.
Fix it by changing the 0x2c offset to 0x30, such that the stack remains
aligned.
2023-01-25 22:07:30 +01:00
Oliver Kowalke
26585ae675 Merge pull request #217 from jschueller/cet
sys/mman.h is unix-only
2023-01-23 19:43:23 +01:00
Julien Schueller
02050ae5ad sys/mman.h is unix-only 2023-01-23 18:36:36 +01:00
Oliver Kowalke
16e2c134b6 Merge pull request #215 from evanmiller/darwin-ppc32-fixes
Fixes for Darwin PPC32
2022-12-27 20:49:27 +01:00
Evan Miller
070d03fc7e Fixes for Darwin PPC32
For make_fcontext, use the diff provided here:

https://github.com/boostorg/context/issues/211#issuecomment-1328154669

For ontop_context, adapt the Linux PPC32 fixes from here:

df8fb6b528

Co-authored-by: George Koehler <kernigh@gmail.com>
2022-12-27 10:47:41 -05:00
Oliver Kowalke
5bcc1ab155 architecture flag for Apple's combined ha changed to 'arm+x86' 2022-12-23 11:14:10 +01:00
Oliver Kowalke
984f7893ce Merge pull request #213 from eduardvoronkin/fix_ucontext_macos
fix ucontext for MacOS
2022-12-17 11:38:47 +01:00