Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Peter Kjellerstedt <pkj@axis.com>
To: <openembedded-core@lists.openembedded.org>
Subject: [PATCH 1/3] busybox: Backport a patch to build with CONFIG_SHA1_HWACCEL on non-x86
Date: Sat, 2 Nov 2024 21:39:08 +0100	[thread overview]
Message-ID: <20241102203910.1267120-1-pkj@axis.com> (raw)

This allows CONFIG_SHA1_HWACCEL to be enabled regardless of the
architecture.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
 ...sha1-on-x86-if-CONFIG_SHA1_HWACCEL-y.patch | 33 +++++++++++++++++++
 meta/recipes-core/busybox/busybox_1.37.0.bb   |  1 +
 2 files changed, 34 insertions(+)
 create mode 100644 meta/recipes-core/busybox/busybox/0001-libbb-fix-sha1-on-x86-if-CONFIG_SHA1_HWACCEL-y.patch

diff --git a/meta/recipes-core/busybox/busybox/0001-libbb-fix-sha1-on-x86-if-CONFIG_SHA1_HWACCEL-y.patch b/meta/recipes-core/busybox/busybox/0001-libbb-fix-sha1-on-x86-if-CONFIG_SHA1_HWACCEL-y.patch
new file mode 100644
index 0000000000..2af188938e
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/0001-libbb-fix-sha1-on-x86-if-CONFIG_SHA1_HWACCEL-y.patch
@@ -0,0 +1,33 @@
+From bf57f732a5b6842f6fa3e0f90385f039e5d6a92c Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi@heitbaum.com>
+Date: Sun, 29 Sep 2024 17:57:55 +0000
+Subject: [PATCH] libbb: fix sha1 on !x86 if CONFIG_SHA1_HWACCEL=y
+
+fixes non i386 and x86 builds
+
+libbb/hash_md5_sha.c: In function 'sha1_end':
+libbb/hash_md5_sha.c:1316:35: error: 'sha1_process_block64_shaNI' undeclared
+ 1316 |          || ctx->process_block == sha1_process_block64_shaNI
+
+Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
+Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
+Upstream-Status: Backport [https://git.busybox.net/busybox/commit/?id=bf57f732a5b6842f6fa3e0f90385f039e5d6a92c]
+Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
+---
+ libbb/hash_md5_sha.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/libbb/hash_md5_sha.c b/libbb/hash_md5_sha.c
+index 57a801459..75a61c32c 100644
+--- a/libbb/hash_md5_sha.c
++++ b/libbb/hash_md5_sha.c
+@@ -1313,7 +1313,9 @@ unsigned FAST_FUNC sha1_end(sha1_ctx_t *ctx, void *resbuf)
+ 	hash_size = 8;
+ 	if (ctx->process_block == sha1_process_block64
+ #if ENABLE_SHA1_HWACCEL
++# if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
+ 	 || ctx->process_block == sha1_process_block64_shaNI
++# endif
+ #endif
+ 	) {
+ 		hash_size = 5;
diff --git a/meta/recipes-core/busybox/busybox_1.37.0.bb b/meta/recipes-core/busybox/busybox_1.37.0.bb
index c3131eb453..3aae6eff4d 100644
--- a/meta/recipes-core/busybox/busybox_1.37.0.bb
+++ b/meta/recipes-core/busybox/busybox_1.37.0.bb
@@ -53,6 +53,7 @@ SRC_URI = "https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
            file://0001-syslogd-fix-wrong-OPT_locallog-flag-detection.patch \
            file://0002-start-stop-daemon-fix-tests.patch \
            file://0003-start-stop-false.patch \
+           file://0001-libbb-fix-sha1-on-x86-if-CONFIG_SHA1_HWACCEL-y.patch \
            "
 SRC_URI:append:libc-musl = " file://musl.cfg"
 SRC_URI:append:x86-64 = " file://sha_accel.cfg"


             reply	other threads:[~2024-11-02 20:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-02 20:39 Peter Kjellerstedt [this message]
2024-11-02 20:39 ` [PATCH 2/3] Revert "busybox: Make provisions to disable sha256/sha1 accelaration on x86" Peter Kjellerstedt
2024-11-02 20:39 ` [PATCH 3/3] busybox: Remove CONFIG_SHA1_SMALL and CONFIG_SHA*_HWACCEL from sha*sum.cfg Peter Kjellerstedt
2024-11-02 22:55 ` [OE-core] [PATCH 1/3] busybox: Backport a patch to build with CONFIG_SHA1_HWACCEL on non-x86 Richard Purdie
     [not found] ` <180448BAD9977D8B.18610@lists.openembedded.org>
2024-11-02 22:57   ` Richard Purdie
2024-11-04  6:53 ` Andrej Valek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241102203910.1267120-1-pkj@axis.com \
    --to=pkj@axis.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox