Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build breakage in OpenSSL 3.0.4 when building with no-rfc3779 #18619

Closed
thesamesam opened this issue Jun 21, 2022 · 12 comments
Closed

Build breakage in OpenSSL 3.0.4 when building with no-rfc3779 #18619

thesamesam opened this issue Jun 21, 2022 · 12 comments
Labels
branch: master Merge to master branch branch: 1.1.1 Merge to OpenSSL_1_1_1-stable branch branch: 3.0 Merge to openssl-3.0 branch severity: regression The issue/pr is a regression from previous released version triaged: bug The issue/pr is/fixes a bug

Comments

@thesamesam
Copy link
Contributor

thesamesam commented Jun 21, 2022

Noticed when packaging OpenSSL 3.0.4 for Gentoo. OpenSSL 3.0.3 is fine.

The following warnings (manifested as errors for me as I build with -Werror=implicit-function-declaration) occur when building tests:

test/v3ext.c: In function 'test_asid':
test/v3ext.c:43:5: error: unknown type name 'ASIdentifiers'
   43 |     ASIdentifiers *asid1 = ASIdentifiers_new(), *asid2 = ASIdentifiers_new(),
      |     ^~~~~~~~~~~~~
test/v3ext.c:43:28: error: implicit declaration of function 'ASIdentifiers_new' [-Werror=implicit-function-declaration]
   43 |     ASIdentifiers *asid1 = ASIdentifiers_new(), *asid2 = ASIdentifiers_new(),
      |                            ^~~~~~~~~~~~~~~~~
test/v3ext.c:43:28: warning: initialization of 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
test/v3ext.c:43:58: warning: initialization of 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
   43 |     ASIdentifiers *asid1 = ASIdentifiers_new(), *asid2 = ASIdentifiers_new(),
      |                                                          ^~~~~~~~~~~~~~~~~
test/v3ext.c:44:28: warning: initialization of 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
   44 |                   *asid3 = ASIdentifiers_new(), *asid4 = ASIdentifiers_new();
      |                            ^~~~~~~~~~~~~~~~~
test/v3ext.c:44:58: warning: initialization of 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
   44 |                   *asid3 = ASIdentifiers_new(), *asid4 = ASIdentifiers_new();
      |                                                          ^~~~~~~~~~~~~~~~~
In file included from test/v3ext.c:16:
test/v3ext.c:56:20: error: implicit declaration of function 'X509v3_asid_add_id_or_range' [-Werror=implicit-function-declaration]
   56 |     if (!TEST_true(X509v3_asid_add_id_or_range(asid1, V3_ASID_ASNUM, val1, NULL)))
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
test/testutil.h:469:66: note: in definition of macro 'TEST_true'
  469 | # define TEST_true(a)         test_true(__FILE__, __LINE__, #a, (a) != 0)
      |                                                                  ^
test/v3ext.c:56:55: error: 'V3_ASID_ASNUM' undeclared (first use in this function)
   56 |     if (!TEST_true(X509v3_asid_add_id_or_range(asid1, V3_ASID_ASNUM, val1, NULL)))
      |                                                       ^~~~~~~~~~~~~
test/testutil.h:469:66: note: in definition of macro 'TEST_true'
  469 | # define TEST_true(a)         test_true(__FILE__, __LINE__, #a, (a) != 0)
      |                                                                  ^
test/v3ext.c:56:55: note: each undeclared identifier is reported only once for each function it appears in
   56 |     if (!TEST_true(X509v3_asid_add_id_or_range(asid1, V3_ASID_ASNUM, val1, NULL)))
      |                                                       ^~~~~~~~~~~~~
test/testutil.h:469:66: note: in definition of macro 'TEST_true'
  469 | # define TEST_true(a)         test_true(__FILE__, __LINE__, #a, (a) != 0)
      |                                                                  ^
test/v3ext.c:83:20: error: implicit declaration of function 'X509v3_asid_subset' [-Werror=implicit-function-declaration]
   83 |     if (!TEST_true(X509v3_asid_subset(NULL, NULL))
      |                    ^~~~~~~~~~~~~~~~~~
test/testutil.h:469:66: note: in definition of macro 'TEST_true'
  469 | # define TEST_true(a)         test_true(__FILE__, __LINE__, #a, (a) != 0)
      |                                                                  ^
test/v3ext.c:110:5: error: implicit declaration of function 'ASIdentifiers_free' [-Werror=implicit-function-declaration]
  110 |     ASIdentifiers_free(asid1);
      |     ^~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
chmod a+x util/wrap.pl
x86_64-pc-linux-gnu-gcc -m32  -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include  -DAES_ASM -DCMLL_ASM -DDES_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DRMD160_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -fPIC -pthread -Wa,--noexecstack -O2 -pipe -march=native -fdiagnostics-color=always -frecord-gcc-switches -ggdb3 -fno-strict-aliasing -Wa,--noexecstack -Werror=format-security -Werror=implicit-function-declaration -Wformat -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSLDIR="\"/etc/ssl\"" -DENGINESDIR="\"/usr/lib/engines-3\"" -DMODULESDIR="\"/usr/lib/ossl-modules\"" -DOPENSSL_BUILDING_OPENSSL -DNDEBUG  -c -o crypto/chacha/libcrypto-lib-chacha-x86.o crypto/chacha/chacha-x86.S
x86_64-pc-linux-gnu-gcc -m32  -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include  -DAES_ASM -DCMLL_ASM -DDES_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DRMD160_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -fPIC -pthread -Wa,--noexecstack -O2 -pipe -march=native -fdiagnostics-color=always -frecord-gcc-switches -ggdb3 -fno-strict-aliasing -Wa,--noexecstack -Werror=format-security -Werror=implicit-function-declaration -Wformat -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSLDIR="\"/etc/ssl\"" -DENGINESDIR="\"/usr/lib/engines-3\"" -DMODULESDIR="\"/usr/lib/ossl-modules\"" -DOPENSSL_BUILDING_OPENSSL -DNDEBUG  -c -o crypto/des/libcrypto-lib-crypt586.o crypto/des/crypt586.S
make[1]: *** [Makefile:21534: test/v3ext-bin-v3ext.o] Error 1
make[1]: *** Waiting for unfinished jobs....
x86_64-pc-linux-gnu-ranlib apps/libapps.a || echo Never mind.
make[1]: Leaving directory '/var/tmp/portage/dev-libs/openssl-3.0.4/work/openssl-3.0.4-abi_x86_32.x86'
make: *** [Makefile:1002: build_sw] Error 2
 * ERROR: dev-libs/openssl-3.0.4::gentoo failed (compile phase):
 *   emake failed

Full build.log: build.log

$ perl configdata.pm --dump

Command line (with current working directory = .):

    /usr/bin/perl ./Configure linux-elf enable-camellia enable-ec enable-ec2m enable-sm2 enable-srp enable-idea enable-mdc2 enable-rc5 enable-asm no-ktls no-rfc3779 no-sctp no-zlib no-weak-ssl-ciphers --prefix=/usr --openssldir=/etc/ssl --libdir=lib shared threads

Perl information:

    /usr/bin/perl
    5.36.0 for x86_64-linux

Enabled features:

    afalgeng
    aria
    asm
    async
    autoalginit
    autoerrinit
    autoload-config
    bf
    blake2
    bulk
    cached-fetch
    camellia
    capieng
    cast
    chacha
    cmac
    cmp
    cms
    comp
    ct
    deprecated
    des
    dgram
    dh
    dsa
    dso
    dtls
    dynamic-engine
    ec
    ec2m
    ecdh
    ecdsa
    engine
    err
    filenames
    gost
    idea
    legacy
    loadereng
    makedepend
    md4
    mdc2
    module
    multiblock
    nextprotoneg
    ocb
    ocsp
    padlockeng
    pic
    pinshared
    poly1305
    posix-io
    psk
    rc2
    rc4
    rc5
    rdrand
    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
    asan                [default]        OPENSSL_NO_ASAN
    buildtest-c++       [default]
    crypto-mdebug       [default]        OPENSSL_NO_CRYPTO_MDEBUG
    devcryptoeng        [default]        OPENSSL_NO_DEVCRYPTOENG
    ec_nistp_64_gcc_128 [default]        OPENSSL_NO_EC_NISTP_64_GCC_128
    egd                 [default]        OPENSSL_NO_EGD
    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                [option]         OPENSSL_NO_KTLS
    md2                 [default]        OPENSSL_NO_MD2 (skip crypto/md2)
    msan                [default]        OPENSSL_NO_MSAN
    rfc3779             [option]         OPENSSL_NO_RFC3779
    sctp                [option]         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    [option]         OPENSSL_NO_WEAK_SSL_CIPHERS
    zlib                [option]
    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 -O3 -fomit-frame-pointer",
    CXX => "g++",
    CXXFLAGS => "-Wall -O3",
    HASHBANGPERL => "/usr/bin/env perl",
    RANLIB => "ranlib",
    RC => "windres",
    asm_arch => "x86",
    bn_ops => "BN_LLONG",
    build_file => "Makefile",
    build_scheme => [ "unified", "unix" ],
    cflags => "-pthread",
    cppflags => "",
    cxxflags => "-std=c++11 -pthread",
    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",
    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 = x86_64-pc-linux-gnu-ar
    ARFLAGS =
    AS =
    ASFLAGS =
    BUILDFILE =
    CC = x86_64-pc-linux-gnu-gcc -m32
    CFLAGS =
    CPP =
    CPPDEFINES =
    CPPFLAGS =
    CPPINCLUDES =
    CROSS_COMPILE =
    CXX = x86_64-pc-linux-gnu-g++ -m32
    CXXFLAGS = -O2 -pipe -march=native -fdiagnostics-color=always -frecord-gcc-switches -D_GLIBCXX_ASSERTIONS -ggdb3 -fno-strict-aliasing -Wa,--noexecstack -Werror=format-security -Wformat
    HASHBANGPERL =
    LD = x86_64-pc-linux-gnu-ld -m elf_i386
    LDFLAGS =
    LDLIBS =
    MT =
    MTFLAGS =
    OPENSSL_LOCAL_CONFIG_DIR =
    PERL =
    RANLIB = x86_64-pc-linux-gnu-ranlib
    RC = windres
    RCFLAGS =
    RM =
    __CNF_CFLAGS =
    __CNF_CPPDEFINES =
    __CNF_CPPFLAGS =
    __CNF_CPPINCLUDES =
    __CNF_CXXFLAGS =
    __CNF_LDFLAGS =
    __CNF_LDLIBS =

Makevars:

    AR              = x86_64-pc-linux-gnu-ar
    ARFLAGS         = qc
    CC              = x86_64-pc-linux-gnu-gcc -m32
    CFLAGS          =
    CPPDEFINES      =
    CPPFLAGS        =
    CPPINCLUDES     =
    CXX             = x86_64-pc-linux-gnu-g++ -m32
    CXXFLAGS        = -O2 -pipe -march=native -fdiagnostics-color=always -frecord-gcc-switches -D_GLIBCXX_ASSERTIONS -ggdb3 -fno-strict-aliasing -Wa,--noexecstack -Werror=format-security -Wformat
    HASHBANGPERL    = /usr/bin/env perl
    LD              = x86_64-pc-linux-gnu-ld -m elf_i386
    LDFLAGS         =
    LDLIBS          =
    PERL            = /usr/bin/perl
    RANLIB          = x86_64-pc-linux-gnu-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
@thesamesam thesamesam added the issue: bug report The issue was opened to report a bug label Jun 21, 2022
@thesamesam thesamesam changed the title Implicit function declaration warnings in OpenSSL 3.0.4 when buildin getsts Implicit function declaration warnings in OpenSSL 3.0.4 when building tests Jun 21, 2022
@thesamesam
Copy link
Contributor Author

CC @tmshort / @mattcaswell.

Introduced in 01fc9b6 via #18514.

@thesamesam
Copy link
Contributor Author

thesamesam commented Jun 21, 2022

Ditto 1.1.1p is broken (1.1.1o is fine).

@thesamesam
Copy link
Contributor Author

I can't check whether this surfaced in CI as a warning because make -s is used rather than make which silences output.

@levitte
Copy link
Member

levitte commented Jun 22, 2022

I wonder why our Github actions didn't catch this. They do use --strict-warnings when configuring, and yet, this sort of error doesn't seem to surface...

@t8m
Copy link
Member

t8m commented Jun 22, 2022

I wonder why our Github actions didn't catch this. They do use --strict-warnings when configuring, and yet, this sort of error doesn't seem to surface...

We do not have no-rfc3779 build.

@t8m t8m added branch: master Merge to master branch branch: 1.1.1 Merge to OpenSSL_1_1_1-stable branch triaged: bug The issue/pr is/fixes a bug branch: 3.0 Merge to openssl-3.0 branch severity: regression The issue/pr is a regression from previous released version and removed issue: bug report The issue was opened to report a bug labels Jun 22, 2022
@levitte
Copy link
Member

levitte commented Jun 22, 2022

I wonder why our Github actions didn't catch this. They do use --strict-warnings when configuring, and yet, this sort of error doesn't seem to surface...

We do not have no-rfc3779 build.

Ah, that's the culprit? Okie...

@Sp1l
Copy link
Contributor

Sp1l commented Jun 22, 2022

Build failure on FreeBSD 13.1, 12.3 both amd64 and i386
FreeBSD clang version 13.0.0

--- test/v3ext.o ---
test/v3ext.c:43:5: error: use of undeclared identifier 'ASIdentifiers'
    ASIdentifiers *asid1 = ASIdentifiers_new(), *asid2 = ASIdentifiers_new(),
    ^
test/v3ext.c:43:20: error: use of undeclared identifier 'asid1'
    ASIdentifiers *asid1 = ASIdentifiers_new(), *asid2 = ASIdentifiers_new(),
                   ^
test/v3ext.c:43:28: warning: implicit declaration of function 'ASIdentifiers_new' is invalid in C99 [-Wimplicit-function-declaration]
    ASIdentifiers *asid1 = ASIdentifiers_new(), *asid2 = ASIdentifiers_new(),
                           ^
test/v3ext.c:43:50: error: use of undeclared identifier 'asid2'
    ASIdentifiers *asid1 = ASIdentifiers_new(), *asid2 = ASIdentifiers_new(),
                                                 ^
test/v3ext.c:44:20: error: use of undeclared identifier 'asid3'
                  *asid3 = ASIdentifiers_new(), *asid4 = ASIdentifiers_new();
                   ^
test/v3ext.c:44:50: error: use of undeclared identifier 'asid4'
                  *asid3 = ASIdentifiers_new(), *asid4 = ASIdentifiers_new();
                                                 ^
test/v3ext.c:47:19: error: use of undeclared identifier 'asid1'
    if (!TEST_ptr(asid1)
                  ^
test/v3ext.c:48:26: error: use of undeclared identifier 'asid2'
            || !TEST_ptr(asid2)
                         ^
test/v3ext.c:49:26: error: use of undeclared identifier 'asid3'
            || !TEST_ptr(asid3))
                         ^
test/v3ext.c:56:20: warning: implicit declaration of function 'X509v3_asid_add_id_or_range' is invalid in C99 [-Wimplicit-function-declaration]
    if (!TEST_true(X509v3_asid_add_id_or_range(asid1, V3_ASID_ASNUM, val1, NULL)))
                   ^
test/v3ext.c:56:48: error: use of undeclared identifier 'asid1'
    if (!TEST_true(X509v3_asid_add_id_or_range(asid1, V3_ASID_ASNUM, val1, NULL)))
                                               ^
test/v3ext.c:56:55: error: use of undeclared identifier 'V3_ASID_ASNUM'
    if (!TEST_true(X509v3_asid_add_id_or_range(asid1, V3_ASID_ASNUM, val1, NULL)))
                                                      ^
test/v3ext.c:64:48: error: use of undeclared identifier 'asid2'
    if (!TEST_true(X509v3_asid_add_id_or_range(asid2, V3_ASID_ASNUM, val2, NULL)))
                                               ^
test/v3ext.c:64:55: error: use of undeclared identifier 'V3_ASID_ASNUM'
    if (!TEST_true(X509v3_asid_add_id_or_range(asid2, V3_ASID_ASNUM, val2, NULL)))
                                                      ^
test/v3ext.c:78:48: error: use of undeclared identifier 'asid3'
    if (!TEST_true(X509v3_asid_add_id_or_range(asid3, V3_ASID_ASNUM, val1, val2)))
                                               ^
test/v3ext.c:78:55: error: use of undeclared identifier 'V3_ASID_ASNUM'
    if (!TEST_true(X509v3_asid_add_id_or_range(asid3, V3_ASID_ASNUM, val1, val2)))
                                                      ^
test/v3ext.c:83:20: warning: implicit declaration of function 'X509v3_asid_subset' is invalid in C99 [-Wimplicit-function-declaration]
    if (!TEST_true(X509v3_asid_subset(NULL, NULL))
                   ^
test/v3ext.c:84:52: error: use of undeclared identifier 'asid1'
            || !TEST_true(X509v3_asid_subset(NULL, asid1))
                                                   ^
test/v3ext.c:85:46: error: use of undeclared identifier 'asid1'
            || !TEST_true(X509v3_asid_subset(asid1, asid1))
                                             ^
test/v3ext.c:85:53: error: use of undeclared identifier 'asid1'
            || !TEST_true(X509v3_asid_subset(asid1, asid1))
                                                    ^
test/v3ext.c:86:46: error: use of undeclared identifier 'asid2'
            || !TEST_true(X509v3_asid_subset(asid2, asid2))
                                             ^
test/v3ext.c:86:53: error: use of undeclared identifier 'asid2'
            || !TEST_true(X509v3_asid_subset(asid2, asid2))
                                                    ^

@mattcaswell
Copy link
Member

We do not have no-rfc3779 build.

Hmmm. That's annoying - how did we miss that? It perhaps should be included in "no-bulk".

I guess that means the workaround for this problem is to not use "no-rfc3779" on the Configure line.

@t8m t8m changed the title Implicit function declaration warnings in OpenSSL 3.0.4 when building tests Build breakage in OpenSSL 3.0.4 when building with no-rfc3779 Jun 22, 2022
@bernd-edlinger
Copy link
Member

Possible fix in #18188

@mattcaswell
Copy link
Member

Possible fix in #18188

Could you pull the fixing commit out into a separate PR? #18188 is already quite big and I think we need to try and get this fix in quicker.

@bernd-edlinger
Copy link
Member

ok. #18634

@tmshort
Copy link
Contributor

tmshort commented Jul 29, 2022

The referenced PRs have been merged and closed.

@tmshort tmshort closed this as completed Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch: master Merge to master branch branch: 1.1.1 Merge to OpenSSL_1_1_1-stable branch branch: 3.0 Merge to openssl-3.0 branch severity: regression The issue/pr is a regression from previous released version triaged: bug The issue/pr is/fixes a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants