summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Pronin <dannftk@yandex.ru>2023-10-23 17:44:31 +0300
committerSam James <sam@gentoo.org>2023-12-14 08:14:21 +0000
commit184cddf3f85fde7effacd6c8bc5f8f4801062163 (patch)
tree7fdcb55ffaa13212e808cffd07f5207b2bbfae9a /app-arch/rpm
parentnet-wireless/bluez: Stabilize 5.70-r1 ppc64, #919864 (diff)
downloadgentoo-184cddf3f85fde7effacd6c8bc5f8f4801062163.tar.gz
gentoo-184cddf3f85fde7effacd6c8bc5f8f4801062163.tar.bz2
gentoo-184cddf3f85fde7effacd6c8bc5f8f4801062163.zip
app-arch/rpm: fix building RPM package with clang
Signed-off-by: Denis Pronin <dannftk@yandex.ru> Closes: https://github.com/gentoo/gentoo/pull/33471 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'app-arch/rpm')
-rw-r--r--app-arch/rpm/files/rpm-4.8.1-clang.patch52
-rw-r--r--app-arch/rpm/rpm-4.18.1.ebuild1
2 files changed, 53 insertions, 0 deletions
diff --git a/app-arch/rpm/files/rpm-4.8.1-clang.patch b/app-arch/rpm/files/rpm-4.8.1-clang.patch
new file mode 100644
index 000000000000..714fbc09b534
--- /dev/null
+++ b/app-arch/rpm/files/rpm-4.8.1-clang.patch
@@ -0,0 +1,52 @@
+https://github.com/rpm-software-management/rpm/commit/6ad8a71407b173b6c50d389f01edd8a4aecd6807
+--- a/lib/fsm.c
++++ b/lib/fsm.c
+@@ -1015,27 +1015,28 @@
+ }
+
+ setmeta:
+- /* Special files require path-based ops */
+- int 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 */
+- if (fp->suffix)
+- flags |= AT_SYMLINK_NOFOLLOW;
+- fd = fsmOpenat(di.dirfd, fp->fpath, flags,
+- S_ISDIR(fp->sb.st_mode));
+- if (fd < 0)
+- rc = RPMERR_OPEN_FAILED;
+- }
++ {
++ /* Special files require path-based ops */
++ int 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 */
++ if (fp->suffix)
++ flags |= AT_SYMLINK_NOFOLLOW;
++ fd = fsmOpenat(di.dirfd, fp->fpath, flags,
++ S_ISDIR(fp->sb.st_mode));
++ if (fd < 0)
++ rc = RPMERR_OPEN_FAILED;
++ }
++ if (!rc && fp->setmeta) {
++ rc = fsmSetmeta(fd, di.dirfd, fp->fpath,
++ fi, plugins, fp->action,
++ &fp->sb, nofcaps);
++ }
+
+- if (!rc && fp->setmeta) {
+- rc = fsmSetmeta(fd, di.dirfd, fp->fpath,
+- fi, plugins, fp->action,
+- &fp->sb, nofcaps);
+- }
+-
+- if (fd != firstlinkfile)
+- fsmClose(&fd);
++ if (fd != firstlinkfile)
++ fsmClose(&fd);
++ }
+ }
+
+ /* Notify on success. */
diff --git a/app-arch/rpm/rpm-4.18.1.ebuild b/app-arch/rpm/rpm-4.18.1.ebuild
index b05d5a57334b..27f9c7e5e81a 100644
--- a/app-arch/rpm/rpm-4.18.1.ebuild
+++ b/app-arch/rpm/rpm-4.18.1.ebuild
@@ -63,6 +63,7 @@ RDEPEND="
PATCHES=(
"${FILESDIR}"/${PN}-4.8.1-db-path.patch
+ "${FILESDIR}"/${PN}-4.8.1-clang.patch
"${FILESDIR}"/${PN}-4.17.0-libdir.patch
)