Repository navigation
Conversation
…s.sh php-types build.rs hard-coded dylib= for gd, tidy, xslt, exslt and xml2, so a --target x86_64-unknown-linux-musl build still loaded the glibc-built system shared objects (and the glibc loader) despite +crt-static. Distributions ship those libraries only as glibc shared objects, which cannot go into a static musl binary. On musl targets build.rs now links PIC static archives from $PHPR_MUSL_PREFIX (default ~/.local/phpr-musl, outside the repo) and stops with a pointer to the script when they are missing. The libxml2 XPath-name probe asks the prefix's xml2-config on musl. glibc builds are unchanged. scripts/build-musl-deps.sh builds, with musl-gcc: zlib, libpng, libjpeg-turbo, libwebp, libaom, libavif, libgd (library only; no FreeType/fontconfig, phpr does not use them), libxml2 (no ICU), libxslt/libexslt and tidy-html5. It works around NASM 3's reworded help text in libaom's probe and tidy 5.8's old cmake_minimum_required. Incremental: only missing libraries are rebuilt; --clean starts over. Requirements (Linux x86_64 host): - musl toolchain with musl-gcc (Arch: musl; Debian/Ubuntu: musl-tools) - rustup target add x86_64-unknown-linux-musl (pinned toolchain) - cmake, make, nasm, curl, tar with xz support Process: 1. scripts/build-musl-deps.sh 2. cargo build --release --target x86_64-unknown-linux-musl -p php-cli -> target/x86_64-unknown-linux-musl/release/phpr, static-pie, ldd: "statically linked"
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.
Part of #5 discussion.
php-types build.rs hard-coded dylib= for gd, tidy, xslt, exslt and xml2, so a --target x86_64-unknown-linux-musl build still loaded the glibc-built system shared objects (and the glibc loader) despite +crt-static. Distributions ship those libraries only as glibc shared objects, which cannot go into a static musl binary.
On musl targets build.rs now links PIC static archives from $PHPR_MUSL_PREFIX (default ~/.local/phpr-musl, outside the repo) and stops with a pointer to the script when they are missing. The libxml2 XPath-name probe asks the prefix's xml2-config on musl. glibc builds are unchanged.
scripts/build-musl-deps.sh builds, with musl-gcc: zlib, libpng, libjpeg-turbo, libwebp, libaom, libavif, libgd (library only; no FreeType/fontconfig, phpr does not use them), libxml2 (no ICU), libxslt/libexslt and tidy-html5. It works around NASM 3's reworded help text in libaom's probe and tidy 5.8's old cmake_minimum_required. Incremental: only missing libraries are rebuilt; --clean starts over.
Requirements (Linux x86_64 host):
Process: