aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl
diff options
context:
space:
mode:
Diffstat (limited to 'meta-networking/recipes-connectivity/networkmanager/networkmanager/musl')
-rw-r--r--meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0001-Fix-build-with-musl-systemd-specific.patch165
-rw-r--r--meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0002-Fix-build-with-musl.patch116
-rw-r--r--meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0003-Fix-build-with-musl-for-n-dhcp4.patch61
-rw-r--r--meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0004-Fix-build-with-musl-systemd-specific.patch26
4 files changed, 0 insertions, 368 deletions
diff --git a/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0001-Fix-build-with-musl-systemd-specific.patch b/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0001-Fix-build-with-musl-systemd-specific.patch
deleted file mode 100644
index c23fc308fd..0000000000
--- a/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0001-Fix-build-with-musl-systemd-specific.patch
+++ /dev/null
@@ -1,165 +0,0 @@
-From e7ed91c48e1a07527a860637a7865eb67ce34cf3 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
-Date: Tue, 2 Apr 2019 01:34:35 +0200
-Subject: [PATCH] Fix build with musl - systemd specific
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Networkmanager imported some code from systemd. This requires some adjustments
-for musl.
-
-Upstream-Status: Pending
-
-Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
-
----
- shared/systemd/src/basic/in-addr-util.c | 1 +
- shared/systemd/src/basic/process-util.c | 9 +++++++++
- shared/systemd/src/basic/socket-util.h | 6 ++++++
- shared/systemd/src/basic/sort-util.h | 27 ++++---------------------
- shared/systemd/src/basic/stdio-util.h | 2 ++
- shared/systemd/src/basic/string-util.h | 5 +++++
- 6 files changed, 27 insertions(+), 23 deletions(-)
-
-diff --git a/shared/systemd/src/basic/in-addr-util.c b/shared/systemd/src/basic/in-addr-util.c
-index 91d687c..8388304 100644
---- a/shared/systemd/src/basic/in-addr-util.c
-+++ b/shared/systemd/src/basic/in-addr-util.c
-@@ -15,6 +15,7 @@
- #include "in-addr-util.h"
- #include "macro.h"
- #include "parse-util.h"
-+#include "string-util.h"
- #include "random-util.h"
- #include "strxcpyx.h"
- #include "util.h"
-diff --git a/shared/systemd/src/basic/process-util.c b/shared/systemd/src/basic/process-util.c
-index 1456167..42f51a0 100644
---- a/shared/systemd/src/basic/process-util.c
-+++ b/shared/systemd/src/basic/process-util.c
-@@ -17,6 +17,9 @@
- #include <sys/wait.h>
- #include <syslog.h>
- #include <unistd.h>
-+#ifndef __GLIBC__
-+#include <pthread.h>
-+#endif
- #if 0 /* NM_IGNORED */
- #if HAVE_VALGRIND_VALGRIND_H
- #include <valgrind/valgrind.h>
-@@ -1123,11 +1126,13 @@ void reset_cached_pid(void) {
- cached_pid = CACHED_PID_UNSET;
- }
-
-+#ifdef __GLIBC__
- /* We use glibc __register_atfork() + __dso_handle directly here, as they are not included in the glibc
- * headers. __register_atfork() is mostly equivalent to pthread_atfork(), but doesn't require us to link against
- * libpthread, as it is part of glibc anyway. */
- extern int __register_atfork(void (*prepare) (void), void (*parent) (void), void (*child) (void), void *dso_handle);
- extern void* __dso_handle _weak_;
-+#endif
-
- pid_t getpid_cached(void) {
- static bool installed = false;
-@@ -1156,7 +1161,11 @@ pid_t getpid_cached(void) {
- * only half-documented (glibc doesn't document it but LSB does — though only superficially)
- * we'll check for errors only in the most generic fashion possible. */
-
-+#ifdef __GLIBC__
- if (__register_atfork(NULL, NULL, reset_cached_pid, __dso_handle) != 0) {
-+#else
-+ if (pthread_atfork(NULL, NULL, reset_cached_pid) != 0) {
-+#endif
- /* OOM? Let's try again later */
- cached_pid = CACHED_PID_UNSET;
- return new_pid;
-diff --git a/shared/systemd/src/basic/socket-util.h b/shared/systemd/src/basic/socket-util.h
-index a0886e0..da47d14 100644
---- a/shared/systemd/src/basic/socket-util.h
-+++ b/shared/systemd/src/basic/socket-util.h
-@@ -14,6 +14,12 @@
- #include <sys/types.h>
- #include <sys/un.h>
-
-+#if !defined(__GLIBC__)
-+/* SIOCGSTAMPNS from linux/asm-generic.h
-+ * for src/systemd/src/libsystemd-network/sd-lldp.c */
-+#include <linux/sockios.h>
-+#endif
-+
- #include "macro.h"
- #include "missing_socket.h"
- #include "sparse-endian.h"
-diff --git a/shared/systemd/src/basic/sort-util.h b/shared/systemd/src/basic/sort-util.h
-index e029f86..1e8b6e1 100644
---- a/shared/systemd/src/basic/sort-util.h
-+++ b/shared/systemd/src/basic/sort-util.h
-@@ -5,15 +5,10 @@
-
- #include "macro.h"
-
--void *xbsearch_r(const void *key, const void *base, size_t nmemb, size_t size,
-- __compar_d_fn_t compar, void *arg);
--
--#define typesafe_bsearch_r(k, b, n, func, userdata) \
-- ({ \
-- const typeof(b[0]) *_k = k; \
-- int (*_func_)(const typeof(b[0])*, const typeof(b[0])*, typeof(userdata)) = func; \
-- xbsearch_r((const void*) _k, (b), (n), sizeof((b)[0]), (__compar_d_fn_t) _func_, userdata); \
-- })
-+#if !defined(__GLIBC__)
-+typedef int (*__compar_fn_t) (const void*, const void*);
-+typedef __compar_fn_t comparison_fn_t;
-+#endif
-
- /**
- * Normal bsearch requires base to be nonnull. Here were require
-@@ -54,17 +49,3 @@ static inline void qsort_safe(void *base, size_t nmemb, size_t size, __compar_fn
- int (*_func_)(const typeof(p[0])*, const typeof(p[0])*) = func; \
- qsort_safe((p), (n), sizeof((p)[0]), (__compar_fn_t) _func_); \
- })
--
--static inline void qsort_r_safe(void *base, size_t nmemb, size_t size, __compar_d_fn_t compar, void *userdata) {
-- if (nmemb <= 1)
-- return;
--
-- assert(base);
-- qsort_r(base, nmemb, size, compar, userdata);
--}
--
--#define typesafe_qsort_r(p, n, func, userdata) \
-- ({ \
-- int (*_func_)(const typeof(p[0])*, const typeof(p[0])*, typeof(userdata)) = func; \
-- qsort_r_safe((p), (n), sizeof((p)[0]), (__compar_d_fn_t) _func_, userdata); \
-- })
-diff --git a/shared/systemd/src/basic/stdio-util.h b/shared/systemd/src/basic/stdio-util.h
-index c3b9448..e80a938 100644
---- a/shared/systemd/src/basic/stdio-util.h
-+++ b/shared/systemd/src/basic/stdio-util.h
-@@ -1,7 +1,9 @@
- /* SPDX-License-Identifier: LGPL-2.1+ */
- #pragma once
-
-+#if defined(__GLIBC__)
- #include <printf.h>
-+#endif
- #include <stdarg.h>
- #include <stdio.h>
- #include <sys/types.h>
-diff --git a/shared/systemd/src/basic/string-util.h b/shared/systemd/src/basic/string-util.h
-index 04cc82b..2cf589a 100644
---- a/shared/systemd/src/basic/string-util.h
-+++ b/shared/systemd/src/basic/string-util.h
-@@ -26,6 +26,11 @@
- #define strcaseeq(a,b) (strcasecmp((a),(b)) == 0)
- #define strncaseeq(a, b, n) (strncasecmp((a), (b), (n)) == 0)
-
-+/* musl does not know strndupa */
-+#if !defined(__GLIBC__)
-+#define strndupa(x,s) strncpy(alloca(strlen(x)+1),x,s)
-+#endif
-+
- int strcmp_ptr(const char *a, const char *b) _pure_;
-
- static inline bool streq_ptr(const char *a, const char *b) {
diff --git a/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0002-Fix-build-with-musl.patch b/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0002-Fix-build-with-musl.patch
deleted file mode 100644
index 196a3358d0..0000000000
--- a/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0002-Fix-build-with-musl.patch
+++ /dev/null
@@ -1,116 +0,0 @@
-From 877fbb4e848629ff57371b5bdb0d56369abe9d81 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
-Date: Mon, 8 Apr 2019 23:10:43 +0200
-Subject: [PATCH] Fix build with musl
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The build issues caused by definition conflicts musl vs linux-libc headers
-(error: redefinition of ...) can be reduced to two headers:
-
-1. netinet/if_ether.h <-> linux/if_ether.h: linux-libc header plays well with
- glibc and musl headers in case libc's variant (netinet/if_ether.h) is
- included BEFORE linux variant [1]. We add include at two positions:
- 1. shared/nm-default.h: This is a global which used for networkmanager and
- is included at the very beginning of all c-files.
- 2. libnm-core/nm-utils.h: This file makes it into installation and is used
- by dependent packages as network-manager-applet
-2. net/if_arp. <-> linux/if_ether.h: linux-libc: Unfortunaly these files do
- not play together in harmony. Therefore the libc variant is included early in
- shared/nm-default.h and occurances linux/if_arp.h are removed.
-
-Note:
-Be aware that this is still nasty business: We have to trust that musl headers
-define same signatures as linux would do - just because musl-makers consider
-linux-libc headers 'notoriously broken for userspace' [2] (search for
-'error: redefinition of').
-
-[1] http://lists.openembedded.org/pipermail/openembedded-core/2019-March/280440.html
-[2] https://wiki.musl-libc.org/faq.html
-
-Upstream-Status: Pending
-
-Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
-
----
- clients/tui/nmt-device-entry.c | 1 -
- libnm-core/nm-utils.h | 4 ++++
- shared/nm-default.h | 3 +++
- src/devices/nm-device.c | 2 +-
- src/platform/nm-linux-platform.c | 1 -
- 5 files changed, 8 insertions(+), 3 deletions(-)
-
-diff --git a/clients/tui/nmt-device-entry.c b/clients/tui/nmt-device-entry.c
-index 4ab5932..915248c 100644
---- a/clients/tui/nmt-device-entry.c
-+++ b/clients/tui/nmt-device-entry.c
-@@ -26,7 +26,6 @@
- #include "nmt-device-entry.h"
-
- #include <sys/socket.h>
--#include <linux/if_arp.h>
-
- #include "nmtui.h"
-
-diff --git a/libnm-core/nm-utils.h b/libnm-core/nm-utils.h
-index 5418a1e..f492da6 100644
---- a/libnm-core/nm-utils.h
-+++ b/libnm-core/nm-utils.h
-@@ -10,6 +10,10 @@
- #error "Only <NetworkManager.h> can be included directly."
- #endif
-
-+/* include as early as possible for musl */
-+#include <netinet/if_ether.h>
-+/* #include <net/if_arp.h> - uncoment for broken dependents?? */
-+
- #include <glib.h>
-
- #include <netinet/in.h>
-diff --git a/shared/nm-default.h b/shared/nm-default.h
-index ace6ede..25357da 100644
---- a/shared/nm-default.h
-+++ b/shared/nm-default.h
-@@ -182,6 +182,9 @@
- #endif
-
- #include <stdlib.h>
-+/* include as early as possible for musl */
-+#include <netinet/if_ether.h>
-+#include <net/if_arp.h>
-
- /*****************************************************************************/
-
-diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
-index 3bbc975..4e8a3f6 100644
---- a/src/devices/nm-device.c
-+++ b/src/devices/nm-device.c
-@@ -9,6 +9,7 @@
- #include "nm-device.h"
-
- #include <netinet/in.h>
-+#include <net/if.h>
- #include <unistd.h>
- #include <sys/ioctl.h>
- #include <signal.h>
-@@ -17,7 +18,6 @@
- #include <arpa/inet.h>
- #include <fcntl.h>
- #include <linux/if_addr.h>
--#include <linux/if_arp.h>
- #include <linux/rtnetlink.h>
- #include <linux/pkt_sched.h>
-
-diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
-index 7abe4df..9f53147 100644
---- a/src/platform/nm-linux-platform.c
-+++ b/src/platform/nm-linux-platform.c
-@@ -14,7 +14,6 @@
- #include <libudev.h>
- #include <linux/fib_rules.h>
- #include <linux/ip.h>
--#include <linux/if_arp.h>
- #include <linux/if_bridge.h>
- #include <linux/if_link.h>
- #include <linux/if_tun.h>
diff --git a/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0003-Fix-build-with-musl-for-n-dhcp4.patch b/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0003-Fix-build-with-musl-for-n-dhcp4.patch
deleted file mode 100644
index 62252826e2..0000000000
--- a/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0003-Fix-build-with-musl-for-n-dhcp4.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From aff5cded8847f3eee59f5cec22afb8630d401a85 Mon Sep 17 00:00:00 2001
-From: Adrian Freihofer <adrian.freihofer@siemens.com>
-Date: Sat, 7 Mar 2020 14:22:36 +0100
-Subject: [PATCH 3/4] Fix build with musl for n-dhcp4
-
----
- shared/n-dhcp4/src/n-dhcp4-c-probe.c | 8 ++++++++
- shared/n-dhcp4/src/n-dhcp4-private.h | 4 ++++
- 2 files changed, 12 insertions(+)
-
-diff --git a/shared/n-dhcp4/src/n-dhcp4-c-probe.c b/shared/n-dhcp4/src/n-dhcp4-c-probe.c
-index e4477a7..75713c8 100644
---- a/shared/n-dhcp4/src/n-dhcp4-c-probe.c
-+++ b/shared/n-dhcp4/src/n-dhcp4-c-probe.c
-@@ -360,8 +360,12 @@ static void n_dhcp4_client_probe_config_initialize_random_seed(NDhcp4ClientProbe
- seed16v[1] = (u64 >> 16) ^ (u64 >> 0);
- seed16v[2] = (u64 >> 32) ^ (u64 >> 16);
-
-+#ifdef __GLIBC__
- r = seed48_r(seed16v, &config->entropy);
- c_assert(!r);
-+#else
-+ memcpy(config->entropy, seed16v, sizeof seed16v);
-+#endif
- }
-
- /**
-@@ -375,10 +379,14 @@ static void n_dhcp4_client_probe_config_initialize_random_seed(NDhcp4ClientProbe
- */
- uint32_t n_dhcp4_client_probe_config_get_random(NDhcp4ClientProbeConfig *config) {
- long int result;
-+#ifdef __GLIBC__
- int r;
-
- r = mrand48_r(&config->entropy, &result);
- c_assert(!r);
-+#else
-+ result = jrand48(config->entropy);
-+#endif
-
- return result;
- };
-diff --git a/shared/n-dhcp4/src/n-dhcp4-private.h b/shared/n-dhcp4/src/n-dhcp4-private.h
-index 436ee80..ffcb4b2 100644
---- a/shared/n-dhcp4/src/n-dhcp4-private.h
-+++ b/shared/n-dhcp4/src/n-dhcp4-private.h
-@@ -267,7 +267,11 @@ struct NDhcp4ClientProbeConfig {
- bool inform_only;
- bool init_reboot;
- struct in_addr requested_ip;
-+#ifdef __GLIBC__
- struct drand48_data entropy; /* entropy pool */
-+#else
-+ unsigned short entropy[3]; /* entropy pool */
-+#endif
- uint64_t ms_start_delay; /* max ms to wait before starting probe */
- NDhcp4ClientProbeOption *options[UINT8_MAX + 1];
- int8_t request_parameters[UINT8_MAX + 1];
---
-2.24.1
-
diff --git a/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0004-Fix-build-with-musl-systemd-specific.patch b/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0004-Fix-build-with-musl-systemd-specific.patch
deleted file mode 100644
index 55aa4d2655..0000000000
--- a/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0004-Fix-build-with-musl-systemd-specific.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 80c7d3391510993cba1a7499bf33a5b2b115280d Mon Sep 17 00:00:00 2001
-From: Adrian Freihofer <adrian.freihofer@siemens.com>
-Date: Sat, 7 Mar 2020 14:24:01 +0100
-Subject: [PATCH 4/4] Fix build with musl - systemd specific
-
----
- src/systemd/src/libsystemd-network/sd-dhcp6-client.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/src/systemd/src/libsystemd-network/sd-dhcp6-client.c b/src/systemd/src/libsystemd-network/sd-dhcp6-client.c
-index e1150f9..2c63bac 100644
---- a/src/systemd/src/libsystemd-network/sd-dhcp6-client.c
-+++ b/src/systemd/src/libsystemd-network/sd-dhcp6-client.c
-@@ -7,7 +7,9 @@
-
- #include <errno.h>
- #include <sys/ioctl.h>
-+#ifdef __GLIBC__ /* musl supplies full set of userspace headers */
- #include <linux/if_arp.h>
-+#endif
- #include <linux/if_infiniband.h>
-
- #include "sd-dhcp6-client.h"
---
-2.24.1
-