]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
bpf: unbreak libelf linkage for bpf obj loader
authorDaniel Borkmann <daniel@iogearbox.net>
Wed, 9 Aug 2017 22:15:41 +0000 (00:15 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Thu, 10 Aug 2017 23:40:02 +0000 (16:40 -0700)
Commit 69fed534a533 ("change how Config is used in Makefile's") moved
HAVE_MNL specific CFLAGS/LDLIBS for building with libmnl out of the
top level Makefile into sub-Makefiles. However, it also removed the
HAVE_ELF specific CFLAGS/LDLIBS entirely, which breaks the BPF object
loader for tc and ip with "No ELF library support compiled in." despite
having libelf detected in configure script. Fix it similarly as in
69fed534a533 for HAVE_ELF.

Fixes: 69fed534a533 ("change how Config is used in Makefile's")
Reported-by: Jeffrey Panneman <jeffrey.panneman@tno.nl>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
ip/Makefile
lib/Makefile
tc/Makefile

index 572604d5f200ad0160caf7e1254bce27e579b4d5..a754c04d2dbb27be092564ed9fb89ecf8527ec1b 100644 (file)
@@ -19,6 +19,10 @@ ifeq ($(IP_CONFIG_SETNS),y)
        CFLAGS += -DHAVE_SETNS
 endif
 
+ifeq ($(HAVE_ELF),y)
+       CFLAGS += -DHAVE_ELF
+       LDLIBS += -lelf
+endif
 ifeq ($(HAVE_MNL),y)
        CFLAGS += -DHAVE_LIBMNL $(shell $(PKG_CONFIG) libmnl --cflags)
        LDLIBS += $(shell $(PKG_CONFIG) libmnl --libs)
index 637fe487329db7b2461bc2dd76b6844081a27bc7..b7b1d5685b943051ba1e46027d9c5e7d43c0de23 100644 (file)
@@ -4,6 +4,10 @@ ifeq ($(IP_CONFIG_SETNS),y)
        CFLAGS += -DHAVE_SETNS
 endif
 
+ifeq ($(HAVE_ELF),y)
+       CFLAGS += -DHAVE_ELF
+endif
+
 ifeq ($(HAVE_MNL),y)
        CFLAGS += -DHAVE_LIBMNL $(shell $(PKG_CONFIG) libmnl --cflags)
 endif
index c364a053ecef268ce9a5d401ae077ec1dbd69994..a9b4b8e60dacbc27b85dc74eeb54ceab8cf2c368 100644 (file)
@@ -102,6 +102,10 @@ endif
 TCOBJ += $(TCMODULES)
 LDLIBS += -L. -lm
 
+ifeq ($(HAVE_ELF),y)
+       CFLAGS += -DHAVE_ELF
+       LDLIBS += -lelf
+endif
 ifeq ($(HAVE_MNL),y)
        CFLAGS += -DHAVE_LIBMNL $(shell $(PKG_CONFIG) libmnl --cflags)
        LDLIBS += $(shell $(PKG_CONFIG) libmnl --libs)