Fix regenerate-native builds against the official LLVM release#790
Merged
tannergooding merged 1 commit intoJul 15, 2026
Merged
Conversation
The regenerate-native workflow consumes the official LLVM release binaries, which are built with zstd and the DIA SDK enabled -- unlike ClangSharp's historical from-source LLVM build (-DLLVM_ENABLE_ZSTD=OFF). Consuming them surfaced three build failures on the first real run: * windows-latest dropped Visual Studio 2022, so the hardcoded -G "Visual Studio 17 2022" generator found no instance. Drop the explicit generator so cmake auto-selects the installed Visual Studio (keeping -A and -Thost, which work with any VS generator). * The release bakes an absolute path to its build machine's Visual Studio DIA SDK diaguids.lib into LLVMDebugInfoPDB, causing LNK1181 on a runner with a different VS. Repoint it at the DIA SDK of the Visual Studio actually in use, only when that replacement exists so the working win-arm64 leg is unaffected. * The distro's static libzstd.a is not PIC and cannot be linked into the shared library. Repoint the imported zstd target at the shared libzstd instead. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.
The
regenerate-nativeworkflow consumes the official LLVM release binaries, which are built with zstd and the DIA SDK enabled -- unlike ClangSharp's historical from-source LLVM build (-DLLVM_ENABLE_ZSTD=OFF, see README). The first real run of the workflow (on the LLVM 22 bump merge, #785) surfaced platform build failures; this fixes all of them.win-x64 --
windows-latestdropped Visual Studio 2022, so the hardcoded-G "Visual Studio 17 2022"found no VS instance, and the release's baked absolute VS2022 DIA SDKdiaguids.libpath causedLNK1181.-A/-Thost, which work with any VS generator).LLVMDebugInfoPDB's bakeddiaguids.libat the DIA SDK of the VS actually in use (CMAKE_GENERATOR_INSTANCE), arch-aware, and only when that replacement exists so the currently-greenwin-arm64leg (still on VS2022) is unaffected.linux-x64 / linux-arm64 -- the distro's static
libzstd.ais not PIC (ld: ... recompile with -fPIC). Repoint the importedzstd::libzstd_statictarget at the sharedlibzstd.so(which is PIC).osx-arm64 -- the official LLVM macOS release ships LTO bitcode in its static archives; Apple's system linker loads Xcode's older libLTO (v21) and fails to parse LLVM 22 bitcode (
could not parse bitcode object file ... Unknown attribute kind). Point the linker at thelibLTO.dylibfrom the LLVM release being consumed. (The Linux release archives are native objects, so this is Apple-only.)Validated: the
win-x64,linux-x64,linux-arm64, andwin-arm64legs are green on the post-merge run of the first commit;win-x64also builds+links locally.regenerate-nativeruns onpush: main/workflow_dispatch(not on PRs), so the macOS fix is validated by the next post-merge run.Note
This PR body and the code changes were drafted by Copilot.