bump(main/ruby): 4.0.3, enable YJIT and ZJIT#29576
Draft
kaan-escober wants to merge 1 commit into
Draft
Conversation
Update Ruby from 3.4.1 to 4.0.3 with YJIT and ZJIT JIT compilers enabled. Changes to build.sh: - Bump version to 4.0.3, update SHA256. - Add --enable-yjit --enable-zjit to configure args. - Call termux_setup_rust in termux_step_pre_configure to provide a Rust toolchain with aarch64-linux-android std. - Pass JIT_RUST_TARGET=$CARGO_TARGET_NAME so configure.ac can inject the correct --target into rustc for cross-compiling the JIT crates. New patches: - configure.ac.patch: Add AC_ARG_VAR(JIT_RUST_TARGET) to rewrite RUSTC with --target for cross-compilation, and allow JIT_TARGET_OK=yes for Android when JIT_RUST_TARGET is set. - yjit-src-options.rs.patch: Fix hardcoded /tmp paths to @TERMUX_PREFIX@/tmp in YJIT perf-map options. Updated patches (line numbers / context for 4.0.3): - Makefile.in.patch - fix-paths.patch - libandroid-execinfo.patch - process.c.patch - yjit-src-codegen.rs.patch - yjit-src-yjit.rs.patch
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.
bump(main/ruby): 4.0.3, enable YJIT and ZJIT
Updates Ruby from 3.4.1 to 4.0.3 and enables the YJIT and ZJIT JIT compilers for
aarch64-linux-android.What changed
build.sh--enable-yjit --enable-zjitto configure args.termux_setup_rustcall to provide a Rust toolchain withaarch64-linux-androidstd (uses the standard Termux helper, no hand-rolled Cargo setup).JIT_RUST_TARGET=$CARGO_TARGET_NAMEthrough to configure so rustc cross-compiles the JIT crates for the target, not the host.New patches
configure.ac.patchAC_ARG_VAR(JIT_RUST_TARGET)to inject--targetintoRUSTC, and allowsJIT_TARGET_OK=yesfor Android when cross-compiling with a Rust target set.yjit-src-options.rs.patch/tmp/perf-{pid}.mappaths with@TERMUX_PREFIX@/tmp/in YJIT options.Updated patches (line-number / context updates for 4.0.3, no logic changes):
Makefile.in.patchfix-paths.patchlibandroid-execinfo.patchprocess.c.patchyjit-src-codegen.rs.patchyjit-src-yjit.rs.patchHow the cross-compilation works
Upstream Ruby's
configure.acblocks YJIT/ZJIT whencross_compiling=yesor when the target is*android*. Theconfigure.ac.patchadds aJIT_RUST_TARGETvariable that, when set:RUSTCto"$RUSTC --target=$JIT_RUST_TARGET"solibyjit.a/libzjit.a/libruby.aare built foraarch64-linux-androidinstead of the host.JIT_TARGET_OK=yespath for Android cross-builds.The Termux toolchain setup already exports
CARGO_TARGET_NAMEandCARGO_TARGET_<TARGET>_LINKER, sotermux_setup_rust+JIT_RUST_TARGETis all that's needed.Build verification
Successfully cross-compiled from x86_64 → aarch64 with:
Produced
ruby_4.0.3_aarch64.deb(10 MB) andruby-ri_4.0.3_all.deb(1.7 MB).Notes