From fc8eff0c76ab35db7d783ce7959193ff4c30a01e Mon Sep 17 00:00:00 2001 From: Grant Nichol Date: Sat, 23 Dec 2023 01:07:30 -0600 Subject: [PATCH] package/libopenssl: use riscv-specific configure target Adds BR2_PACKAGE_LIBOPENSSL_TARGET_ARCH for riscv32 and riscv64. Otherwise, riscv targets fall back to the linux-generic libopenssl configs. This exacerbates the issue partially addressed in openssl/openssl#22871 which causes build failures. Fixes a mispelling in upstream causing 0builds for riscv32 to fail when linking. Signed-off-by: Grant Nichol [yann.morin.1998@free.fr: squash the two commits together] Signed-off-by: Yann E. MORIN --- ...x-mispelling-of-extension-test-macro.patch | 30 +++++++++++++++++++ package/libopenssl/Config.in | 2 ++ 2 files changed, 32 insertions(+) create mode 100644 package/libopenssl/0004-riscv-Fix-mispelling-of-extension-test-macro.patch diff --git a/package/libopenssl/0004-riscv-Fix-mispelling-of-extension-test-macro.patch b/package/libopenssl/0004-riscv-Fix-mispelling-of-extension-test-macro.patch new file mode 100644 index 0000000000..93b191a61c --- /dev/null +++ b/package/libopenssl/0004-riscv-Fix-mispelling-of-extension-test-macro.patch @@ -0,0 +1,30 @@ +From 68c549df05892c16b99603b9a831c79c540f268c Mon Sep 17 00:00:00 2001 +From: Grant Nichol +Date: Fri, 22 Dec 2023 23:46:39 -0600 +Subject: [PATCH] riscv: Fix mispelling of extension test macro + +When refactoring the riscv extension test macros, +RISCV_HAS_ZKND_AND_ZKNE was mispelled. + +Upstream: https://github.com/openssl/openssl/pull/23139 +Signed-off-by: Grant Nichol +--- + providers/implementations/ciphers/cipher_aes_xts_hw.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/providers/implementations/ciphers/cipher_aes_xts_hw.c b/providers/implementations/ciphers/cipher_aes_xts_hw.c +index b35b71020e..65adc47d1f 100644 +--- a/providers/implementations/ciphers/cipher_aes_xts_hw.c ++++ b/providers/implementations/ciphers/cipher_aes_xts_hw.c +@@ -285,7 +285,7 @@ static const PROV_CIPHER_HW aes_xts_rv32i_zbkb_zknd_zkne = { \ + # define PROV_CIPHER_HW_select_xts() \ + if (RISCV_HAS_ZBKB_AND_ZKND_AND_ZKNE()) \ + return &aes_xts_rv32i_zbkb_zknd_zkne; \ +-if (RISCV_HAS_ZKND_ZKNE()) \ ++if (RISCV_HAS_ZKND_AND_ZKNE()) \ + return &aes_xts_rv32i_zknd_zkne; + # else + /* The generic case */ +-- +2.43.0 + diff --git a/package/libopenssl/Config.in b/package/libopenssl/Config.in index 3199de8cfe..49958d9fd6 100644 --- a/package/libopenssl/Config.in +++ b/package/libopenssl/Config.in @@ -23,6 +23,8 @@ config BR2_PACKAGE_LIBOPENSSL_TARGET_ARCH default "linux-x86" if BR2_i386 && !BR2_TOOLCHAIN_HAS_LIBATOMIC default "linux-x86-latomic" if BR2_i386 && BR2_TOOLCHAIN_HAS_LIBATOMIC default "linux-x86_64" if BR2_x86_64 + default "linux64-riscv64" if BR2_riscv && BR2_ARCH_IS_64 + default "linux32-riscv32" if BR2_riscv && !BR2_ARCH_IS_64 # no-asm is needed with generic architectures such as # linux-generic{32,64}, see # https://github.com/openssl/openssl/issues/9839