1b0d17251SchristosNOTES FOR THE HPE NONSTOP PLATFORM 2b0d17251Schristos============================== 3b0d17251Schristos 4b0d17251SchristosRequirement details 5b0d17251Schristos------------------- 6b0d17251Schristos 7b0d17251SchristosIn addition to the requirements and instructions listed 8b0d17251Schristosin [INSTALL.md](INSTALL.md), the following are required as well: 9b0d17251Schristos 10b0d17251Schristos * The TNS/X platform supports hardware randomization. 11b0d17251Schristos Specify the `--with-rand-seed=rdcpu` option to the `./Configure` script. 12b0d17251Schristos This is recommended but not required. `egd` is supported at 3.0 but cannot 13b0d17251Schristos be used if FIPS is selected. 14b0d17251Schristos * The TNS/E platform does not support hardware randomization, so 15b0d17251Schristos specify the `--with-rand-seed=egd` option to the `./Configure` script. 16b0d17251Schristos 17b0d17251SchristosAbout c99 compiler 18b0d17251Schristos------------------ 19b0d17251Schristos 20b0d17251SchristosThe c99 compiler is required for building OpenSSL from source. While c11 21b0d17251Schristosmay work, it has not been broadly tested. c99 is the only compiler 22b0d17251Schristosprerequisite needed to build OpenSSL 3.0 on this platform. You should also 23b0d17251Schristoshave the FLOSS package installed on your system. The ITUGLIB FLOSS package 24b0d17251Schristosis the only FLOSS variant that has been broadly tested. 25b0d17251Schristos 26b0d17251SchristosThreading Models 27b0d17251Schristos---------------- 28b0d17251Schristos 29b0d17251SchristosOpenSSL can be built using unthreaded, POSIX User Threads (PUT), or Standard 30b0d17251SchristosPOSIX Threads (SPT). Select the following build configuration for each on 31b0d17251Schristosthe TNS/X (L-Series) platform: 32b0d17251Schristos 33b0d17251Schristos * `nonstop-nsx` or default will select an unthreaded build. 34b0d17251Schristos * `nonstop-nsx_put` selects the PUT build. 35b0d17251Schristos * `nonstop-nsx_64_put` selects the 64 bit file length PUT build. 36b0d17251Schristos * `nonstop-nsx_spt_floss` selects the SPT build with FLOSS. FLOSS is 37b0d17251Schristos required for SPT builds because of a known hang when using SPT on its own. 38b0d17251Schristos 39b0d17251Schristos### TNS/E Considerations 40b0d17251Schristos 41b0d17251SchristosThe TNS/E platform is build using the same set of builds specifying `nse` 42b0d17251Schristosinstead of `nsx` in the set above. 43b0d17251Schristos 44b0d17251SchristosYou cannot build for TNS/E for FIPS, so you must specify the `no-fips` 45b0d17251Schristosoption to `./Configure`. 46b0d17251Schristos 474170684fSchristosLinking and Loading Considerations 484170684fSchristos---------------------------------- 494170684fSchristos 504170684fSchristosBecause of how the NonStop Common Runtime Environment (CRE) works, there are 514170684fSchristosrestrictions on how programs can link and load with OpenSSL libraries. 524170684fSchristosOn current NonStop platforms, programs cannot both statically link OpenSSL 534170684fSchristoslibraries and dynamically load OpenSSL shared libraries concurrently. If this 544170684fSchristosis done, there is a high probability of encountering a SIGSEGV condition 554170684fSchristosrelating to `atexit()` processing when a shared library is unloaded and when 564170684fSchristosthe program terminates. This limitation applies to all OpenSSL shared library 574170684fSchristoscomponents. 584170684fSchristos 59*0e2e28bcSchristosIt is possible to configure the build with `no-atexit` to avoid the SIGSEGV. 60*0e2e28bcSchristosPreferably, you can explicitly call `OPENSSL_cleanup()` from your application. 61*0e2e28bcSchristosIt is not mandatory as it just deallocates various global data structures 62*0e2e28bcSchristosOpenSSL allocated. 634170684fSchristos 64b0d17251SchristosAbout Prefix and OpenSSLDir 65b0d17251Schristos--------------------------- 66b0d17251Schristos 67b0d17251SchristosBecause there are many potential builds that must co-exist on any given 68b0d17251SchristosNonStop node, managing the location of your build distribution is crucial. 69b0d17251SchristosKeep each destination separate and distinct. Mixing any mode described in 70b0d17251Schristosthis document can cause application instability. The recommended approach 71b0d17251Schristosis to specify the OpenSSL version and threading model in your configuration 72b0d17251Schristosoptions, and keeping your memory and float options consistent, for example: 73b0d17251Schristos 74b0d17251Schristos * For 1.1 `--prefix=/usr/local-ssl1.1 --openssldir=/usr/local-ssl1.1/ssl` 75b0d17251Schristos * For 1.1 PUT `--prefix=/usr/local-ssl1.1_put --openssldir=/usr/local-ssl1.1_put/ssl` 76b0d17251Schristos 77b0d17251SchristosAs of 3.0, the NonStop configurations use the multilib attribute to distinguish 78b0d17251Schristosbetween different models: 79b0d17251Schristos 80b0d17251Schristos * For 3.0 `--prefix=/usr/local-ssl3.0 --openssldir=/usr/local-ssl3.0/ssl` 81b0d17251Schristos 82b0d17251SchristosThe PUT model is placed in `${prefix}/lib-put` for 32-bit models and 83b0d17251Schristos`${prefix}/lib64-put` for 64-bit models. 84b0d17251Schristos 85b0d17251SchristosUse the `_RLD_LIB_PATH` environment variable in OSS to select the appropriate 86b0d17251Schristosdirectory containing `libcrypto.so` and `libssl.so`. In GUARDIAN, use the 87b0d17251Schristos`=_RLD_LIB_PATH` search define to locate the GUARDIAN subvolume where OpenSSL 88b0d17251Schristosis installed. 89b0d17251Schristos 90b0d17251SchristosFloat Considerations 91b0d17251Schristos-------------------- 92b0d17251Schristos 93b0d17251SchristosOpenSSL is built using IEEE Float mode by default. If you need a different 94b0d17251SchristosIEEE mode, create a new configuration specifying `tfloat-x86-64` (for Tandem 95b0d17251SchristosFloat) or `nfloat-x86-64` (for Neutral Float). 96b0d17251Schristos 97b0d17251SchristosMemory Models 98b0d17251Schristos------------- 99b0d17251Schristos 100b0d17251SchristosThe current OpenSSL default memory model uses the default platform address 101b0d17251Schristosmodel. If you need a different address model, you must specify the appropriate 102b0d17251Schristosc99 options for compile (`CFLAGS`) and linkers (`LDFLAGS`). 103b0d17251Schristos 104b0d17251SchristosCross Compiling on Windows 105b0d17251Schristos-------------------------- 106b0d17251Schristos 107b0d17251SchristosTo configure and compile OpenSSL, you will need to set up a Cygwin environment. 108b0d17251SchristosThe Cygwin tools should include bash, make, and any other normal tools required 109b0d17251Schristosfor building programs. 110b0d17251Schristos 111b0d17251SchristosYour `PATH` must include the bin directory for the c99 cross-compiler, as in: 112b0d17251Schristos 113b0d17251Schristos export PATH=/cygdrive/c/Program\ Files\ \(x86\)/HPE\ NonStop/L16.05/usr/bin:$PATH 114b0d17251Schristos 115b0d17251SchristosThis should be set before Configure is run. For the c99 cross-compiler to work 116b0d17251Schristoscorrectly, you also need the `COMP_ROOT` set, as in: 117b0d17251Schristos 118b0d17251Schristos export COMP_ROOT="C:\Program Files (x86)\HPE NonStop\L16.05" 119b0d17251Schristos 120b0d17251Schristos`COMP_ROOT` needs to be in Windows form. 121b0d17251Schristos 122b0d17251Schristos`Configure` must specify the `no-makedepend` option otherwise errors will 123b0d17251Schristosresult when running the build because the c99 cross-compiler does not support 124b0d17251Schristosthe `gcc -MT` option. An example of a `Configure` command to be run from the 125b0d17251SchristosOpenSSL directory is: 126b0d17251Schristos 127b0d17251Schristos ./Configure nonstop-nsx_64 no-makedepend --with-rand-seed=rdcpu 128b0d17251Schristos 129b0d17251SchristosDo not forget to include any OpenSSL cross-compiling prefix and certificate 130b0d17251Schristosoptions when creating your libraries. 131b0d17251Schristos 132b0d17251SchristosThe OpenSSL test suite will not run on your workstation. In order to verify the 133b0d17251Schristosbuild, you will need to perform the build and test steps in OSS in your NonStop 134b0d17251Schristosserver. You can also build under gcc and run the test suite for Windows but that 135b0d17251Schristosis not equivalent. 136b0d17251Schristos 137b0d17251Schristos**Note:** In the event that you are attempting a FIPS-compliant cross-compile, 138b0d17251Schristosbe aware that signatures may not match between builds done under OSS and under 139b0d17251Schristoscross-compiles as the compilers do not necessarily generate identical objects. 140b0d17251SchristosAnything and everything to do with FIPS is outside the scope of this document. 141b0d17251SchristosRefer to the FIPS security policy for more information. 142b0d17251Schristos 143b0d17251SchristosThe following build configurations have been successfully attempted at one 144b0d17251Schristospoint or another. If you are successful in your cross-compile efforts, please 145b0d17251Schristosupdate this list: 146b0d17251Schristos 147b0d17251Schristos- nonstop-nsx_64 148b0d17251Schristos- nonstop-nsx_64_put 149b0d17251Schristos 150b0d17251Schristos**Note:** Cross-compile builds for TNS/E have not been attempted, but should 151b0d17251Schristosfollow the same considerations as for TNS/X above. SPT builds generally require 152b0d17251SchristosFLOSS, which is not available for workstation builds. As a result, SPT builds 153b0d17251Schristosof OpenSSL cannot be cross-compiled. 154b0d17251Schristos 155b0d17251SchristosAlso see the NSDEE discussion below for more historical information. 156b0d17251Schristos 157b0d17251SchristosCross Compiling with NSDEE 158b0d17251Schristos-------------------------- 159b0d17251Schristos 160b0d17251Schristos**Note:** None of these builds have been tested by the platform maintainer and 161b0d17251Schristosare supplied for historical value. Please submit a Pull Request to OpenSSL 162b0d17251Schristosshould these need to be adjusted. 163b0d17251Schristos 164b0d17251SchristosIf you are attempting to build OpenSSL with NSDEE, you will need to specify 165b0d17251Schristosthe following variables. The following set of compiler defines are required: 166b0d17251Schristos 167b0d17251Schristos # COMP_ROOT must be a full path for the build system (e.g. windows) 168b0d17251Schristos COMP_ROOT=$(cygpath -w /path/to/comp_root) 169b0d17251Schristos # CC must be executable by your shell 170b0d17251Schristos CC=/path/to/c99 171b0d17251Schristos 172b0d17251Schristos### Optional Build Variables 173b0d17251Schristos 174b0d17251Schristos DBGFLAG="--debug" 175b0d17251Schristos CIPHENABLES="enable-ssl3 enable-ssl3-method enable-weak-ssl-ciphers enable-rc4" 176b0d17251Schristos 177b0d17251Schristos### Internal Known TNS/X to TNS/E Cross Compile Variables 178b0d17251Schristos 179b0d17251SchristosThe following definition is required if you are building on TNS/X for TNS/E 180b0d17251Schristosand have access to a TNS/E machine on your EXPAND network - with an example 181b0d17251Schristosnode named `\CS3`: 182b0d17251Schristos 183b0d17251Schristos SYSTEMLIBS="-L/E/cs3/usr/local/lib" 184b0d17251Schristos 185b0d17251SchristosVersion Procedure (VPROC) Considerations 186b0d17251Schristos---------------------------------------- 187b0d17251Schristos 188b0d17251SchristosIf you require a VPROC entry for platform version identification, use the 189b0d17251Schristosfollowing variables: 190b0d17251Schristos 191b0d17251Schristos### For Itanium 192b0d17251Schristos 193b0d17251Schristos OPENSSL_VPROC_PREFIX=T0085H06 194b0d17251Schristos 195b0d17251Schristos### For x86 196b0d17251Schristos 197b0d17251Schristos OPENSSL_VPROC_PREFIX=T0085L01 198b0d17251Schristos 199b0d17251Schristos### Common Definition 200b0d17251Schristos 201b0d17251Schristos export OPENSSL_VPROC=${OPENSSL_VPROC_PREFIX}_$( 202b0d17251Schristos . VERSION.dat 203b0d17251Schristos if [ -n "$PRE_RELEASE_TAG" ]; then 204b0d17251Schristos PRE_RELEASE_TAG="-$PRE_RELEASE_TAG" 205b0d17251Schristos fi 206b0d17251Schristos if [ -n "$BUILD_METADATA" ]; then 207b0d17251Schristos BUILD_METADATA="+$BUILD_METADATA" 208b0d17251Schristos fi 209b0d17251Schristos echo "$MAJOR.$MINOR.$PATCH$PRE_RELEASE_TAG$BUILD_METADATA" |\ 210b0d17251Schristos sed -e 's/[-.+]/_/g' 211b0d17251Schristos ) 212b0d17251Schristos 213b0d17251SchristosExample Configure Targets 214b0d17251Schristos------------------------- 215b0d17251Schristos 216b0d17251SchristosFor OSS targets, the main DLL names will be `libssl.so` and `libcrypto.so`. 217b0d17251SchristosFor GUARDIAN targets, DLL names will be `ssl` and `crypto`. The following 218b0d17251Schristosassumes that your PWD is set according to your installation standards. 219b0d17251Schristos 220b0d17251Schristos ./Configure nonstop-nsx --prefix=${PWD} \ 221b0d17251Schristos --openssldir=${PWD}/ssl no-threads \ 222b0d17251Schristos --with-rand-seed=rdcpu ${CIPHENABLES} ${DBGFLAG} ${SYSTEMLIBS} 223b0d17251Schristos ./Configure nonstop-nsx_g --prefix=${PWD} \ 224b0d17251Schristos --openssldir=${PWD}/ssl no-threads \ 225b0d17251Schristos --with-rand-seed=rdcpu ${CIPHENABLES} ${DBGFLAG} ${SYSTEMLIBS} 226b0d17251Schristos ./Configure nonstop-nsx_put --prefix=${PWD} \ 227b0d17251Schristos --openssldir=${PWD}/ssl threads "-D_REENTRANT" \ 228b0d17251Schristos --with-rand-seed=rdcpu ${CIPHENABLES} ${DBGFLAG} ${SYSTEMLIBS} 229b0d17251Schristos ./Configure nonstop-nsx_spt_floss --prefix=${PWD} \ 230b0d17251Schristos --openssldir=${PWD}/ssl threads "-D_REENTRANT" \ 231b0d17251Schristos --with-rand-seed=rdcpu ${CIPHENABLES} ${DBGFLAG} ${SYSTEMLIBS} 232b0d17251Schristos ./Configure nonstop-nsx_64 --prefix=${PWD} \ 233b0d17251Schristos --openssldir=${PWD}/ssl no-threads \ 234b0d17251Schristos --with-rand-seed=rdcpu ${CIPHENABLES} ${DBGFLAG} ${SYSTEMLIBS} 235b0d17251Schristos ./Configure nonstop-nsx_64_put --prefix=${PWD} \ 236b0d17251Schristos --openssldir=${PWD}/ssl threads "-D_REENTRANT" \ 237b0d17251Schristos --with-rand-seed=rdcpu ${CIPHENABLES} ${DBGFLAG} ${SYSTEMLIBS} 238b0d17251Schristos ./Configure nonstop-nsx_g_tandem --prefix=${PWD} \ 239b0d17251Schristos --openssldir=${PWD}/ssl no-threads \ 240b0d17251Schristos --with-rand-seed=rdcpu ${CIPHENABLES} ${DBGFLAG} ${SYSTEMLIBS} 241b0d17251Schristos 242b0d17251Schristos ./Configure nonstop-nse --prefix=${PWD} \ 243b0d17251Schristos --openssldir=${PWD}/ssl no-threads \ 244b0d17251Schristos --with-rand-seed=egd ${CIPHENABLES} ${DBGFLAG} ${SYSTEMLIBS} 245b0d17251Schristos ./Configure nonstop-nse_g --prefix=${PWD} \ 246b0d17251Schristos --openssldir=${PWD}/ssl no-threads \ 247b0d17251Schristos --with-rand-seed=egd ${CIPHENABLES} ${DBGFLAG} ${SYSTEMLIBS} 248b0d17251Schristos ./Configure nonstop-nse_put --prefix=${PWD} \ 249b0d17251Schristos --openssldir=${PWD}/ssl threads "-D_REENTRANT" \ 250b0d17251Schristos --with-rand-seed=egd ${CIPHENABLES} ${DBGFLAG} ${SYSTEMLIBS} 251b0d17251Schristos ./Configure nonstop-nse_spt_floss --prefix=${PWD} \ 252b0d17251Schristos --openssldir=${PWD}/ssl threads "-D_REENTRANT" \ 253b0d17251Schristos --with-rand-seed=egd ${CIPHENABLES} ${DBGFLAG} ${SYSTEMLIBS} 254b0d17251Schristos ./Configure nonstop-nse_64 --prefix=${PWD} \ 255b0d17251Schristos --openssldir=${PWD}/ssl no-threads \ 256b0d17251Schristos --with-rand-seed=egd ${CIPHENABLES} ${DBGFLAG} ${SYSTEMLIBS} 257b0d17251Schristos ./Configure nonstop-nse_64_put --prefix=${PWD} \ 258b0d17251Schristos --openssldir=${PWD}/ssl threads "-D_REENTRANT" 259b0d17251Schristos --with-rand-seed=egd ${CIPHENABLES} ${DBGFLAG} ${SYSTEMLIBS} 260b0d17251Schristos ./Configure nonstop-nse_g_tandem --prefix=${PWD} \ 261b0d17251Schristos --openssldir=${PWD}/ssl no-threads \ 262b0d17251Schristos --with-rand-seed=egd ${CIPHENABLES} ${DBGFLAG} ${SYSTEMLIBS} 263