Commit b0efc216 authored by Andrii Nakryiko's avatar Andrii Nakryiko Committed by Alexei Starovoitov

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: default avatarAndrii Nakryiko <andriin@fb.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Acked-by: default avatarMartin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20200929220604.833631-3-andriin@fb.com
parent 0a62291d
...@@ -104,13 +104,12 @@ endif ...@@ -104,13 +104,12 @@ endif
# Append required CFLAGS # Append required CFLAGS
override CFLAGS += $(EXTRA_WARNINGS) -Wno-switch-enum override CFLAGS += $(EXTRA_WARNINGS) -Wno-switch-enum
override CFLAGS += -Werror -Wall override CFLAGS += -Werror -Wall
override CFLAGS += -fPIC
override CFLAGS += $(INCLUDES) override CFLAGS += $(INCLUDES)
override CFLAGS += -fvisibility=hidden override CFLAGS += -fvisibility=hidden
override CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 override CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
# flags specific for shared library # flags specific for shared library
SHLIB_FLAGS := -DSHARED SHLIB_FLAGS := -DSHARED -fPIC
ifeq ($(VERBOSE),1) ifeq ($(VERBOSE),1)
Q = Q =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment