wkz / ply

Light-weight Dynamic Tracer for Linux
https://wkz.github.io/ply
GNU General Public License v2.0
402 stars 156 forks source link

Unable to build correctly on Ubuntu #6

Closed ricard0ff closed 7 years ago

ricard0ff commented 7 years ago

Heya, While trying to build ply on a ubuntu 14.04.5 with HWE, I get the following error:

$~/ply# make
Making all in src
make[1]: Entering directory `/root/ply/src'
  LEX      lang/lex.c
  YACC     lang/parse.c
updating lang/parse.h
make  all-am
make[2]: Entering directory `/root/ply/src'
  CC       lang/ply-lex.o
  CC       lang/ply-parse.o
In file included from lang/parse.y:25:0:
../src/include/ply/ast.h:32:23: fatal error: linux/bpf.h: No such file or directory
 #include <linux/bpf.h>
                       ^
compilation terminated.
make[2]: *** [lang/ply-parse.o] Error 1
make[2]: Leaving directory `/root/ply/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/root/ply/src'
make: *** [all-recursive] Error 1

I know there is the option to pass the kernel dir:

$ ~/ply# find / -name bpf.h
/usr/src/linux-headers-4.4.0-66/include/linux/bpf.h
/usr/src/linux-headers-4.4.0-66/include/uapi/linux/bpf.h
/usr/src/linux-headers-3.13.0-108-generic/include/config/netfilter/xt/match/bpf.h
/usr/src/linux-headers-3.13.0-108-generic/include/config/net/cls/bpf.h
/usr/src/linux-headers-4.4.0-66-generic/include/config/bpf.h
/usr/src/linux-headers-4.4.0-66-generic/include/config/netfilter/xt/match/bpf.h
/usr/src/linux-headers-4.4.0-66-generic/include/config/test/bpf.h
/usr/src/linux-headers-4.4.0-66-generic/include/config/net/act/bpf.h
/usr/src/linux-headers-4.4.0-66-generic/include/config/net/cls/bpf.h
/usr/include/bcc/compat/linux/bpf.h

trying to use kerneldir flag:


$~/ply# ./configure --with-kerneldir=/usr/src/linux-headers-4.4.0-66/
checking for a BSD-compatible install... /usr/bin/install -c
[...]
config.status: creating src/config.h
config.status: src/config.h is unchanged
config.status: executing depfiles commands

$ ~/ply# make
Making all in src
make[1]: Entering directory `/root/ply/src'
  HEADERS  /usr/src/linux-headers-4.4.0-66/(x86_64)
make -C /usr/src/linux-headers-4.4.0-66/ ARCH=x86_64 INSTALL_HDR_PATH=/root/ply/src/.kernel headers_install
make[2]: Entering directory `/usr/src/linux-headers-4.4.0-66'
  CHK     include/generated/uapi/linux/version.h
make[3]: *** No rule to make target `arch/x86/entry/syscalls/syscall_32.tbl', needed by `arch/x86/entry/syscalls/../../include/generated/asm/syscalls_32.h'.  Stop.
make[2]: *** [archheaders] Error 2
make[2]: Leaving directory `/usr/src/linux-headers-4.4.0-66'
make[1]: *** [.kernel/include/linux/version.h] Error 2
make[1]: Leaving directory `/root/ply/src'
make: *** [all-recursive] Error 1

Is there anything I'm doing incorrectly?

Thanks, Ricardo