ajor / bpftrace

High-level tracing language for Linux eBPF - development moved to https://github.com/iovisor/bpftrace
https://github.com/iovisor/bpftrace
Apache License 2.0
250 stars 15 forks source link

Why use "-static" option during link stage? #2

Closed NanXiao closed 7 years ago

NanXiao commented 7 years ago

Is there any special meaning for following line in src/CMakeLists.txt:

 set(CMAKE_EXE_LINKER_FLAGS "-static")

Arch Linux seems don't provide static library for ncurses, and this link option will cause link error. Plz refer this discussion, thanks very much in advance!

ajor commented 7 years ago

I wanted bpftrace to be statically linked by default to make it easier to deploy to other machines (just have to copy the single executable), but I've added in an option to support dynamic linking for situations like this where static linking isn't possible. The CMake command now becomes:

cmake -DDYNAMIC_LINKING:BOOL=ON -DCMAKE_BUILD_TYPE=Release ../

ajor commented 7 years ago

Oh forgot to say that there also seem to be other problems running bpftrace on Arch Linux as it uses LLVM 4.0 (issue #4), so unfortunately it probably still won't work at the moment :(