[PATCH] bpftool: Allow building statically

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sometime it can be useful to haul around a statically built version of
bpftool. Simply add support for passing STATIC=1 while building to build
the tool statically.

Signed-off-by: Nikolay Borisov <nborisov@xxxxxxxx>
---

Currently the bpftool being distributed as part of libbpf-tools under bcc project
is dynamically built on a system using GLIBC 2.28, this makes the tool unusable on
ubuntu 18.04 for example. Perhaps after this patch has landed the bpftool in bcc
can be turned into a static binary.

 tools/bpf/bpftool/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
index 83369f55df61..835621e215e4 100644
--- a/tools/bpf/bpftool/Makefile
+++ b/tools/bpf/bpftool/Makefile
@@ -13,6 +13,10 @@ else
   Q = @
 endif

+ifeq ($(STATIC),1)
+	CFLAGS += --static
+endif
+
 BPF_DIR = $(srctree)/tools/lib/bpf

 ifneq ($(OUTPUT),)
--
2.25.1




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux