* [PATCH iproute2 master] bpf: unbreak libelf linkage for bpf obj loader
@ 2017-08-09 22:15 Daniel Borkmann
2017-08-10 0:35 ` Stephen Hemminger
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Borkmann @ 2017-08-09 22:15 UTC (permalink / raw)
To: stephen; +Cc: netdev, Daniel Borkmann
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 | 4 ++++
lib/Makefile | 4 ++++
tc/Makefile | 4 ++++
3 files changed, 12 insertions(+)
diff --git a/ip/Makefile b/ip/Makefile
index 572604d..a754c04 100644
--- a/ip/Makefile
+++ b/ip/Makefile
@@ -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)
diff --git a/lib/Makefile b/lib/Makefile
index 637fe48..b7b1d56 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -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
diff --git a/tc/Makefile b/tc/Makefile
index c364a05..a9b4b8e 100644
--- a/tc/Makefile
+++ b/tc/Makefile
@@ -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)
--
1.9.3
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH iproute2 master] bpf: unbreak libelf linkage for bpf obj loader
2017-08-09 22:15 [PATCH iproute2 master] bpf: unbreak libelf linkage for bpf obj loader Daniel Borkmann
@ 2017-08-10 0:35 ` Stephen Hemminger
2017-08-10 8:44 ` Daniel Borkmann
0 siblings, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2017-08-10 0:35 UTC (permalink / raw)
To: Daniel Borkmann; +Cc: netdev
On Thu, 10 Aug 2017 00:15:41 +0200
Daniel Borkmann <daniel@iogearbox.net> wrote:
> 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>
Thanks, but I am thinking maybe a better solution long term would be to
move all the package specific stuff into the generated Config file.
That way only the generation shell script would have to change.
Also, all the flags should probably be using pkg-config to get the values.
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH iproute2 master] bpf: unbreak libelf linkage for bpf obj loader
2017-08-10 0:35 ` Stephen Hemminger
@ 2017-08-10 8:44 ` Daniel Borkmann
2017-08-10 23:41 ` Stephen Hemminger
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Borkmann @ 2017-08-10 8:44 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
On 08/10/2017 02:35 AM, Stephen Hemminger wrote:
> On Thu, 10 Aug 2017 00:15:41 +0200
> Daniel Borkmann <daniel@iogearbox.net> wrote:
>
>> 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>
>
> Thanks, but I am thinking maybe a better solution long term would be to
> move all the package specific stuff into the generated Config file.
>
> That way only the generation shell script would have to change.
>
> Also, all the flags should probably be using pkg-config to get the values.
Sure, sounds all good, for the time being, I would like to have
that breakage undone though, so users can work with loading BPF
programs again on -master.
Thanks,
Daniel
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH iproute2 master] bpf: unbreak libelf linkage for bpf obj loader
2017-08-10 8:44 ` Daniel Borkmann
@ 2017-08-10 23:41 ` Stephen Hemminger
2017-08-11 8:56 ` Daniel Borkmann
0 siblings, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2017-08-10 23:41 UTC (permalink / raw)
To: Daniel Borkmann; +Cc: netdev
On Thu, 10 Aug 2017 10:44:13 +0200
Daniel Borkmann <daniel@iogearbox.net> wrote:
> On 08/10/2017 02:35 AM, Stephen Hemminger wrote:
> > On Thu, 10 Aug 2017 00:15:41 +0200
> > Daniel Borkmann <daniel@iogearbox.net> wrote:
> >
> >> 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>
> >
> > Thanks, but I am thinking maybe a better solution long term would be to
> > move all the package specific stuff into the generated Config file.
> >
> > That way only the generation shell script would have to change.
> >
> > Also, all the flags should probably be using pkg-config to get the values.
>
> Sure, sounds all good, for the time being, I would like to have
> that breakage undone though, so users can work with loading BPF
> programs again on -master.
>
> Thanks,
> Daniel
Agree. I will merge this for master, and work on better config management
in net-next.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-08-11 8:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-09 22:15 [PATCH iproute2 master] bpf: unbreak libelf linkage for bpf obj loader Daniel Borkmann
2017-08-10 0:35 ` Stephen Hemminger
2017-08-10 8:44 ` Daniel Borkmann
2017-08-10 23:41 ` Stephen Hemminger
2017-08-11 8:56 ` Daniel Borkmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).