bpf: unbreak libelf linkage for bpf obj loader

Commit 69fed534a5 ("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
69fed534a5 for HAVE_ELF.

Fixes: 69fed534a5 ("change how Config is used in Makefile's")
Reported-by: Jeffrey Panneman <jeffrey.panneman@tno.nl>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
This commit is contained in:
Daniel Borkmann 2017-08-10 00:15:41 +02:00 committed by Stephen Hemminger
parent fb6cb30774
commit 8cc360fe48
3 changed files with 12 additions and 0 deletions

View 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)

View 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

View 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)