baffled on old Red Hat Enterprise Linux 6 with OpenSSL 3.0.3

Dennis Clarke dclarke at blastwave.org
Thu Jun 9 17:24:19 UTC 2022


* baffled *


After many many various incantations and a few coffee I can not get past
this strange nested pile of ifdef's to allow usleep() to exist :

make depend && make _build_sw
make[1]: Entering directory `/opt/bw/build/openssl-3.0.3_rhel6_amd64.004'
make[1]: Leaving directory `/opt/bw/build/openssl-3.0.3_rhel6_amd64.004'
make[1]: Entering directory `/opt/bw/build/openssl-3.0.3_rhel6_amd64.004'
/opt/bw/gcc12/bin/gcc  -I. -Iinclude -Iapps/include  -fPIC -pthread -g 
-O0 -fno-builtin -m64 -march=k8 -mtune=k8 -malign-double -mpc80 -mno-mmx 
-Wl,-rpath=/opt/bw/lib,--enable-new-dtags -std=iso9899:1999 -pedantic 
-pedantic-errors -g -O0 -fno-builtin -m64 -march=k8 -mtune=k8 
-malign-double -mpc80 -mno-mmx -Wl,-rpath=/opt/bw/lib,--enable-new-dtags 
-DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC 
-DOPENSSLDIR="\"/opt/bw/ssl\"" 
-DENGINESDIR="\"/opt/bw/lib64/engines-3\"" 
-DMODULESDIR="\"/opt/bw/lib64/ossl-modules\"" -DOPENSSL_BUILDING_OPENSSL 
-DNDEBUG -DPEDANTIC -DOPENSSL_SYS_UNIX -I/opt/bw/include 
-D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D__EXTENSIONS__ 
-D_EXTENSIONS_ -MMD -MF apps/lib/libapps-lib-app_libctx.d.tmp -MT 
apps/lib/libapps-lib-app_libctx.o -c -o 
apps/lib/libapps-lib-app_libctx.o apps/lib/app_libctx.c
In file included from include/openssl/types.h:20,
                  from apps/include/app_libctx.h:13,
                  from apps/lib/app_libctx.c:9:
include/openssl/e_os2.h:31: error: "OPENSSL_SYS_UNIX" redefined
    31 | # define OPENSSL_SYS_UNIX
       |
<command-line>: note: this is the location of the previous definition
In file included from apps/include/apps.h:13,
                  from apps/lib/app_libctx.c:10:
./e_os.h: In function 'ossl_sleep':
./e_os.h:312:5: error: implicit declaration of function 'usleep'; did 
you mean 'sleep'? [-Wimplicit-function-declaration]
   312 |     usleep(millis * 1000);
       |     ^~~~~~
       |     sleep
make[1]: *** [apps/lib/libapps-lib-app_libctx.o] Error 1
make[1]: Leaving directory `/opt/bw/build/openssl-3.0.3_rhel6_amd64.004'
make: *** [build_sw] Error 2


I am not sure what the environment wants or needs to get past this and I
would prefer to not go hacking at a header to force the function
ossl_sleep into existence. Also I can not seem to figure out what C 
standards the new OpenSSL 3 wants. Could be C90 per the old OpenSSL 1.x
or maybe we need C99. Regardless the whole show stops fast on RHEL6 and
yes I do have gcc 12.1.0 bootstrapped and tested as well as new binutils 
and a pile of other newish stuff. I have tried :

/opt/bw/bin/perl ./Configure linux-x86_64 no-asm --prefix=/opt/bw shared
  no-engine -DPEDANTIC -DOPENSSL_SYS_UNIX

However that won't work. So I have been tossing darts at the wall to see
what sticks but thus far everything fails.

     * * *  any helpful hints are accepted * * *


Here is the configdata.pm dump thingy :

Command line (with current working directory = .):

     /opt/bw/bin/perl ./Configure linux-x86_64 no-asm --prefix=/opt/bw 
shared no-engine -DPEDANTIC -DOPENSSL_SYS_UNIX

Perl information:

     /opt/bw/bin/perl
     5.36.0 for x86_64-linux-ld

