Conversation
Add `-Wl,-rpath,$ORIGIN` to the Android Rust linker flags so the bundled binaries can resolve `libc++_shared.so` when they are launched directly without a wrapper-provided `LD_LIBRARY_PATH`. This fixes the Termux linker failure while leaving approval and tool behaviour unchanged. Verified by rebuilding `codex-cli` and running `codex --version` under an empty environment. Co-authored-by: Codex <codex@openai.com>
Update the patch inventory and verification script so the Termux fork records the restored Android RUNPATH behaviour alongside the existing launcher hardening notes. This keeps the compatibility delta documented in the repo's patch workflow. Verified with verify-patches.sh. Co-authored-by: Codex <codex@openai.com>
|
Thanks, this looks like a sensible hardening step. Adding One thing that may be worth tightening before we roll it into a release: the current verification only checks that the linker flag is present in source config. Since the bug shows up at runtime in the produced ELF, it would be even better if the verification also checked the built/package binary itself, for example with That would make the fix much easier to trust long-term across rebases and toolchain changes. From my side the direction looks good; I’d just like to integrate the runtime proof as well so the next release carries both the fix and a stronger guard against regressions. |
Integrate PR #1 from GFernie into the latest Termux release prep. Add Android RUNPATH=$ORIGIN linker hardening, teach verify-patches.sh to validate the packaged ELFs at the binary level, and align maintainer/user docs with the layered libc++_shared.so fix path. Co-authored-by: GFernie <9322279+GFernie@users.noreply.github.com>
Update Patch openai#10 verification so it can inspect real ELF outputs instead of only source wiring. When a built binary pair is available, verify-patches.sh now uses readelf to require RUNPATH or RPATH containing $ORIGIN on both codex and codex-exec. The script still passes in source-only checkouts by skipping runtime proof when no ELF pair is present, and it ignores the shell launcher scripts in npm-package/bin. patches/README.md now documents the stronger runtime check. Co-authored-by: Codex <codex@openai.com>
|
Effectively merged via 91a8611 |
Summary
Restore an Android runpath on the native Codex ELF so
codex.bincan resolve its bundledlibc++_shared.soeven when it is launched directly without the Node wrapper environment.Bug report: GFernie#1
Problem
On Termux, the latest package can fail when
apply_patchor another direct native-binary launch path bypasses the wrapper-providedLD_LIBRARY_PATH.Observed interactive
apply_patchfailure:The same failure is also reproducible by launching the packaged ELF directly in a stripped environment.
Change
This PR keeps the runtime fix minimal:
-Wl,-rpath,$ORIGINnext to the existing Android-lc++_sharedlinker flag incodex-rs/.cargo/config.tomlverify-patches.shso Patch "OpenAI rejected the request" openai/codex#10 performs runtime ELF verification when a built binary pair is availableWith that change, the rebuilt Android binary carries a runpath containing
$ORIGIN, so the loader can find the sibling shared runtime without depending on wrapper-set environment variables.Validation
bash verify-patches.shreadelf -dconfirms the older known-good packaged binaries exposeRUNPATH [$ORIGIN]on bothcodex.binandcodex-exec.binreadelf -dconfirms the newer broken packaged binaries do not expose that runpath, which is the regression pattern this check is meant to catchverify-patches.shnow behaves in two modes:RUNPATHorRPATHcontaining$ORIGINon both binariesScope
This PR is intentionally limited to the Android linker regression. A separate Termux issue around persistent approval rule storage (
lock() not supported) is not part of this change (GFernie#3).