This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [systemtap trunk] Build error on eBPF.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]