Skip to content

Commit

Permalink
tools/zstd: enable position independent code compilation
Browse files Browse the repository at this point in the history
Currently, trying to compile LLVM-BPF will fail with:
[2225/3517] Linking CXX shared library lib/libLLVM-15.so
FAILED: lib/libLLVM-15.so
/usr/bin/ld: staging_dir/host/lib/libzstd.a(zstd_common.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status

So, to fix it enable PIC for the host ZSTD.

Fixes: #15247
Signed-off-by: Bryan Roessler <[email protected]>
  • Loading branch information
cryobry authored and robimarko committed Apr 24, 2024
1 parent da13ff3 commit 98cc65d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/zstd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ include $(INCLUDE_DIR)/host-build.mk

HOSTCC:= $(HOSTCC_NOCACHE)

HOST_CFLAGS += $(HOST_FPIC)

HOST_MAKE_FLAGS += \
BACKTRACE=0 \
HAVE_THREAD=1 \
Expand Down

0 comments on commit 98cc65d

Please sign in to comment.