summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfred Persson Forsberg <cat@catcream.org>2022-07-21 11:33:14 +0300
committerJoonas Niilola <juippis@gentoo.org>2022-07-21 11:37:26 +0300
commitfdaaf77024a0006d4cea03ee2959aab2dcf277c3 (patch)
treef9b45a412ea523cc9531fe976c4b63eb627cb4a9 /app-containers
parentdev-libs/libmpack: drop 1.0.5-r2 (diff)
downloadgentoo-fdaaf77024a0006d4cea03ee2959aab2dcf277c3.tar.gz
gentoo-fdaaf77024a0006d4cea03ee2959aab2dcf277c3.tar.bz2
gentoo-fdaaf77024a0006d4cea03ee2959aab2dcf277c3.zip
app-containers/lxc: Fix build on musl
From: https://github.com/lxc/lxc/commit/8ee8879083f40d2d0b9cef46d6a6907c1b5a814b "STRERROR_R_CHAR_P is always defined to 0 or 1 depending on the value of have_func_strerror_r_char_p in meson.build so replace #ifdef by #if to avoid a redefinition build failure if char *strerror_r is not defined" - strerror_r returns an int on musl (XSI compliant), not char * which causes the build failure due to the reason above. See: https://git.musl-libc.org/cgit/musl/tree/src/string/strerror_r.c#n4 Signed-off-by: Alfred Persson Forsberg <cat@catcream.org> Closes: https://github.com/gentoo/gentoo/pull/26500 Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'app-containers')
-rw-r--r--app-containers/lxc/files/lxc-5.0.0-fix-strerror-r-char-p-musl.patch36
-rw-r--r--app-containers/lxc/lxc-5.0.0.ebuild3
2 files changed, 38 insertions, 1 deletions
diff --git a/app-containers/lxc/files/lxc-5.0.0-fix-strerror-r-char-p-musl.patch b/app-containers/lxc/files/lxc-5.0.0-fix-strerror-r-char-p-musl.patch
new file mode 100644
index 000000000000..fdd7aa24ad8a
--- /dev/null
+++ b/app-containers/lxc/files/lxc-5.0.0-fix-strerror-r-char-p-musl.patch
@@ -0,0 +1,36 @@
+https://github.com/lxc/lxc/commit/8ee8879083f40d2d0b9cef46d6a6907c1b5a814b
+
+From 8ee8879083f40d2d0b9cef46d6a6907c1b5a814b Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Thu, 14 Jul 2022 12:31:21 +0200
+Subject: [PATCH] src/lxc/log.h: fix STRERROR_R_CHAR_P
+
+STRERROR_R_CHAR_P is always defined to 0 or 1 depending on the value of
+have_func_strerror_r_char_p in meson.build so replace #ifdef by #if to
+avoid a redefinition build failure if char *strerror_r is not defined
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ src/lxc/log.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/lxc/log.h b/src/lxc/log.h
+index 554a2e1d48..fcddc679a8 100644
+--- a/src/lxc/log.h
++++ b/src/lxc/log.h
+@@ -304,13 +304,13 @@ __lxc_unused static inline void LXC_##LEVEL(struct lxc_log_locinfo* locinfo, \
+ * Helper macro to define errno string.
+ */
+ #if HAVE_STRERROR_R
+- #ifdef STRERROR_R_CHAR_P
++ #if STRERROR_R_CHAR_P
+ char *strerror_r(int errnum, char *buf, size_t buflen);
+ #else
+ int strerror_r(int errnum, char *buf, size_t buflen);
+ #endif
+
+- #ifdef STRERROR_R_CHAR_P
++ #if STRERROR_R_CHAR_P
+ #define lxc_log_strerror_r \
+ char errno_buf[PATH_MAX / 2] = {"Failed to get errno string"}; \
+ char *ptr = NULL; \
diff --git a/app-containers/lxc/lxc-5.0.0.ebuild b/app-containers/lxc/lxc-5.0.0.ebuild
index 32030fd52c47..975d697a0e5b 100644
--- a/app-containers/lxc/lxc-5.0.0.ebuild
+++ b/app-containers/lxc/lxc-5.0.0.ebuild
@@ -67,7 +67,8 @@ VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/linuxcontainers.asc
DOCS=( AUTHORS CONTRIBUTING MAINTAINERS README.md doc/FAQ.txt )
-PATCHES=( "${FILESDIR}"/lxc-5.0.0-dont-depend-on-static-libcap.patch )
+PATCHES=( "${FILESDIR}"/lxc-5.0.0-dont-depend-on-static-libcap.patch
+ "${FILESDIR}"/${PN}-5.0.0-fix-strerror-r-char-p-musl.patch )
pkg_setup() {
linux-info_pkg_setup