Fix ld error due to debian/ubuntu -pie default
authorRyan Tomayko <r@tomayko.com>
Mon, 5 Jun 2017 17:43:46 +0000 (17:43 +0000)
committerSasha Goldshtein <goldshtn@gmail.com>
Thu, 8 Jun 2017 01:08:51 +0000 (04:08 +0300)
commit8e9aaea07f1f108953c7b8c998f45ac209f7045b
tree8956f730bf3a76f91adf0e699d3a6a187e328fcb
parente09564df601d6225b1c367d8faf45d6dcf9656f8
Fix ld error due to debian/ubuntu -pie default

Fixes #782. Solution taken verbatim from @jepio here:

https://github.com/iovisor/bcc/issues/782#issuecomment-259075010

I ran into the same issue attempting to compile from source on
a fresh Ubuntu 16.10/Yakkety host:

Linking C executable bcc-lua
/usr/bin/ld: libluajit-5.1.a(ljamalg.o): relocation R_X86_64_32S
    against `.rodata' can not be used when making a shared object;
    recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output

Build succeeded after patch was applied.
src/lua/CMakeLists.txt