Skip to content

Commit d1282cb

Browse files
authored
Add -lzstd to RT_LIBS and when USE_SYSTEM_LLVM=1 (#59475)
Rather than depending on `llvm-config --system-libs` to link libzstd to libjulia-internal, we should ask for it explicitly, since we now depend on it even if LLVM was not configured with zstd. Possibly fixes the error in JuliaPackaging/Yggdrasil#11999 (comment)
1 parent 1811564 commit d1282cb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ ifneq ($(USE_SYSTEM_LLVM),0)
160160
CG_LLVMLINK += $(LLVM_LDFLAGS) $(shell $(LLVM_CONFIG_HOST) --libs --system-libs)
161161
LLVM_SHLIB_SYMBOL_VERSION := $(shell readelf -W --dyn-syms $(shell $(LLVM_CONFIG_HOST) --libfiles --link-shared | awk '{print $1; exit}') | \
162162
grep _ZN4llvm3Any6TypeId | head -n 1 | sed -ne 's/.*@//p')
163+
CG_LLVMLINK += -lz -lzstd
163164

164165
# HACK: llvm-config doesn't correctly point to shared libs on all platforms
165166
# https://github.com/JuliaLang/julia/issues/29981
@@ -202,7 +203,7 @@ LIBJULIA_PATH_REL := libjulia
202203
endif
203204

204205
COMMON_LIBPATHS := -L$(build_libdir) -L$(build_shlibdir)
205-
RT_LIBS := $(WHOLE_ARCHIVE) $(LIBUV) $(WHOLE_ARCHIVE) $(LIBUTF8PROC) $(NO_WHOLE_ARCHIVE) $(LIBUNWIND) $(RT_LLVMLINK) $(OSLIBS) $(LIBTRACYCLIENT) $(LIBITTAPI)
206+
RT_LIBS := $(WHOLE_ARCHIVE) $(LIBUV) $(WHOLE_ARCHIVE) $(LIBUTF8PROC) $(NO_WHOLE_ARCHIVE) $(LIBUNWIND) $(RT_LLVMLINK) $(OSLIBS) $(LIBTRACYCLIENT) $(LIBITTAPI) -lzstd
206207
# NB: CG needs uv_mutex_* symbols, but we expect to export them from libjulia-internal
207208
CG_LIBS := $(LIBUNWIND) $(CG_LLVMLINK) $(OSLIBS) $(LIBTRACYCLIENT) $(LIBITTAPI)
208209

0 commit comments

Comments
 (0)