Enabled features:

     aria
     async
     autoalginit
     autoerrinit
     autoload-config
     bf
     blake2
     bulk
     cached-fetch
     camellia
     cast
     chacha
     cmac
     cmp
     cms
     comp
     ct
     deprecated
     des
     dgram
     dh
     dsa
     dso
     dtls
     ec
     ec2m
     ecdh
     ecdsa
     err
     filenames
     gost
     idea
     legacy
     makedepend
     md4
     mdc2
     module
     multiblock
     nextprotoneg
     ocb
     ocsp
     pic
     pinshared
     poly1305
     posix-io
     psk
     rc2
     rc4
     rdrand
     rfc3779
     rmd160
     scrypt
     secure-memory
     seed
     shared
     siphash
     siv
     sm2
     sm3
     sm4
     sock
     srp
     srtp
     sse2
     ssl
     ssl-trace
     static-engine
     stdio
     tests
     threads
     tls
     ts
     ui-console
     whirlpool
     tls1
     tls1-method
     tls1_1
     tls1_1-method
     tls1_2
     tls1_2-method
     tls1_3
     dtls1
     dtls1-method
     dtls1_2
     dtls1_2-method

Disabled features:

     acvp-tests          [cascade]        OPENSSL_NO_ACVP_TESTS
     afalgeng            [cascade]        OPENSSL_NO_AFALGENG
     asan                [default]        OPENSSL_NO_ASAN
     asm                 [option]         OPENSSL_NO_ASM
     buildtest-c++       [default]
     capieng             [cascade]        OPENSSL_NO_CAPIENG
     crypto-mdebug       [default]        OPENSSL_NO_CRYPTO_MDEBUG
     devcryptoeng        [default]        OPENSSL_NO_DEVCRYPTOENG
     dynamic-engine      [cascade]
     ec_nistp_64_gcc_128 [default]        OPENSSL_NO_EC_NISTP_64_GCC_128
     egd                 [default]        OPENSSL_NO_EGD
     engine              [option]         OPENSSL_NO_ENGINE (skip 
engines, crypto/engine)
     external-tests      [default]        OPENSSL_NO_EXTERNAL_TESTS
     fips                [default]
     fips-securitychecks [cascade]        OPENSSL_NO_FIPS_SECURITYCHECKS
     fuzz-afl            [default]        OPENSSL_NO_FUZZ_AFL
     fuzz-libfuzzer      [default]        OPENSSL_NO_FUZZ_LIBFUZZER
     ktls                [default]        OPENSSL_NO_KTLS
     loadereng           [cascade]        OPENSSL_NO_LOADERENG
     md2                 [default]        OPENSSL_NO_MD2 (skip crypto/md2)
     msan                [default]        OPENSSL_NO_MSAN
     padlockeng          [cascade]        OPENSSL_NO_PADLOCKENG
     rc5                 [default]        OPENSSL_NO_RC5 (skip crypto/rc5)
     sctp                [default]        OPENSSL_NO_SCTP
     trace               [default]        OPENSSL_NO_TRACE
     ubsan               [default]        OPENSSL_NO_UBSAN
     unit-test           [default]        OPENSSL_NO_UNIT_TEST
     uplink              [no uplink_arch] OPENSSL_NO_UPLINK
     weak-ssl-ciphers    [default]        OPENSSL_NO_WEAK_SSL_CIPHERS
     zlib                [default]
     zlib-dynamic        [default]
     ssl3                [default]        OPENSSL_NO_SSL3
     ssl3-method         [default]        OPENSSL_NO_SSL3_METHOD

Config target attributes:

     AR => "ar",
     ARFLAGS => "qc",
     CC => "gcc",
     CFLAGS => "-Wall -O0 -g",
     CXX => "g++",
     CXXFLAGS => "-Wall -O0 -g",
     HASHBANGPERL => "/usr/bin/env perl",
     RANLIB => "ranlib",
     RC => "windres",
     asm_arch => "x86_64",
     bn_ops => "SIXTY_FOUR_BIT_LONG",
     build_file => "Makefile",
     build_scheme => [ "unified", "unix" ],
     cflags => "-pthread -g -O0 -fno-builtin -m64 -march=k8 -mtune=k8 
-malign-double -mpc80 -mno-mmx -Wl,-rpath=/opt/bw/lib,--enable-new-dtags",
     cppflags => "",
     cxxflags => "-std=c++11 -pthread -g -O0 -fno-builtin -m64 -march=k8 
