[packages/libxcrypt] Build with -Werror; backport upstream const-qualifier fix

arekm arekm at pld-linux.org
Tue Oct 13 12:32:35 CEST 2026


commit ffb5f0c836563d3b09119f54976d651656e80386
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Tue Oct 13 12:31:45 2026 +0200

    Build with -Werror; backport upstream const-qualifier fix

 libxcrypt-const.patch | 38 ++++++++++++++++++++++++++++++++++++++
 libxcrypt.spec        | 11 ++++++-----
 2 files changed, 44 insertions(+), 5 deletions(-)
---
diff --git a/libxcrypt.spec b/libxcrypt.spec
index e4bc4b2..6d1fdfd 100644
--- a/libxcrypt.spec
+++ b/libxcrypt.spec
@@ -15,6 +15,8 @@ Group:		Libraries
 Source0:	https://github.com/besser82/libxcrypt/archive/v%{version}/%{name}-%{version}.tar.gz
 # Source0-md5:	58533fef6469e7d54f5f70a21952869a
 Patch0:		%{name}-xcrypt.patch
+# https://github.com/besser82/libxcrypt/commit/174c24d6e87aeae631bc0a7bb1ba983cf8def4de
+Patch1:		%{name}-const.patch
 URL:		https://github.com/besser82/libxcrypt
 BuildRequires:	autoconf >= 2.62
 BuildRequires:	automake >= 1:1.14
@@ -108,6 +110,7 @@ dostarczaną przez ten pakiet.
 %prep
 %setup -q
 %{!?with_default_crypt:%patch -P0 -p1}
+%patch -P1 -p1
 
 %build
 %{__libtoolize}
@@ -123,12 +126,11 @@ cd regular
 	--enable-hashes=all \
 %if %{with default_crypt}
 	--disable-obsolete-api \
-	--disable-obsolete-api-enosys \
+	--disable-obsolete-api-enosys
 %else
 	--includedir=%{_includedir}/xcrypt \
-	--disable-xcrypt-compat-files \
+	--disable-xcrypt-compat-files
 %endif
-	--disable-werror
 %{__make}
 
 %if %{with tests}
@@ -142,8 +144,7 @@ cd compat
 %configure \
 	--enable-hashes=all \
 	--enable-obsolete-api=glibc \
-	--enable-obsolete-api-enosys \
-	--disable-werror
+	--enable-obsolete-api-enosys
 %{__make}
 
 %if %{with tests}
diff --git a/libxcrypt-const.patch b/libxcrypt-const.patch
new file mode 100644
index 0000000..15cb405
--- /dev/null
+++ b/libxcrypt-const.patch
@@ -0,0 +1,38 @@
+From 174c24d6e87aeae631bc0a7bb1ba983cf8def4de Mon Sep 17 00:00:00 2001
+From: Stanislav Zidek <szidek at redhat.com>
+Date: Wed, 10 Dec 2025 14:03:54 +0100
+Subject: [PATCH] fix -Werror=discarded-qualifiers
+
+On Fedora rawhide (to be Fedora 44), gcc became more strict
+wrt. const-ness.
+---
+ lib/crypt-gost-yescrypt.c | 2 +-
+ lib/crypt-sm3-yescrypt.c  | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/crypt-gost-yescrypt.c b/lib/crypt-gost-yescrypt.c
+index 190ae94b..e9dc7e80 100644
+--- a/lib/crypt-gost-yescrypt.c
++++ b/lib/crypt-gost-yescrypt.c
+@@ -131,7 +131,7 @@ crypt_gost_yescrypt_rn (const char *phrase, size_t phr_size,
+   intbuf->outbuf[1] = 'g';
+ 
+   /* extract yescrypt output from "$y$param$salt$output" */
+-  char *hptr = strchr ((const char *) intbuf->retval + 3, '$');
++  char *hptr = strchr ((char *) intbuf->retval + 3, '$');
+   if (!hptr)
+     {
+       errno = EINVAL;
+diff --git a/lib/crypt-sm3-yescrypt.c b/lib/crypt-sm3-yescrypt.c
+index 4f42aa66..17da83e1 100644
+--- a/lib/crypt-sm3-yescrypt.c
++++ b/lib/crypt-sm3-yescrypt.c
+@@ -136,7 +136,7 @@ crypt_sm3_yescrypt_rn (const char *phrase, size_t phr_size,
+   intbuf->outbuf[3] = '3';
+ 
+   /* extract yescrypt output from "$y$param$salt$output" */
+-  char *hptr = strchr ((const char *) intbuf->retval + 3, '$');
++  char *hptr = strchr ((char *) intbuf->retval + 3, '$');
+   if (!hptr)
+     {
+       errno = EINVAL;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libxcrypt.git/commitdiff/ffb5f0c836563d3b09119f54976d651656e80386



More information about the pld-cvs-commit mailing list