Fixes for NonStop builds on 3.5 to handle OS platform header file changes.

This changes handles the introduction of _POSIX_VERSION into the NonStop x86
header files that tricks OpenSSL into thinking that ucontext.h is available.

Fixes #28498

Signed-off-by: Randall S. Becker <randall.becker@nexbridge.ca>

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28769)

(cherry picked from commit fb2f239ca1)
This commit is contained in:
Randall S. Becker
2025-10-07 00:02:42 +01:00
committed by Tomas Mraz
parent 76af45fe62
commit 80a3c76913
3 changed files with 22 additions and 7 deletions

View File

@@ -168,6 +168,7 @@
# Build models
'nonstop-model-put' => {
template => 1,
disable => ['secure-memory'],
defines => ['_PUT_MODEL_',
'_REENTRANT', '_THREAD_SUPPORT_FUNCTIONS'],
ex_libs => '-lput',
@@ -177,6 +178,7 @@
# Build models
'nonstop-model-klt' => {
template => 1,
disable => ['secure-memory'],
defines => ['_KLT_MODEL_',
'_REENTRANT', '_THREAD_SUPPORT_FUNCTIONS'],
ex_libs => '-lklt',

View File

@@ -37,8 +37,7 @@ for each on the TNS/X (L-Series) platform:
The KLT threading model is a newly released model on NonStop. It implements
kernel-level threading. KLT provides much closer threading to what OpenSSL
uses for Linux-like threading models. KLT continues to use the pthread library
API. There is no supported 32-bit or Guardian builds for KLT. Note: KLT is
not currently available but is planned for post-2024.
API. There is no supported 32-bit or Guardian builds for KLT.
The SPT threading model is no longer supported as of OpenSSL 3.2.
@@ -53,6 +52,9 @@ instead of `nsx` in the set above.
You cannot build for TNS/E for FIPS, so you must specify the `no-fips`
option to `./Configure`.
TNS/E has moved to a limited support state, so fixes for this platform will not
be guaranteed in future.
Linking and Loading Considerations
----------------------------------
@@ -73,6 +75,12 @@ for NonStop builds. If you need to have `atexit()` functionality, set
register `OPENSSL_cleanup()` automatically. Preferably, you can explicitly call
`OPENSSL_cleanup()` from your application.
Secure Memory
-------------
The mechanism used by OpenSSL for secure memory is not supported on NonStop.
Use the `no-secure-memory` option when running `Configure`.
About Prefix and OpenSSLDir
---------------------------

View File

@@ -13,7 +13,8 @@
#if defined(OPENSSL_SYS_UNIX) \
&& defined(OPENSSL_THREADS) && !defined(OPENSSL_NO_ASYNC) \
&& !defined(__ANDROID__) && !defined(__OpenBSD__)
&& !defined(__ANDROID__) && !defined(__OpenBSD__) \
&& !defined(OPENSSL_SYS_TANDEM)
# include <unistd.h>
@@ -48,10 +49,14 @@
*/
# define USE_SWAPCONTEXT
# endif
# include <ucontext.h>
# ifndef USE_SWAPCONTEXT
# include <setjmp.h>
# endif
# if defined(OPENSSL_SYS_TANDEM)
# include <tdmsig.h>
# else
# include <ucontext.h>
# endif
# ifndef USE_SWAPCONTEXT
# include <setjmp.h>
# endif
typedef struct async_fibre_st {
ucontext_t fibre;