-mtune=k8 -malign-double -mpc80 -mno-mmx 
-Wl,-rpath=/opt/bw/lib,--enable-new-dtags",
     defines => [ "OPENSSL_BUILDING_OPENSSL" ],
     disable => [  ],
     dso_ldflags => "-Wl,-z,defs",
     dso_scheme => "dlfcn",
     enable => [ "afalgeng" ],
     ex_libs => "-ldl -pthread",
     includes => [  ],
     lflags => "",
     lib_cflags => "",
     lib_cppflags => "-DOPENSSL_USE_NODELETE -DL_ENDIAN",
     lib_defines => [  ],
     module_cflags => "-fPIC",
     module_cxxflags => undef,
     module_ldflags => "-Wl,-znodelete -shared -Wl,-Bsymbolic",
     multilib => "64",
     perl_platform => "Unix",
     perlasm_scheme => "elf",
     shared_cflag => "-fPIC",
     shared_defflag => "-Wl,--version-script=",
     shared_defines => [  ],
     shared_ldflag => "-Wl,-znodelete -shared -Wl,-Bsymbolic",
     shared_rcflag => "",
     shared_sonameflag => "-Wl,-soname=",
     shared_target => "linux-shared",
     thread_defines => [  ],
     thread_scheme => "pthreads",
     unistd => "<unistd.h>",

Recorded environment:

     AR = /usr/bin/ar
     BUILDFILE =
     CC = /opt/bw/gcc12/bin/gcc
     CFLAGS = -std=iso9899:1999 -pedantic -pedantic-errors -g -O0 
-fno-builtin -m64 -march=k8 -mtune=k8 -malign-double -mpc80 -mno-mmx 
-Wl,-rpath=/opt/bw/lib,--enable-new-dtags
     CPPFLAGS = -I/opt/bw/include -D_POSIX_PTHREAD_SEMANTICS 
-D_LARGEFILE64_SOURCE -D__EXTENSIONS__ -D_EXTENSIONS_
     CROSS_COMPILE =
     CXX = /opt/bw/gcc12/bin/g++
     CXXFLAGS = -std=c++11 -pedantic -pedantic-errors -g -O0 
-fno-builtin -m64 -march=k8 -mtune=k8 -malign-double -mpc80 -mno-mmx 
-Wl,-rpath=/opt/bw/lib,--enable-new-dtags
     HASHBANGPERL =
     LDFLAGS =
     LDLIBS =
     OPENSSL_LOCAL_CONFIG_DIR =
     PERL = /opt/bw/bin/perl
     RANLIB = /usr/bin/ranlib
     RC =
     RCFLAGS =
     WINDRES =
     __CNF_CFLAGS =
     __CNF_CPPDEFINES =
     __CNF_CPPFLAGS =
     __CNF_CPPINCLUDES =
     __CNF_CXXFLAGS =
     __CNF_LDFLAGS =
     __CNF_LDLIBS =

Makevars:

     AR              = /usr/bin/ar
     ARFLAGS         = qc
     CC              = /opt/bw/gcc12/bin/gcc
     CFLAGS          = -std=iso9899:1999 -pedantic -pedantic-errors -g 
-O0 -fno-builtin -m64 -march=k8 -mtune=k8 -malign-double -mpc80 -mno-mmx 
-Wl,-rpath=/opt/bw/lib,--enable-new-dtags
     CPPDEFINES      = PEDANTIC OPENSSL_SYS_UNIX
     CPPFLAGS        = -I/opt/bw/include -D_POSIX_PTHREAD_SEMANTICS 
-D_LARGEFILE64_SOURCE -D__EXTENSIONS__ -D_EXTENSIONS_
     CPPINCLUDES     =
     CXX             = /opt/bw/gcc12/bin/g++
     CXXFLAGS        = -std=c++11 -pedantic -pedantic-errors -g -O0 
-fno-builtin -m64 -march=k8 -mtune=k8 -malign-double -mpc80 -mno-mmx 
-Wl,-rpath=/opt/bw/lib,--enable-new-dtags
     HASHBANGPERL    = /opt/bw/bin/perl
     LDFLAGS         =
     LDLIBS          =
     PERL            = /opt/bw/bin/perl
     RANLIB          = /usr/bin/ranlib
     RC              = windres
     RCFLAGS         =

NOTE: These variables only represent the configuration view.  The build file
template may have processed these variables further, please have a look 
at the
build file for more exact data:
     Makefile

build file:

     Makefile

build file templates:

     Configurations/common0.tmpl
     Configurations/unix-Makefile.tmpl


However the above is just whatever I have after a pile of guess and miss
and guess again and then miss again trials. It has almost become a game
with myself and a few friends watching this blow up over and over. At
the last guess I called out "what are the chances this works?" and the
reply from folks is "less than 10%". So far that has been correct.

So then ... what pray tell is the magic incantation whilst I face east
and bow to some silicon statue ?


-- 
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional


More information about the openssl-users mailing list