Skip to content

[LLVM] Ship clang resource headers and compiler-rt builtins; disable LZMA - #724

Merged
makslevental merged 2 commits into
mainfrom
orc-pgo/01-distro-resource-headers
Oct 9, 2026
Merged

makslevental merged 2 commits into
mainfrom
orc-pgo/01-distro-resource-headers

Conversation

@makslevental

@makslevental makslevental commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

First PR of the orc-pgo stack (runtime PGO via embedded bitcode + ORC JIT). The project's driver is built on the clang libraries and links LLVM statically into user executables. That needs a few additions to the distribution:

  • clang-resource-headers: clang's builtin headers (lib/clang/<N>/include: stddef.h, arm_neon.h, …). Without them the driver can't compile anything that includes them.
  • compiler-rt builtins only (non-Windows): LLVM_ENABLE_RUNTIMES=compiler-rt with every compiler-rt runtime turned off, plus the builtins distribution component. On macOS this provides lib/clang/<N>/lib/darwin/libclang_rt.osx.a. Without it the Darwin driver silently skips the library, and e.g. __builtin_available fails to link.
  • LLVM_ENABLE_LZMA=OFF: llvm-config --link-static --system-libs currently reports -llzma, so anything linking LLVM statically would pick up the liblzma dylib.

Also fixes the distribution component list. The list(APPEND … LLVM MLIR) after the CACHE set never reached the cache, because only cache entries survive a -C script. The cached list ended at mlir-translate. The full list is now built first and cached once. LLVM, MLIR and builtins are now real dependencies of install-mlirdevelopment-distribution; this was checked with a fresh configure and ninja -t query.

Note: none of the cache values use FORCE, so an existing build directory keeps its old cached values. Reconfigure from a fresh build directory, or delete CMakeCache.txt.

…LZMA

Needed by projects/orc-pgo, whose driver is built on the clang libraries
and links LLVM statically into user executables:

- clang-resource-headers: builtin headers (stddef.h, arm_neon.h, ...).
- compiler-rt builtins only (LLVM_ENABLE_RUNTIMES=compiler-rt, every
  compiler-rt runtime off, non-Windows), e.g. libclang_rt.osx.a for
  __builtin_available.
- LLVM_ENABLE_LZMA=OFF so static LLVM consumers don't link liblzma.

Also fix the distribution component list: the list(APPEND ... LLVM MLIR)
after the CACHE set never reached the cache (only cache entries survive a
-C script), so build the full list first and cache it once.
@makslevental
makslevental force-pushed the orc-pgo/01-distro-resource-headers branch from e2b0599 to 20cd95e Compare October 9, 2026 06:13
@makslevental
makslevental merged commit 4fe470e into main Oct 9, 2026
125 checks passed
@makslevental
makslevental deleted the orc-pgo/01-distro-resource-headers branch October 9, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant