[openssl-users] 1.1.1 pre1 tests failing on Solaris SPARC

Michael Wojcik Michael.Wojcik at microfocus.com
Tue Feb 20 13:43:27 UTC 2018


> From: openssl-users [mailto:openssl-users-bounces at openssl.org] On Behalf
> Of Norm Green
> Sent: Monday, February 19, 2018 17:02
> To: Benjamin Kaduk; openssl-users at openssl.org
> Subject: Re: [openssl-users] 1.1.1 pre1 tests failing on Solaris SPARC
> 
> For the failure in secmemtst, it appears that secure memory is not
> enabled per this code in ./crypto/mem_sec.c
> 
>   23 /* e_os.h includes unistd.h, which defines _POSIX_VERSION */
>   24 #if !defined(OPENSSL_NO_SECURE_MEMORY) &&
> defined(OPENSSL_SYS_UNIX) \
>   25     && defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L
>   26 # define IMPLEMENTED
>   27 # include <stdlib.h>
>   28 # include <assert.h>
>   29 # include <unistd.h>
>   30 # include <sys/types.h>
>   31 # include <sys/mman.h>
>   32 # if defined(OPENSSL_SYS_LINUX)
>   33 #  include <sys/syscall.h>
>   34 #  include <linux/mman.h>
>   35 #  include <errno.h>
>   36 # endif
>   37 # include <sys/param.h>
>   38 # include <sys/stat.h>
>   39 # include <fcntl.h>
>   40 #endif
> 
> 
> 
> Solaris has this in sys/unistd.h
> 
> #ifndef _POSIX_VERSION
> #ifdef  _XPG6
> #define _POSIX_VERSION          200112L /* Supports IEEE Std 1003.1-2001 */
> #else
> #define _POSIX_VERSION          199506L /* Supports POSIX-1c DIS */
> #endif
> #endif /* _POSIX_VERSION */
> 
> I'm building with the native Oracle Solaris compiler which apparently
> does not define these macros.

Not by default. The comments in /usr/include/sys/feature_tests.h (on a Solaris system) explain this in excruciating detail, but in short you need either -DPOSIX_C_SOURCE=200112L or -D_XOPEN_SOURCE=600 (or the equivalent in the code) to compile with XPG6 (aka IEEE 1003.1-2001).

Solaris has always (well, since Solaris 2) been a bit cautious about making new standards the default, preferring backward compatibility as the default and requiring applications that want new features to set the appropriate feature macros. In this case, that's one of the two macros I listed above.

One of them should probably be added to the appropriate entries in Configure. I don't think it much matters which one; they ought to have the same effect, and neither is particularly clear to people who haven't had to dig into this stuff.

Disclaimer: I haven't tested this (in the OpenSSL case), just confirmed what feature_tests.h says.

-- 
Michael Wojcik 
Distinguished Engineer, Micro Focus 


More information about the openssl-users mailing list