Skip to contentSkip to conversation

networkmanager: fix gobject-introspection/musl and cleanup

PATCH New Andreas Müller 1 participant 3 messages Apr 17, 2018 – Apr 25, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/2 networkmanager: fix gobject-introspection/musl and cleanup

This adresses the comments for recent patch which updated nm to 1.10.6 and is a follow-up for [1].

* Make gobject-introspection work by skipping creation of gobject-introspection specific documentation. This fixes networkmanager-applet regression.
* Cleanup patches: Remove current musl patches completely and re-use those found in void-linux because they do look much cleaner and don't touch glibc build. Since void-linux does not use systemd there have to be two patches added.

[1] https://patchwork.openembedded.org/patch/149244/

---
V1->V2: Fix parsing error introduced in V1
V2->V3: Fix musl build - now build tested

 ...adjust-net-headers-for-musl-compatibility.patch | 86 --------------------
 ...move-net-ethernet.h-seems-to-be-over-spe.patch} |  0
 ...igure.ac-Fix-pkgconfig-sysroot-locations.patch} |  0
 ...et-util.h-Include-linux-sockios.h-on-musl.patch | 30 -------
 .../networkmanager/0003-Define-ETH_ALEN.patch      | 39 ---------
 ...te-settings-settings-property-documentati.patch | 77 ++++++++++++++++++
 ...Define-missing-features-to-cater-for-musl.patch | 92 ----------------------
 .../0006-check-for-strndupa-before-using-it.patch  | 67 ----------------
 .../networkmanager/musl/0001-musl-basic.patch      | 53 +++++++++++++
 .../musl/0002-musl-dlopen-configure-ac.patch       | 35 ++++++++
 .../musl/0003-musl-network-support.patch           | 72 +++++++++++++++++
 .../musl/0004-musl-process-util.patch              | 62 +++++++++++++++
 ...further-conflicts-by-including-net-ethern.patch | 77 ++++++++++++++++++
 .../0006-Add-a-strndupa-replacement-for-musl.patch | 47 +++++++++++
 .../networkmanager/networkmanager_1.10.6.bb        | 39 +++++----
 15 files changed, 448 insertions(+), 328 deletions(-)
 delete mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-adjust-net-headers-for-musl-compatibility.patch
 rename meta-networking/recipes-connectivity/networkmanager/networkmanager/{0005-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch => 0001-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch} (100%)
 rename meta-networking/recipes-connectivity/networkmanager/networkmanager/{0007-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch => 0002-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch} (100%)
 delete mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-socket-util.h-Include-linux-sockios.h-on-musl.patch
 delete mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/0003-Define-ETH_ALEN.patch
 create mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/0003-Do-not-create-settings-settings-property-documentati.patch
 delete mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/0004-Define-missing-features-to-cater-for-musl.patch
 delete mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/0006-check-for-strndupa-before-using-it.patch
 create mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0001-musl-basic.patch
 create mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0002-musl-dlopen-configure-ac.patch
 create mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0003-musl-network-support.patch
 create mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0004-musl-process-util.patch
 create mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0005-musl-avoid-further-conflicts-by-including-net-ethern.patch
 create mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0006-Add-a-strndupa-replacement-for-musl.patch
meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-adjust-net-headers-for-musl-compatibility.patch deleted +0 -86
deleted file mode 100644
index 194e03722..000000000
@@ -1,86 +0,0 @@
-From f81abf62c0ae93628df36c27357358523be25fb8 Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Fri, 31 Mar 2017 15:57:05 -0700
-Subject: [PATCH 1/7] adjust net/ headers for musl compatibility
-
-Signed-off-by: Khem Raj <[email protected]>
----
- libnm-core/nm-utils.c          | 13 ++++++++-----
- libnm-core/nm-utils.h          |  5 ++---
- src/platform/wifi/wifi-utils.h |  2 +-
- 3 files changed, 11 insertions(+), 9 deletions(-)
-
-diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c
-index ebbbfd3..77273df 100644
---- a/libnm-core/nm-utils.c
-+++ b/libnm-core/nm-utils.c
-@@ -19,14 +19,9 @@
-  * Copyright 2005 - 2017 Red Hat, Inc.
-  */
- 
--#include "nm-default.h"
--
--#include "nm-utils.h"
--
- #include <string.h>
- #include <errno.h>
- #include <stdlib.h>
--#include <netinet/ether.h>
- #include <arpa/inet.h>
- #include <uuid/uuid.h>
- #include <libintl.h>
-@@ -34,12 +29,20 @@
- #include <sys/stat.h>
- #include <net/if.h>
- #include <linux/pkt_sched.h>
-+//#include <net/if_arp.h>
-+//#include <net/ethernet.h>
-+#include <netinet/ether.h>
-+
-+#include "nm-default.h"
-+
-+#include "nm-utils.h"
- 
- #if WITH_JANSSON
- #include "nm-json.h"
- #include <jansson.h>
- #endif
- 
-+
- #include "nm-utils/nm-enum-utils.h"
- #include "nm-utils/nm-hash-utils.h"
- #include "nm-common-macros.h"
-diff --git a/libnm-core/nm-utils.h b/libnm-core/nm-utils.h
-index df9284b..02e24ea 100644
---- a/libnm-core/nm-utils.h
-+++ b/libnm-core/nm-utils.h
-@@ -27,11 +27,10 @@
- 
- #include <glib.h>
- 
--#include <netinet/in.h>
--
- /* For ETH_ALEN and INFINIBAND_ALEN */
--#include <linux/if_ether.h>
-+//#include <linux/if_ether.h>
- #include <linux/if_infiniband.h>
-+#include <netinet/in.h>
- 
- #include "nm-core-enum-types.h"
- #include "nm-setting-wireless-security.h"
-diff --git a/src/platform/wifi/wifi-utils.h b/src/platform/wifi/wifi-utils.h
-index 705717b..939080f 100644
---- a/src/platform/wifi/wifi-utils.h
-+++ b/src/platform/wifi/wifi-utils.h
-@@ -22,7 +22,7 @@
- #ifndef __WIFI_UTILS_H__
- #define __WIFI_UTILS_H__
- 
--#include <net/ethernet.h>
-+//#include <net/ethernet.h>
- 
- #include "nm-dbus-interface.h"
- 
--- 
-2.14.1
-
meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch renamed from meta-networking/recipes-connectivity/networkmanager/networkmanager/0005-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch +0 -0
similarity index 100%
rename from meta-networking/recipes-connectivity/networkmanager/networkmanager/0005-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch
rename to meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch
meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch renamed from meta-networking/recipes-connectivity/networkmanager/networkmanager/0007-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch +0 -0
similarity index 100%
rename from meta-networking/recipes-connectivity/networkmanager/networkmanager/0007-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch
rename to meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch
meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-socket-util.h-Include-linux-sockios.h-on-musl.patch deleted +0 -30
deleted file mode 100644
index cdcd397d7..000000000
@@ -1,30 +0,0 @@
-From 7f0e0613abe8aa1861946e2cc25397690da7128b Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Fri, 31 Mar 2017 16:05:05 -0700
-Subject: [PATCH 2/7] socket-util.h: Include linux/sockios.h on musl
-
-Signed-off-by: Khem Raj <[email protected]>
----
- src/systemd/src/basic/socket-util.h | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/src/systemd/src/basic/socket-util.h b/src/systemd/src/basic/socket-util.h
-index d7e2d85..2e7f7b6 100644
---- a/src/systemd/src/basic/socket-util.h
-+++ b/src/systemd/src/basic/socket-util.h
-@@ -30,6 +30,12 @@
- #include <linux/if_infiniband.h>
- #include <linux/if_packet.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.h"
- #include "util.h"
--- 
-2.14.1
-
meta-networking/recipes-connectivity/networkmanager/networkmanager/0003-Define-ETH_ALEN.patch deleted +0 -39
deleted file mode 100644
index 549e46e0e..000000000
@@ -1,39 +0,0 @@
-From d0951fe7da63d8296a305781d7322ce4d3249415 Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Fri, 31 Mar 2017 16:08:45 -0700
-Subject: [PATCH 3/7] Define ETH_ALEN
-
-Signed-off-by: Khem Raj <[email protected]>
----
- libnm-core/nm-utils.h          | 1 +
- src/platform/wifi/wifi-utils.h | 2 ++
- 2 files changed, 3 insertions(+)
-
-diff --git a/libnm-core/nm-utils.h b/libnm-core/nm-utils.h
-index 02e24ea..5ff279c 100644
---- a/libnm-core/nm-utils.h
-+++ b/libnm-core/nm-utils.h
-@@ -29,6 +29,7 @@
- 
- /* For ETH_ALEN and INFINIBAND_ALEN */
- //#include <linux/if_ether.h>
-+#define ETH_ALEN	6		/* Octets in one ethernet addr	 */
- #include <linux/if_infiniband.h>
- #include <netinet/in.h>
- 
-diff --git a/src/platform/wifi/wifi-utils.h b/src/platform/wifi/wifi-utils.h
-index 939080f..2274408 100644
---- a/src/platform/wifi/wifi-utils.h
-+++ b/src/platform/wifi/wifi-utils.h
-@@ -24,6 +24,8 @@
- 
- //#include <net/ethernet.h>
- 
-+#define ETH_ALEN	6		/* Octets in one ethernet addr	 */
-+
- #include "nm-dbus-interface.h"
- 
- typedef struct WifiData WifiData;
--- 
-2.14.1
-
meta-networking/recipes-connectivity/networkmanager/networkmanager/0003-Do-not-create-settings-settings-property-documentati.patch new file +77 -0

