Can OpenSSL 3.1.0 be compiled without atomic.h ?

Matt Caswell matt at
Fri Mar 31 07:58:47 UTC 2023

On 30/03/2023 22:50, Dennis Clarke via openssl-users wrote:
> So I was quite happy to see the compile run and crank and churn until :
> /opt/csw/gcc4/bin/gcc  -I. -Iinclude -Iproviders/common/include 
> -Iproviders/implementations/include  -fPIC -m32 -g -O0 -fno-builtin 
> -mno-app-regs -mhard-float -mno-faster-structs -mstd-struct-return 
> -mcpu=v8 -mno-v8plus -mno-vis -pthread -I/opt/bw/include 
> -D_LARGEFILE64_SOURCE -m32 -g -O0 -fno-builtin -mno-app-regs 
> -mhard-float -mno-faster-structs -mstd-struct-return -mcpu=v8 
> -mno-v8plus -mno-vis -DFILIO_H -DB_ENDIAN -DBN_DIV2W -DOPENSSL_PIC 
> -DOPENSSLDIR="\"/opt/bw/ssl\"" -DENGINESDIR="\"/opt/bw/lib/engines-3\"" 
> -DMODULESDIR="\"/opt/bw/lib/ossl-modules\"" -DOPENSSL_BUILDING_OPENSSL 
> crypto/libcrypto-lib-threads_pthread.d.tmp -MT 
> crypto/libcrypto-lib-threads_pthread.o -c -o 
> crypto/libcrypto-lib-threads_pthread.o crypto/threads_pthread.c
> crypto/threads_pthread.c:17:21: fatal error: atomic.h: No such file or 
> directory
> compilation terminated.
> gmake[1]: *** [Makefile:14613: crypto/libcrypto-lib-threads_pthread.o] 
> Error 1
> gmake[1]: Leaving directory 
> '/opt/bw/build/openssl-3.1.0_SunOS5.8_sun4m.001'
> gmake: *** [Makefile:2406: build_sw] Error 2
> Well gee.  That can be annoying.
> Any thoughts?

Hmmm. Most of the Solaris atomics code in the crypto/threads_pthread.c 
file seems to be conditioned on detecting Solaris 10 or 11:

# elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))

But the include of atomics.h at the top of the file just looks like this:

#if defined(__sun)
# include <atomic.h>

My guess is modifying that include to have the same check for Solaris 
10/11 as used elsewhere might force it through.


More information about the openssl-users mailing list