pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lvm2: Fix build with musl-libc



Module Name:	pkgsrc-wip
Committed By:	Sijmen J. Mulder <sjmulder%NetBSD.org@localhost>
Pushed By:	sjmulder
Date:		Sat Aug 7 19:15:43 2021 +0200
Changeset:	f196b25295ce7df78b8597766f8b31a68634ef8c

Modified Files:
	lvm2/distinfo
Added Files:
	lvm2/patches/patch-lib_device_dev-cache.c
	lvm2/patches/patch-lib_mm_memlock.c
	lvm2/patches/patch-tools_lvmcmdline.c
	lvm2/patches/patch-tools_tools.h
Removed Files:
	lvm2/TODO

Log Message:
lvm2: Fix build with musl-libc

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=f196b25295ce7df78b8597766f8b31a68634ef8c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 lvm2/TODO                                 |  1 -
 lvm2/distinfo                             |  4 ++++
 lvm2/patches/patch-lib_device_dev-cache.c | 14 ++++++++++++++
 lvm2/patches/patch-lib_mm_memlock.c       | 30 ++++++++++++++++++++++++++++++
 lvm2/patches/patch-tools_lvmcmdline.c     | 29 +++++++++++++++++++++++++++++
 lvm2/patches/patch-tools_tools.h          | 14 ++++++++++++++
 6 files changed, 91 insertions(+), 1 deletion(-)

diffs:
diff --git a/lvm2/TODO b/lvm2/TODO
deleted file mode 100644
index 87518f0443..0000000000
--- a/lvm2/TODO
+++ /dev/null
@@ -1 +0,0 @@
-- Undefined LOCK_EX and LOCK_SH on Void Linux with musl-libc.
diff --git a/lvm2/distinfo b/lvm2/distinfo
index 46708444e9..b17814274a 100644
--- a/lvm2/distinfo
+++ b/lvm2/distinfo
@@ -5,3 +5,7 @@ RMD160 (LVM2.2.03.12.tgz) = 997e07fd3ff78a81987d607337dffdd817e82546
 SHA512 (LVM2.2.03.12.tgz) = e4d3bfb38b346251a2ea2cee7b79f2e12ed407652b659b35b65f58c8bb252943cee1c511713aeec8ff3400790e0e99ea6b83e8740050defe5cbb118f18bf7700
 Size (LVM2.2.03.12.tgz) = 2594040 bytes
 SHA1 (patch-configure) = ce48968f66d7a6ec4997da43ad3ef835615d9aea
+SHA1 (patch-lib_device_dev-cache.c) = 6c4143263280b414538bb1c2afa43ea8d3a6b69b
+SHA1 (patch-lib_mm_memlock.c) = 8965dcc419c11db5a906d8c3ac320cab1580e460
+SHA1 (patch-tools_lvmcmdline.c) = 36324688b98e1fdca405b0ddfc919d7048c7e67a
+SHA1 (patch-tools_tools.h) = a6b9d5468bbcbdd1d504efdbbb56356aded15720
diff --git a/lvm2/patches/patch-lib_device_dev-cache.c b/lvm2/patches/patch-lib_device_dev-cache.c
new file mode 100644
index 0000000000..5d4f9fb3d0
--- /dev/null
+++ b/lvm2/patches/patch-lib_device_dev-cache.c
@@ -0,0 +1,14 @@
+$NetBSD$
+
+Include <sys/file.h> for LOCK_* (needed for musl-libc).
+
+--- lib/device/dev-cache.c.orig	2021-05-07 21:14:09.000000000 +0000
++++ lib/device/dev-cache.c
+@@ -29,6 +29,7 @@
+ #include <unistd.h>
+ #include <dirent.h>
+ #include <locale.h>
++#include <sys/file.h>
+ 
+ struct dev_iter {
+ 	struct btree_iter *current;
diff --git a/lvm2/patches/patch-lib_mm_memlock.c b/lvm2/patches/patch-lib_mm_memlock.c
new file mode 100644
index 0000000000..47b1d7e3b6
--- /dev/null
+++ b/lvm2/patches/patch-lib_mm_memlock.c
@@ -0,0 +1,30 @@
+$NetBSD$
+
+Guard GNU libc-ism (use of mallinfo()).
+
+--- lib/mm/memlock.c.orig	2021-05-07 21:14:09.000000000 +0000
++++ lib/mm/memlock.c
+@@ -22,6 +22,7 @@
+ #include <limits.h>
+ #include <fcntl.h>
+ #include <unistd.h>
++#include <features.h>	/* for __GNU_LIBRARY__ check */
+ #include <sys/mman.h>
+ #include <sys/time.h>
+ #include <sys/resource.h>
+@@ -176,6 +177,7 @@ static void _allocate_memory(void)
+ 	}
+ 	/* FIXME else warn user setting got ignored */
+ 
++#ifdef __GNU_LIBRARY__	/* mallinfo() is glibc-specific */
+         /*
+          *  When a brk() fails due to fragmented address space (which sometimes
+          *  happens when we try to grab 8M or so), glibc will make a new
+@@ -213,6 +215,7 @@ static void _allocate_memory(void)
+ 			break;
+ 		}
+ 	}
++#endif /* __GNU_LIBRARY__ */
+ 
+ 	if ((_malloc_mem = malloc(_size_malloc)))
+ 		_touch_memory(_malloc_mem, _size_malloc);
diff --git a/lvm2/patches/patch-tools_lvmcmdline.c b/lvm2/patches/patch-tools_lvmcmdline.c
new file mode 100644
index 0000000000..a48656ce41
--- /dev/null
+++ b/lvm2/patches/patch-tools_lvmcmdline.c
@@ -0,0 +1,29 @@
+$NetBSD$
+
+Guard GNU libc-ism (assignable stdin/stdout/stderr).
+
+--- tools/lvmcmdline.c.orig	2021-05-07 21:14:09.000000000 +0000
++++ tools/lvmcmdline.c
+@@ -3341,6 +3341,7 @@ static int _check_standard_fds(void)
+ {
+ 	int err = is_valid_fd(STDERR_FILENO);
+ 
++#ifdef __GNU_LIBARY__	/* on glibc std* are assignable */
+ 	if (!is_valid_fd(STDIN_FILENO) &&
+ 	    !(stdin = fopen(_PATH_DEVNULL, "r"))) {
+ 		if (err)
+@@ -3365,6 +3366,14 @@ static int _check_standard_fds(void)
+ 		       strerror(errno));
+ 		return 0;
+ 	}
++#else
++	if (!is_valid_fd(STDIN_FILENO))
++		return 0;
++	if (!is_valid_fd(STDOUT_FILENO))
++		return 0;
++	if (!is_valid_fd(STDERR_FILENO))
++		return 0;
++#endif
+ 
+ 	return 1;
+ }
diff --git a/lvm2/patches/patch-tools_tools.h b/lvm2/patches/patch-tools_tools.h
new file mode 100644
index 0000000000..68daab9fe2
--- /dev/null
+++ b/lvm2/patches/patch-tools_tools.h
@@ -0,0 +1,14 @@
+$NetBSD$
+
+Include <sys/file.h> for LOCK_* (needed for musl-libc).
+
+--- tools/tools.h.orig	2021-05-07 21:14:09.000000000 +0000
++++ tools/tools.h
+@@ -47,6 +47,7 @@
+ 
+ #include <ctype.h>
+ #include <sys/types.h>
++#include <sys/file.h>	/* LOCK_* */
+ 
+ #define CMD_LEN 256
+ #define MAX_ARGS 64


Home | Main Index | Thread Index | Old Index