Update LLVM from 14.0.6 to 21.1.2#8737
Merged
csyonghe merged 13 commits intoshader-slang:masterfrom Oct 27, 2025
Merged
Conversation
Contributor
Author
|
The |
This does not need to be permanent, as the build is cached on the CI.
samestep
approved these changes
Oct 17, 2025
Contributor
samestep
left a comment
There was a problem hiding this comment.
Amazing, thank you for doing this! Someone who's more familiar with the code touched here should review this in more detail, but in particular, this would unblock any future efforts to reenable slang-llvm in Nixpkgs since LLVM versions 17 and older were dropped last month: NixOS/nixpkgs#440273 (comment)
I was able to successfully build this locally on x86 NixOS via the following commands in the flake dev shell:
git clean -xdfe .envrc
external/build-llvm.sh --source-dir build/slang-llvm_src --install-prefix build/slang-llvm_install
cmake --preset default --fresh -DSLANG_SLANG_LLVM_FLAVOR=USE_SYSTEM_LLVM -DLLVM_DIR=build/slang-llvm_install/lib/cmake/llvm -DClang_DIR=build/slang-llvm_install/lib/cmake/clang
cmake --build --preset release
csyonghe
approved these changes
Oct 27, 2025
jvepsalainen-nv
pushed a commit
to jvepsalainen-nv/slang
that referenced
this pull request
Nov 4, 2025
This PR upgrades slang-llvm to use LLVM 21.1.2. It also fixes the `USE_SYSTEM_LLVM` option on some Linux distributions (e.g. SUSE and derivatives) which don't ship separate components for LLVM or Clang, and instead just have `libLLVM.so` and `libclang-cpp.so` containing all components. ## Motivation I'm working on a [direct LLVM IR emitter](https://github.com/juliusikkala/slang/tree/llvm-target) for Slang. That work is in a fairly good state by now, but I still need to move the emitter into slang-llvm and link to LLVM in the Correct Way instead of whatever garbage I have in that branch right now. The problem with that is that slang-llvm currently links to a comparatively ancient LLVM version. There have been major changes to LLVM since then, and I wrote the emitter for LLVM 20-21. Differences between those two versions are minor and I can downgrade to 20 with little effort if that's better.
juliusikkala
added a commit
to juliusikkala/slang
that referenced
this pull request
Nov 12, 2025
This PR upgrades slang-llvm to use LLVM 21.1.2. It also fixes the `USE_SYSTEM_LLVM` option on some Linux distributions (e.g. SUSE and derivatives) which don't ship separate components for LLVM or Clang, and instead just have `libLLVM.so` and `libclang-cpp.so` containing all components. ## Motivation I'm working on a [direct LLVM IR emitter](https://github.com/juliusikkala/slang/tree/llvm-target) for Slang. That work is in a fairly good state by now, but I still need to move the emitter into slang-llvm and link to LLVM in the Correct Way instead of whatever garbage I have in that branch right now. The problem with that is that slang-llvm currently links to a comparatively ancient LLVM version. There have been major changes to LLVM since then, and I wrote the emitter for LLVM 20-21. Differences between those two versions are minor and I can downgrade to 20 with little effort if that's better.
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.
This PR upgrades slang-llvm to use LLVM 21.1.2. It also fixes the
USE_SYSTEM_LLVMoption on some Linux distributions (e.g. SUSE and derivatives) which don't ship separate components for LLVM or Clang, and instead just havelibLLVM.soandlibclang-cpp.socontaining all components.Motivation
I'm working on a direct LLVM IR emitter for Slang. That work is in a fairly good state by now, but I still need to move the emitter into slang-llvm and link to LLVM in the Correct Way instead of whatever garbage I have in that branch right now. The problem with that is that slang-llvm currently links to a comparatively ancient LLVM version. There have been major changes to LLVM since then, and I wrote the emitter for LLVM 20-21. Differences between those two versions are minor and I can downgrade to 20 with little effort if that's better.