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

riscv64gc-unknown-linux-gnu fails to build after upgrade from 300.1.6+3.1.4 to 300.2.0+3.2.0 #222

Closed
VorpalBlade opened this issue Dec 10, 2023 · 4 comments · Fixed by #230

Comments

@VorpalBlade
Copy link

I built riscv64gc-unknown-linux-gnu of my program in CI. After updating dependencies openssl-src fails to build. I don't know if this is a binding issue or an issue with upstream OpenSSL. I don't really want to set up a non-rust cross compiling environment to find out either.

[...]
  riscv64-linux-gnu-gcc  -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include  -fPIC -pthread -Wall -O3 -O2 -ffunction-sections -fdata-sections -fPIC -gdwarf-4 -fno-omit-frame-pointer -march=rv64gc -mabi=lp64d -mcmodel=medany -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/target/riscv64gc-unknown-linux-gnu/debug/build/openssl-sys-f3521352c2d5de8b/out/openssl-build/install/lib/engines-3\"" -DMODULESDIR="\"/target/riscv64gc-unknown-linux-gnu/debug/build/openssl-sys-f3521352c2d5de8b/out/openssl-build/install/lib/ossl-modules\"" -DOPENSSL_BUILDING_OPENSSL -DNDEBUG  -MMD -MF providers/implementations/ciphers/libdefault-lib-cipher_aes_gcm_siv.d.tmp -MT providers/implementations/ciphers/libdefault-lib-cipher_aes_gcm_siv.o -c -o providers/implementations/ciphers/libdefault-lib-cipher_aes_gcm_siv.o providers/implementations/ciphers/cipher_aes_gcm_siv.c
  riscv64-linux-gnu-gcc  -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include  -fPIC -pthread -Wall -O3 -O2 -ffunction-sections -fdata-sections -fPIC -gdwarf-4 -fno-omit-frame-pointer -march=rv64gc -mabi=lp64d -mcmodel=medany -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/target/riscv64gc-unknown-linux-gnu/debug/build/openssl-sys-f3521352c2d5de8b/out/openssl-build/install/lib/engines-3\"" -DMODULESDIR="\"/target/riscv64gc-unknown-linux-gnu/debug/build/openssl-sys-f3521352c2d5de8b/out/openssl-build/install/lib/ossl-modules\"" -DOPENSSL_BUILDING_OPENSSL -DNDEBUG  -MMD -MF providers/implementations/ciphers/libdefault-lib-cipher_aes_gcm_siv_hw.d.tmp -MT providers/implementations/ciphers/libdefault-lib-cipher_aes_gcm_siv_hw.o -c -o providers/implementations/ciphers/libdefault-lib-cipher_aes_gcm_siv_hw.o providers/implementations/ciphers/cipher_aes_gcm_siv_hw.c
  Makefile:12023: recipe for target 'providers/implementations/ciphers/libdefault-lib-cipher_aes_ccm_hw.o' failed
  Makefile:12039: recipe for target 'providers/implementations/ciphers/libdefault-lib-cipher_aes_gcm_hw.o' failed
  make[1]: Leaving directory '/target/riscv64gc-unknown-linux-gnu/debug/build/openssl-sys-f3521352c2d5de8b/out/openssl-build/build/src'
  Makefile:2282: recipe for target 'build_libs' failed

  --- stderr
  providers/implementations/ciphers/cipher_aes_ccm_hw_rv64i.inc: In function 'ccm_rv64i_zknd_zkne_initkey':
  providers/implementations/ciphers/cipher_aes_ccm_hw_rv64i.inc:20:27: warning: implicit declaration of function 'rv64i_zkne_set_encrypt_key'; did you mean 'AES_set_encrypt_key'? [-Wimplicit-function-declaration]
       AES_HW_CCM_SET_KEY_FN(rv64i_zkne_set_encrypt_key, rv64i_zkne_encrypt,
                             ^
  providers/implementations/ciphers/cipher_aes_ccm_hw.c:21:5: note: in definition of macro 'AES_HW_CCM_SET_KEY_FN'
       fn_set_enc_key(key, keylen * 8, &actx->ccm.ks.ks);                         \
       ^~~~~~~~~~~~~~
  providers/implementations/ciphers/cipher_aes_ccm_hw_rv64i.inc:20:55: error: 'rv64i_zkne_encrypt' undeclared (first use in this function); did you mean 'AES_bi_ige_encrypt'?
       AES_HW_CCM_SET_KEY_FN(rv64i_zkne_set_encrypt_key, rv64i_zkne_encrypt,
                                                         ^
  providers/implementations/ciphers/cipher_aes_ccm_hw.c:23:36: note: in definition of macro 'AES_HW_CCM_SET_KEY_FN'
                          (block128_f)fn_blk);                                    \
                                      ^~~~~~
  providers/implementations/ciphers/cipher_aes_ccm_hw_rv64i.inc:20:55: note: each undeclared identifier is reported only once for each function it appears in
       AES_HW_CCM_SET_KEY_FN(rv64i_zkne_set_encrypt_key, rv64i_zkne_encrypt,
                                                         ^
  providers/implementations/ciphers/cipher_aes_ccm_hw.c:23:36: note: in definition of macro 'AES_HW_CCM_SET_KEY_FN'
                          (block128_f)fn_blk);                                    \
                                      ^~~~~~
  In file included from providers/implementations/ciphers/cipher_aes_ccm_hw.c:65:0:
  providers/implementations/ciphers/cipher_aes_ccm_hw_rv64i.inc: In function 'ossl_prov_aes_hw_ccm':
  providers/implementations/ciphers/cipher_aes_ccm_hw_rv64i.inc:36:12: warning: implicit declaration of function 'RISCV_HAS_ZKND_AND_ZKNE' [-Wimplicit-function-declaration]
       return RISCV_HAS_ZKND_AND_ZKNE() ? &rv64i_zknd_zkne_ccm : &aes_ccm;
              ^~~~~~~~~~~~~~~~~~~~~~~
  make[1]: *** [providers/implementations/ciphers/libdefault-lib-cipher_aes_ccm_hw.o] Error 1
  make[1]: *** Waiting for unfinished jobs....
  In file included from providers/implementations/ciphers/cipher_aes_gcm.h:12:0,
                   from providers/implementations/ciphers/cipher_aes_gcm_hw.c:18:
  providers/implementations/ciphers/cipher_aes_gcm_hw_rv64i.inc: In function 'rv64i_zknd_zkne_gcm_initkey':
  providers/implementations/ciphers/cipher_aes_gcm_hw_rv64i.inc:20:31: warning: implicit declaration of function 'rv64i_zkne_set_encrypt_key'; did you mean 'AES_set_encrypt_key'? [-Wimplicit-function-declaration]
       GCM_HW_SET_KEY_CTR_FN(ks, rv64i_zkne_set_encrypt_key, rv64i_zkne_encrypt,
                                 ^
  providers/implementations/include/prov/ciphercommon_gcm.h:128:5: note: in definition of macro 'GCM_HW_SET_KEY_CTR_FN'
       fn_set_enc_key(key, keylen * 8, ks);                                       \
       ^~~~~~~~~~~~~~
  providers/implementations/ciphers/cipher_aes_gcm_hw_rv64i.inc:20:59: error: 'rv64i_zkne_encrypt' undeclared (first use in this function); did you mean 'AES_bi_ige_encrypt'?
       GCM_HW_SET_KEY_CTR_FN(ks, rv64i_zkne_set_encrypt_key, rv64i_zkne_encrypt,
                                                             ^
  providers/implementations/include/prov/ciphercommon_gcm.h:129:51: note: in definition of macro 'GCM_HW_SET_KEY_CTR_FN'
       CRYPTO_gcm128_init(&ctx->gcm, ks, (block128_f)fn_block);                   \
                                                     ^~~~~~~~
  providers/implementations/ciphers/cipher_aes_gcm_hw_rv64i.inc:20:59: note: each undeclared identifier is reported only once for each function it appears in
       GCM_HW_SET_KEY_CTR_FN(ks, rv64i_zkne_set_encrypt_key, rv64i_zkne_encrypt,
                                                             ^
  providers/implementations/include/prov/ciphercommon_gcm.h:129:51: note: in definition of macro 'GCM_HW_SET_KEY_CTR_FN'
       CRYPTO_gcm128_init(&ctx->gcm, ks, (block128_f)fn_block);                   \
                                                     ^~~~~~~~
  In file included from providers/implementations/ciphers/cipher_aes_gcm_hw.c:146:0:
  providers/implementations/ciphers/cipher_aes_gcm_hw_rv64i.inc: In function 'ossl_prov_aes_hw_gcm':
  providers/implementations/ciphers/cipher_aes_gcm_hw_rv64i.inc:36:9: warning: implicit declaration of function 'RISCV_HAS_ZKND_AND_ZKNE' [-Wimplicit-function-declaration]
       if (RISCV_HAS_ZKND_AND_ZKNE())
           ^~~~~~~~~~~~~~~~~~~~~~~
  make[1]: *** [providers/implementations/ciphers/libdefault-lib-cipher_aes_gcm_hw.o] Error 1
  make: *** [build_libs] Error 2
  thread 'main' panicked at /cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-src-300.2.0+3.2.0/src/lib.rs:611:9:



  Error building OpenSSL:
      Command: cd "/target/riscv64gc-unknown-linux-gnu/debug/build/openssl-sys-f3521352c2d5de8b/out/openssl-build/build/src" && MAKEFLAGS="-j --jobserver-fds=7,8 --jobserver-auth=7,8" "make" "build_libs"
      Exit status: exit status: 2


      
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
+ rustup component list --toolchain stable-x86_64-unknown-linux-gnu
Error: Process completed with exit code 101.

Note: This was built using https://github.com/cross-rs/cross

Build command was: cross test --locked --no-default-features --features=updater-tls-native-vendored --target riscv64gc-unknown-linux-gnu --verbose. I don't know how to figure out what features for the openssl crate itself that corresponds to.

Here is a link to the full CI run: https://github.com/VorpalBlade/chezmoi_modify_manager/actions/runs/7159126052/job/19494770480

@weihanglo
Copy link

See openssl/openssl#22871 and openssl/openssl@ff27959 should have fixed it but not yet released.

@hustcer
Copy link

hustcer commented Jan 23, 2024

When will it be released? Thanks

@weihanglo
Copy link

Looks like upstream openssl 3.2.1 has the fix. People can now help check the release log and update openssl git submodule.

@rami3l
Copy link

rami3l commented Feb 11, 2024

Looks like upstream openssl 3.2.1 has the fix. People can now help check the release log and update openssl git submodule.

@weihanglo This is weird. After updating to 3.2.1 I'm still having the same issue with Rustup (rust-lang/rustup#3668)... Could it be that providers/implementations/ciphers/cipher_aes_gcm* remains unfixed?

--- stderr
  In file included from providers/implementations/ciphers/cipher_aes_gcm.h:12,
                   from providers/implementations/ciphers/cipher_aes_gcm_hw.c:18:
  providers/implementations/ciphers/cipher_aes_gcm_hw_rv64i.inc: In function 'rv64i_zknd_zkne_gcm_initkey':
  providers/implementations/ciphers/cipher_aes_gcm_hw_rv64i.inc:20:31: warning: implicit declaration of function 'rv64i_zkne_set_encrypt_key'; did you mean 'AES_set_encrypt_key'? [-Wimplicit-function-declaration]
       GCM_HW_SET_KEY_CTR_FN(ks, rv64i_zkne_set_encrypt_key, rv64i_zkne_encrypt,
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
  providers/implementations/include/prov/ciphercommon_gcm.h:128:5: note: in definition of macro 'GCM_HW_SET_KEY_CTR_FN'
       fn_set_enc_key(key, keylen * 8, ks);                                       \
       ^~~~~~~~~~~~~~
  providers/implementations/ciphers/cipher_aes_gcm_hw_rv64i.inc:20:59: error: 'rv64i_zkne_encrypt' undeclared (first use in this function); did you mean 'AES_bi_ige_encrypt'?
       GCM_HW_SET_KEY_CTR_FN(ks, rv64i_zkne_set_encrypt_key, rv64i_zkne_encrypt,
                                                             ^~~~~~~~~~~~~~~~~~
  providers/implementations/include/prov/ciphercommon_gcm.h:129:51: note: in definition of macro 'GCM_HW_SET_KEY_CTR_FN'
       CRYPTO_gcm128_init(&ctx->gcm, ks, (block128_f)fn_block);                   \
                                                     ^~~~~~~~
  providers/implementations/ciphers/cipher_aes_gcm_hw_rv64i.inc:20:59: note: each undeclared identifier is reported only once for each function it appears in
       GCM_HW_SET_KEY_CTR_FN(ks, rv64i_zkne_set_encrypt_key, rv64i_zkne_encrypt,
                                                             ^~~~~~~~~~~~~~~~~~
  providers/implementations/include/prov/ciphercommon_gcm.h:129:51: note: in definition of macro 'GCM_HW_SET_KEY_CTR_FN'
       CRYPTO_gcm128_init(&ctx->gcm, ks, (block128_f)fn_block);                   \
                                                     ^~~~~~~~
  In file included from providers/implementations/ciphers/cipher_aes_gcm_hw.c:146:
  providers/implementations/ciphers/cipher_aes_gcm_hw_rv64i.inc: In function 'ossl_prov_aes_hw_gcm':
  providers/implementations/ciphers/cipher_aes_gcm_hw_rv64i.inc:36:9: warning: implicit declaration of function 'RISCV_HAS_ZKND_AND_ZKNE' [-Wimplicit-function-declaration]
       if (RISCV_HAS_ZKND_AND_ZKNE())
           ^~~~~~~~~~~~~~~~~~~~~~~
  make[1]: *** [Makefile:12043: providers/implementations/ciphers/libdefault-lib-cipher_aes_gcm_hw.o] Error 1
  make[1]: *** Waiting for unfinished jobs....
  make: *** [Makefile:2287: build_libs] Error 2
  thread 'main' panicked at /cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-src-300.2.2+3.2.1/src/lib.rs:611:9:



  Error building OpenSSL:
      Command: cd "/checkout/target/riscv64gc-unknown-linux-gnu/debug/build/openssl-sys-fba9372a4c678fb6/out/openssl-build/build/src" && MAKEFLAGS="-j --jobserver-fds=7,10 --jobserver-auth=7,10" "make" "build_libs"
      Exit status: exit status: 2

kxxt added a commit to kxxt/archriscv-packages that referenced this issue Feb 12, 2024
- Remove ring fix
- Remove upstreamed patch
- Don't vendor openssl in check() to avoid
  alexcrichton/openssl-src-rs#222 ,
upstreamed: https://gitlab.archlinux.org/archlinux/packaging/packages/lychee/-/merge_requests/1
felixonmars pushed a commit to felixonmars/archriscv-packages that referenced this issue Feb 13, 2024
- Remove ring fix
- Remove upstreamed patch
- Don't vendor openssl in check() to avoid
  alexcrichton/openssl-src-rs#222 ,
upstreamed: https://gitlab.archlinux.org/archlinux/packaging/packages/lychee/-/merge_requests/1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants