Bug#853888: bpfcc not building on ppc64el and aarch64

2017-02-11 Thread Ritesh Raj Sarraf
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On Wed, 2017-02-01 at 14:42 -0500, Breno Leitao wrote:
> Currently bpfcc does not build on ppc64el (and aaarch64) due to missing
> luajit package.
> 
> The luajit upstream situation for the new architecture is not clear
> , so, Debian have a luajit package in the experimental archive that
> contains the ppc64el patch (still not accepted upstream).
> 
> I am planning on how to enable it for ppc64el, Can we depend on 
> experimental package for ppc64el? If not, can we depend on lua instead
> of luajit?

The package's test binary is failing to build on ppc64el, on top of your
mentioned patch for luajit.

https://buildd.debian.org/status/fetch.php?pkg=bpfcc=ppc64el=0.2.0-3
amp=1486558047=0

The build failure looks more like a luajit problem.

- -- 
Ritesh Raj Sarraf | http://people.debian.org/~rrs
Debian - The Universal Operating System
-BEGIN PGP SIGNATURE-

iQIzBAEBCgAdFiEEQCVDstmIVAB/Yn02pjpYo/LhdWkFAlifV8cACgkQpjpYo/Lh
dWmG9xAAjltDvoC5hi9+uKD6msbGS41ouX24kF7SmZ3WR6rWKOv2EsgZGvhNoGlt
MPlMy8m4ADnjZIvnBq9teQGFkYLOxWcffGMvnzdfEaxaTnbqw/FsBOt+mXd2vpUL
B9d1hI6vUzRutIl11mT69QsISco+FrBvj5JVqlaRDq5RZd10aTyXvWCXAmcqCcLV
BnPulk9yv2LTBtQDgcQMSEpScFFaalQRCSoWVFIin9+Xl1LzNB++MBoYJ3sfA1Km
FMXvLbsKITWjouZtxF8wT0bt22bsZJL3HUqIX31xvm98SVbwKM4bAyX3Xmfsztkh
UQaMolexu2EH27BQ4baBwnOZtW1sQMaD7BUbBEat5yPDQiSfUpCJt7u3orBdVPEO
BuYAItEWvOOYYgw73gZ2XLE9jiFHwkr302zfdPPq+VOktdGKvys67VJuofiQQw/4
4aoaWtCGXylfxTUDgJ8sQD08EWMz2hKFPYaycC1XwlCFDsbeSkV4UawKruyzxHGu
qZleDeJCwrUeeYC8pLLEQukerFgZGYelovCalC5EvkuWgyYzQPLHEpzpFBD1TBGk
i8bPAbngllVIGyACtrqZaByKv1AwoIFjFKn6ZO0Yjf8EwmdBd1KoJT/8aWh5vjxP
jaGBdJKrH4cWLrnvIFG0KRtlLYFHk9yfTdbjxPeriRFVzh8qPz4=
=QT8Z
-END PGP SIGNATURE-



Bug#853888: bpfcc not building on ppc64el and aarch64

2017-02-09 Thread Ritesh Raj Sarraf
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On Thu, 2017-02-09 at 09:22 -0200, Breno Leitao wrote:
> Yes, you can check the following bug:
> 
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=813831

That bug is an year old with no closure.

Anyways, for bpfcc, this is still an experimental build. Unless that bug is
fixed, having that versioned dependency on luajit is useless.


- -- 
Ritesh Raj Sarraf | http://people.debian.org/~rrs
Debian - The Universal Operating System
-BEGIN PGP SIGNATURE-

iQIzBAEBCgAdFiEEQCVDstmIVAB/Yn02pjpYo/LhdWkFAlicb7gACgkQpjpYo/Lh
dWlk3w/+I+RrA7DQv0s3KGKL1fD64pVxsWAhCjkoKwDX43aa6Xgbhn3zB87wi0dY
ozwzgIbh+2oClQLHOm7S3TQKoC6Wd2HyV7aNYXAB6J1LxOya4rDc/wA9Vs2xMdrI
eNhDVmW3iq3UBkrG/sMbMyi67uFJSzYU0IySGtC/ECNHiRnBjJ9FYGbtC7yKurNj
GrrULuKNzRN0s8taGlF4vO0xheQAtftACGl3Qco55E19YSzuwQUJhgLCRzXNL8Yw
7SyVK5fTnRoxTck9SLPGP2neYfGmPUIWcRiC8x2B64/q2SAp2uGoV9ULVc3iAbSo
l5JYY/I/tClDfwW+56iNBwysXMJUBuAdmBcWTJ+LQqUgZeb239u18z5e/PTq/4wD
BBZ+cLwpii0NgQuPo7OsfiPd0aUI5v47N8ae63Cwo7LqAdsBPwyewrsG6r0Abdgn
+cBGBVO7iMSkY9aPsgIMvPuuvNVZ/cnxDmNYAvwy2pO9DvqMB4gG7pt2YhIhg7KF
SqlXkF528BbKqOVgqoCH995xy7qOauBii1J84yE71W9vL2qLPlddafuer5kddxap
291PHUXy7jNBL1YRw9YlW9N/6GZ7vjUrQbgknz4CU+cZZfPgJGPSVlC9HQkov8fJ
o1gECWfGjfFg78XcNx3NtekicxH6UmSsylyyP0ZS7krbL4GP+XY=
=X+2y
-END PGP SIGNATURE-



Bug#853888: bpfcc not building on ppc64el and aarch64

2017-02-09 Thread Ritesh Raj Sarraf
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Hi,

On Thu, 2017-02-09 at 09:22 -0200, Breno Leitao wrote:
> On Wed, Feb 08, 2017 at 12:56:21PM +0530, Ritesh Raj Sarraf wrote:
> > @Breno: Is this the version you are talking about ?  2.1.0~beta2+dfsg-3
> > bpfcc is not targeted for Stretch anyways, so I can add a dependency on this
> > version to test.
> 
> Cool, that would work as well, but I suppose it does not fix the aarch64
> problem.
> 

Yes. There still are many architectures missing. But that is a luajit problem.

> > By the way, can you point me to the bug report that talks about the luajit
> > patch
> > for ppc64el ?
> 
> Yes, you can check the following bug:
> 
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=813831
> 
> You can also find luajit package with these patches at experimental
> archive:
> 
> https://packages.debian.org/experimental/luajit

This is done already. Please try out the experimental build and provide
feedback, if any.


PS: Please keep the bug in CC. It'll help others too.

- -- 
Ritesh Raj Sarraf | http://people.debian.org/~rrs
Debian - The Universal Operating System
-BEGIN PGP SIGNATURE-

iQIzBAEBCgAdFiEEQCVDstmIVAB/Yn02pjpYo/LhdWkFAlicbtEACgkQpjpYo/Lh
dWnavRAAtPKeM8YqAsusQ4i03+z+K0+HPVHIB+Z5trV+CAfvAfD/HLsphVVwPW5I
2sHaYTPdA98g6ArEqhmBsbo+FNhICJZ7PE9bQZPVCyK5tKuImZ9n8zuQha6llFQC
npLUzNy0Q4eIpghwr3MP0ZCf9PGZvvuhiDcY86TdRuFA3DrOBmJPRv5JtQDcORay
9rP3kb2r09JqXa7PSyUnvfQSPHHhGp7Ls4LZnmftH6IZuF7rGwZTXwCmj3ObhmJ4
xFK5BMYjIwLX4sdfz0xwmzAuhQQ2tVY7J6WJCZZRIlDkYSOCLUOAV/8enYiIK6Ao
yTZL+xx9QBtLNE3D4NxbGGJZi5aH7ePufhSerDrl2JXMZ9VEnW1MagWAY8OZ3ASM
Ozhkct/ycVEFZPDdV4zsfJl2PTG1Te1RKBcI8FBCWPRVLyvgobd41MQ/88xi6QAk
SAJFQTa4AtS0WUjLKfw8n8zSKJxKOPkYzNUyTsraQEeGbVrMgLJnVs8W6GD3j/rf
y5IwO0B+jPGtO34kYBESjz/M1GjrRwsEFsT03hC+qslQY1udvbGLTQQyg50ak0KK
RWn/N2C4hysoGRuSC8A5r3NkkQlCEZsaOOukbDdj42g8ytllISEh07x6SRPwF4RV
cmkz1jVFSVzvQ3moU6B+O5Yk1c18f/IkAJw5H62Kd4soJB5gbk4=
=Z5Yt
-END PGP SIGNATURE-



Bug#853888: bpfcc not building on ppc64el and aarch64

2017-02-08 Thread Ritesh Raj Sarraf
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On Wed, 2017-02-08 at 12:56 +0530, Ritesh Raj Sarraf wrote:
> No. I don't want to do that. Packages should be consistent across
> architectures.
> Either we fix it, or let it FTBFS on these architectures.
> 
> @Breno: Is this the version you are talking about ?  2.1.0~beta2+dfsg-3
> bpfcc is not targeted for Stretch anyways, so I can add a dependency on this
> version to test.
> By the way, can you point me to the bug report that talks about the luajit
> patch
> for ppc64el ?

This bug is done from the build perspective, but I'm still eager to hear your
feedback of its runtime on all the built architectures. So please, if you can,
do run the scripts on the respective architectures and share your results. I'm
also interested on reports on i386.

Thanks,
Ritesh

- -- 
Ritesh Raj Sarraf | http://people.debian.org/~rrs
Debian - The Universal Operating System
-BEGIN PGP SIGNATURE-

iQIzBAEBCgAdFiEEQCVDstmIVAB/Yn02pjpYo/LhdWkFAlibPTIACgkQpjpYo/Lh
dWkzlQ//RtaWgzhZY3nhuddMr5Rw8rGDMldpJP4wrxQmv2MoRbViVWdwCE+JaI27
Ks/eiC8zdighUghuOHmOJKAWuiUeGNWN/qIq7mkYl9cVmJ9yLL7ouaUNiFFSv0Yw
ob4R1iyYIXL6eXW2cv55AdZpwW7qRy2ST7ckttdx4hIeIUo1Gsr8G9XeeadeYOtv
YkVCoswsjGy53FDvfg62iU0gaOTV4+CUq+PD2b3wfmT0NvYwoYssfjSRKqYsmZoF
TKRfGq1FU3/KacgKu8DYXl5KCilAk/k0wacHOATIOb0/AMAriWRn/icrIsyJkYj9
snvx+JX6Q0CFFHannQlvHpvB1a/9ISI/8GQXq0TceS6fR4Zi+4s0pYqcRuV1wuV+
S//X83YwAW2VvobZpQTUM8YpuRo5p66mt3ceZzPSkVOZHguHqh5unjU00c8XV4l0
qjYu4hnV0h3ddC1ILJrVoqFzrOePPPKqLZJ8NHlXAUg7WF/hvxnnjTbfDBQwU/p1
fSuTmOatRNe9eiKYRyHFA3b7QphyPewndjMQ9jdxaIq3ADbsLYh+109WTaxvUG3g
HP8KqFkiLFRGQQOHgMgiM5BiUmtXKUQ6zmASBdsOHr4s7B/0/skZTYYBE8pwfj9K
EU//2lzZvGBACyXOH5brPSfMLy8kHCtQyt6QAvZQr/0qEzhJMwA=
=8fyd
-END PGP SIGNATURE-



Bug#853888: bpfcc not building on ppc64el and aarch64

2017-02-07 Thread Ritesh Raj Sarraf
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On Wed, 2017-02-08 at 01:15 +0530, Naveen N. Rao wrote:
> > That doesn't help Debian but the changes are almost the same to what I was
> > attempting. But I'm still curious to see how those changes fix the actual
> > bug I
> > encountered. Because for non-luajit setups, the build would still fail.
> 
> My understanding is that there is a hard dependency on luajit itself.  
> bcc/bpfcc supports writing the BPF filter in lua as well, and in that 
> scenario, it needs luajit to generate lua bytecode, which is then 
> translated to BPF bytecode.
> 

- From the build files I do not see any hard wired dependency on the jit itself,
but yes, the current structure was only built with the jit in mind.

> So, I think the right approach would be to _disable_ bpfcc-lua package 
> as well as the lua examples in bpfcc-tools on ppc64el and aarch64.

No. I don't want to do that. Packages should be consistent across architectures.
Either we fix it, or let it FTBFS on these architectures.

@Breno: Is this the version you are talking about ?  2.1.0~beta2+dfsg-3
bpfcc is not targeted for Stretch anyways, so I can add a dependency on this
version to test.
By the way, can you point me to the bug report that talks about the luajit patch
for ppc64el ?

- -- 
Ritesh Raj Sarraf | http://people.debian.org/~rrs
Debian - The Universal Operating System
-BEGIN PGP SIGNATURE-

iQIzBAEBCgAdFiEEQCVDstmIVAB/Yn02pjpYo/LhdWkFAliayB0ACgkQpjpYo/Lh
dWnQ3RAAjvV2XrKs0LcADnewaeS9b9KAOKrWVwQvxhzTEQZChfNU+2RbgFzX/lDl
0A3y3cyZn+SaEo/+PutJO93YrulD9ckVuvLo9LAPKrK7FtZJJMq3WnlFOOOewLZi
wtfO/ECFls5pqTRFW67CME5cmqLXPpi059lhE7tugjh607CwwRJOWzuQpY1YCWyV
hYrIM3KETqnN5I9Dp/QfythTcr/2J52ZZzzNWKK5w5FqEER5WL98hjfGAznS8r1r
F16yXrEMt3i00O83dowrHACB56Z2NfIw7tw5bkyeNN3bNmbTw35HjRhxB6j/6ZiF
l95Um0kPFqkVwa37B39/t5iiE3+Cbxmif03zZrBdhCnV2/s0WkmqHJG/ro7WWxDz
LogJD+T4WN6wxqb9YFDT8V00BzcH3wOkz9VuScDNQirtv5cZQXsh1OAf3UG4zYZX
LHOxzaJEi6qudWS9rQ+QRfzmMojm0yLwu03lYyhUSzSeljYdZN9Hhap7euWLw1Qb
aaZ2FFHD39Ey0l6OAiaemskTBkdyycsjrxV3LqVmv4vhIvaiGfSJeuyPpYjybQi5
b99sJrA/8nWfGKcOHzA+ilTYpMQZN5/pmc863Y9DQrDGzPWnQ84zMrRLIaXjpBkH
Z0q70qJkvXMAT1RdoUdt2bBqDL979tTFmOAEygxrfcXKTLVrx/c=
=9QZT
-END PGP SIGNATURE-



Bug#853888: bpfcc not building on ppc64el and aarch64

2017-02-07 Thread Naveen N. Rao
On 2017/02/08 12:08AM, Ritesh Raj Sarraf wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA512
> 
> Hello Naveen,
> 
> On Tue, 2017-02-07 at 23:18 +0530, Naveen N. Rao wrote:
> > I'm not familiar with lua/luajit, but can it be made optional for 
> > ppc64el and aarch64?
> > 
> > Upstream has a similar fix for rpm distros:
> > https://github.com/iovisor/bcc/commit/ef91b6ed64d022baec977a8415581cd1a4a218c5
> 
> Thanks for the link. The RH folks are doing similar things to what I tried but
> their changes are confined to the RPM build script.

They've actually *disabled* building the bcc-lua package on ppc64el and 
aarch64.

> 
> That doesn't help Debian but the changes are almost the same to what I was
> attempting. But I'm still curious to see how those changes fix the actual bug 
> I
> encountered. Because for non-luajit setups, the build would still fail.

My understanding is that there is a hard dependency on luajit itself.  
bcc/bpfcc supports writing the BPF filter in lua as well, and in that 
scenario, it needs luajit to generate lua bytecode, which is then 
translated to BPF bytecode.

So, I think the right approach would be to _disable_ bpfcc-lua package 
as well as the lua examples in bpfcc-tools on ppc64el and aarch64.

- Naveen



Bug#853888: bpfcc not building on ppc64el and aarch64

2017-02-07 Thread Ritesh Raj Sarraf
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Hello Naveen,

On Tue, 2017-02-07 at 23:18 +0530, Naveen N. Rao wrote:
> I'm not familiar with lua/luajit, but can it be made optional for 
> ppc64el and aarch64?
> 
> Upstream has a similar fix for rpm distros:
> https://github.com/iovisor/bcc/commit/ef91b6ed64d022baec977a8415581cd1a4a218c5

Thanks for the link. The RH folks are doing similar things to what I tried but
their changes are confined to the RPM build script.

That doesn't help Debian but the changes are almost the same to what I was
attempting. But I'm still curious to see how those changes fix the actual bug I
encountered. Because for non-luajit setups, the build would still fail.

Did you try building BCC on Debian with my (incomplete) patch ?
Let me pick the exact build failure.

[ 81%] Generating bcc.lua
Scanning dependencies of target test_static
cd /build/bpfcc-0.2.0/obj-x86_64-linux-gnu/src/lua && /usr/bin/lua5.3 
/build/bpfcc-0.2.0/src/lua/src/squish.lua /build/bpfcc-0.2.0/src/lua
make[3]: Leaving directory '/build/bpfcc-0.2.0/obj-x86_64-linux-gnu'
make -f tests/cc/CMakeFiles/test_static.dir/build.make 
tests/cc/CMakeFiles/test_static.dir/build
Writing bcc.lua...
OK!
make[3]: Entering directory '/build/bpfcc-0.2.0/obj-x86_64-linux-gnu'
[ 83%] Generating bcc.o
cd /build/bpfcc-0.2.0/obj-x86_64-linux-gnu/src/lua && /usr/bin/lua5.3 bcc.lua 
bcc.o
/usr/bin/lua5.3: bcc.lua:1656: ')' expected near 'ULL'
src/lua/CMakeFiles/bcc-lua.dir/build.make:64: recipe for target 'src/lua/bcc.o' 
failed
make[3]: *** [src/lua/bcc.o] Error 1
[ 85%] Building C object tests/cc/CMakeFiles/test_static.dir/test_static.c.o
make[3]: Leaving directory '/build/bpfcc-0.2.0/obj-x86_64-linux-gnu'
CMakeFiles/Makefile2:676: recipe for target 
'src/lua/CMakeFiles/bcc-lua.dir/all' failed
make[2]: *** [src/lua/CMakeFiles/bcc-lua.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs
cd /build/bpfcc-0.2.0/obj-x86_64-linux-gnu/tests/cc && /usr/lib/ccache/cc   
-I/usr/lib/llvm-3.8/include/../tools/clang/include -I/build/bpfcc-0.2.0/src/cc  
-g -O2 -fdebug-prefix-map=/build/b
pfcc-0.2.0=. -fstack-protector-strong -Wformat -Werror=format-security -no-pie 
-Wdate-time -D_FORTIFY_SOURCE=2 -Wall -O3 -DNDEBUG   -o 
CMakeFiles/test_static.dir/test_static.c.o   -c /build/
bpfcc-0.2.0/tests/cc/test_static.c
[ 87%] Linking CXX executable test_static



The same code builds fine with luajit. So that begs the question of what Lua
does different than Luajit.

Can someone help me with the following ?

* What is the luajit equivalent in Lua? Lua has `luac` and `lua5.3`, which are
the compiler and the interpreter respectively.
* Command option equivalent.

ADD_CUSTOM_COMMAND(
OUTPUT bcc.o
COMMAND ${LUAJIT} -bg bcc.lua bcc.o
DEPENDS bcc.lua
)

For luajit, "-bg" is understood. What we need is the equivalent of it in
lua/luac.


- -- 
Ritesh Raj Sarraf | http://people.debian.org/~rrs
Debian - The Universal Operating System
-BEGIN PGP SIGNATURE-

iQIzBAEBCgAdFiEEQCVDstmIVAB/Yn02pjpYo/LhdWkFAliaFA8ACgkQpjpYo/Lh
dWkM8Q//SNcAAZ0iojISqOzmUAy46u5WLz7NFc4COiML5X5Bmn6M0yWp5zyzB+NM
npEd3bpXENFm+PLLor6AZElWp6jSUxDfmyH1oQb1ZjzfwFRDSrEAq08uabYDspxe
JWMK49g49/swiiEoxQcc+WZ+5PNoUPEz0Xvg/TC0PksbUrurKDfxveKvo/1ic3Hp
ZpdMANsu94VSyDAAxPFeWpFXH0BxELaDNiznz9B3fHi0jywkdxVUUxhjZkwO/Rig
xMv2ihuRNNu73365Y0V/2NrC89s0B6Bcl080GKsjfyOvQsnun8E3pJ9uvATDpSaH
SP+wEHJmG89xuLWlSdCKyqRQoRZHPg5wq7RUBSKngHxnWzbJGSU3QOwcsHUj3X7O
llH86hGap3XI3rU5ug5G1tTjGPY655750PEInUecYR/BmqPfsp4lE+oGweH1GHAn
YB7RhLMQvyIWb44v037qdu+eIzn7UGowpVP0+MFGXxh09abU0+csu1o7bag76OHZ
Jw+kJQWCXGcby2gJKo/z5dddBsc/6MI5OyS7QX0LP4yrINfRiPUL9DuKOO3BVBRU
Qn2xLQs6vuMW/UWL0/n1uNQyoaDH/D1SSvy2zApatN4XrGpWv8rTSfX2yDwitwi3
1NXb+qFulaiez3v+w00qFcDLNLyj8VkYfSrgaUm0PrTJB4J8CXg=
=fT56
-END PGP SIGNATURE-



Bug#853888: bpfcc not building on ppc64el and aarch64

2017-02-07 Thread Naveen N. Rao
I'm not familiar with lua/luajit, but can it be made optional for 
ppc64el and aarch64?

Upstream has a similar fix for rpm distros:
https://github.com/iovisor/bcc/commit/ef91b6ed64d022baec977a8415581cd1a4a218c5

Thanks,
Naveen



Bug#853888: bpfcc not building on ppc64el and aarch64

2017-02-05 Thread Ritesh Raj Sarraf
On Sun, 2017-02-05 at 21:31 +0530, Ritesh Raj Sarraf wrote:
> On Sun, 2017-02-05 at 21:18 +0530, Ritesh Raj Sarraf wrote:
> > I am willing to extend the build to lua, but I need help here. My knowledge
> > of
> > Lua is limited and it'd help if, someone more knowledgeable on the topic,
> > takes
> > the task of extending FindLuaJIT.cmake to include Lua.
> 
> I got it to like Lua 5.3, but I still have some (hopefully minor) build
> failures. Still investigating.

I'm going to give up further, and instead look up to you guys. Attached patch is
my attempt at extending it to support Lua.

I'll also clean up the experimental branch and push it in its current state
(fails to build).


-- 
Ritesh Raj Sarraf | http://people.debian.org/~rrs
Debian - The Universal Operating SystemExtend support to Lua
Index: bpfcc/cmake/FindLuaJIT.cmake
===
--- bpfcc.orig/cmake/FindLuaJIT.cmake	2017-02-05 21:58:25.386114899 +0530
+++ bpfcc/cmake/FindLuaJIT.cmake	2017-02-05 21:58:25.382781534 +0530
@@ -31,7 +31,7 @@
 FIND_PATH(LUAJIT_INCLUDE_DIR lua.h
   HINTS
   $ENV{LUAJIT_DIR}
-  PATH_SUFFIXES include/luajit-2.0 include/luajit2.0 include/luajit include
+  PATH_SUFFIXES include/lua5.3 include/luajit-2.0 include/luajit2.0 include/luajit include
   PATHS
   ~/Library/Frameworks
   /Library/Frameworks
@@ -44,7 +44,7 @@
 )
 
 FIND_LIBRARY(LUAJIT_LIBRARY
-  NAMES libluajit-51.a libluajit-5.1.a libluajit.a
+  NAMES liblua5.3.a libluajit-51.a libluajit-5.1.a libluajit.a
   HINTS
   $ENV{LUAJIT_DIR}
   PATH_SUFFIXES lib64 lib
Index: bpfcc/src/lua/CMakeLists.txt
===
--- bpfcc.orig/src/lua/CMakeLists.txt	2017-02-05 21:58:25.386114899 +0530
+++ bpfcc/src/lua/CMakeLists.txt	2017-02-05 21:59:10.958086335 +0530
@@ -1,5 +1,6 @@
 find_package(LuaJIT)
 find_program(LUAJIT luajit)
+find_program(LUA53 lua5.3)
 
 if (LUAJIT_LIBRARIES AND LUAJIT)
 	FILE(GLOB_RECURSE SRC_LUA
@@ -18,6 +19,30 @@
 		DEPENDS bcc.lua
 	)
 
+	include_directories(${LUAJIT_INCLUDE_DIR})
+	add_executable(bcc-lua src/main.c bcc.o)
+	set_target_properties(bcc-lua PROPERTIES LINKER_LANGUAGE C)
+	target_link_libraries(bcc-lua ${LUAJIT_LIBRARIES})
+	target_link_libraries(bcc-lua -Wl,--whole-archive bcc-static -Wl,--no-whole-archive)
+
+	install(TARGETS bcc-lua RUNTIME DESTINATION bin)
+elseif (LUAJIT_LIBRARIES AND LUA53)
+	FILE(GLOB_RECURSE SRC_LUA
+		${CMAKE_CURRENT_SOURCE_DIR}/bcc/*.lua
+		${CMAKE_CURRENT_SOURCE_DIR}/bcc/vendor/*.lua)
+
+	ADD_CUSTOM_COMMAND(
+		OUTPUT bcc.lua
+COMMAND ${LUA53} ${CMAKE_CURRENT_SOURCE_DIR}/src/squish.lua ${CMAKE_CURRENT_SOURCE_DIR}
+		DEPENDS ${SRC_LUA} ${CMAKE_CURRENT_SOURCE_DIR}/squishy
+	)
+
+	ADD_CUSTOM_COMMAND(
+		OUTPUT bcc.o
+COMMAND ${LUA53} bcc.lua bcc.o
+		DEPENDS bcc.lua
+	)
+
 	include_directories(${LUAJIT_INCLUDE_DIR})
 	add_executable(bcc-lua src/main.c bcc.o)
 	set_target_properties(bcc-lua PROPERTIES LINKER_LANGUAGE C)


signature.asc
Description: This is a digitally signed message part


Bug#853888: bpfcc not building on ppc64el and aarch64

2017-02-05 Thread Ritesh Raj Sarraf
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On Sun, 2017-02-05 at 21:18 +0530, Ritesh Raj Sarraf wrote:
> I am willing to extend the build to lua, but I need help here. My knowledge of
> Lua is limited and it'd help if, someone more knowledgeable on the topic,
> takes
> the task of extending FindLuaJIT.cmake to include Lua.

I got it to like Lua 5.3, but I still have some (hopefully minor) build
failures. Still investigating.


dh_auto_configure -- -DREVISION_LAST=0.2.0 -DREVISION=0.2.0 
-DLLVM_DEFINITIONS="-D_GNU_SOURCE-D__STDC_CONSTANT_MACROS 
-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS" -DBCC_KERNEL_HAS_SOURCE_DI
R=1 

  
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON 
-DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc 
-DCMAKE_INSTALL_LOCALSTATEDIR=/var -DREVISION_LAST=0.2.0 -DRE
VISION=0.2.0 "-DLLVM_DEFINITIONS=-D_GNU_SOURCE -D__STDC_CONSTANT_MACROS 
-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS" -DBCC_KERNEL_HAS_SOURCE_DIR=1 
  
- -- The C compiler identification is GNU 7.0.1 


- -- The CXX compiler identification is GNU 7.0.1   


- -- Check for working C compiler: /usr/lib/ccache/cc   


- -- Check for working C compiler: /usr/lib/ccache/cc -- works  


- -- Detecting C compiler ABI info  


- -- Detecting C compiler ABI info - done   


- -- Detecting C compile features   


- -- Detecting C compile features - done


- -- Check for working CXX compiler: /usr/lib/ccache/c++


- -- Check for working CXX compiler: /usr/lib/ccache/c++ -- works   


- -- Detecting CXX compiler ABI info


- -- Detecting CXX compiler ABI info - done 


- -- Detecting CXX compile features 


- -- Detecting CXX compile features - done  


- -- Revision is 0.2.0  


- -- Found BISON: /usr/bin/bison (found version "3.0.4")


- -- Found FLEX: /usr/bin/flex (found version "2.6.1")
- -- Found LLVM: /usr/lib/llvm-3.8/include
- -- Found LibElf: /usr/lib/x86_64-linux-gnu/libelf.so
- -- Performing Test ELF_GETSHDRSTRNDX
- -- Performing Test ELF_GETSHDRSTRNDX - Success
- -- Using static-libstdc++
- -- Found LuaJIT: 
/usr/lib/x86_64-linux-gnu/liblua5.3.a;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so
CMake Warning at tests/python/CMakeLists.txt:6 (message):
  Recommended test program 'arping' not found



- -- 
Ritesh Raj Sarraf | http://people.debian.org/~rrs
Debian - The Universal Operating System
-BEGIN PGP SIGNATURE-


Bug#853888: bpfcc not building on ppc64el and aarch64

2017-02-05 Thread Ritesh Raj Sarraf
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Thank you for reminding me about experimental. I had completely forgotten about
that.

So, I enabled build dependency on lua5.3. 
Request: It'd be nice to have a meta package instead.

By the way, all these packages provide the dependency. I just chose the latest
one.

liblua5.1-0-dev: /usr/include/lua5.1/lua.h
liblua5.1-0-dev: /usr/include/lua5.1/lua.hpp
liblua5.2-dev: /usr/include/lua5.2/lua.h
liblua5.2-dev: /usr/include/lua5.2/lua.hpp
liblua5.3-dev: /usr/include/lua5.3/lua.h
liblua5.3-dev: /usr/include/lua5.3/lua.hpp
liblua50-dev: /usr/include/lua50/lua.h
libluabind-dev: /usr/include/luabind/detail/convert_to_lua.hpp
libluajit-5.1-dev: /usr/include/luajit-2.0/lua.h
libluajit-5.1-dev: /usr/include/luajit-2.0/lua.hpp
libluajit-5.1-dev: /usr/include/luajit-2.1/lua.h
libluajit-5.1-dev: /usr/include/luajit-2.1/lua.hpp
libluasandbox-dev: /usr/include/luasandbox/lua.h


The build still fails because upstream cmake tightly looks for luajit only.

cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON 
-DCMAKE_BUILD_TYPE=None 
- -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var 
-DREVISION_LAST=0.2.0 
- -DREVISION=0.2.0 "-DLLVM_DEFINITIONS=-D_GNU_SOURCE -D__STDC_CONSTANT_MACROS 
-D__STDC_FORMAT_MACROS 
- -D__STDC_LIMIT_MACROS" -DBCC_KERNEL_HAS_SOURCE_DIR=1  
 
- -- The C compiler identification is GNU 7.0.1 


- -- The CXX compiler identification is GNU 7.0.1   


- -- Check for working C compiler: /usr/lib/ccache/cc   


- -- Check for working C compiler: /usr/lib/ccache/cc -- works  


- -- Detecting C compiler ABI info  


- -- Detecting C compiler ABI info - done   


- -- Detecting C compile features   


- -- Detecting C compile features - done


- -- Check for working CXX compiler: /usr/lib/ccache/c++


- -- Check for working CXX compiler: /usr/lib/ccache/c++ -- works   


- -- Detecting CXX compiler ABI info


- -- Detecting CXX compiler ABI info - done 


- -- Detecting CXX compile features 


- -- Detecting CXX compile features - done  


- -- Revision is 0.2.0
- -- Found BISON: /usr/bin/bison (found version "3.0.4")
- -- Found FLEX: /usr/bin/flex (found version "2.6.1")
- -- Found LLVM: /usr/lib/llvm-3.8/include
- -- Found LibElf: /usr/lib/x86_64-linux-gnu/libelf.so
- -- Performing Test ELF_GETSHDRSTRNDX
- -- Performing Test ELF_GETSHDRSTRNDX - Success
- -- Using static-libstdc++
- -- Could NOT find LuaJIT (missing:  LUAJIT_LIBRARIES LUAJIT_INCLUDE_DIR)
CMake Warning at tests/python/CMakeLists.txt:6 (message):
  Recommended test program 'arping' not found


I am willing to extend the build to lua, but I need help here. My knowledge of
Lua is limited and it'd help if, someone more knowledgeable on the topic, takes
the task of extending FindLuaJIT.cmake to include Lua.



On Sun, 2017-02-05 at 14:15 +, Riku Voipio wrote:
> Hi,
> 
> If you submit a build to experimental, I'd be happy to
> 

Bug#853888: bpfcc not building on ppc64el and aarch64

2017-02-05 Thread Riku Voipio
Hi,

If you submit a build to experimental, I'd be happy to
test it on aarch64 and armhf.

Riku



Bug#853888: bpfcc not building on ppc64el and aarch64

2017-02-02 Thread Ritesh Raj Sarraf
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Hello Breno,

On Wed, 2017-02-01 at 14:42 -0500, Breno Leitao wrote:
> Currently bpfcc does not build on ppc64el (and aaarch64) due to missing
> luajit package.
> 
> The luajit upstream situation for the new architecture is not clear
> , so, Debian have a luajit package in the experimental archive that
> contains the ppc64el patch (still not accepted upstream).
> 
> I am planning on how to enable it for ppc64el, Can we depend on 
> experimental package for ppc64el? If not, can we depend on lua instead
> of luajit?

Have you tried it locally, if it works ? Once you verify it, I'm okay to add a
dependency, like "luajit | lua". I hope that'll suffice for this bug report ?

For an upload to experimental, to test it, should be fine to add such a build
dependency. But not for an upload to unstable.


On another note, if you have more interest in BCC.
https://github.com/iovisor/bcc/issues/873

The BCC folks do not have a very clear message in the documentation stating that
it only is supported for 64 bit architectures.


In my initial packaging, it failed to build on i386 (and armhf). My patch got it
to build on i386 but I haven't been able to runtime verify it. If you have an
interest, you can try it on an armhf/i386 box too ? The tools that BCC provides
are really cool and having them run on more architectures will be nicer.

- -- 
Ritesh Raj Sarraf | http://people.debian.org/~rrs
Debian - The Universal Operating System
-BEGIN PGP SIGNATURE-

iQIzBAEBCgAdFiEEQCVDstmIVAB/Yn02pjpYo/LhdWkFAliS+hEACgkQpjpYo/Lh
dWnA1A//d7Wr+KRKmB2Mkf5R5KJLAiCZUogqwUCs/JVcn+livyhb2hO8+vC1NY7Z
9zqFF2OeQRIZlyaUt2CM+TqkSGcKftxWD/1Z2BwpLyqy0aFzVH9dRedVipqlXIwV
wpsrF0YxaMFyMXZqqCBQyw0/waRYtXlOLcrd2tarpHbgeOt2c0JCJYAb1p/YSlw/
qLXXJCA1KGe3HhYYwIxjAO77e6WwRUkKb+Oo2mqFCMZ7Pfq3ElYpfK/xqLY4w1nX
ksOt+HKkZ01TgJOGiz8ekSKAR8o8aJwqbkdW2pc9ZzYZDYNl4FLR/Eh6eSzRccrM
b84aNmmYe6lIdGa+CRiAIwFnpHOcSMdUEBI6E55Ygo8Bc4FX3t9ogVzC5vEhhCPu
9eCRCx4VON9ycyAK0hBTmQOYlntyJljoldr4ulLh2YzmYYPekH67BSwsBrB+44F6
QwMGgC1g6Hh5iYpM5AGPxPlAxD0LP6nY1X9ibdnpFtPGh09Ye/dGAv9h5dUksdrv
JoztZnFxDxDNyAxaXyzC1P8wFn3P0/Zuo+/4NMTeKeUI4RUcak3Zodi/afA++MDi
k5IxfyMCOS/7giij+ZPdAflBXq+Viz2tI0WrFC0fUiMfKn1QKJK/rsUrlMVRe74F
zCKnCrDSVQ25jZgdvVxjc8IS/QX5r17fTp5cN2EkHRAenJ9zdz8=
=Fxke
-END PGP SIGNATURE-



Bug#853888: bpfcc not building on ppc64el and aarch64

2017-02-01 Thread Breno Leitao
Source: bpfcc
Version: 0.2.0
Severity: normal

Currently bpfcc does not build on ppc64el (and aaarch64) due to missing
luajit package.

The luajit upstream situation for the new architecture is not clear
, so, Debian have a luajit package in the experimental archive that
contains the ppc64el patch (still not accepted upstream).

I am planning on how to enable it for ppc64el, Can we depend on 
experimental package for ppc64el? If not, can we depend on lua instead
of luajit?

Thank you,
Breno

-- System Information:
Debian Release: 9.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: ppc64el (ppc64le)
Foreign Architectures: powerpc

Kernel: Linux 4.8.0-1-powerpc64le (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)