meson: add llvm_extra_link_args for building against a system LLVM#169
Closed
cyyever wants to merge 1 commit into
Closed
meson: add llvm_extra_link_args for building against a system LLVM#169cyyever wants to merge 1 commit into
cyyever wants to merge 1 commit into
Conversation
DXMT's hardcoded llvm_deps assumes an LLVM built with
-DLLVM_ENABLE_ZSTD=Off (per docs/DEVELOPMENT.md). When linking against a
distro/Homebrew LLVM that *is* built with zstd (e.g. `brew install
llvm@15`), its static libs reference ZSTD_* symbols and the link fails
with "Undefined symbols ... _ZSTD_isError" for airconv and winemetal.so.
Add an `llvm_extra_link_args` array option, appended to llvm_deps, so the
extra system libs can be supplied without building LLVM from source, e.g.:
meson setup ... \
-Dllvm_extra_link_args=/opt/homebrew/opt/zstd/lib/libzstd.dylib,-lz
Defaults to empty (no behaviour change for the documented LLVM build).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
src/airconv/meson.build's hardcodedllvm_depslist assumes LLVM was built with-DLLVM_ENABLE_ZSTD=Off(as indocs/DEVELOPMENT.md). When building against a distro/Homebrew LLVM that is built with zstd — e.g.brew install llvm@15on macOS — its static libs referenceZSTD_*symbols, and the link fails:This hits both
airconv(native) andwinemetal.so.llvm-config --system-libsdoesn't report zstd for the Homebrew build, so it can't be discovered automatically.Change
Add an
llvm_extra_link_argsarray option (default empty), appended tollvm_deps. This lets you build against a system LLVM without compiling LLVM from source:meson setup ... \ -Dnative_llvm_path=$(brew --prefix llvm@15) \ -Dllvm_extra_link_args=/opt/homebrew/opt/zstd/lib/libzstd.dylib,-lzDefault empty → no behaviour change for the documented LLVM build.
Testing
Built win64 (PE dlls + x86_64 unixlib) against Homebrew
llvm@15on macOS 26 (Apple M2) with the option set;airconvandwinemetal.solink cleanly and DXMT renders a Unity 2022 D3D11 game at feature level 11.1.