summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Roessler <bryanroessler@gmail.com>2024-04-23 21:37:25 -0400
committerRobert Marko <robimarko@gmail.com>2024-04-24 12:16:48 +0200
commit98cc65d9a0c4e7beb4b9a8f8482ab8908435290b (patch)
treea40a351f0af692986e58331afe53d006fe749baf
parentda13ff30efdb921fe22d02334432c578ba95996a (diff)
downloadopenwrt-98cc65d9a0c4e7beb4b9a8f8482ab8908435290b.tar.gz
openwrt-98cc65d9a0c4e7beb4b9a8f8482ab8908435290b.tar.bz2
openwrt-98cc65d9a0c4e7beb4b9a8f8482ab8908435290b.zip
tools/zstd: enable position independent code compilation
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 <bryanroessler@gmail.com>
-rw-r--r--tools/zstd/Makefile2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/zstd/Makefile b/tools/zstd/Makefile
index f962809f82..e1d36c59cf 100644
--- a/tools/zstd/Makefile
+++ b/tools/zstd/Makefile
@@ -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 \