summaryrefslogtreecommitdiff
path: root/sys-fs/mdadm/files
diff options
context:
space:
mode:
Diffstat (limited to 'sys-fs/mdadm/files')
-rw-r--r--sys-fs/mdadm/files/mdadm-4.3-in_initrd-collision.patch45
-rw-r--r--sys-fs/mdadm/files/mdadm-4.3-ldflags.patch11
2 files changed, 56 insertions, 0 deletions
diff --git a/sys-fs/mdadm/files/mdadm-4.3-in_initrd-collision.patch b/sys-fs/mdadm/files/mdadm-4.3-in_initrd-collision.patch
new file mode 100644
index 000000000000..54e4aadacb58
--- /dev/null
+++ b/sys-fs/mdadm/files/mdadm-4.3-in_initrd-collision.patch
@@ -0,0 +1,45 @@
+Fix collision with libudev symbols when statically linking.
+
+https://bugs.gentoo.org/830485
+--- a/mdadm.h
++++ b/mdadm.h
+@@ -1665,7 +1665,7 @@
+ extern void udev_block(char *devnm);
+ extern void udev_unblock(void);
+
+-extern int in_initrd(void);
++extern int mdadm_in_initrd(void);
+
+ struct cmap_hooks {
+ void *cmap_handle; /* corosync lib related */
+--- a/mdmon.c
++++ b/mdmon.c
+@@ -309,7 +309,7 @@
+ {NULL, 0, NULL, 0}
+ };
+
+- if (in_initrd()) {
++ if (mdadm_in_initrd()) {
+ /*
+ * set first char of argv[0] to @. This is used by
+ * systemd to signal that the task was launched from
+--- a/util.c
++++ b/util.c
+@@ -1960,7 +1960,7 @@
+ int len;
+ pid_t pid;
+ int status;
+- char *prefix = in_initrd() ? "initrd-" : "";
++ char *prefix = mdadm_in_initrd() ? "initrd-" : "";
+ char pathbuf[1024];
+ char *paths[4] = {
+ pathbuf,
+@@ -2219,7 +2219,7 @@
+ return 0;
+ }
+
+-int in_initrd(void)
++int mdadm_in_initrd(void)
+ {
+ /* This is based on similar function in systemd. */
+ struct statfs s;
diff --git a/sys-fs/mdadm/files/mdadm-4.3-ldflags.patch b/sys-fs/mdadm/files/mdadm-4.3-ldflags.patch
new file mode 100644
index 000000000000..e8e93d424592
--- /dev/null
+++ b/sys-fs/mdadm/files/mdadm-4.3-ldflags.patch
@@ -0,0 +1,11 @@
+--- mdadm-4.3/Makefile.orig 2024-03-13 20:11:48.949678469 -0700
++++ mdadm-4.3/Makefile 2024-03-13 20:11:52.773671814 -0700
+@@ -132,7 +132,7 @@
+ MON_LDFLAGS += -pthread
+ endif
+
+-LDFLAGS = -Wl,-z,now,-z,noexecstack
++LDFLAGS += -Wl,-z,now,-z,noexecstack
+
+ # If you want a static binary, you might uncomment these
+ # LDFLAGS += -static