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
This commit is contained in:
Andrii Nakryiko 2020-09-29 15:06:04 -07:00 committed by Alexei Starovoitov
parent 0a62291d69
commit b0efc216f5

View file

@ -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 =