public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rizin] rawhide: Fixes the build with OpenSSL4+ due SM3 detection issue
@ 2026-08-15 20:12 Filipe Rosset
  0 siblings, 0 replies; only message in thread
From: Filipe Rosset @ 2026-08-15 20:12 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/rizin
            Branch : rawhide
            Commit : aceebc271ba636ec93a3aeceac7bb9c6e8d0cfd8
            Author : Filipe Rosset <rosset.filipe@gmail.com>
            Date   : 2026-08-02T22:13:03-03:00
            Stats  : +84/-4 in 3 file(s)
            URL    : https://src.fedoraproject.org/rpms/rizin/c/aceebc271ba636ec93a3aeceac7bb9c6e8d0cfd8?branch=rawhide

            Log:
            Fixes the build with OpenSSL4+ due SM3 detection issue

Resolves: rhbz#2504632

---
diff --git a/6615.patch b/6615.patch
new file mode 100644
index 0000000..3c0be77
--- /dev/null
+++ b/6615.patch
@@ -0,0 +1,39 @@
+From c8be0d61817165d96183ef2051e57c336a8c779e Mon Sep 17 00:00:00 2001
+From: wargio <deroad@kumo.xn--q9jyb4c>
+Date: Sat, 11 Jul 2026 12:45:17 +0800
+Subject: [PATCH] When sm3 on openssl is not available, compile
+ algorithms/sm3/sm3.c
+
+---
+ librz/hash/meson.build | 5 +++++
+ meson.build            | 1 +
+ 2 files changed, 6 insertions(+)
+
+diff --git a/librz/hash/meson.build b/librz/hash/meson.build
+index ede2801b159..f0db4202a2a 100644
+--- a/librz/hash/meson.build
++++ b/librz/hash/meson.build
+@@ -184,6 +184,11 @@ else
+     'algorithms/md5/md5.c',
+     'algorithms/sha1/sha1.c',
+     'algorithms/sha2/sha2.c',
++  ]
++endif
++
++if userconf.get('HAVE_OPENSSL_SM3', 0) == 0
++  rz_hash_sources += [
+     'algorithms/sm3/sm3.c',
+   ]
+ endif
+diff --git a/meson.build b/meson.build
+index 973be5c792e..4e456fb2567 100644
+--- a/meson.build
++++ b/meson.build
+@@ -945,6 +945,7 @@ summary({
+   'System xxhash library': xxhash_dep.found() and xxhash_dep.type_name() != 'internal',
+   'System libmspack library': libmspack_dep.found() and libmspack_dep.type_name() != 'internal',
+   'System openssl library': sys_openssl.found() and sys_openssl.type_name() != 'internal',
++  'System openssl has SM3': userconf.get('HAVE_OPENSSL_SM3', 0) != 0,
+   'System capstone library': capstone_dep.found() and capstone_dep.type_name() != 'internal',
+   'System zydis library': zydis_dep.found() and zydis_dep.type_name() != 'internal',
+   'System tree-sitter library': tree_sitter_dep.found() and tree_sitter_dep.type_name() != 'internal',

diff --git a/openssl-sm3.patch b/openssl-sm3.patch
new file mode 100644
index 0000000..5c72673
--- /dev/null
+++ b/openssl-sm3.patch
@@ -0,0 +1,38 @@
+diff -urN a/librz/hash/p/algo_sm3.c b/librz/hash/p/algo_sm3.c
+--- a/librz/hash/p/algo_sm3.c	2026-06-28 14:25:19.000000000 -0300
++++ b/librz/hash/p/algo_sm3.c	2026-08-02 22:04:10.362303137 -0300
+@@ -4,7 +4,7 @@
+ #include <rz_hash.h>
+ #include <rz_util/rz_assert.h>
+ 
+-#if HAVE_LIB_SSL
++#if HAVE_LIB_SSL && HAVE_OPENSSL_SM3
+ /**
+  * Use OpenSSL lib, not the Rizin implementation
+  */
+diff -urN a/librz/include/rz_userconf.h.in b/librz/include/rz_userconf.h.in
+--- a/librz/include/rz_userconf.h.in	2026-06-28 14:25:19.000000000 -0300
++++ b/librz/include/rz_userconf.h.in	2026-08-02 22:04:15.500061147 -0300
+@@ -37,6 +37,7 @@
+ #define USE_LIB_XXHASH              @USE_LIB_XXHASH@
+ #define USE_SYS_ZYDIS               @USE_SYS_ZYDIS@
+ #define HAVE_LIB_SSL                @HAVE_OPENSSL@
++#define HAVE_OPENSSL_SM3            @HAVE_OPENSSL_SM3@
+ #define HAVE_PTRACE                 @HAVE_PTRACE@
+ #define USE_PTRACE_WRAP             @USE_PTRACE_WRAP@
+ #define HAVE_FORK                   @HAVE_FORK@
+diff -urN a/meson.build b/meson.build
+--- a/meson.build	2026-06-28 14:25:19.000000000 -0300
++++ b/meson.build	2026-08-02 22:04:21.156794714 -0300
+@@ -484,6 +484,11 @@
+   it_userconf.set('PLUGINS', rizin_plugins)
+   it_userconf.set('BINDINGS', rizin_bindings)
+   it_userconf.set10('HAVE_OPENSSL', sys_openssl.found())
++  has_openssl_sm3 = false
++  if sys_openssl.found()
++    has_openssl_sm3 = it_cc.has_function('EVP_sm3', dependencies: sys_openssl)
++  endif
++  it_userconf.set10('HAVE_OPENSSL_SM3', has_openssl_sm3)
+   it_userconf.set10('WANT_DYLINK', true)
+   it_userconf.set10('HAVE_PTRACE', have_ptrace)
+   it_userconf.set10('USE_PTRACE_WRAP', use_ptrace_wrap)

diff --git a/rizin.spec b/rizin.spec
index fd5190a..6e994f6 100644
--- a/rizin.spec
+++ b/rizin.spec
@@ -9,7 +9,6 @@ Release:        %autorelease
 URL:            https://rizin.re/
 
 Source0:        %{forgeurl}/releases/download/v%{version}/%{name}-src-v%{version}.tar.xz
-
 # https://github.com/rizinorg/rizin/pull/5414
 # already in 0.9.1
 # Patch:          rizin-0001-Add-option-to-use-system-BLAKE3.patch
@@ -22,6 +21,11 @@ Source0:        %{forgeurl}/releases/download/v%{version}/%{name}-src-v%{version
 # already in 0.9.1
 # Patch:          rizin-0003-s390x-debug-stubs.patch
 
+# https://github.com/rizinorg/rizin/pull/6615
+# Fixes the build with OpenSSL4+ - EVP_sm3 struct
+Patch:          6615.patch
+Patch:          openssl-sm3.patch
+
 # see .reuse/dep5 for license breakdown
 License:        LGPL-3.0-only AND LGPL-2.1-or-later AND LGPL-2.1-only AND LGPL-2.0-or-later AND GPL-3.0-or-later AND GPL-2.0-or-later AND GPL-2.0-only AND GPL-1.0-or-later AND MIT AND Apache-2.0 AND NCSA AND BSD-3-Clause AND BSD-2-Clause AND CC-BY-SA-4.0 AND CC0-1.0 AND CC-PDDC
 
@@ -157,9 +161,8 @@ information
 %{_includedir}/librz
 %{_libdir}/librz*.so
 %{_libdir}/pkgconfig/*.pc
-%{_libdir}/cmake/**/*.cmake
-%dir %{_libdir}/cmake
-%dir %{_libdir}/cmake/**
+%{_libdir}/cmake/Rizin/
+%{_libdir}/cmake/rz_*/
 
 
 %files common

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-15 20:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-15 20:12 [rpms/rizin] rawhide: Fixes the build with OpenSSL4+ due SM3 detection issue Filipe Rosset

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox