public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [systemtap trunk] Build error on eBPF.
@ 2017-04-12 14:24 Tetsuo Handa
  2017-04-14 10:54 ` Mark Wielaard
  0 siblings, 1 reply; 6+ messages in thread
From: Tetsuo Handa @ 2017-04-12 14:24 UTC (permalink / raw)
  To: rth; +Cc: systemtap

Hello.

Commit 7e2cd9f56293f697 ("Squashed commit of the eBPF backend for stap")
caused following build error when trying to build on CentOS 7.

  CXX      stap-loc2stap.o
loc2stap.cxx: In member function ‘location* location_context::translate(const Dwarf_Op*, size_t, size_t, location*, bool, bool)’:
loc2stap.cxx:239:34: error: missing initializer for member ‘Dwarf_Block::length’ [-Werror=missing-field-initializers]
   Dwarf_Block implicit_value = { };
                                  ^
loc2stap.cxx:239:34: error: missing initializer for member ‘Dwarf_Block::data’ [-Werror=missing-field-initializers]
cc1plus: all warnings being treated as errors
make[2]: *** [stap-loc2stap.o] Error 1
  CXX      stap-bpf-base.o
In file included from bpf-base.cxx:10:0:
bpf-internal.h:20:23: fatal error: linux/bpf.h: No such file or directory
 #include <linux/bpf.h>
                       ^
compilation terminated.
make[2]: *** [stap-bpf-base.o] Error 1
  CXX      stap-bpf-translate.o
In file included from bpf-translate.cxx:10:0:
bpf-internal.h:20:23: fatal error: linux/bpf.h: No such file or directory
 #include <linux/bpf.h>
                       ^
compilation terminated.
make[2]: *** [stap-bpf-translate.o] Error 1
  CXX      stap-bpf-opt.o
In file included from bpf-opt.cxx:15:0:
bpf-internal.h:20:23: fatal error: linux/bpf.h: No such file or directory
 #include <linux/bpf.h>
                       ^
compilation terminated.
make[2]: *** [stap-bpf-opt.o] Error 1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [systemtap trunk] Build error on eBPF.
  2017-04-12 14:24 [systemtap trunk] Build error on eBPF Tetsuo Handa
@ 2017-04-14 10:54 ` Mark Wielaard
  2017-04-14 11:17   ` Tetsuo Handa
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Wielaard @ 2017-04-14 10:54 UTC (permalink / raw)
  To: Tetsuo Handa; +Cc: rth, systemtap

Hi,

On Wed, 2017-04-12 at 23:24 +0900, Tetsuo Handa wrote:
> Commit 7e2cd9f56293f697 ("Squashed commit of the eBPF backend for stap")
> caused following build error when trying to build on CentOS 7.

Older GCC versions seemed to have some trouble with initialization of
anonymous struct fields in unions. Older elfutils didn't provide some
strtab manipulation functions. And some older kernel headers didn't
define all needed constants.

I pushed the following commits to hopefully fix the compilation (I
haven't tested running the ebpf backend yet):

commit 0603c3e9f86c47f3b5096a8060bed35f71d1d6e4
Author: Mark Wielaard <mark@klomp.org>
Date:   Fri Apr 14 12:44:36 2017 +0200

    stapbpf/libbpf.c: Define __NR_bpf and initialize anonymous bpf_attr union.
    
    __NR_bpf might not be defined in older headers, if so define it ourselves.
    Older GCC have trouble initializing anonymous struct fields in a union
    directly. Initialize them more explicitly.

commit cbceaaecb14cfb81ae4d6e88e3495edc02e6efbf
Author: Mark Wielaard <mark@klomp.org>
Date:   Fri Apr 14 12:43:38 2017 +0200

    stapbpf/stapbpf.cxx: Define PERF_EVENT_IOC_SET_BPF.
    
    PERF_EVENT_IOC_SET_BPF was introduced in 4.1, define it if unknown.

commit 567e36b73db7ce7c293d2e8f5378d3968f5838af
Author: Mark Wielaard <mark@klomp.org>
Date:   Fri Apr 14 12:40:57 2017 +0200

    bpf-translate.cxx: Include elfutils/version.h and check Strent exists.
    
    Before elfutils 0.167 the strtab functions were only available through
    the unsupported libebl library.

commit ee54f2bab5265d044955d1d29a8564b778c21416
Author: Mark Wielaard <mark@klomp.org>
Date:   Fri Apr 14 12:12:44 2017 +0200

    loc2stap.cxx (location_context::translate): Initialize implicit_value.
    
    Prevent a error with GCC -Werror=missing-field-initializers.
    Explicit set length and data.

Could you check if that helps in your case (my setup isn't really a pure
CentOS7 one).

Thanks,

Mark

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [systemtap trunk] Build error on eBPF.
  2017-04-14 10:54 ` Mark Wielaard
@ 2017-04-14 11:17   ` Tetsuo Handa
  2017-04-14 11:57     ` Mark Wielaard
  0 siblings, 1 reply; 6+ messages in thread
From: Tetsuo Handa @ 2017-04-14 11:17 UTC (permalink / raw)
  To: mark; +Cc: rth, systemtap

Mark Wielaard wrote:
> Hi,
> 
> On Wed, 2017-04-12 at 23:24 +0900, Tetsuo Handa wrote:
> > Commit 7e2cd9f56293f697 ("Squashed commit of the eBPF backend for stap")
> > caused following build error when trying to build on CentOS 7.
> 
> Older GCC versions seemed to have some trouble with initialization of
> anonymous struct fields in unions. Older elfutils didn't provide some
> strtab manipulation functions. And some older kernel headers didn't
> define all needed constants.
> 
> I pushed the following commits to hopefully fix the compilation (I
> haven't tested running the ebpf backend yet):

> Could you check if that helps in your case (my setup isn't really a pure
> CentOS7 one).
> 
> Thanks,
> 
> Mark

Thank you. But linux/bpf.h check seems to be missing.

./configure --prefix=/usr/local --with-java=/usr/lib/jvm/java
make -k

  CXX      stap-bpf-base.o
In file included from bpf-base.cxx:10:0:
bpf-internal.h:20:23: fatal error: linux/bpf.h: No such file or directory
 #include <linux/bpf.h>
                       ^
compilation terminated.
make[2]: *** [stap-bpf-base.o] Error 1
  CXX      stap-bpf-translate.o
In file included from bpf-translate.cxx:10:0:
bpf-internal.h:20:23: fatal error: linux/bpf.h: No such file or directory
 #include <linux/bpf.h>
                       ^
compilation terminated.
make[2]: *** [stap-bpf-translate.o] Error 1
  CXX      stap-bpf-opt.o
In file included from bpf-opt.cxx:15:0:
bpf-internal.h:20:23: fatal error: linux/bpf.h: No such file or directory
 #include <linux/bpf.h>
                       ^
compilation terminated.

  CXX      stapbpf-stapbpf.o
In file included from stapbpf.cxx:35:0:
bpfinterp.h:25:23: fatal error: linux/bpf.h: No such file or directory
 #include <linux/bpf.h>
                       ^
compilation terminated.
make[3]: *** [stapbpf-stapbpf.o] Error 1
  CXX      stapbpf-bpfinterp.o
In file included from bpfinterp.cxx:28:0:
bpfinterp.h:25:23: fatal error: linux/bpf.h: No such file or directory
 #include <linux/bpf.h>
                       ^
compilation terminated.
make[3]: *** [stapbpf-bpfinterp.o] Error 1
  CC       stapbpf-libbpf.o
libbpf.c:8:23: fatal error: linux/bpf.h: No such file or directory
 #include <linux/bpf.h>
                       ^
compilation terminated.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [systemtap trunk] Build error on eBPF.
  2017-04-14 11:17   ` Tetsuo Handa
@ 2017-04-14 11:57     ` Mark Wielaard
  2017-04-14 13:13       ` Tetsuo Handa
  2017-04-14 13:48       ` Richard Henderson
  0 siblings, 2 replies; 6+ messages in thread
From: Mark Wielaard @ 2017-04-14 11:57 UTC (permalink / raw)
  To: Tetsuo Handa; +Cc: rth, systemtap

On Fri, 2017-04-14 at 20:17 +0900, Tetsuo Handa wrote:
> Mark Wielaard wrote:
> > On Wed, 2017-04-12 at 23:24 +0900, Tetsuo Handa wrote:
> > > Commit 7e2cd9f56293f697 ("Squashed commit of the eBPF backend for stap")
> > > caused following build error when trying to build on CentOS 7.
> > 
> > Older GCC versions seemed to have some trouble with initialization of
> > anonymous struct fields in unions. Older elfutils didn't provide some
> > strtab manipulation functions. And some older kernel headers didn't
> > define all needed constants.
> > 
> > I pushed the following commits to hopefully fix the compilation (I
> > haven't tested running the ebpf backend yet):
> 
> > Could you check if that helps in your case (my setup isn't really a pure
> > CentOS7 one).
> 
> Thank you. But linux/bpf.h check seems to be missing.

Aha. Seems I have a slightly older version than Richard tested with, but
you don't have it at all. Could you try to update your git sources with
this commit:

commit 7ca1ffe6e431e4818a9a479935d75a428d2aaf57
Author: Mark Wielaard <mark@klomp.org>
Date:   Fri Apr 14 13:52:39 2017 +0200

    configure: Check for linux/bpf.h header.
    
    Don't build bpf backend support if there is no bpf.h header.
    Skip translate_bpf_pass if there is no bpf support.
    Regenerate configure and Makefile.in.

It should completely skip building the bpf backend in your case.

Thanks,

Mark

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [systemtap trunk] Build error on eBPF.
  2017-04-14 11:57     ` Mark Wielaard
@ 2017-04-14 13:13       ` Tetsuo Handa
  2017-04-14 13:48       ` Richard Henderson
  1 sibling, 0 replies; 6+ messages in thread
From: Tetsuo Handa @ 2017-04-14 13:13 UTC (permalink / raw)
  To: mark; +Cc: rth, systemtap

Mark Wielaard wrote:
> On Fri, 2017-04-14 at 20:17 +0900, Tetsuo Handa wrote:
> > Thank you. But linux/bpf.h check seems to be missing.
> 
> Aha. Seems I have a slightly older version than Richard tested with, but
> you don't have it at all. Could you try to update your git sources with
> this commit:

Now it builds correctly. Thank you.

> 
> commit 7ca1ffe6e431e4818a9a479935d75a428d2aaf57
> Author: Mark Wielaard <mark@klomp.org>
> Date:   Fri Apr 14 13:52:39 2017 +0200
> 
>     configure: Check for linux/bpf.h header.
>     
>     Don't build bpf backend support if there is no bpf.h header.
>     Skip translate_bpf_pass if there is no bpf support.
>     Regenerate configure and Makefile.in.
> 
> It should completely skip building the bpf backend in your case.
> 
> Thanks,
> 
> Mark

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [systemtap trunk] Build error on eBPF.
  2017-04-14 11:57     ` Mark Wielaard
  2017-04-14 13:13       ` Tetsuo Handa
@ 2017-04-14 13:48       ` Richard Henderson
  1 sibling, 0 replies; 6+ messages in thread
From: Richard Henderson @ 2017-04-14 13:48 UTC (permalink / raw)
  To: Mark Wielaard, Tetsuo Handa; +Cc: systemtap

On 04/14/2017 04:57 AM, Mark Wielaard wrote:
> On Fri, 2017-04-14 at 20:17 +0900, Tetsuo Handa wrote:
>> Mark Wielaard wrote:
>>> On Wed, 2017-04-12 at 23:24 +0900, Tetsuo Handa wrote:
>>>> Commit 7e2cd9f56293f697 ("Squashed commit of the eBPF backend for stap")
>>>> caused following build error when trying to build on CentOS 7.
>>>
>>> Older GCC versions seemed to have some trouble with initialization of
>>> anonymous struct fields in unions. Older elfutils didn't provide some
>>> strtab manipulation functions. And some older kernel headers didn't
>>> define all needed constants.
>>>
>>> I pushed the following commits to hopefully fix the compilation (I
>>> haven't tested running the ebpf backend yet):
>>
>>> Could you check if that helps in your case (my setup isn't really a pure
>>> CentOS7 one).
>>
>> Thank you. But linux/bpf.h check seems to be missing.
>
> Aha. Seems I have a slightly older version than Richard tested with, but
> you don't have it at all. Could you try to update your git sources with
> this commit:
>
> commit 7ca1ffe6e431e4818a9a479935d75a428d2aaf57
> Author: Mark Wielaard <mark@klomp.org>
> Date:   Fri Apr 14 13:52:39 2017 +0200
>
>     configure: Check for linux/bpf.h header.
>
>     Don't build bpf backend support if there is no bpf.h header.
>     Skip translate_bpf_pass if there is no bpf support.
>     Regenerate configure and Makefile.in.
>
> It should completely skip building the bpf backend in your case.

Thanks, Mark.


r~

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-04-14 13:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-12 14:24 [systemtap trunk] Build error on eBPF Tetsuo Handa
2017-04-14 10:54 ` Mark Wielaard
2017-04-14 11:17   ` Tetsuo Handa
2017-04-14 11:57     ` Mark Wielaard
2017-04-14 13:13       ` Tetsuo Handa
2017-04-14 13:48       ` Richard Henderson

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 read-only IMAP folder(s) and NNTP newsgroup(s).