dev-libs/openssl-3.2.1-r1 fails to build on riscv with USE=-asm (found during stage1 build) riscv64-unknown-linux-gnu-gcc -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl-3.2.1 -I../openssl-3.2.1/crypto -I../openssl-3.2.1/include -I../openssl-3.2.1/providers/implementations/include -I../openssl-3.2.1/providers/common/include -fPIC -pthread -O2 -pipe -fno-strict-aliasing -Wa,--noexecstack -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSLDIR="\"/etc/ssl\"" -DENGINESDIR="\"/usr/lib64/engines-3\"" -DMODULESDIR="\"/usr/lib64/ossl-modules\"" -DOPENSSL_BUILDING_OPENSSL -DNDEBUG -DL_ENDIAN -MMD -MF providers/implementations/ciphers/libdefault-lib-cipher_aria_ccm.d.tmp -MT providers/implementations/ciphers/libdefault-lib-cipher_aria_ccm.o -c -o providers/implementations/ciphers/libdefault-lib-cipher_aria_ccm.o ../openssl-3.2.1/providers/implementations/ciphers/cipher_aria_ccm.c In file included from ../openssl-3.2.1/providers/implementations/ciphers/cipher_aes_gcm.h:12, from ../openssl-3.2.1/providers/implementations/ciphers/cipher_aes_gcm_hw.c:18: ../openssl-3.2.1/providers/implementations/ciphers/cipher_aes_gcm_hw_rv64i.inc: In function 'rv64i_zknd_zkne_gcm_initkey': ../openssl-3.2.1/providers/implementations/ciphers/cipher_aes_gcm_hw_rv64i.inc:20:31: warning: implicit declaration of function 'rv64i_zkne_set_encrypt_key' [-Wimplicit-function-declaration] 20 | GCM_HW_SET_KEY_CTR_FN(ks, rv64i_zkne_set_encrypt_key, rv64i_zkne_encrypt, | ^~~~~~~~~~~~~~~~~~~~~~~~~~ ../openssl-3.2.1/providers/implementations/include/prov/ciphercommon_gcm.h:128:5: note: in definition of macro 'GCM_HW_SET_KEY_CTR_FN' 128 | fn_set_enc_key(key, keylen * 8, ks); \ | ^~~~~~~~~~~~~~ riscv64-unknown-linux-gnu-gcc -I. -Icrypto -Iinclude -Iproviders/implementations/include -Iproviders/common/include -I../openssl-3.2.1 -I../openssl-3.2.1/crypto -I../openssl-3.2.1/include -I../openssl-3.2.1/providers/implementations/include -I../openssl-3.2.1/providers/common/include -fPIC -pthread -O2 -pipe -fno-strict-aliasing -Wa,--noexecstack -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSLDIR="\"/etc/ssl\"" -DENGINESDIR="\"/usr/lib64/engines-3\"" -DMODULESDIR="\"/usr/lib64/ossl-modules\"" -DOPENSSL_BUILDING_OPENSSL -DNDEBUG -DL_ENDIAN -MMD -MF providers/implementations/ciphers/libdefault-lib-cipher_aria_ccm_hw.d.tmp -MT providers/implementations/ciphers/libdefault-lib-cipher_aria_ccm_hw.o -c -o providers/implementations/ciphers/libdefault-lib-cipher_aria_ccm_hw.o ../openssl-3.2.1/providers/implementations/ciphers/cipher_aria_ccm_hw.c ../openssl-3.2.1/providers/implementations/ciphers/cipher_aes_gcm_hw_rv64i.inc:20:59: error: 'rv64i_zkne_encrypt' undeclared (first use in this function) 20 | GCM_HW_SET_KEY_CTR_FN(ks, rv64i_zkne_set_encrypt_key, rv64i_zkne_encrypt, | ^~~~~~~~~~~~~~~~~~ ../openssl-3.2.1/providers/implementations/include/prov/ciphercommon_gcm.h:129:51: note: in definition of macro 'GCM_HW_SET_KEY_CTR_FN' 129 | CRYPTO_gcm128_init(&ctx->gcm, ks, (block128_f)fn_block); \ | ^~~~~~~~ ... ... ...
Created attachment 884429 [details] build log
Created attachment 884646 [details, diff] openssl-riscv.patch Attached patch fixed compilation. The check for OPENSSL_CPUID_OBJ likely needs to be added to other riscv checks in providers/implementations/ciphers in same way as in https://github.com/openssl/openssl/pull/22881 I'll look into submitting this upstream.
(In reply to Jakov Smolić from comment #2) > Created attachment 884646 [details, diff] [details, diff] > openssl-riscv.patch > > Attached patch fixed compilation. The check for OPENSSL_CPUID_OBJ likely > needs to be added to other riscv checks in providers/implementations/ciphers > in same way as in https://github.com/openssl/openssl/pull/22881 > I'll look into submitting this upstream. Any news?
So I've confirmed this patch works and see upstream merged it so this should be resolved in the next release.
(In reply to immolo from comment #4) > So I've confirmed this patch works and see upstream merged it so this should > be resolved in the next release. Where? Nobody submitted it upstream yet?
I misread that commit. please ignore everything I said after confirming the patch works.
(In reply to Sam James from comment #3) > (In reply to Jakov Smolić from comment #2) > > Created attachment 884646 [details, diff] [details, diff] [details, diff] > > openssl-riscv.patch > > > > Attached patch fixed compilation. The check for OPENSSL_CPUID_OBJ likely > > needs to be added to other riscv checks in providers/implementations/ciphers > > in same way as in https://github.com/openssl/openssl/pull/22881 > > I'll look into submitting this upstream. > > Any news? Thanks for pinging, I've forgotten about it in the meantime, I'll submit the patch today
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=64867ad1eb261d199c0e80a71b24d1a9d6769c39 commit 64867ad1eb261d199c0e80a71b24d1a9d6769c39 Author: Jakov Smolić <jsmolic@gentoo.org> AuthorDate: 2024-03-24 17:47:21 +0000 Commit: Jakov Smolić <jsmolic@gentoo.org> CommitDate: 2024-03-31 16:48:16 +0000 dev-libs/openssl: Backport riscv patch to 3.2.1 Closes: https://bugs.gentoo.org/923956 Signed-off-by: Jakov Smolić <jsmolic@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/35901 Signed-off-by: Jakov Smolić <jsmolic@gentoo.org> dev-libs/openssl/files/openssl-3.2.1-riscv.patch | 70 ++++++++++++++++++++++++ dev-libs/openssl/openssl-3.2.1-r1.ebuild | 2 + 2 files changed, 72 insertions(+)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/releng.git/commit/?id=f1b7efed71088300172f3a342ee24759c9b200f9 commit f1b7efed71088300172f3a342ee24759c9b200f9 Author: Matoro Mahri <matoro_gentoo@matoro.tk> AuthorDate: 2024-04-29 17:26:07 +0000 Commit: Matoro Mahri <matoro_gentoo@matoro.tk> CommitDate: 2024-04-29 17:26:07 +0000 releases: remove dev-lang/openssl-3.2 masks And old specific version mask for 3.0. Both relevant bugs fixed. Bug: https://bugs.gentoo.org.923957 Bug: https://bugs.gentoo.org/923956 Signed-off-by: Matoro Mahri <matoro_gentoo@matoro.tk> releases/portage/isos-qemu/package.mask/releng/openssl | 3 --- releases/portage/isos/package.mask/releng/openssl | 3 --- releases/portage/livegui/package.mask/releng/openssl | 3 --- releases/portage/stages-qemu/package.mask/releng/openssl | 4 ---- releases/portage/stages/package.mask/releng/openssl | 4 ---- 5 files changed, 17 deletions(-)