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 broken on s390x-unknown-linux-gnu with FIPS #655

Closed
Gelbpunkt opened this issue Jan 12, 2025 · 8 comments
Closed

Build broken on s390x-unknown-linux-gnu with FIPS #655

Gelbpunkt opened this issue Jan 12, 2025 · 8 comments
Assignees
Labels
build problem Build failure

Comments

@Gelbpunkt
Copy link

Gelbpunkt commented Jan 12, 2025

Problem:

aws-lc-rs with FIPS mode enabled fails to build for me on s390x-unknown-linux-gnu. I haven't tested non-FIPS yet. I'm using a nightly rust compiler from rustup with roughly the following container and packages:

FROM docker.io/library/ubuntu:24.10

RUN apt -y update && \
    apt -y install --no-install-recommends \
        autoconf \
        automake \
        build-essential \
        ca-certificates \
        cmake \
        curl \
        dotnet-sdk-8.0 \
        git \
        golang-go \
        jq \
        libclang-dev \
        libffi-dev \
        libssl-dev \
        libtool \
        m4 \
        make \
        pkg-config \
        python3 \
        sudo \
        wget

I'm aware that GCC 14 builds of the FIPS mode are currently failing, but the issue I'm running into is a different one than #569 and doesn't seem to be related to my compiler version.

Relevant details

AWS-LC for Rust version: 1.12.0

System information: for linux, below info can be collected by running uname -srvmp

  • CPU architecture: s390x
  • CPU name: IBM z15
  • OS: Ubuntu 24.10

Build log:

  • The log tells compiler and version.
Logs are here
warning: aws-lc-fips-sys@0.13.0: Building with: CMake
warning: aws-lc-fips-sys@0.13.0: Symbol Prefix: Some("aws_lc_fips_0_13_0")
warning: aws-lc-fips-sys@0.13.0: Clang version: Ubuntu clang version 19.1.1 (1ubuntu1)
warning: aws-lc-fips-sys@0.13.0: Generating bindings - internal bindgen. Platform: s390x-unknown-linux-gnu
warning: aws-lc-fips-sys@0.13.0: GCC v14.2.0 detected.
warning: aws-lc-fips-sys@0.13.0: WARNING: FIPS build is known to fail on GCC >= 14. See: https://github.com/aws/aws-lc-rs/issues/569
error: failed to run custom build command for `aws-lc-fips-sys v0.13.0`
Caused by:
  process didn't exit successfully: `/opt/runner/_work/tokio-websockets/tokio-websockets/target/debug/build/aws-lc-fips-sys-12eb35dc519dcf0a/build-script-main` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=AWS_LC_FIPS_SYS_NO_PREFIX
  cargo:rerun-if-env-changed=AWS_LC_FIPS_SYS_PREGENERATING_BINDINGS
  cargo:rerun-if-env-changed=AWS_LC_FIPS_SYS_EXTERNAL_BINDGEN
  cargo:rerun-if-env-changed=AWS_LC_FIPS_SYS_NO_ASM
  cargo:rerun-if-env-changed=AWS_LC_FIPS_SYS_STATIC
  cargo:warning=Building with: CMake
  cargo:warning=Symbol Prefix: Some("aws_lc_fips_0_13_0")
  cargo:rerun-if-env-changed=CMAKE
  cargo:warning=Clang version: Ubuntu clang version 19.1.1 (1ubuntu1)
  cargo:warning=Generating bindings - internal bindgen. Platform: s390x-unknown-linux-gnu
  cargo:rerun-if-env-changed=AWS_LC_FIPS_SYS_INCLUDES
  cargo:rustc-cfg=use_bindgen_generated
  cargo:rerun-if-env-changed=AWS_LC_FIPS_SYS_STATIC
  OPT_LEVEL = Some(0)
  OUT_DIR = Some(/opt/runner/_work/tokio-websockets/tokio-websockets/target/s390x-unknown-linux-gnu/debug/build/aws-lc-fips-sys-d78b9617e0474c10/out)
  TARGET = Some(s390x-unknown-linux-gnu)
  HOST = Some(s390x-unknown-linux-gnu)
  cargo:rerun-if-env-changed=CC_s390x-unknown-linux-gnu
  CC_s390x-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CC_s390x_unknown_linux_gnu
  CC_s390x_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  RUSTC_WRAPPER = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some(true)
  CARGO_CFG_TARGET_FEATURE = Some(backchain)
  cargo:rerun-if-env-changed=CFLAGS_s390x-unknown-linux-gnu
  CFLAGS_s390x-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CFLAGS_s390x_unknown_linux_gnu
  CFLAGS_s390x_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  CARGO_ENCODED_RUSTFLAGS = Some()
  cargo:warning=GCC v14.2.0 detected.
  cargo:warning=WARNING: FIPS build is known to fail on GCC >= 14. See: https://github.com/aws/aws-lc-rs/issues/569
  cargo:rerun-if-env-changed=CMAKE_TOOLCHAIN_FILE
  cargo:rerun-if-env-changed=CMAKE_TOOLCHAIN_FILE_s390x_unknown_linux_gnu
  CMAKE_TOOLCHAIN_FILE_s390x-unknown-linux-gnu = None
  CMAKE_TOOLCHAIN_FILE_s390x_unknown_linux_gnu = None
  HOST_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_s390x-unknown-linux-gnu = None
  CMAKE_GENERATOR_s390x_unknown_linux_gnu = None
  HOST_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_s390x-unknown-linux-gnu = None
  CMAKE_PREFIX_PATH_s390x_unknown_linux_gnu = None
  HOST_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_s390x-unknown-linux-gnu = None
  CMAKE_s390x_unknown_linux_gnu = None
  HOST_CMAKE = None
  CMAKE = Some("cmake")
  running: cd "/opt/runner/_work/tokio-websockets/tokio-websockets/target/s390x-unknown-linux-gnu/debug/build/aws-lc-fips-sys-d78b9617e0474c10/out/build" && CMAKE_PREFIX_PATH="" LC_ALL="C" "cmake" "/home/ubuntu/.cargo/registry/src/index.crates.io-7f555b6b8ccf4919/aws-lc-fips-sys-0.13.0" "-DBUILD_SHARED_LIBS=1" "-DCMAKE_BUILD_TYPE=debug" "-DBORINGSSL_PREFIX=aws_lc_fips_0_13_0_" "-DBORINGSSL_PREFIX_HEADERS=/home/ubuntu/.cargo/registry/src/index.crates.io-7f555b6b8ccf4919/aws-lc-fips-sys-0.13.0/generated-include" "-DBUILD_TESTING=OFF" "-DBUILD_LIBSSL=OFF" "-DFIPS=1" "-DCMAKE_INSTALL_PREFIX=/opt/runner/_work/tokio-websockets/tokio-websockets/target/s390x-unknown-linux-gnu/debug/build/aws-lc-fips-sys-d78b9617e0474c10/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "--no-
  Not searching for unused variables given on the command line.
  -- The C compiler identification is GNU 14.2.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /usr/bin/cc - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Go compiler 1.23.2 found
  -- FIPS build mode configured
  -- FIPS entropy source method configured: Passive
  -- Found Perl: /usr/bin/perl (found version "5.38.2")
  -- Checking for module 'libunwind-generic'
  --   Package 'libunwind-generic', required by 'virtual:world', not found
  -- Prefix build configured: performing build using prefix "aws_lc_fips_0_13_0_" and headers path "/home/ubuntu/.cargo/registry/src/index.crates.io-7f555b6b8ccf4919/aws-lc-fips-sys-0.13.0/generated-include"
  -- Setting CMAKE_C_STANDARD=11
  -- stdalign_check.c probe is positive, enabling AWS_LC_STDALIGN_AVAILABLE
  -- builtin_swap_check.c probe is positive, enabling AWS_LC_BUILTIN_SWAP_SUPPORTED
  -- linux_u32.c probe is positive, enabling AWS_LC_URANDOM_U32
  -- The ASM compiler identification is GNU
  -- Found assembler: /usr/bin/cc
  -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
  -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
  -- Found Threads: TRUE
  -- Configuring done (0.4s)
  -- Generating done (0.1s)
  -- Build files have been written to: /opt/runner/_work/tokio-websockets/tokio-websockets/target/s390x-unknown-linux-gnu/debug/build/aws-lc-fips-sys-d78b9617e0474c10/out/build
  running: cd "/opt/runner/_work/tokio-websockets/tokio-websockets/target/s390x-unknown-linux-gnu/debug/build/aws-lc-fips-sys-d78b9617e0474c10/out/build" && LC_ALL="C" MAKEFLAGS="-j --jobserver-fds=11,13 --jobserver-auth=11,13" "cmake" "--build" "/opt/runner/_work/tokio-websockets/tokio-websockets/target/s390x-unknown-linux-gnu/debug/build/aws-lc-fips-sys-d78b9617e0474c10/out/build" "--target" "install" "--config" "Debug"
  [  0%] Built target boringssl_prefix_symbols
  [  1%] Generating err_data.c
  [  1%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/asn1/a_bitstr.c.o
  [  1%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/asn1/a_bool.c.o
  [  2%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/asn1/a_d2i_fp.c.o
  [  2%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/asn1/a_dup.c.o
  [  3%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/asn1/a_gentm.c.o
  [  3%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/asn1/a_i2d_fp.c.o
  [  3%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/asn1/a_int.c.o
  [  4%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/asn1/a_mbstr.c.o
  [  4%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/asn1/a_object.c.o
  [  5%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/asn1/a_octet.c.o
  [  5%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/asn1/a_strex.c.o
  [  5%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/asn1/a_strnid.c.o
  [  6%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/asn1/a_time.c.o
  [  6%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/asn1/a_type.c.o
  [  7%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/asn1/a_utctm.c.o
  [  7%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/asn1/a_utf8.c.o
  [  7%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/asn1/asn1_lib.c.o
  [  8%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/asn1/asn1_par.c.o
  [  8%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/asn1/asn_pack.c.o
  [  9%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/asn1/f_int.c.o
  [  9%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/asn1/f_string.c.o
  [  9%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/asn1/tasn_dec.c.o
  [ 10%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/asn1/tasn_enc.c.o
  [ 10%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/asn1/tasn_fre.c.o
  [ 11%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/asn1/tasn_new.c.o
  [ 11%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/asn1/tasn_typ.c.o
  [ 11%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/asn1/tasn_utl.c.o
  [ 12%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/asn1/posix_time.c.o
  [ 12%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/base64/base64.c.o
  [ 13%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/bio/bio.c.o
  [ 13%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/bio/bio_mem.c.o
  [ 13%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/bio/connect.c.o
  [ 14%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/bio/errno.c.o
  [ 14%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/bio/fd.c.o
  [ 15%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/bio/file.c.o
  [ 15%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/bio/hexdump.c.o
  [ 15%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/bio/pair.c.o
  [ 16%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/bio/printf.c.o
  [ 16%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/bio/socket.c.o
  [ 17%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/bio/socket_helper.c.o
  [ 17%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/blake2/blake2.c.o
  [ 17%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/bn_extra/bn_asn1.c.o
  [ 18%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/bn_extra/convert.c.o
  [ 18%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/buf/buf.c.o
  [ 19%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/bytestring/asn1_compat.c.o
  [ 19%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/bytestring/ber.c.o
  [ 19%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/bytestring/cbb.c.o
  [ 20%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/bytestring/cbs.c.o
  [ 20%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/bytestring/unicode.c.o
  [ 21%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/chacha/chacha.c.o
  [ 21%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/cipher_extra/cipher_extra.c.o
  [ 21%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/cipher_extra/derive_key.c.o
  [ 22%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/cipher_extra/e_aesctrhmac.c.o
  [ 22%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/cipher_extra/e_aesgcmsiv.c.o
  [ 23%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/cipher_extra/e_chacha20poly1305.c.o
  [ 23%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/cipher_extra/e_aes_cbc_hmac_sha1.c.o
  [ 24%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/cipher_extra/e_aes_cbc_hmac_sha256.c.o
  [ 24%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/cipher_extra/e_des.c.o
  [ 24%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/cipher_extra/e_null.c.o
  [ 25%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/cipher_extra/e_rc2.c.o
  [ 25%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/cipher_extra/e_rc4.c.o
  [ 26%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/cipher_extra/e_tls.c.o
  [ 26%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/cipher_extra/tls_cbc.c.o
  [ 26%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/conf/conf.c.o
  [ 27%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/crypto.c.o
  [ 27%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/des/des.c.o
  [ 28%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/dh_extra/params.c.o
  [ 28%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/dh_extra/dh_asn1.c.o
  [ 28%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/digest_extra/digest_extra.c.o
  [ 29%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/dsa/dsa.c.o
  [ 29%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/dsa/dsa_asn1.c.o
  [ 30%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/ecdh_extra/ecdh_extra.c.o
  [ 30%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/ecdsa_extra/ecdsa_asn1.c.o
  [ 30%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/ec_extra/ec_asn1.c.o
  [ 31%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/ec_extra/ec_derive.c.o
  [ 31%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/ec_extra/hash_to_curve.c.o
  [ 32%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/err/err.c.o
  [ 32%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/err_data.c.o
  [ 32%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/engine/engine.c.o
  [ 33%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/evp_extra/evp_asn1.c.o
  [ 33%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/evp_extra/p_dh.c.o
  [ 34%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/evp_extra/p_dh_asn1.c.o
  [ 34%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/evp_extra/p_dsa_asn1.c.o
  [ 34%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/evp_extra/p_ec_asn1.c.o
  [ 35%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/evp_extra/p_ed25519_asn1.c.o
  [ 35%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/evp_extra/p_hmac_asn1.c.o
  [ 36%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/evp_extra/p_kem_asn1.c.o
  [ 36%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/evp_extra/p_rsa_asn1.c.o
  [ 36%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/evp_extra/p_x25519.c.o
  [ 37%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/evp_extra/p_x25519_asn1.c.o
  [ 37%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/evp_extra/p_methods.c.o
  [ 38%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/evp_extra/print.c.o
  [ 38%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/evp_extra/scrypt.c.o
  [ 38%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/evp_extra/sign.c.o
  [ 39%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/ex_data.c.o
  [ 39%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/hpke/hpke.c.o
  [ 40%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/hrss/hrss.c.o
  [ 40%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/kyber/kyber512r3_ref.c.o
  [ 40%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/kyber/kyber768r3_ref.c.o
  [ 41%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/kyber/kyber1024r3_ref.c.o
  [ 41%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/kyber/pqcrystals_kyber_ref_common/fips202.c.o
  [ 42%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/kyber/kem_kyber.c.o
  [ 42%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/lhash/lhash.c.o
  [ 42%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/mem.c.o
  [ 43%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/obj/obj.c.o
  [ 43%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/obj/obj_xref.c.o
  [ 44%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/ocsp/ocsp_asn.c.o
  [ 44%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/ocsp/ocsp_client.c.o
  [ 44%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/ocsp/ocsp_extension.c.o
  [ 45%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/ocsp/ocsp_http.c.o
  [ 45%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/ocsp/ocsp_lib.c.o
  [ 46%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/ocsp/ocsp_print.c.o
  [ 46%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/ocsp/ocsp_server.c.o
  [ 46%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/ocsp/ocsp_verify.c.o
  [ 47%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/pem/pem_all.c.o
  [ 47%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/pem/pem_info.c.o
  [ 48%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/pem/pem_lib.c.o
  [ 48%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/pem/pem_oth.c.o
  [ 49%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/pem/pem_pk8.c.o
  [ 49%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/pem/pem_pkey.c.o
  [ 49%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/pem/pem_x509.c.o
  [ 50%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/pem/pem_xaux.c.o
  [ 50%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/pkcs7/pkcs7.c.o
  [ 51%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/pkcs7/pkcs7_asn1.c.o
  [ 51%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/pkcs7/pkcs7_x509.c.o
  [ 51%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/pkcs8/pkcs8.c.o
  [ 52%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/pkcs8/pkcs8_x509.c.o
  [ 52%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/pkcs8/p5_pbev2.c.o
  [ 53%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/poly1305/poly1305.c.o
  [ 53%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/poly1305/poly1305_arm.c.o
  [ 53%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/poly1305/poly1305_vec.c.o
  [ 54%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/pool/pool.c.o
  [ 54%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/rand_extra/deterministic.c.o
  [ 55%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/rand_extra/entropy_passive.c.o
  [ 55%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/rand_extra/forkunsafe.c.o
  [ 55%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/rand_extra/fuchsia.c.o
  [ 56%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/rand_extra/rand_extra.c.o
  [ 56%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/rand_extra/pq_custom_randombytes.c.o
  [ 57%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/rand_extra/trusty.c.o
  [ 57%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/rand_extra/windows.c.o
  [ 57%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/rc4/rc4.c.o
  [ 58%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/refcount_c11.c.o
  [ 58%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/refcount_lock.c.o
  [ 59%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/refcount_win.c.o
  [ 59%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/rsa_extra/rsa_asn1.c.o
  [ 59%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/rsa_extra/rsassa_pss_asn1.c.o
  [ 60%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/rsa_extra/rsa_crypt.c.o
  [ 60%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/rsa_extra/rsa_print.c.o
  [ 61%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/stack/stack.c.o
  [ 61%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/siphash/siphash.c.o
  [ 61%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/spake25519/spake25519.c.o
  [ 62%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/thread.c.o
  [ 62%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/thread_none.c.o
  [ 63%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/thread_pthread.c.o
  [ 63%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/thread_win.c.o
  [ 63%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/trust_token/pmbtoken.c.o
  [ 64%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/trust_token/trust_token.c.o
  [ 64%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/trust_token/voprf.c.o
  [ 65%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/a_digest.c.o
  [ 65%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/a_sign.c.o
  [ 65%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/a_verify.c.o
  [ 66%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/algorithm.c.o
  [ 66%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/asn1_gen.c.o
  [ 67%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/by_dir.c.o
  [ 67%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/by_file.c.o
  [ 67%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/i2d_pr.c.o
  [ 68%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/name_print.c.o
  [ 68%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/policy.c.o
  [ 69%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/rsa_pss.c.o
  [ 69%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/t_crl.c.o
  [ 69%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/t_req.c.o
  [ 70%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/t_x509.c.o
  [ 70%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/t_x509a.c.o
  [ 71%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/v3_akey.c.o
  [ 71%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/v3_akeya.c.o
  [ 71%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/v3_alt.c.o
  [ 72%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/v3_bcons.c.o
  [ 72%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/v3_bitst.c.o
  [ 73%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/v3_conf.c.o
  [ 73%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/v3_cpols.c.o
  [ 74%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/v3_crld.c.o
  [ 74%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/v3_enum.c.o
  [ 74%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/v3_extku.c.o
  [ 75%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/v3_genn.c.o
  [ 75%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/v3_ia5.c.o
  [ 76%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/v3_info.c.o
  [ 76%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/v3_int.c.o
  [ 76%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/v3_lib.c.o
  [ 77%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/v3_ncons.c.o
  [ 77%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/v3_ocsp.c.o
  [ 78%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/v3_pcons.c.o
  [ 78%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/v3_pmaps.c.o
  [ 78%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/v3_prn.c.o
  [ 79%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/v3_purp.c.o
  [ 79%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/v3_skey.c.o
  [ 80%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/v3_utl.c.o
  [ 80%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x_algor.c.o
  [ 80%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x_all.c.o
  [ 81%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x_attrib.c.o
  [ 81%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x_crl.c.o
  [ 82%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x_exten.c.o
  [ 82%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x_name.c.o
  [ 82%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x_pubkey.c.o
  [ 83%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x_req.c.o
  [ 83%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x_sig.c.o
  [ 84%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x_spki.c.o
  [ 84%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x_val.c.o
  [ 84%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x_x509.c.o
  [ 85%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x_x509a.c.o
  [ 85%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x509_att.c.o
  [ 86%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x509_cmp.c.o
  [ 86%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x509_d2.c.o
  [ 86%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x509_def.c.o
  [ 87%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x509_ext.c.o
  [ 87%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x509_lu.c.o
  [ 88%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x509_obj.c.o
  [ 88%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x509_req.c.o
  [ 88%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x509_set.c.o
  [ 89%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x509_trs.c.o
  [ 89%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x509_txt.c.o
  [ 90%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x509_v3.c.o
  [ 90%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x509_vfy.c.o
  [ 90%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x509_vpm.c.o
  [ 91%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x509.c.o
  [ 91%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x509cset.c.o
  [ 92%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x509name.c.o
  [ 92%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x509rset.c.o
  [ 92%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/x509/x509spki.c.o
  [ 93%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/decrepit/bio/base64_bio.c.o
  [ 93%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/decrepit/blowfish/blowfish.c.o
  [ 94%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/decrepit/cast/cast.c.o
  [ 94%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/decrepit/cast/cast_tables.c.o
  [ 94%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/decrepit/cfb/cfb.c.o
  [ 95%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/decrepit/dh/dh_decrepit.c.o
  [ 95%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/decrepit/evp/evp_do_all.c.o
  [ 96%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/decrepit/obj/obj_decrepit.c.o
  [ 96%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/decrepit/ripemd/ripemd.c.o
  [ 96%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/decrepit/rsa/rsa_decrepit.c.o
  [ 97%] Building C object aws-lc/crypto/CMakeFiles/crypto_objects.dir/decrepit/x509/x509_decrepit.c.o
  [ 97%] Built target crypto_objects
  [ 97%] Building C object aws-lc/crypto/fipsmodule/CMakeFiles/fipsmodule.dir/fips_shared_support.c.o
  [ 98%] Building C object aws-lc/crypto/fipsmodule/CMakeFiles/fipsmodule.dir/cpucap/cpucap.c.o
  [ 98%] Built target fipsmodule
  [ 98%] Building C object aws-lc/crypto/fipsmodule/CMakeFiles/bcm_library.dir/bcm.c.o
  --- stderr
  error: 'rustfmt' is not installed for the toolchain 'nightly-s390x-unknown-linux-gnu'.
  To install, run `rustup component add rustfmt`
  Failed to run rustfmt: Internal rustfmt error (non-fatal, continuing)
  CMake Deprecation Warning at CMakeLists.txt:4 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.
    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.
  CMake Deprecation Warning at aws-lc/CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.
    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.
  libunwind not found. Disabling unwind tests.
  In file included from /home/ubuntu/.cargo/registry/src/index.crates.io-7f555b6b8ccf4919/aws-lc-fips-sys-0.13.0/aws-lc/include/openssl/base.h:80,
                   from /home/ubuntu/.cargo/registry/src/index.crates.io-7f555b6b8ccf4919/aws-lc-fips-sys-0.13.0/aws-lc/include/openssl/crypto.h:18,
                   from /home/ubuntu/.cargo/registry/src/index.crates.io-7f555b6b8ccf4919/aws-lc-fips-sys-0.13.0/aws-lc/crypto/fipsmodule/bcm.c:19:
  /home/ubuntu/.cargo/registry/src/index.crates.io-7f555b6b8ccf4919/aws-lc-fips-sys-0.13.0/aws-lc/crypto/fipsmodule/bcm.c: In function 'BORINGSSL_bcm_power_on_self_test':
  /opt/runner/_work/tokio-websockets/tokio-websockets/target/s390x-unknown-linux-gnu/debug/build/aws-lc-fips-sys-d78b9617e0474c10/out/build/aws-lc/symbol_prefix_include/openssl/boringssl_prefix_symbols.h:20:26: error: implicit declaration of function 'aws_lc_fips_0_13_0_OPENSSL_cpuid_setup'; did you mean 'aws_lc_fips_0_13_0_OPENSSL_sk_set'? [-Wimplicit-function-declaration]
     20 | #define BORINGSSL_PREFIX aws_lc_fips_0_13_0
        |                          ^~~~~~~~~~~~~~~~~~
  /opt/runner/_work/tokio-websockets/tokio-websockets/target/s390x-unknown-linux-gnu/debug/build/aws-lc-fips-sys-d78b9617e0474c10/out/build/aws-lc/symbol_prefix_include/openssl/boringssl_prefix_symbols.h:27:42: note: in definition of macro 'BORINGSSL_ADD_PREFIX_INNER'
     27 | #define BORINGSSL_ADD_PREFIX_INNER(a, b) a ## _ ## b
        |                                          ^
  /opt/runner/_work/tokio-websockets/tokio-websockets/target/s390x-unknown-linux-gnu/debug/build/aws-lc-fips-sys-d78b9617e0474c10/out/build/aws-lc/symbol_prefix_include/openssl/boringssl_prefix_symbols.h:1699:29: note: in expansion of macro 'BORINGSSL_ADD_PREFIX'
   1699 | #define OPENSSL_cpuid_setup BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, OPENSSL_cpuid_setup)
        |                             ^~~~~~~~~~~~~~~~~~~~
  /opt/runner/_work/tokio-websockets/tokio-websockets/target/s390x-unknown-linux-gnu/debug/build/aws-lc-fips-sys-d78b9617e0474c10/out/build/aws-lc/symbol_prefix_include/openssl/boringssl_prefix_symbols.h:1699:50: note: in expansion of macro 'BORINGSSL_PREFIX'
   1699 | #define OPENSSL_cpuid_setup BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, OPENSSL_cpuid_setup)
        |                                                  ^~~~~~~~~~~~~~~~
  /home/ubuntu/.cargo/registry/src/index.crates.io-7f555b6b8ccf4919/aws-lc-fips-sys-0.13.0/aws-lc/crypto/fipsmodule/bcm.c:260:3: note: in expansion of macro 'OPENSSL_cpuid_setup'
    260 |   OPENSSL_cpuid_setup();
        |   ^~~~~~~~~~~~~~~~~~~
  At top level:
  cc1: note: unrecognized command-line option '-Wno-c11-extensions' may have been intended to silence earlier diagnostics
  gmake[2]: *** [aws-lc/crypto/fipsmodule/CMakeFiles/bcm_library.dir/build.make:76: aws-lc/crypto/fipsmodule/CMakeFiles/bcm_library.dir/bcm.c.o] Error 1
  gmake[1]: *** [CMakeFiles/Makefile2:288: aws-lc/crypto/fipsmodule/CMakeFiles/bcm_library.dir/all] Error 2
  gmake: *** [Makefile:136: all] Error 2
  thread 'main' panicked at /home/ubuntu/.cargo/registry/src/index.crates.io-7f555b6b8ccf4919/cmake-0.1.52/src/lib.rs:1115:5:
  command did not execute successfully, got: exit status: 2
  build script failed, must exit now
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@Gelbpunkt
Copy link
Author

Gelbpunkt commented Jan 12, 2025

I can reproduce the error with GCC 13.3.0, just to be sure.

@justsmth
Copy link
Contributor

Hello!

The FIPS build requires additional complexity that makes it much more fragile, especially when building for a platform (like s390x) for which we don't have CI setup w/ a FIPS build. Unless you've been guidance otherwise by FIPS-compliance experts, I would avoid using our "fips" feature for this target.

(Also, our FIPS build for s390x-unknown-linux-gnu can only create a shared, *.so, library, which might add complexity to your distribution.)

That said, I will look into this build failure. Hopefully, it's an easy fix. 🤞 😄

@justsmth justsmth added the build problem Build failure label Jan 13, 2025
@justsmth justsmth self-assigned this Jan 13, 2025
@justsmth
Copy link
Contributor

I'm able to reproduce the same failure: 🤔

❯ cross build -p aws-lc-fips-sys --target s390x-unknown-linux-gnu
...
  In file included from /Users/justsmth/repos/aws-lc-rs/aws-lc-fips-sys/aws-lc/include/openssl/base.h:80,
                   from /Users/justsmth/repos/aws-lc-rs/aws-lc-fips-sys/aws-lc/include/openssl/crypto.h:18,
                   from /Users/justsmth/repos/aws-lc-rs/aws-lc-fips-sys/aws-lc/crypto/fipsmodule/bcm.c:19:
  /Users/justsmth/repos/aws-lc-rs/aws-lc-fips-sys/aws-lc/crypto/fipsmodule/bcm.c: In function 'BORINGSSL_bcm_power_on_self_test':
  /target/s390x-unknown-linux-gnu/debug/build/aws-lc-fips-sys-9f8343b2707dda50/out/build/aws-lc/symbol_prefix_include/openssl/boringssl_prefix_symbols.h:20:26: error: implicit declaration of function 'aws_lc_fips_0_13_1_OPENSSL_cpuid_setup'; did you mean 'aws_lc_fips_0_13_1_OPENSSL_sk_set'? [-Werror=implicit-function-declaration]
     20 | #define BORINGSSL_PREFIX aws_lc_fips_0_13_1
        |                          ^~~~~~~~~~~~~~~~~~
  /target/s390x-unknown-linux-gnu/debug/build/aws-lc-fips-sys-9f8343b2707dda50/out/build/aws-lc/symbol_prefix_include/openssl/boringssl_prefix_symbols.h:27:42: note: in definition of macro 'BORINGSSL_ADD_PREFIX_INNER'
     27 | #define BORINGSSL_ADD_PREFIX_INNER(a, b) a ## _ ## b
        |                                          ^
  /target/s390x-unknown-linux-gnu/debug/build/aws-lc-fips-sys-9f8343b2707dda50/out/build/aws-lc/symbol_prefix_include/openssl/boringssl_prefix_symbols.h:1699:29: note: in expansion of macro 'BORINGSSL_ADD_PREFIX'
   1699 | #define OPENSSL_cpuid_setup BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, OPENSSL_cpuid_setup)
        |                             ^~~~~~~~~~~~~~~~~~~~
  /target/s390x-unknown-linux-gnu/debug/build/aws-lc-fips-sys-9f8343b2707dda50/out/build/aws-lc/symbol_prefix_include/openssl/boringssl_prefix_symbols.h:1699:50: note: in expansion of macro 'BORINGSSL_PREFIX'
   1699 | #define OPENSSL_cpuid_setup BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, OPENSSL_cpuid_setup)
        |                                                  ^~~~~~~~~~~~~~~~
  /Users/justsmth/repos/aws-lc-rs/aws-lc-fips-sys/aws-lc/crypto/fipsmodule/bcm.c:260:3: note: in expansion of macro 'OPENSSL_cpuid_setup'
    260 |   OPENSSL_cpuid_setup();
        |   ^~~~~~~~~~~~~~~~~~~
  /Users/justsmth/repos/aws-lc-rs/aws-lc-fips-sys/aws-lc/crypto/fipsmodule/bcm.c: At top level:
  cc1: error: unrecognized command line option '-Wno-c11-extensions' [-Werror]
  cc1: all warnings being treated as errors

@Gelbpunkt
Copy link
Author

Unless you've been guidance otherwise by FIPS-compliance experts, I would avoid using our "fips" feature for this target.

My particular "usecase" is that I maintain a library which in itself depends on rustls and exposes an optional feature to toggle the fips feature in aws-lc-rs by propagating it through the dependency chain. I run tests with --all-features --all-targets in CI, which causes no issues on x86 and ARM, but fails on s390x. I would prefer not having a feature flag that is broken on a particular target and having to special case for s390x in CI.

From what I see at quick glance in aws-lc's FIPS code, there is no architecture specific file for CPU features in s390x (resulting in the undeclared function), but it doesn't seem like adding one that just no-ops since there is no architecture-specific code for it would be an issue? Feel free to correct me if I'm wrong, though.

@justsmth
Copy link
Contributor

Thanks for the context around this issue.

I think you were right about the cause, I can get the build to succeed using this patch:

 crypto/fipsmodule/bcm.c             | 2 +-
 crypto/fipsmodule/cpucap/internal.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/crypto/fipsmodule/bcm.c b/crypto/fipsmodule/bcm.c
index 0b0fa8120..c8bee909c 100644
--- a/crypto/fipsmodule/bcm.c
+++ b/crypto/fipsmodule/bcm.c
@@ -256,7 +256,7 @@ static void BORINGSSL_bcm_power_on_self_test(void) {
 // TODO: remove !defined(OPENSSL_PPC64BE) from the check below when starting to support
 // PPC64BE that has VCRYPTO capability. In that case, add `|| defined(OPENSSL_PPC64BE)`
 // to `#if defined(OPENSSL_PPC64LE)` wherever it occurs.
-#if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_PPC32BE) && !defined(OPENSSL_PPC64BE)
+#if defined(HAS_CPUID_SETUP) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_PPC32BE) && !defined(OPENSSL_PPC64BE)
   OPENSSL_cpuid_setup();
 #endif

diff --git a/crypto/fipsmodule/cpucap/internal.h b/crypto/fipsmodule/cpucap/internal.h
index a2724c509..fa68f2654 100644
--- a/crypto/fipsmodule/cpucap/internal.h
+++ b/crypto/fipsmodule/cpucap/internal.h
@@ -10,6 +10,7 @@ extern "C" {
 #if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || defined(OPENSSL_ARM) || \
     defined(OPENSSL_AARCH64) || defined(OPENSSL_PPC64LE)
 // OPENSSL_cpuid_setup initializes the platform-specific feature cache.
+#define HAS_CPUID_SETUP
 void OPENSSL_cpuid_setup(void);
 #endif

I'll put up a PR to get this change into AWS-LC. However, it might be awhile before the change makes it into branch used by aws-lc-fips-sys. I'll also try to find a mitigation for this in the aws-lc-fips-sys build scripts.

@justsmth
Copy link
Contributor

I've put up a couple of PRs to address this build issue. We should have this resolved by our next release. Thanks for the report!

@Gelbpunkt
Copy link
Author

Awesome, thanks a lot for the quick responses!

justsmth added a commit to aws/aws-lc that referenced this issue Jan 14, 2025
### Issues:
Addresses aws/aws-lc-rs#655

### Description of changes: 
* The criteria for invoking `OPENSSL_cpuid_setup` should align with the
criteria for defining `OPENSSL_cpuid_setup`.

### Call-outs:
Consumers building `aws-lc-fips-sys` for `s390x` were seeing the
following failure:
```
.../boringssl_prefix_symbols.h:20:26: error: implicit declaration of function 'aws_lc_fips_0_13_1_OPENSSL_cpuid_setup'; did you mean 'aws_lc_fips_0_13_1_OPENSSL_sk_set'? [-Werror=implicit-function-declaration]
```

### Testing:
I verified this fix works for the `aws-lc-fips-sys` build for
`s390x-unknown-linux-gnu`.

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license and the ISC license.
@justsmth
Copy link
Contributor

Hello! We just released aws-lc-rs v1.12.1 which we believe will resolve this issue.

Please let us know if you have any more problems after upgrading. If needed, feel free to reopen this issue or create a new one. Thanks for helping to improve our library!

manastasova pushed a commit to manastasova/aws-lc that referenced this issue Jan 30, 2025
### Issues:
Addresses aws/aws-lc-rs#655

### Description of changes: 
* The criteria for invoking `OPENSSL_cpuid_setup` should align with the
criteria for defining `OPENSSL_cpuid_setup`.

### Call-outs:
Consumers building `aws-lc-fips-sys` for `s390x` were seeing the
following failure:
```
.../boringssl_prefix_symbols.h:20:26: error: implicit declaration of function 'aws_lc_fips_0_13_1_OPENSSL_cpuid_setup'; did you mean 'aws_lc_fips_0_13_1_OPENSSL_sk_set'? [-Werror=implicit-function-declaration]
```

### Testing:
I verified this fix works for the `aws-lc-fips-sys` build for
`s390x-unknown-linux-gnu`.

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license and the ISC license.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build problem Build failure
Projects
None yet
Development

No branches or pull requests

2 participants