From 081ff470ab1a73825dc5371839b60fb8ddfc9da7 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 28 May 2022 15:30:53 +0200 Subject: [PATCH] - add libnl --- package/libnl/libnl.mk | 17 +++++++++ ...rivate-field-in-libnl-pkg-config-fil.patch | 30 +++++++++++++++ ...workaround-to-the-libc-compat.h-copy.patch | 37 +++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 package/libnl/libnl.mk create mode 100644 package/libnl/patches/0001-build-add-Libs.private-field-in-libnl-pkg-config-fil.patch create mode 100644 package/libnl/patches/0002-Add-musl-workaround-to-the-libc-compat.h-copy.patch diff --git a/package/libnl/libnl.mk b/package/libnl/libnl.mk new file mode 100644 index 00000000..89ceed14 --- /dev/null +++ b/package/libnl/libnl.mk @@ -0,0 +1,17 @@ +################################################################################ +# +# libnl +# +################################################################################ + +LIBNL_VERSION = 3.5.0 +LIBNL_DIR = libnl-$(LIBNL_VERSION) +LIBNL_SOURCE = libnl-$(LIBNL_VERSION).tar.gz +LIBNL_SITE = https://github.com/thom311/libnl/releases/download/libnl$(subst .,_,$(LIBNL_VERSION)) + +LIBNL_CONF_OPTS = \ + --disable-cli \ + --disable-unit-tests + +libnl: | $(TARGET_DIR) + $(call autotools-package) diff --git a/package/libnl/patches/0001-build-add-Libs.private-field-in-libnl-pkg-config-fil.patch b/package/libnl/patches/0001-build-add-Libs.private-field-in-libnl-pkg-config-fil.patch new file mode 100644 index 00000000..2419ae28 --- /dev/null +++ b/package/libnl/patches/0001-build-add-Libs.private-field-in-libnl-pkg-config-fil.patch @@ -0,0 +1,30 @@ +From db0d59cd06f3ffd350379847c0885e1bfb85af0f Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Sat, 7 Mar 2015 11:34:42 +0100 +Subject: [PATCH] build: add Libs.private field in libnl pkg-config file + +In order to support static linking, the libnl pkg-config file should +indicate in its Libs.private field the libraries that libnl-3.0.a +requires. The LIBS variable contains the appropriate list of +libraries: -lm in all cases, and -lpthread when pthread support is +enabled. This allows to statically link applications against libnl +properly. + +Signed-off-by: Thomas Petazzoni +--- + libnl-3.0.pc.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libnl-3.0.pc.in b/libnl-3.0.pc.in +index b87e3dc..ddbc999 100644 +--- a/libnl-3.0.pc.in ++++ b/libnl-3.0.pc.in +@@ -7,4 +7,5 @@ Name: libnl + Description: Convenience library for netlink sockets + Version: @PACKAGE_VERSION@ + Libs: -L${libdir} -lnl-@MAJ_VERSION@ ++Libs.private: @LIBS@ + Cflags: -I${includedir}/libnl@MAJ_VERSION@ +-- +2.1.0 + diff --git a/package/libnl/patches/0002-Add-musl-workaround-to-the-libc-compat.h-copy.patch b/package/libnl/patches/0002-Add-musl-workaround-to-the-libc-compat.h-copy.patch new file mode 100644 index 00000000..57d1c874 --- /dev/null +++ b/package/libnl/patches/0002-Add-musl-workaround-to-the-libc-compat.h-copy.patch @@ -0,0 +1,37 @@ +From be07fdbc9658de19304defa7538f219cd3f21ec0 Mon Sep 17 00:00:00 2001 +From: Baruch Siach +Date: Sun, 12 Mar 2017 08:52:20 +0200 +Subject: [PATCH] Add musl workaround to the libc-compat.h copy + +The libc-compat.h kernel header uses glibc specific macros to solve conflicts +with libc provided headers. This patch makes libc-compat.h work also for musl +libc. + +Future rebase note: when upstream updates libc-compat.h some additional macro +definitions will be needed. See the Buildroot iproute2 patch +package/iproute2/0001-Add-the-musl-workaround-to-the-libc-compat.h-copy.patch. + +Signed-off-by: Baruch Siach +--- +Upstream status: libc-compat.h is a local copy of a kernel headers. A proper +musl fix must go to the kernel first. +--- + include/linux-private/linux/libc-compat.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/linux-private/linux/libc-compat.h b/include/linux-private/linux/libc-compat.h +index 9bed5b6ae4d9..e2562a819464 100644 +--- a/include/linux-private/linux/libc-compat.h ++++ b/include/linux-private/linux/libc-compat.h +@@ -49,7 +49,7 @@ + #define _LIBC_COMPAT_H + + /* We have included glibc headers... */ +-#if defined(__GLIBC__) ++#if 1 + + /* Coordinate with glibc netinet/in.h header. */ + #if defined(_NETINET_IN_H) +-- +2.11.0 +