77 lines not on this page · raw message

meta-networking/recipes-connectivity/networkmanager/networkmanager/0004-Define-missing-features-to-cater-for-musl.patch deleted +0 -92

92 lines not on this page · raw message

meta-networking/recipes-connectivity/networkmanager/networkmanager/0006-check-for-strndupa-before-using-it.patch deleted +0 -67

67 lines not on this page · raw message

meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0001-musl-basic.patch new file +53 -0

53 lines not on this page · raw message

meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0002-musl-dlopen-configure-ac.patch new file +35 -0
new file mode 100644
index 000000000..548cccb32
@@ -0,0 +1,35 @@
+From 57239fda56b68a8f3e413f7b6af5290ba0d86636 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <[email protected]>
+Date: Thu, 22 Mar 2018 18:18:06 +0100
+Subject: [PATCH 2/4] musl: dlopen is included so LD_LIBS="" instead of
+ LD_LIBS="none required"
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Pending
+
+Stolen from [1] and prettyfied slightly
+
+[1] https://github.com/voidlinux/void-packages/tree/master/srcpkgs/NetworkManager/patches
+
+Signed-off-by: Andreas Müller <[email protected]>
+---
+ configure.ac | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/configure.ac b/configure.ac
+index 487a266..96ae4f7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -305,6 +305,7 @@ dnl
+ dnl Checks for libdl - on certain platforms its part of libc
+ dnl
+ AC_SEARCH_LIBS([dlopen], [dl dld], [], [ac_cv_search_dlopen=])
++AS_IF([test "$ac_cv_search_dlopen" = "none required"],[ac_cv_search_dlopen=""])
+ AC_SUBST([DL_LIBS], "$ac_cv_search_dlopen")
+ 
+ PKG_CHECK_MODULES(GLIB, [gio-unix-2.0 >= 2.37.6 gmodule-2.0],
+-- 
+2.14.3
+
meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0003-musl-network-support.patch new file +72 -0

72 lines not on this page · raw message

meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0004-musl-process-util.patch new file +62 -0

62 lines not on this page · raw message

meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0005-musl-avoid-further-conflicts-by-including-net-ethern.patch new file +77 -0

77 lines not on this page · raw message

meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0006-Add-a-strndupa-replacement-for-musl.patch new file +47 -0

47 lines not on this page · raw message

meta-networking/recipes-connectivity/networkmanager/networkmanager_1.10.6.bb +25 -14
index 6538e7b82..ccbd8e28c 100644
@@ -10,6 +10,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=cbbffd568227ada506640fe950a4823b \
 
 DEPENDS = " \
     intltool-native \
+    libxslt-native \
     libnl \
     dbus \
     dbus-glib \
@@ -23,18 +24,20 @@ DEPENDS = " \
     curl \
 "
 
-inherit gnomebase gettext systemd bluetooth bash-completion vala gobject-introspection
-
-GI_DATA_ENABLED_libc-musl = "False"
-
-SRC_URI = "${GNOME_MIRROR}/NetworkManager/${@gnome_verdir("${PV}")}/NetworkManager-${PV}.tar.xz \
-           file://0001-adjust-net-headers-for-musl-compatibility.patch \
-           file://0002-socket-util.h-Include-linux-sockios.h-on-musl.patch \
-           file://0003-Define-ETH_ALEN.patch \
-           file://0005-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch \
-           file://0006-check-for-strndupa-before-using-it.patch \
-           file://0007-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch \
-           "
+inherit gnomebase gettext systemd bluetooth bash-completion vala gobject-introspection gtk-doc
+
+SRC_URI = " \
+    ${GNOME_MIRROR}/NetworkManager/${@gnome_verdir("${PV}")}/NetworkManager-${PV}.tar.xz \
+    file://0001-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch \
+    file://0002-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch \
+    file://0003-Do-not-create-settings-settings-property-documentati.patch \
+    file://musl/0001-musl-basic.patch \
+    file://musl/0002-musl-dlopen-configure-ac.patch \
+    file://musl/0003-musl-network-support.patch \
+    file://musl/0004-musl-process-util.patch \
+    file://musl/0005-musl-avoid-further-conflicts-by-including-net-ethern.patch \
+    file://musl/0006-Add-a-strndupa-replacement-for-musl.patch \
+"
 SRC_URI[md5sum] = "de3c7147a693da6f80eb22f126086a14"
 SRC_URI[sha256sum] = "6af0b1e856a3725f88791f55c4fbb04105dc0b20dbf182aaec8aad16481fac76"
 
@@ -44,15 +47,23 @@ EXTRA_OECONF = " \
     --disable-ifcfg-rh \
     --disable-ifnet \
     --disable-ifcfg-suse \
-    --disable-introspection \
     --disable-more-warnings \
     --with-iptables=${sbindir}/iptables \
     --with-tests \
     --with-nmtui=yes \
 "
 
+# gobject-introspection related
+GI_DATA_ENABLED_libc-musl = "False"
+
+# stolen from https://github.com/voidlinux/void-packages/blob/master/srcpkgs/NetworkManager/template
+CFLAGS_libc-musl_append = " \
+    -DHAVE_SECURE_GETENV -Dsecure_getenv=getenv \
+    -D__USE_POSIX199309 -DRTLD_DEEPBIND=0 \
+"
+
 do_compile_prepend() {
-        export GIR_EXTRA_LIBS_PATH="${B}/libnm-util/.libs"
+    export GIR_EXTRA_LIBS_PATH="${B}/libnm/.libs:${B}/libnm-glib/.libs:${B}/libnm-util/.libs"
 }
 
 PACKAGECONFIG ??= "nss ifupdown netconfig dhclient dnsmasq \
Signature · 1 line
2.14.3
#1 lore raw

PATCH 2/2 libtevent: add libtirpc to DEPENDS

musl build fails with:

| Checking for header rpc/rpc.h                                : no
| Checking for header rpc/nettype.h                            : no
| Checking for libtirpc headers                                : not found
| Checking for libntirpc headers                               : not found
| ERROR: No rpc/rpc.h header found, tirpc or libntirpc missing?
---
 meta-networking/recipes-support/libtevent/libtevent_0.9.36.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-networking/recipes-support/libtevent/libtevent_0.9.36.bb +1 -1
index a83851ea4..c91b221b1 100644
@@ -3,7 +3,7 @@ HOMEPAGE = "http://tevent.samba.org"
 SECTION = "libs"
 LICENSE = "LGPLv3+"
 
-DEPENDS += "libtalloc"
+DEPENDS += "libtalloc libtirpc"
 RDEPENDS_python-tevent = "python"
 
 SRC_URI = "https://samba.org/ftp/tevent/tevent-${PV}.tar.gz \
Signature · 1 line
2.14.3
#2 lore raw

Re: [PATCH 2/2] libtevent: add libtirpc to DEPENDS

Quoted 27 lines · Andreas Müller

musl build fails with:

| Checking for header rpc/rpc.h                                : no
| Checking for header rpc/nettype.h                            : no
| Checking for libtirpc headers                                : not found
| Checking for libntirpc headers                               : not found
| ERROR: No rpc/rpc.h header found, tirpc or libntirpc missing?
---
 meta-networking/recipes-support/libtevent/libtevent_0.9.36.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-networking/recipes-support/libtevent/libtevent_0.9.36.bb +1 -2
index a83851ea4..c91b221b1 100644
@@ -3,7 +3,7 @@ HOMEPAGE = "http://tevent.samba.org"
 SECTION = "libs"
 LICENSE = "LGPLv3+"
 
-DEPENDS += "libtalloc"
+DEPENDS += "libtalloc libtirpc"
 RDEPENDS_python-tevent = "python"
 
 SRC_URI = "https://samba.org/ftp/tevent/tevent-${PV}.tar.gz \
--
Quoted 2 lines

2.14.3

ping?