From 35c465232b2ac2dd35d9d0920680563d88d98e45 Mon Sep 17 00:00:00 2001 From: Daniel Uvehag Date: Thu, 10 Mar 2022 09:09:40 +0100 Subject: [PATCH] Fix aarch64 libdroplet compatibility --- bareos.spec | 7 ++++++- libdroplet-aarch64-format.patch | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 libdroplet-aarch64-format.patch diff --git a/bareos.spec b/bareos.spec index 2e7c6ff..a26688e 100644 --- a/bareos.spec +++ b/bareos.spec @@ -36,7 +36,7 @@ Name: bareos Version: 21.0.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Backup Archiving REcovery Open Sourced - metapackage License: AGPL-3.0 @@ -45,6 +45,7 @@ Source0: https://github.com/%{name}/%{name}/archive/Release/%{version}.tar Source1: bareos-tmpfiles.d.conf Patch0: openssl-3.0-warnings.patch +Patch1: libdroplet-aarch64-format.patch BuildRequires: chrpath BuildRequires: gcc @@ -505,6 +506,7 @@ This package contains the CEPH plugins for the file daemon. %prep %setup -q -n %{name}-Release-%{version} %patch0 -p1 +%patch1 -p1 %build # EL7: Use the Developer Toolset 8 compiler as the default is too old. @@ -1229,6 +1231,9 @@ fi %endif %changelog +* Wed Mar 09 2022 Daniel Uvehag 21.0.0-2 +- Patch snprintf format warnings for aarch64 + * Mon Feb 28 2022 Daniel Uvehag 21.0.0-1 - Upgrade to 21.0.0 diff --git a/libdroplet-aarch64-format.patch b/libdroplet-aarch64-format.patch new file mode 100644 index 0000000..6ea6889 --- /dev/null +++ b/libdroplet-aarch64-format.patch @@ -0,0 +1,21 @@ +diff -Naur a/core/src/droplet/libdroplet/src/backend/posix/backend.c b/core/src/droplet/libdroplet/src/backend/posix/backend.c +--- a/core/src/droplet/libdroplet/src/backend/posix/backend.c 2021-12-21 12:00:49.000000000 +0100 ++++ b/core/src/droplet/libdroplet/src/backend/posix/backend.c 2022-03-10 08:53:14.873899783 +0100 +@@ -144,7 +144,7 @@ + goto end; + } + +- snprintf(buf, sizeof(buf), "%ld", st.st_nlink); ++ snprintf(buf, sizeof(buf), "%"PRIuMAX, (uintmax_t)st.st_nlink); + ret2 = dpl_dict_add(metadata, "nlink", buf, 0); + if (DPL_SUCCESS != ret2) { + ret = ret2; +@@ -179,7 +179,7 @@ + goto end; + } + +- snprintf(buf, sizeof(buf), "%lu", st.st_blksize); ++ snprintf(buf, sizeof(buf), "%"PRIuMAX, (uintmax_t)st.st_blksize); + ret2 = dpl_dict_add(metadata, "blksize", buf, 0); + if (DPL_SUCCESS != ret2) { + ret = ret2;