new file mode 100644
@@ -0,0 +1,40 @@
+From b960c0b43a080287a7c13533eeb2d9f288db1414 Mon Sep 17 00:00:00 2001
+From: Florian Festi <ffesti@redhat.com>
+Date: Thu, 16 Mar 2023 19:05:04 +0100
+Subject: [PATCH] Fix compiler error on clang
+
+Turns out variable declarations are not allowed after a label, even in
+C99. And while some compilers don't seem to care others do.
+
+Moving the declaration of mayopen to the start of the function to avoid
+this problem.
+
+Resolves: #2435
+
+Upstream: b960c0b43a080287a7c13533eeb2d9f288db1414
+Signed-off-by: James Knight <james.d.knight@live.com>
+---
+ lib/fsm.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/lib/fsm.c b/lib/fsm.c
+index 5671ac642d..183293edb0 100644
+--- a/lib/fsm.c
++++ b/lib/fsm.c
+@@ -879,6 +879,7 @@ int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfiles files,
+ int nodigest = (rpmtsFlags(ts) & RPMTRANS_FLAG_NOFILEDIGEST) ? 1 : 0;
+ int nofcaps = (rpmtsFlags(ts) & RPMTRANS_FLAG_NOCAPS) ? 1 : 0;
+ int firstlinkfile = -1;
++ int mayopen = 0;
+ char *tid = NULL;
+ struct filedata_s *fdata = xcalloc(fc, sizeof(*fdata));
+ struct filedata_s *firstlink = NULL;
+@@ -1016,7 +1017,7 @@ int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfiles files,
+
+ setmeta:
+ /* Special files require path-based ops */
+- int mayopen = S_ISREG(fp->sb.st_mode) || S_ISDIR(fp->sb.st_mode);
++ mayopen = S_ISREG(fp->sb.st_mode) || S_ISDIR(fp->sb.st_mode);
+ if (!rc && fd == -1 && mayopen) {
+ int flags = O_RDONLY;
+ /* Only follow safe symlinks, and never on temporary files */
@@ -1,5 +1,5 @@
-# From https://rpm.org/wiki/Releases/4.18.0.html
-sha256 2a17152d7187ab30edf2c2fb586463bdf6388de7b5837480955659e5e9054554 rpm-4.18.0.tar.bz2
+# From https://rpm.org/wiki/Releases/4.18.1.html
+sha256 37f3b42c0966941e2ad3f10fde3639824a6591d07197ba8fd0869ca0779e1f56 rpm-4.18.1.tar.bz2
# Hash for license file
sha256 171d94d9f1641316bff7f157a903237dc69cdb5fca405fed8c832c76ed8370f9 COPYING
@@ -5,7 +5,7 @@
################################################################################
RPM_VERSION_MAJOR = 4.18
-RPM_VERSION = $(RPM_VERSION_MAJOR).0
+RPM_VERSION = $(RPM_VERSION_MAJOR).1
RPM_SOURCE = rpm-$(RPM_VERSION).tar.bz2
RPM_SITE = http://ftp.rpm.org/releases/rpm-$(RPM_VERSION_MAJOR).x
RPM_DEPENDENCIES = \
The most recent release of RPM is v4.18.1 [1]. Adding an upstream patch to prevent build failures for certain toolchains (0001-fix-var-declare-in-label-error.patch). Fix should be available next release. [1]: https://rpm.org/wiki/Releases/4.18.1 Signed-off-by: James Knight <james.d.knight@live.com> --- Changes v1 -> v2: - New patch in v2, with changes from the original first patch. --- .../0001-fix-var-declare-in-label-error.patch | 40 +++++++++++++++++++ package/rpm/rpm.hash | 4 +- package/rpm/rpm.mk | 2 +- 3 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 package/rpm/0001-fix-var-declare-in-label-error.patch