[openwrt/openwrt] iproute2: fix libbpf detection with NLS enabled

LEDE Commits lede-commits at lists.infradead.org
Sat Apr 3 18:17:27 BST 2021


hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/aab3a04ce87c27996b7ce9ea306db8c6eed86941

commit aab3a04ce87c27996b7ce9ea306db8c6eed86941
Author: Tony Ambardar <itugrok at yahoo.com>
AuthorDate: Sat Mar 27 05:43:03 2021 -0700

    iproute2: fix libbpf detection with NLS enabled
    
    Upstream iproute2 detects libbpf using a one-line $CC test-compile, which
    normally ignores LDFLAGS. With NLS enabled however, LDFLAGS includes an
    "rpath-link" linker option needed to resolve libintl.so. Its absence
    causes both the compile and libbpf detection to fail:
    
      ld: warning: libintl.so.8, needed by libbpf.so, not found (try using
          -rpath or -rpath-link)
      ld: libelf.so.1: undefined reference to `libintl_dgettext'
      collect2: error: ld returned 1 exit status
    
    Fix this by directly including $LDFLAGS in the test-compile command.
    
    Reported-by: Ian Cooper <iancooper at hotmail.com>
    Signed-off-by: Tony Ambardar <itugrok at yahoo.com>
---
 package/network/utils/iproute2/Makefile              |  2 +-
 .../iproute2/patches/190-fix-nls-rpath-link.patch    | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile
index b1a137c18f..d7a7b3ed0f 100644
--- a/package/network/utils/iproute2/Makefile
+++ b/package/network/utils/iproute2/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=iproute2
 PKG_VERSION:=5.11.0
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2
diff --git a/package/network/utils/iproute2/patches/190-fix-nls-rpath-link.patch b/package/network/utils/iproute2/patches/190-fix-nls-rpath-link.patch
new file mode 100644
index 0000000000..d0f8cec633
--- /dev/null
+++ b/package/network/utils/iproute2/patches/190-fix-nls-rpath-link.patch
@@ -0,0 +1,20 @@
+--- a/configure
++++ b/configure
+@@ -259,7 +259,7 @@ int main(int argc, char **argv) {
+ }
+ EOF
+ 
+-    $CC -o $TMPDIR/libbpf_test $TMPDIR/libbpf_test.c $LIBBPF_CFLAGS $LIBBPF_LDLIBS >/dev/null 2>&1
++    $CC -o $TMPDIR/libbpf_test $TMPDIR/libbpf_test.c $LIBBPF_CFLAGS $LIBBPF_LDLIBS $LDFLAGS >/dev/null 2>&1
+     local ret=$?
+ 
+     rm -f $TMPDIR/libbpf_test.c $TMPDIR/libbpf_test
+@@ -277,7 +277,7 @@ int main(int argc, char **argv) {
+ }
+ EOF
+ 
+-    $CC -o $TMPDIR/libbpf_sec_test $TMPDIR/libbpf_sec_test.c $LIBBPF_CFLAGS $LIBBPF_LDLIBS >/dev/null 2>&1
++    $CC -o $TMPDIR/libbpf_sec_test $TMPDIR/libbpf_sec_test.c $LIBBPF_CFLAGS $LIBBPF_LDLIBS $LDFLAGS >/dev/null 2>&1
+     local ret=$?
+ 
+     rm -f $TMPDIR/libbpf_sec_test.c $TMPDIR/libbpf_sec_test



More information about the lede-commits mailing list