Honor $(STRIP) in install-strip for cross-compilation - #1024
Merged
steadytao merged 2 commits intoAug 16, 2026
Merged
Conversation
The install-strip target hard-coded `install -s`, which strips via the install program using the build host's strip and ignores the STRIP variable. When cross-compiling this runs the host strip against a target binary and fails. Pass --strip-program=$(or $(STRIP),strip) so the target strip is used when STRIP is set (as cross toolchains and build systems provide), falling back to plain `strip` for native builds. A plain `make install` is unaffected.
steadytao
requested changes
Jul 11, 2026
- Detect the target strip via AC_CHECK_TOOL([STRIP],[strip],[strip]) in configure.ac (picks up the cross-prefixed strip when cross-compiling, defaults to plain strip otherwise) and substitute @strip@ in Makefile.in. - Rewrite install-strip to run a normal install then $(STRIP) on the installed rsync binary, dropping the GNU Make $(or ...) and the GNU install --strip-program extension that broke with install-sh/BSD install. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
alessandrodn
added a commit
to alessandrodn/conan-center-index
that referenced
this pull request
Jul 13, 2026
Rework the install-strip patch to match the revised upstream fix (RsyncProject/rsync#1024): instead of the GNU Make $(or ...) and GNU install --strip-program extension (unsupported by install-sh / BSD install), install normally then run $(STRIP) on the installed binary. Add STRIP ?= strip to Makefile.in so the strip comes from the environment/toolchain when set (e.g. a cross profile's [buildenv] STRIP or the Android NDK strip) and falls back to plain strip for native builds. rsync 3.2.7's shipped configure does not substitute @strip@ and the recipe does not run autoreconf, so ?= (env wins) is used rather than @strip@.
Member
|
Cheers, that addresses my portability concern. I'll add the native and cross-strip coverage then give this another passover. |
Member
Contributor
Author
|
@steadytao @tridge is there anything I can help with to merge this? |
Member
|
Apologies on the slow reply. We are currently focusing on our security release (3.5.0). We are quite stretched on review time and will get to this once available. |
Contributor
Author
|
Thanks for the update @steadytao. |
alessandrodn
added a commit
to alessandrodn/conan-center-index
that referenced
this pull request
Aug 16, 2026
rsync's install-strip target hard-codes `install -s`, which strips using the build host's strip and ignores the STRIP variable (rsync's configure has no AC_CHECK_TOOL([STRIP])). When cross-compiling with tools.build:install_strip=True this runs the host strip against a target-architecture binary and fails. Add a patch passing --strip-program=$(or $(STRIP),strip) so the target strip is used when STRIP is set, falling back to plain strip for native builds. Submitted upstream: RsyncProject/rsync#1024
alessandrodn
added a commit
to alessandrodn/conan-center-index
that referenced
this pull request
Aug 16, 2026
Rework the install-strip patch to match the revised upstream fix (RsyncProject/rsync#1024): instead of the GNU Make $(or ...) and GNU install --strip-program extension (unsupported by install-sh / BSD install), install normally then run $(STRIP) on the installed binary. Add STRIP ?= strip to Makefile.in so the strip comes from the environment/toolchain when set (e.g. a cross profile's [buildenv] STRIP or the Android NDK strip) and falls back to plain strip for native builds. rsync 3.2.7's shipped configure does not substitute @strip@ and the recipe does not run autoreconf, so ?= (env wins) is used rather than @strip@.
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
install-striptarget hard-codedinstall -s, which strips via the install program using the build host's strip and ignores theSTRIPvariable, and rsync'sconfigure.achad no check to detect a cross strip. When cross-compiling,make install-striptherefore ran the hoststripagainst a target-architecture binary and failed.This makes
install-stripportable and cross-aware:configure.ac: addAC_CHECK_TOOL([STRIP], [strip], [strip]), which detects the target-prefixed strip (e.g.aarch64-linux-gnu-strip) when cross-compiling, falls back to plainstripfor native builds, and substitutes@STRIP@.Makefile.in:install-stripnow performs a normalmake installand then runs$(STRIP)on the installedrsyncbinary.This replaces an earlier attempt that used
install --strip-program=$(or $(STRIP),strip), which assumed GNU Make ($(or ...)) and GNU coreutilsinstall(--strip-program) — neither guaranteed, sinceAC_PROG_INSTALLmay select the bundledinstall-shor a BSDinstall. The new approach depends only on POSIX Make and astripbinary. A plainmake installis unaffected.Verified in a clean Alpine/musl container: a native
make install-stripstrips the installed binary (1.9 MB → 607 KB), the detectedSTRIPis honored, and an explicitmake install-strip STRIP=...override is respected (as cross toolchains / Conan / Buildroot / Yocto provide).