diff options
author | Andrii Nakryiko <andriin@fb.com> | 2020-09-30 00:06:04 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-09-30 02:05:31 +0200 |
commit | b0efc216f577997bf563d76d51673ed79c3d5f71 (patch) | |
tree | 91d6a14de27cdf4875abc82692bea293485f16ce /tools | |
parent | libbpf: Compile libbpf under -O2 level by default and catch extra warnings (diff) | |
download | linux-b0efc216f577997bf563d76d51673ed79c3d5f71.tar.xz linux-b0efc216f577997bf563d76d51673ed79c3d5f71.zip |
libbpf: Compile in PIC mode only for shared library case
Libbpf compiles .o's for static and shared library modes separately, so no
need to specify -fPIC for both. Keep it only for shared library mode.
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20200929220604.833631-3-andriin@fb.com
Diffstat (limited to 'tools')
-rw-r--r-- | tools/lib/bpf/Makefile | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile index 70cb44efe8cb..5f9abed3e226 100644 --- a/tools/lib/bpf/Makefile +++ b/tools/lib/bpf/Makefile @@ -104,13 +104,12 @@ endif # Append required CFLAGS override CFLAGS += $(EXTRA_WARNINGS) -Wno-switch-enum override CFLAGS += -Werror -Wall -override CFLAGS += -fPIC override CFLAGS += $(INCLUDES) override CFLAGS += -fvisibility=hidden override CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 # flags specific for shared library -SHLIB_FLAGS := -DSHARED +SHLIB_FLAGS := -DSHARED -fPIC ifeq ($(VERBOSE),1) Q = |