mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-04 23:35:40 +08:00
llvm-tools: build host llvm-objcopy/strip/profdata under ZigToolchain
Add an `llvm-tools` target artifact that downloads llvm-project source matching the version of clang shipped by the active zig install, builds llvm-objcopy, llvm-strip and llvm-profdata into PKG_ROOT_PATH/llvm-tools/bin, and exposes them through the same path/binary/isInstalled static surface as the other artifacts. A new LlvmToolsCheck doctor item runs when the active toolchain is ZigToolchain and reports whether the three tools are built, with a fix that installs the package and runs the build. PackageBuilder now picks the right tool when the active toolchain is ZigToolchain: - extractDebugInfo() honours OBJCOPY from the environment, then falls back to llvm-tools' llvm-objcopy under Zig and plain objcopy otherwise. - stripBinary() uses llvm-strip under Zig and plain strip otherwise. System strip/objcopy refuse zig-produced archives and bitcode sections, so without this the strip stage breaks LTO builds. Other toolchains keep using the system binaries. ApplicationContext::tryGet() wraps the container's get() in a try/catch and returns null on failure, so PackageBuilder can ask "which toolchain is active right now" without PHP-DI throwing on autowirable-but-unconstructable classes. Depends on v3c/artifact-static-helpers (uses zig::isInstalled() and zig::binary()).
This commit is contained in:
6
config/pkg/target/llvm-tools.yml
Normal file
6
config/pkg/target/llvm-tools.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
llvm-tools:
|
||||
type: target
|
||||
artifact:
|
||||
binary: custom
|
||||
depends:
|
||||
- zig
|
||||
Reference in New Issue
Block a user