From 4a4420bf793b6e11ba6d1912a2c0ea19187e99cc Mon Sep 17 00:00:00 2001 From: ZhouGuangyuan Date: Wed, 5 Aug 2026 22:56:46 +0800 Subject: [PATCH] go-llvm: link zstd for static LLVM on Darwin --- README.markdown | 3 +++ llvm_link_static.go | 1 + 2 files changed, 4 insertions(+) diff --git a/README.markdown b/README.markdown index fd90b5e..9af1e64 100644 --- a/README.markdown +++ b/README.markdown @@ -34,6 +34,9 @@ For example: The static command requires `libLLVMGoALLC.a` to have been assembled first. The GoALLC toolchain does this automatically for `-llvm-link=static`. +The final link also consumes the system libraries reported by the selected +LLVM build. On Darwin, zstd is resolved with `pkg-config libzstd`; the +development package must be installed and discoverable through pkg-config. Do not select multiple version tags or multiple link-mode tags in one build. diff --git a/llvm_link_static.go b/llvm_link_static.go index b8dacfb..c171ce5 100644 --- a/llvm_link_static.go +++ b/llvm_link_static.go @@ -4,6 +4,7 @@ package llvm /* #cgo darwin LDFLAGS: -L${SRCDIR} -lLLVMGoALLC -lm -lz -lxml2 +#cgo darwin pkg-config: libzstd #cgo linux LDFLAGS: -L${SRCDIR} -lLLVMGoALLC -lm -lz -lzstd -lxml2 -ldl -lpthread -lrt */ import "C"