Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 923956 - dev-libs/openssl-3.2.1-r1 fails to build on riscv with USE=-asm
Summary: dev-libs/openssl-3.2.1-r1 fails to build on riscv with USE=-asm
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: riscv Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: PATCH, PullRequest
Depends on:
Blocks: openssl32
  Show dependency tree
 
Reported: 2024-02-06 21:29 UTC by Andreas K. Hüttel
Modified: 2024-04-29 23:10 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (dev-libs:openssl-3.2.1-r1:20240206-195736.log,570.81 KB, text/plain)
2024-02-06 21:30 UTC, Andreas K. Hüttel
Details
openssl-riscv.patch (openssl-riscv.patch,4.12 KB, patch)
2024-02-10 00:57 UTC, Jakov Smolić
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas K. Hüttel archtester gentoo-dev 2024-02-06 21:29:34 UTC
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);                   \
      |                                                   ^~~~~~~~
...
...
...
Comment 1 Andreas K. Hüttel archtester gentoo-dev 2024-02-06 21:30:09 UTC
Created attachment 884429 [details]
build log
Comment 2 Jakov Smolić archtester gentoo-dev 2024-02-10 00:57:20 UTC
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.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-03-05 00:50:12 UTC
(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?
Comment 4 immolo 2024-03-05 00:58:26 UTC
So I've confirmed this patch works and see upstream merged it so this should be resolved in the next release.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-03-05 01:01:06 UTC
(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?
Comment 6 immolo 2024-03-05 01:23:56 UTC
I misread that commit. please ignore everything I said after confirming the patch works.
Comment 7 Jakov Smolić archtester gentoo-dev 2024-03-05 15:33:25 UTC
(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
Comment 8 Larry the Git Cow gentoo-dev 2024-03-31 16:48:23 UTC
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(+)
Comment 9 Larry the Git Cow gentoo-dev 2024-04-29 23:10:28 UTC
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(-)