Failed to compile networkmanager with musl
cover Failed to compile networkmanager with musl
From: Kai Kang <[email protected]>
Hi Khem,
I am updating networkmanager to 1.20. But I meet a problem with musl that "error: redefinition of 'struct ethhdr'". I find a patch for kernel which is created in Jan 2018. The musl part has been merged in musl:
commit b583c5d3b4cc2c54c68eef5eb7855ecfacee8bfc
Author: Hauke Mehrtens <[email protected]> Date: Sat Jan 6 23:32:52 2018 +0100
add additional uapi guards for Linux kernel header files
With Linux kernel 4.16 it will be possible to guard more parts of the Linux header files from a libc. Make use of this in musl to guard all the structures and other definitions from the Linux header files which are also defined by the header files provided by musl. This will make it possible to compile source files which include both the libc headers and the kernel userspace headers.
This extends the definitions done in commit 04983f227238 ("make netinet/in.h suppress clashing definitions from kernel headers")
But the kernel part doesn't exist in current kernel source. It should not be networkmanager specified.
Do you have any suggestion to fix this error? Thanks.
PS: detailed error messages:
x86_64-poky-linux-musl-gcc -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot -Isrc/25a6634@@NetworkManager@sta -Isrc -I../NetworkManager-1.20.0/src -Ilibnm-core -I../NetworkManager-1.20.0/libnm-core -I. -I../NetworkManager-1.20.0/ -Ishared -I../NetworkManager-1.20.0/shared -I../NetworkManager-1.20.0/shared/systemd/sd-adapt-shared -I../NetworkManager-1.20.0/shared/systemd/src/basic -I../NetworkManager-1.20.0/shared/systemd/src/shared -I/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/gio-unix-2.0 -I/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/glib-2.0 -I/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/lib/glib-2.0/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -std=gnu11 -fdata-sections -ffunction-sections -O2 -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0=/usr/src/debug/networkmanager/1.20.0-r0 -fdebug-prefix-map=/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0=/usr/src/debug/networkmanager/1.20.0-r0 -fdebug-prefix-map=/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot= -fdebug-prefix-map=/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot-native= -DRTLD_DEEPBIND=0 -fPIC -pthread -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_40 -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON -MD -MQ 'src/25a6634@@NetworkManager@sta/devices_nm-device.c.o' -MF 'src/25a6634@@NetworkManager@sta/devices_nm-device.c.o.d' -o 'src/25a6634@@NetworkManager@sta/devices_nm-device.c.o' -c ../NetworkManager-1.20.0/src/devices/nm-device.c In file included from /home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/net/ethernet.h:10,
from ../NetworkManager-1.20.0/src/systemd/src/systemd/sd-dhcp-client.h:23,
from ../NetworkManager-1.20.0/src/systemd/nm-sd.h:21,
from ../NetworkManager-1.20.0/src/devices/nm-device.c:76:
/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/netinet/if_ether.h:111:8: error: redefinition of 'struct ethhdr'
111 | struct ethhdr {
| ^~~~~~
In file included from ../NetworkManager-1.20.0/libnm-core/nm-utils.h:32,
from ../NetworkManager-1.20.0/libnm-core/nm-setting-ip-config.h:29,
from ../NetworkManager-1.20.0/src/NetworkManagerUtils.h:26,
from ../NetworkManager-1.20.0/src/devices/nm-device.h:31,
from ../NetworkManager-1.20.0/src/devices/nm-device.c:23:
/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/linux/if_ether.h:167:8: note: originally defined here
167 | struct ethhdr {
| ^~~~~~
In file included from /home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/netinet/if_ether.h:118,
from /home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/net/ethernet.h:10,
from ../NetworkManager-1.20.0/src/systemd/src/systemd/sd-dhcp-client.h:23,
from ../NetworkManager-1.20.0/src/systemd/nm-sd.h:21,
from ../NetworkManager-1.20.0/src/devices/nm-device.c:76:
/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/net/if_arp.h:22:8: error: redefinition of 'struct arphdr'
22 | struct arphdr {
| ^~~~~~
In file included from ../NetworkManager-1.20.0/src/devices/nm-device.c:34:
/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/linux/if_arp.h:144:8: note: originally defined here
144 | struct arphdr {
| ^~~~~~Regards,
Kai
Kai Kang (1):
networkmanager: 1.18.2 -> 1.20.0
...e.ac-Fix-pkgconfig-sysroot-locations.patch | 22 ---
...ttings-settings-property-documentati.patch | 71 ---------
...on.build-pkgconfig-sysroot-locations.patch | 23 +++
...eate-settings-property-documentation.patch | 146 ++++++++++++++++++
...Fix-build-with-musl-systemd-specific.patch | 10 +-
.../musl/0002-Fix-build-with-musl.patch | 12 +-
.../musl/0003-Fix-mrand48_r-with-musl.patch | 47 ++++++
...ger_1.18.2.bb => networkmanager_1.20.0.bb} | 72 +++++----
8 files changed, 262 insertions(+), 141 deletions(-)
delete mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch
delete mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-Do-not-create-settings-settings-property-documentati.patch
create mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/fix-meson.build-pkgconfig-sysroot-locations.patch
create mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/meson-do-not-create-settings-property-documentation.patch
create mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0003-Fix-mrand48_r-with-musl.patch
rename meta-networking/recipes-connectivity/networkmanager/{networkmanager_1.18.2.bb => networkmanager_1.20.0.bb} (62%)Signature · 1 line
2.20.0
RFC PATCH 1/1 networkmanager: 1.18.2 -> 1.20.0
From: Kai Kang <[email protected]>
Update networkmanager to latest stable release 1.20.0.
* adopt meson to replace autotools
- it speeds up about 30% from 2m27s to 1m36s
- remove 2 autotools related patches and add 2 similar ones for meson
* update context of musl patches and add one to fix mrand48_r related failure for musl
* it removes libnm-glib, libnm-glib-vpn, and libnm-util by commit
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/commit/5801f89f4d1464fc15cb1d97755b73f9f68cb2e6
remove related items license file, packge config 'glib' and sub-packges from recipe
* add new PACKAGECONFIGs audit and selinux, and sort PACKAGECONFIGs except systemd
---
...e.ac-Fix-pkgconfig-sysroot-locations.patch | 22 ---
...ttings-settings-property-documentati.patch | 71 ---------
...on.build-pkgconfig-sysroot-locations.patch | 23 +++
...eate-settings-property-documentation.patch | 146 ++++++++++++++++++
...Fix-build-with-musl-systemd-specific.patch | 10 +-
.../musl/0002-Fix-build-with-musl.patch | 12 +-
.../musl/0003-Fix-mrand48_r-with-musl.patch | 47 ++++++
...ger_1.18.2.bb => networkmanager_1.20.0.bb} | 72 +++++----
8 files changed, 262 insertions(+), 141 deletions(-)
delete mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch
delete mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-Do-not-create-settings-settings-property-documentati.patch
create mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/fix-meson.build-pkgconfig-sysroot-locations.patch
create mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/meson-do-not-create-settings-property-documentation.patch
create mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0003-Fix-mrand48_r-with-musl.patch
rename meta-networking/recipes-connectivity/networkmanager/{networkmanager_1.18.2.bb => networkmanager_1.20.0.bb} (62%)meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch deleted +0 -22
@@ -1,22 +0,0 @@ -From 3dc3d8e73bc430ea4e93e33f7b2a4b3e0ff175af Mon Sep 17 00:00:00 2001 -From: Pablo Saavedra <[email protected]> -Date: Tue, 13 Mar 2018 17:36:20 +0100 -Subject: [PATCH] Fixed configure.ac: Fix pkgconfig sysroot locations - ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 967eac0..b914219 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -592,7 +592,7 @@ if test "$have_jansson" = "yes"; then - AC_DEFINE(WITH_JANSSON, 1, [Define if JANSSON is enabled]) - - AC_CHECK_TOOLS(READELF, [eu-readelf readelf]) -- JANSSON_LIBDIR=`$PKG_CONFIG --variable=libdir jansson` -+ JANSSON_LIBDIR=${PKG_CONFIG_SYSROOT_DIR}`$PKG_CONFIG --variable=libdir jansson` - JANSSON_SONAME=`$READELF -d $JANSSON_LIBDIR/libjansson.so |sed -n 's/.*SONAME.*\[[\([^]]*\)]]/\1/p'` - - if test "$JANSSON_SONAME" = ""; then
meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-Do-not-create-settings-settings-property-documentati.patch deleted +0 -71
71 lines not on this page · raw message
meta-networking/recipes-connectivity/networkmanager/networkmanager/fix-meson.build-pkgconfig-sysroot-locations.patch new file +23 -0
@@ -0,0 +1,23 @@ +It uses pkg-config to get location of libjansson.so. But for cross compile it +needs to prepend prefix $PKG_CONFIG_SYSROOT_DIR. + +Upstream-Status: Inappropriate [cross-compile specific] + +Signed-off-by: Kai Kang <[email protected]> +--- +diff --git a/meson.build b/meson.build +index efad842..820fa8e 100644 +--- a/meson.build ++++ b/meson.build +@@ -190,8 +190,10 @@ jansson_dep = dependency('jansson', version: '>= 2.5', required: false) + config_h.set10('WITH_JANSSON', jansson_dep.found()) + + if jansson_dep.found() ++ cmd = run_command('sh', '-c', 'echo $PKG_CONFIG_SYSROOT_DIR') ++ pkg_config_sysroot_dir = cmd.stdout().strip() + jansson_libdir = jansson_dep.get_pkgconfig_variable('libdir') +- res = run_command(find_program('eu-readelf', 'readelf'), '-d', join_paths(jansson_libdir, 'libjansson.so')) ++ res = run_command(find_program('eu-readelf', 'readelf'), '-d', pkg_config_sysroot_dir + jansson_libdir + '/libjansson.so') + jansson_soname = '' + foreach line: res.stdout().split('\n') + if line.strip().contains('SONAME')
meta-networking/recipes-connectivity/networkmanager/networkmanager/meson-do-not-create-settings-property-documentation.patch new file +146 -0
146 lines not on this page · raw message
meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0001-Fix-build-with-musl-systemd-specific.patch +5 -5
@@ -25,7 +25,7 @@ diff --git a/shared/systemd/src/basic/in-addr-util.c b/shared/systemd/src/basic/ index 5899f62..0adb248 100644 --- a/shared/systemd/src/basic/in-addr-util.c +++ b/shared/systemd/src/basic/in-addr-util.c -@@ -14,6 +14,7 @@ +@@ -15,6 +15,7 @@ #include "in-addr-util.h" #include "macro.h" #include "parse-util.h"
@@ -37,7 +37,7 @@ diff --git a/shared/systemd/src/basic/process-util.c b/shared/systemd/src/basic/ index 7431be3..189060a 100644 --- a/shared/systemd/src/basic/process-util.c +++ b/shared/systemd/src/basic/process-util.c -@@ -21,6 +21,9 @@ +@@ -19,6 +19,9 @@ #include <sys/wait.h> #include <syslog.h> #include <unistd.h>
@@ -47,7 +47,7 @@ index 7431be3..189060a 100644 #if 0 /* NM_IGNORED */ #if HAVE_VALGRIND_VALGRIND_H #include <valgrind/valgrind.h> -@@ -1183,11 +1186,13 @@ void reset_cached_pid(void) { +@@ -1105,11 +1108,13 @@ void reset_cached_pid(void) { cached_pid = CACHED_PID_UNSET; }
@@ -61,7 +61,7 @@ index 7431be3..189060a 100644 pid_t getpid_cached(void) { static bool installed = false; -@@ -1216,7 +1221,11 @@ pid_t getpid_cached(void) { +@@ -1138,7 +1143,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. */
@@ -77,7 +77,7 @@ diff --git a/shared/systemd/src/basic/socket-util.h b/shared/systemd/src/basic/s index 15443f1..4807198 100644 --- a/shared/systemd/src/basic/socket-util.h +++ b/shared/systemd/src/basic/socket-util.h -@@ -13,6 +13,12 @@ +@@ -14,6 +14,12 @@ #include <sys/types.h> #include <sys/un.h>
meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0002-Fix-build-with-musl.patch +6 -6
@@ -44,7 +44,7 @@ diff --git a/clients/tui/nmt-device-entry.c b/clients/tui/nmt-device-entry.c index 43fbbc1..3eae286 100644 --- a/clients/tui/nmt-device-entry.c +++ b/clients/tui/nmt-device-entry.c -@@ -39,7 +39,6 @@ +@@ -38,7 +38,6 @@ #include "nmt-device-entry.h" #include <sys/socket.h>
@@ -56,7 +56,7 @@ diff --git a/libnm-core/nm-utils.h b/libnm-core/nm-utils.h index 2b5baba..f7abab6 100644 --- a/libnm-core/nm-utils.h +++ b/libnm-core/nm-utils.h -@@ -25,6 +25,10 @@ +@@ -24,6 +24,10 @@ #error "Only <NetworkManager.h> can be included directly." #endif
@@ -71,7 +71,7 @@ diff --git a/shared/nm-default.h b/shared/nm-default.h index 54e9916..26e9f4e 100644 --- a/shared/nm-default.h +++ b/shared/nm-default.h -@@ -211,6 +211,9 @@ +@@ -197,6 +197,9 @@ #endif #include <stdlib.h>
@@ -85,7 +85,7 @@ diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index bd4fbcc..f70b309 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c -@@ -24,6 +24,7 @@ +@@ -23,6 +23,7 @@ #include "nm-device.h" #include <netinet/in.h>
@@ -93,7 +93,7 @@ index bd4fbcc..f70b309 100644 #include <unistd.h> #include <sys/ioctl.h> #include <signal.h> -@@ -32,7 +33,6 @@ +@@ -31,7 +32,6 @@ #include <arpa/inet.h> #include <fcntl.h> #include <linux/if_addr.h>
@@ -105,7 +105,7 @@ diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index d4b0115..22a3a90 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c -@@ -28,7 +28,6 @@ +@@ -27,7 +27,6 @@ #include <libudev.h> #include <linux/fib_rules.h> #include <linux/ip.h>
meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0003-Fix-mrand48_r-with-musl.patch new file +47 -0
47 lines not on this page · raw message
meta-networking/recipes-connectivity/networkmanager/networkmanager_1.20.0.bb renamed from meta-networking/recipes-connectivity/networkmanager/networkmanager_1.18.2.bb +35 -37
125 lines not on this page · raw message
Signature · 1 line
2.20.0
Quoted 22 lines · On Tue, Aug 27, 2019 at 8:43 PM <[email protected]> wrote:
From: Kai Kang <[email protected]>
Hi Khem,
I am updating networkmanager to 1.20. But I meet a problem with musl that "error: redefinition of 'struct ethhdr'". I find a patch for kernel which is created in Jan 2018. The musl part has been merged in musl:
commit
b583c5d3b4cc2c54c68eef5eb7855ecfacee8bfcAuthor: Hauke Mehrtens <[email protected]> Date: Sat Jan 6 23:32:52 2018 +0100add additional uapi guards for Linux kernel header files
With Linux kernel 4.16 it will be possible to guard more parts of the Linux header files from a libc. Make use of this in musl to guard all the structures and other definitions from the Linux header files which are also defined by the header files provided by musl. This will make it possible to compile source files which include both the libc headers and the kernel userspace headers.
Quoted 7 lines
This extends the definitions done in commit
04983f227238("makenetinet/in.hsuppress clashing definitions from kernel headers")But the kernel part doesn't exist in current kernel source. It should not be networkmanager specified.
Do you have any suggestion to fix this error? Thanks.
the kernel patch should be applied to linux-libc-headers
Quoted 62 lines
PS: detailed error messages:
x86_64-poky-linux-musl-gcc -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot -Isrc/25a6634@@NetworkManager@sta -Isrc -I../NetworkManager-1.20.0/src -Ilibnm-core -I../NetworkManager-1.20.0/libnm-core -I. -I../NetworkManager-1.20.0/ -Ishared -I../NetworkManager-1.20.0/shared -I../NetworkManager-1.20.0/shared/systemd/sd-adapt-shared -I../NetworkManager-1.20.0/shared/systemd/src/basic -I../NetworkManager-1.20.0/shared/systemd/src/shared -I/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/gio-unix-2.0 -I/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/glib-2.0 -I/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/lib/glib-2.0/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -std=gnu11 -fdata-sections -ffunction-sections -O2 -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0=/usr/src/debug/networkmanager/1.20.0-r0 -fdebug-prefix-map=/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0=/usr/src/debug/networkmanager/1.20.0-r0 -fdebug-prefix-map=/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot= -fdebug-prefix-map=/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot-native= -DRTLD_DEEPBIND=0 -fPIC -pthread -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_40 -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON -MD -MQ '
src/25a6634@@NetworkManager@sta/devices_nm-device.c.o' -MF 'src/25a6634@@NetworkManager@sta/devices_nm-device.c.o.d' -o 'src/25a6634@@NetworkManager@sta/devices_nm-device.c.o' -c../NetworkManager-1.20.0/src/devices/nm-device.cIn file included from/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/net/ethernet.h:10,from ../NetworkManager-1.20.0/src/systemd/src/systemd/sd-dhcp-client.h:23, from ../NetworkManager-1.20.0/src/systemd/nm-sd.h:21, from ../NetworkManager-1.20.0/src/devices/nm-device.c:76: /home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/netinet/if_ether.h:111:8: error: redefinition of 'struct ethhdr' 111 | struct ethhdr { | ^~~~~~ In file included from ../NetworkManager-1.20.0/libnm-core/nm-utils.h:32, from ../NetworkManager-1.20.0/libnm-core/nm-setting-ip-config.h:29, from ../NetworkManager-1.20.0/src/NetworkManagerUtils.h:26, from ../NetworkManager-1.20.0/src/devices/nm-device.h:31, from ../NetworkManager-1.20.0/src/devices/nm-device.c:23: /home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/linux/if_ether.h:167:8: note: originally defined here 167 | struct ethhdr { | ^~~~~~ In file included from /home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/netinet/if_ether.h:118, from /home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/net/ethernet.h:10, from ../NetworkManager-1.20.0/src/systemd/src/systemd/sd-dhcp-client.h:23, from ../NetworkManager-1.20.0/src/systemd/nm-sd.h:21, from ../NetworkManager-1.20.0/src/devices/nm-device.c:76: /home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/net/if_arp.h:22:8: error: redefinition of 'struct arphdr' 22 | struct arphdr { | ^~~~~~ In file included from ../NetworkManager-1.20.0/src/devices/nm-device.c:34: /home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/linux/if_arp.h:144:8: note: originally defined here 144 | struct arphdr { | ^~~~~~Regards,
KaiKai Kang (1):
networkmanager: 1.18.2 -> 1.20.0...e.ac-Fix-pkgconfig-sysroot-locations.patch | 22 --- ...ttings-settings-property-documentati.patch | 71 --------- ...on.build-pkgconfig-sysroot-locations.patch | 23 +++ ...eate-settings-property-documentation.patch | 146 ++++++++++++++++++ ...Fix-build-with-musl-systemd-specific.patch | 10 +- .../musl/0002-Fix-build-with-musl.patch | 12 +- .../musl/0003-Fix-mrand48_r-with-musl.patch | 47 ++++++ ...ger_1.18.2.bb => networkmanager_1.20.0.bb} | 72 +++++---- 8 files changed, 262 insertions(+), 141 deletions(-) delete mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch delete mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-Do-not-create-settings-settings-property-documentati.patch create mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/fix-meson.build-pkgconfig-sysroot-locations.patch create mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/meson-do-not-create-settings-property-documentation.patch create mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0003-Fix-mrand48_r-with-musl.patch rename meta-networking/recipes-connectivity/networkmanager/{networkmanager_1.18.2.bb => networkmanager_1.20.0.bb} (62%)--
2.20.0
Quoted 27 lines · Khem Raj
Quoted 25 lines · On Tue, Aug 27, 2019 at 8:43 PM <[email protected]> wrote:
From: Kai Kang <[email protected]>
Hi Khem,
I am updating networkmanager to 1.20. But I meet a problem with musl that "error: redefinition of 'struct ethhdr'". I find a patch for kernel which is created in Jan 2018. The musl part has been merged in musl:
commit
b583c5d3b4cc2c54c68eef5eb7855ecfacee8bfcAuthor: Hauke Mehrtens <[email protected]> Date: Sat Jan 6 23:32:52 2018 +0100add additional uapi guards for Linux kernel header files
With Linux kernel 4.16 it will be possible to guard more parts of the Linux header files from a libc. Make use of this in musl to guard all the structures and other definitions from the Linux header files which are also defined by the header files provided by musl. This will make it possible to compile source files which include both the libc headers and the kernel userspace headers.
This extends the definitions done in commit
04983f227238("makenetinet/in.hsuppress clashing definitions from kernel headers")
Quoted 6 lines
Quoted 4 lines
But the kernel part doesn't exist in current kernel source. It should not be networkmanager specified.
Do you have any suggestion to fix this error? Thanks.
the kernel patch should be applied to linux-libc-headers
.. and please wait a day or so before sending it, since I'm about to bump the reference headers to 5.2
Cheers,
Bruce
Quoted 70 lines
Quoted 6 lines
PS: detailed error messages:
x86_64-poky-linux-musl-gcc -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot -Isrc/25a6634@@NetworkManager@sta -Isrc -I../NetworkManager-1.20.0/src -Ilibnm-core -I../NetworkManager-1.20.0/libnm-core -I. -I../NetworkManager-1.20.0/ -Ishared -I../NetworkManager-1.20.0/shared -I../NetworkManager-1.20.0/shared/systemd/sd-adapt-shared -I../NetworkManager-1.20.0/shared/systemd/src/basic -I../NetworkManager-1.20.0/shared/systemd/src/shared -I/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/gio-unix-2.0 -I/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/glib-2.0 -I/home/kkang/buildare
a/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/lib/glib-2.0/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -std=gnu11 -fdata-sections -ffunction-sections -O2 -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0=/usr/src/debug/networkmanager/1.20.0-r0 -fdebug-prefix-map=/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0=/usr/src/debug/networkmanager/1.20.0-r0 -fdebug-prefix-map=/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot= -fdebug-prefix-map=/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot-native= -DRTLD_DEEPBIND=0 -fPIC -pthread -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -DGLIB_VE RSION_MAX_ALLOWED=GLIB_VERSION_2_40 -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON -MD -MQ '
src/25a6634@@NetworkManager@sta/devices_nm-device.c.o' -MF 'src/25a6634@@NetworkManager@sta/devices_nm-device.c.o.d' -o 'src/25a6634@@NetworkManager@sta/devices_nm-device.c.o' -c../NetworkManager-1.20.0/src/devices/nm-device.cQuoted 54 lines
In file included from
/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/net/ethernet.h:10,from ../NetworkManager-1.20.0/src/systemd/src/systemd/sd-dhcp-client.h:23, from ../NetworkManager-1.20.0/src/systemd/nm-sd.h:21, from ../NetworkManager-1.20.0/src/devices/nm-device.c:76: /home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/netinet/if_ether.h:111:8: error: redefinition of 'struct ethhdr' 111 | struct ethhdr { | ^~~~~~ In file included from ../NetworkManager-1.20.0/libnm-core/nm-utils.h:32, from ../NetworkManager-1.20.0/libnm-core/nm-setting-ip-config.h:29, from ../NetworkManager-1.20.0/src/NetworkManagerUtils.h:26, from ../NetworkManager-1.20.0/src/devices/nm-device.h:31, from ../NetworkManager-1.20.0/src/devices/nm-device.c:23: /home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/linux/if_ether.h:167:8: note: originally defined here 167 | struct ethhdr { | ^~~~~~ In file included from /home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/netinet/if_ether.h:118, from /home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/net/ethernet.h:10, from ../NetworkManager-1.20.0/src/systemd/src/systemd/sd-dhcp-client.h:23, from ../NetworkManager-1.20.0/src/systemd/nm-sd.h:21, from ../NetworkManager-1.20.0/src/devices/nm-device.c:76: /home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/net/if_arp.h:22:8: error: redefinition of 'struct arphdr' 22 | struct arphdr { | ^~~~~~ In file included from ../NetworkManager-1.20.0/src/devices/nm-device.c:34: /home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/linux/if_arp.h:144:8: note: originally defined here 144 | struct arphdr { | ^~~~~~Regards,
KaiKai Kang (1):
networkmanager: 1.18.2 -> 1.20.0...e.ac-Fix-pkgconfig-sysroot-locations.patch | 22 --- ...ttings-settings-property-documentati.patch | 71 --------- ...on.build-pkgconfig-sysroot-locations.patch | 23 +++ ...eate-settings-property-documentation.patch | 146 ++++++++++++++++++ ...Fix-build-with-musl-systemd-specific.patch | 10 +- .../musl/0002-Fix-build-with-musl.patch | 12 +- .../musl/0003-Fix-mrand48_r-with-musl.patch | 47 ++++++ ...ger_1.18.2.bb => networkmanager_1.20.0.bb} | 72 +++++---- 8 files changed, 262 insertions(+), 141 deletions(-) delete mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch delete mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-Do-not-create-settings-settings-property-documentati.patch create mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/fix-meson.build-pkgconfig-sysroot-locations.patch create mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/meson-do-not-create-settings-property-documentation.patch create mode 100644 meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0003-Fix-mrand48_r-with-musl.patch rename meta-networking/recipes-connectivity/networkmanager/{networkmanager_1.18.2.bb => networkmanager_1.20.0.bb} (62%)Quoted 3 lines
--
2.20.0--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II
Quoted 26 lines · Bruce Ashfield
Quoted 25 lines · Khem Raj
Quoted 24 lines · On Tue, Aug 27, 2019 at 8:43 PM <[email protected]> wrote:
From: Kai Kang <[email protected]>
Hi Khem,
I am updating networkmanager to 1.20. But I meet a problem with musl that "error: redefinition of 'struct ethhdr'". I find a patch for kernel which is created in Jan 2018. The musl part has been merged in musl:
commit
b583c5d3b4cc2c54c68eef5eb7855ecfacee8bfcAuthor: Hauke Mehrtens <[email protected]> Date: Sat Jan 6 23:32:52 2018 +0100add additional uapi guards for Linux kernel header files
With Linux kernel 4.16 it will be possible to guard more parts of the Linux header files from a libc. Make use of this in musl to guard all the structures and other definitions from the Linux header files which are also defined by the header files provided by musl. This will make it possible to compile source files which include both the libc headers and the kernel userspace headers.
This extends the definitions done in commit
04983f227238("makenetinet/in.hsuppress clashing definitions from kernel headers")
Quoted 7 lines
Quoted 5 lines
Quoted 4 lines
But the kernel part doesn't exist in current kernel source. It should not be networkmanager specified.
Do you have any suggestion to fix this error? Thanks.
the kernel patch should be applied to linux-libc-headers
.. and please wait a day or so before sending it, since I'm about to bump the reference headers to 5.2
It seems musl's fault that there is already a patch for the header files. I update the patch and can fix this issue. If no big change in linux headers 5.2, then networkmanger 1.20 won't be affected.
Thanks.
Kai
Quoted 75 lines
Cheers,
Bruce
Quoted 68 lines
Quoted 4 lines
PS: detailed error messages:
x86_64-poky-linux-musl-gcc -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot -Isrc/25a6634@@NetworkManager@sta -Isrc -I../NetworkManager-1.20.0/src -Ilibnm-core -I../NetworkManager-1.20.0/libnm-core -I. -I../NetworkManager-1.20.0/ -Ishared -I../NetworkManager-1.20.0/shared -I../NetworkManager-1.20.0/shared/systemd/sd-adapt-shared -I../NetworkManager-1.20.0/shared/systemd/src/basic -I../NetworkManager-1.20.0/shared/systemd/src/shared -I/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/gio-unix-2.0 -I/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/glib-2.0 -I/home/kkang/buildare
a/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/lib/glib-2.0/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -std=gnu11 -fdata-sections -ffunction-sections -O2 -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0=/usr/src/debug/networkmanager/1.20.0-r0 -fdebug-prefix-map=/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0=/usr/src/debug/networkmanager/1.20.0-r0 -fdebug-prefix-map=/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot= -fdebug-prefix-map=/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot-native= -DRTLD_DEEPBIND=0 -fPIC -pthread -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -DGLIB_VE RSION_MAX_ALLOWED=GLIB_VERSION_2_40 -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON -MD -MQ '
src/25a6634@@NetworkManager@sta/devices_nm-device.c.o' -MF 'src/25a6634@@NetworkManager@sta/devices_nm-device.c.o.d' -o 'src/25a6634@@NetworkManager@sta/devices_nm-device.c.o' -c../NetworkManager-1.20.0/src/devices/nm-device.cQuoted 54 lines
In file included from
/home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/net/ethernet.h:10,from ../NetworkManager-1.20.0/src/systemd/src/systemd/sd-dhcp-client.h:23, from ../NetworkManager-1.20.0/src/systemd/nm-sd.h:21, from ../NetworkManager-1.20.0/src/devices/nm-device.c:76: /home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/netinet/if_ether.h:111:8: error: redefinition of 'struct ethhdr' 111 | struct ethhdr { | ^~~~~~ In file included from ../NetworkManager-1.20.0/libnm-core/nm-utils.h:32, from ../NetworkManager-1.20.0/libnm-core/nm-setting-ip-config.h:29, from ../NetworkManager-1.20.0/src/NetworkManagerUtils.h:26, from ../NetworkManager-1.20.0/src/devices/nm-device.h:31, from ../NetworkManager-1.20.0/src/devices/nm-device.c:23: /home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/linux/if_ether.h:167:8: note: originally defined here 167 | struct ethhdr { | ^~~~~~ In file included from /home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/netinet/if_ether.h:118, from /home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/net/ethernet.h:10, from ../NetworkManager-1.20.0/src/systemd/src/systemd/sd-dhcp-client.h:23, from ../NetworkManager-1.20.0/src/systemd/nm-sd.h:21, from ../NetworkManager-1.20.0/src/devices/nm-device.c:76: /home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/net/if_arp.h:22:8: error: redefinition of 'struct arphdr' 22 | struct arphdr { | ^~~~~~ In file included from ../NetworkManager-1.20.0/src/devices/nm-device.c:34: /home/kkang/buildarea/222-Yocto/build-xfce-x86-64/tmp/work/core2-64-poky-linux-musl/networkmanager/1.20.0-r0/recipe-sysroot/usr/include/linux/if_arp.h:144:8: note: originally defined here 144 | struct arphdr { | ^~~~~~Regards,
KaiKai Kang (1):
networkmanager: 1.18.2 -> 1.20.0...e.ac-Fix-pkgconfig-sysroot-locations.patch | 22 --- ...ttings-settings-property-documentati.patch | 71 --------- ...on.build-pkgconfig-sysroot-locations.patch | 23 +++ ...eate-settings-property-documentation.patch | 146 ++++++++++++++++++ ...Fix-build-with-musl-systemd-specific.patch | 10 +- .../musl/0002-Fix-build-with-musl.patch | 12 +- .../musl/0003-Fix-mrand48_r-with-musl.patch | 47 ++++++ ...ger_1.18.2.bb => networkmanager_1.20.0.bb} | 72 +++++---- 8 files changed, 262 insertions(+), 141 deletions(-)delete mode 100644
meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patchdelete mode 100644meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-Do-not-create-settings-settings-property-documentati.patchcreate mode 100644meta-networking/recipes-connectivity/networkmanager/networkmanager/fix-meson.build-pkgconfig-sysroot-locations.patchcreate mode 100644meta-networking/recipes-connectivity/networkmanager/networkmanager/meson-do-not-create-settings-property-documentation.patchcreate mode 100644meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0003-Fix-mrand48_r-with-musl.patchrename meta-networking/recipes-connectivity/networkmanager/{networkmanager_1.18.2.bb => networkmanager_1.20.0.bb} (62%)Quoted 3 lines
--
2.20.0--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Signature · 1 line
Kai Kang
What about marking networkmanager as incompatible with musl instead of maintaining an ever-growing mess?
Networkmanager uses parts of systemd as a library and also has own glibc-only usages.
Both systemd and networkmanager are fundamentally Linux-only, and for systemd it is known that upstream has made the design decision to not compromise their software for rare usecases with C libraries other than glibc.
AFAIK OE is the only distribution trying to build either of these with musl, other musl-using distributions are using less heavyweight solutions.
cu
Adrian
Signature · 4 lines
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon SeedQuoted 4 lines · Adrian Bunk
What about marking networkmanager as incompatible with musl instead of maintaining an ever-growing mess?
if the fix is specifically done for musl alone then I would agree, but in many cases, the fixes
have been cleaning up assumptions in kernel UAPI headers on glibc provided headers
which is a good thing, and it does take some time for kernel header changes to flow upstream
but eventually, they do. e.g. see [1]
Quoted 12 lines
Networkmanager uses parts of systemd as a library and also has own glibc-only usages.
Both systemd and networkmanager are fundamentally Linux-only, and for systemd it is known that upstream has made the design decision to not compromise their software for rare usecases with C libraries other than glibc.
AFAIK OE is the only distribution trying to build either of these with musl, other musl-using distributions are using less heavyweight solutions.
We should enable as much as possible we can and not go overboard in supporting everything
except for core packages where it might be ok to put a bit of effort and upstream the changes
network manager is quite useful in base images eg. xfce images etc
Quoted 3 lines
cu
Adrian
[1] https://github.com/torvalds/linux/commit/35341ca0614ab13e1ef34ad4f29a39e15ef31fa8
Quoted 6 lines · Khem Raj
Quoted 4 lines · Adrian Bunk
What about marking networkmanager as incompatible with musl instead of maintaining an ever-growing mess?
Quoted 7 lines
if the fix is specifically done for musl alone then I would agree, but in many cases, the fixes
have been cleaning up assumptions in kernel UAPI headers on glibc provided headers
which is a good thing, and it does take some time for kernel header changes to flow upstream
but eventually, they do. e.g. see [1]
This is not a cleanup, this is a workaround for a misfeature of musl.
The kernel userspace headers are the userspace ABI of the kernel for usage by all C libraries provided in one place, they are not tied to any specific C library.
musl upstream does not even try to use the kernel userspace headers.
The kernel userspace headers used to be a mess, but after more than 10 years of cleanup there is no excuse for musl to insist on providing own definitions of what is already provided by the kernel headers.
Quoted 12 lines
Quoted 11 lines
Networkmanager uses parts of systemd as a library and also has own glibc-only usages.
Both systemd and networkmanager are fundamentally Linux-only, and for systemd it is known that upstream has made the design decision to not compromise their software for rare usecases with C libraries other than glibc.
AFAIK OE is the only distribution trying to build either of these with musl, other musl-using distributions are using less heavyweight solutions.
Quoted 6 lines
We should enable as much as possible we can and not go overboard in supporting everything
except for core packages where it might be ok to put a bit of effort and upstream the changes
network manager is quite useful in base images eg. xfce images etc
...
When you are using networkmanager and xfce in your image, what is the point of using musl instead of glibc?
Networkmanager alone has twice the size of glibc.
There is a benefit of a small C library when your flash space is single-digit megabytes, but maintaining plenty of not upstreamable OE-only patches for using networkmanager on musl without a sane usecase is a waste of effort.
cu
Adrian
Signature · 4 lines
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon SeedQuoted 22 lines · Adrian Bunk
Quoted 6 lines · Khem Raj
Quoted 4 lines · Adrian Bunk
What about marking networkmanager as incompatible with musl instead of maintaining an ever-growing mess?
Quoted 7 lines
if the fix is specifically done for musl alone then I would agree, but in many cases, the fixes
have been cleaning up assumptions in kernel UAPI headers on glibc provided headers
which is a good thing, and it does take some time for kernel header changes to flow upstream
but eventually, they do. e.g. see [1]This is not a cleanup, this is a workaround for a misfeature of musl.
The kernel userspace headers are the userspace ABI of the kernel for usage by all C libraries provided in one place, they are not tied to any specific C library.
Quoted 6 lines
musl upstream does not even try to use the kernel userspace headers.
The kernel userspace headers used to be a mess, but after more than 10 years of cleanup there is no excuse for musl to insist on providing own definitions of what is already provided by the kernel headers.
I was citing an example, you might have good feedback maybe bring it up upstream with musl or
Quoted 19 lines
Quoted 12 lines
Quoted 11 lines
Networkmanager uses parts of systemd as a library and also has own glibc-only usages.
Both systemd and networkmanager are fundamentally Linux-only, and for systemd it is known that upstream has made the design decision to not compromise their software for rare usecases with C libraries other than glibc.
AFAIK OE is the only distribution trying to build either of these with musl, other musl-using distributions are using less heavyweight solutions.
Quoted 6 lines
We should enable as much as possible we can and not go overboard in supporting everything
except for core packages where it might be ok to put a bit of effort and upstream the changes
network manager is quite useful in base images eg. xfce images etc
...
Quoted 5 lines
When you are using networkmanager and xfce in your image, what is the point of using musl instead of glibc?
Networkmanager alone has twice the size of glibc.
Size is just one of many reasons to use musl not the only one.
Quoted 4 lines
There is a benefit of a small C library when your flash space is single-digit megabytes, but maintaining plenty of not upstreamable OE-only patches for using networkmanager on musl without a sane usecase is a waste of effort.
I have said it before as well, I will say it again if we can improve an upstream packages portability that itself is a good thing, but we should not go overboard if its too much of work. there are container distros using musl so we have a wide
list of packages which work well with musl, and this list is always increasing, so I
would refrain from pushing musl to a narrow usecase
Quoted 23 lines · Khem Raj
Quoted 22 lines · Adrian Bunk
Quoted 6 lines · Khem Raj
Quoted 4 lines · Adrian Bunk
What about marking networkmanager as incompatible with musl instead of maintaining an ever-growing mess?
Quoted 7 lines
if the fix is specifically done for musl alone then I would agree, but in many cases, the fixes
have been cleaning up assumptions in kernel UAPI headers on glibc provided headers
which is a good thing, and it does take some time for kernel header changes to flow upstream
but eventually, they do. e.g. see [1]This is not a cleanup, this is a workaround for a misfeature of musl.
The kernel userspace headers are the userspace ABI of the kernel for usage by all C libraries provided in one place, they are not tied to any specific C library.
Quoted 8 lines
Quoted 5 lines
musl upstream does not even try to use the kernel userspace headers.
The kernel userspace headers used to be a mess, but after more than 10 years of cleanup there is no excuse for musl to insist on providing own definitions of what is already provided by the kernel headers.
I was citing an example, you might have good feedback maybe bring it up upstream with musl or
musl upstream says the patched kernel-headers package from sabotage linux should be used:
https://wiki.musl-libc.org/faq.html#Q:-Why-am-I-getting-
Quoted 9 lines
...
Quoted 4 lines
There is a benefit of a small C library when your flash space is single-digit megabytes, but maintaining plenty of not upstreamable OE-only patches for using networkmanager on musl without a sane usecase is a waste of effort.
I have said it before as well, I will say it again if we can improve an upstream packages portability that itself is a good thing, but we should not go overboard if its too much of work.
Networkmanager doesn't aim at portability and is too much work.
Quoted 5 lines
there are container distros using musl so we
have a wide
list of packages which work well with musl, and this list is always increasing, so I
would refrain from pushing musl to a narrow usecase
AFAIK OE is the only distribution trying to build software like systemd or networkmanager with musl, and container distros optimized for size are only supporting smaller alternatives.
cu
Adrian
Signature · 4 lines
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon SeedQuoted 22 lines · Adrian Bunk
Quoted 21 lines · Khem Raj
Quoted 20 lines · Adrian Bunk
Quoted 11 lines · Khem Raj
Quoted 3 lines · Adrian Bunk
What about marking networkmanager as incompatible with musl instead of maintaining an ever-growing mess?
if the fix is specifically done for musl alone then I would agree, but in many cases, the fixes
have been cleaning up assumptions in kernel UAPI headers on glibc provided headers
which is a good thing, and it does take some time for kernel header changes to flow upstream
but eventually, they do. e.g. see [1]This is not a cleanup, this is a workaround for a misfeature of musl.
The kernel userspace headers are the userspace ABI of the kernel for usage by all C libraries provided in one place, they are not tied to any specific C library.
musl upstream does not even try to use the kernel userspace headers.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
The kernel userspace headers used to be a mess, but after more than 10 years of cleanup there is no excuse for musl to insist on providing own definitions of what is already provided by the kernel headers.
I was citing an example, you might have good feedback maybe bring it up upstream with musl or
musl upstream says the patched kernel-headers package from sabotage linux should be used:
https://wiki.musl-libc.org/faq.html#Q:-Why-am-I-getting-
There has been a patch of networkmanger for the headers issue. And I update it then this problem gone.
Quoted 10 lines
Quoted 9 lines
...
Quoted 4 lines
There is a benefit of a small C library when your flash space is single-digit megabytes, but maintaining plenty of not upstreamable OE-only patches for using networkmanager on musl without a sane usecase is a waste of effort.
I have said it before as well, I will say it again if we can improve an upstream packages portability that itself is a good thing, but we should not go overboard if its too much of work.
Networkmanager doesn't aim at portability and is too much work.
Yes, another following issue is that NetworkManger uses non-posix portable functions mrand48_r() and struct drand48_data. musl doesn't recognize them. After adapt to posix functions jrand48(), it segment fault when startup. (The point of segment fault is far from my patch). Still working on it. :(
Regards,
Kai
Quoted 13 lines
Quoted 6 lines
there are container distros using musl so we
have a wide
list of packages which work well with musl, and this list is always increasing, so I
would refrain from pushing musl to a narrow usecaseAFAIK OE is the only distribution trying to build software like systemd or networkmanager with musl, and container distros optimized for size are only supporting smaller alternatives.
cu
Adrian
Signature · 1 line
Kai Kang
Quoted 46 lines · Kang Kai
Quoted 22 lines · Adrian Bunk
Quoted 21 lines · Khem Raj
Quoted 20 lines · Adrian Bunk
Quoted 11 lines · Khem Raj
Quoted 3 lines · Adrian Bunk
What about marking networkmanager as incompatible with musl instead of maintaining an ever-growing mess?
if the fix is specifically done for musl alone then I would agree, but in many cases, the fixes
have been cleaning up assumptions in kernel UAPI headers on glibc provided headers
which is a good thing, and it does take some time for kernel header changes to flow upstream
but eventually, they do. e.g. see [1]This is not a cleanup, this is a workaround for a misfeature of musl.
The kernel userspace headers are the userspace ABI of the kernel for usage by all C libraries provided in one place, they are not tied to any specific C library.
musl upstream does not even try to use the kernel userspace headers.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
The kernel userspace headers used to be a mess, but after more than 10 years of cleanup there is no excuse for musl to insist on providing own definitions of what is already provided by the kernel headers.
I was citing an example, you might have good feedback maybe bring it up upstream with musl or
musl upstream says the patched kernel-headers package from sabotage linux should be used:
https://wiki.musl-libc.org/faq.html#Q:-Why-am-I-getting-There has been a patch of networkmanger for the headers issue. And I update it then this problem gone.
Quoted 9 lines
Quoted 9 lines
...
Quoted 4 lines
There is a benefit of a small C library when your flash space is single-digit megabytes, but maintaining plenty of not upstreamable OE-only patches for using networkmanager on musl without a sane usecase is a waste of effort.
I have said it before as well, I will say it again if we can improve an upstream packages portability that itself is a good thing, but we should not go overboard if its too much of work.
Quoted 8 lines
Quoted 1 line
Networkmanager doesn't aim at portability and is too much work.
Yes, another following issue is that NetworkManger uses non-posix portable functions
mrand48_r()and structdrand48_data. musl doesn't recognize them.
After adapt to posix functionsjrand48(), it segment fault when startup. (The point of segment fault is far from my patch). Still working on it. :(
Can you look at
https://code.foxkit.us/adelie/packages/tree/master/user/networkmanager
especially https://code.foxkit.us/adelie/packages/blob/master/user/networkmanager/random.patch
Quoted 21 lines
Regards,
KaiQuoted 6 lines
Quoted 6 lines
there are container distros using musl so we
have a wide
list of packages which work well with musl, and this list is always increasing, so I
would refrain from pushing musl to a narrow usecaseQuoted 7 lines
AFAIK OE is the only distribution trying to build software like systemd or networkmanager with musl, and container distros optimized for size are only supporting smaller alternatives.
cu
Adrian--
Kai Kang
Quoted 51 lines · Khem Raj
Quoted 43 lines · Kang Kai
Quoted 22 lines · Adrian Bunk
Quoted 21 lines · Khem Raj
Quoted 20 lines · Adrian Bunk
Quoted 11 lines · Khem Raj
Quoted 3 lines · Adrian Bunk
What about marking networkmanager as incompatible with musl instead of maintaining an ever-growing mess?
if the fix is specifically done for musl alone then I would agree, but in many cases, the fixes
have been cleaning up assumptions in kernel UAPI headers on glibc provided headers
which is a good thing, and it does take some time for kernel header changes to flow upstream
but eventually, they do. e.g. see [1]This is not a cleanup, this is a workaround for a misfeature of musl.
The kernel userspace headers are the userspace ABI of the kernel for usage by all C libraries provided in one place, they are not tied to any specific C library.
musl upstream does not even try to use the kernel userspace headers.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
The kernel userspace headers used to be a mess, but after more than 10 years of cleanup there is no excuse for musl to insist on providing own definitions of what is already provided by the kernel headers.
I was citing an example, you might have good feedback maybe bring it up upstream with musl or
musl upstream says the patched kernel-headers package from sabotage linux should be used:
https://wiki.musl-libc.org/faq.html#Q:-Why-am-I-getting-There has been a patch of networkmanger for the headers issue. And I update it then this problem gone.
Quoted 8 lines
Quoted 8 lines
...
Quoted 4 lines
There is a benefit of a small C library when your flash space is single-digit megabytes, but maintaining plenty of not upstreamable OE-only patches for using networkmanager on musl without a sane usecase is a waste of effort.
I have said it before as well, I will say it again if we can improve an upstream packages portability that itself is a good thing, but we should not go overboard if its too much of work.
Quoted 7 lines
Quoted 1 line
Networkmanager doesn't aim at portability and is too much work.
Yes, another following issue is that NetworkManger uses non-posix portable functions
mrand48_r()and structdrand48_data. musl doesn't recognize them.
After adapt to posix functionsjrand48(), it segment fault when startup. (The point of segment fault is far from my patch). Still working on it. :(
Quoted 3 lines
Can you look at
https://code.foxkit.us/adelie/packages/tree/master/user/networkmanager
especially https://code.foxkit.us/adelie/packages/blob/master/user/networkmanager/random.patch
I referred to https://github.com/tpm2-software/tpm2-abrmd/pull/503/commits/4d652c679ab687e0253a65c2677f73661af76725#diff-99e087f6c795d91b5c4d4362fc9dc1ff
and my patch is almost same with you listed:
shared/n-dhcp4/src/n-dhcp4-c-probe.c +0 -0
@@ -362,8 +362,9 @@ static void n_dhcp4_client_probe_config_initialize_random_seed(NDhcp4ClientProbe
seed16v[1] = (u64 >> 16) ^ (u64 >> 0);
seed16v[2] = (u64 >> 32) ^ (u64 >> 16);
- r = seed48_r(seed16v, &config->entropy);
- c_assert(!r);
+ config->entropy[0] = seed16v[0];
+ config->entropy[1] = seed16v[1];
+ config->entropy[2] = seed16v[2];
}
/**
@@ -377,10 +378,8 @@ 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;
- int r;
- r = mrand48_r(&config->entropy, &result); - c_assert(!r);
+ result = jrand48(config->entropy);
return result;
};
shared/n-dhcp4/src/n-dhcp4-private.h +0 -0
@@ -259,7 +259,7 @@ struct NDhcp4ClientProbeConfig {
bool inform_only;
bool init_reboot;
struct in_addr requested_ip;
- struct drand48_data entropy; /* entropy pool */
+ unsigned short entropy[3]; /* entropy pool */
uint64_t ms_start_delay; /* max ms to wait before starting probe */ NDhcp4ClientProbeOption *options[UINT8_MAX + 1];
int8_t request_parameters[UINT8_MAX + 1];
Regards,
Kai
Quoted 20 lines
Quoted 20 lines
Regards,
KaiQuoted 5 lines
Quoted 5 lines
there are container distros using musl so we
have a wide
list of packages which work well with musl, and this list is always increasing, so I
would refrain from pushing musl to a narrow usecaseQuoted 7 lines
AFAIK OE is the only distribution trying to build software like systemd or networkmanager with musl, and container distros optimized for size are only supporting smaller alternatives.
cu
Adrian--
Kai Kang
Signature · 1 line
Kai Kang