From 4fce4c99f7b607a034f7b195465f16ab093fbcef Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Wed, 8 Oct 2025 16:06:50 +0200 Subject: [PATCH] ruby: disable yjit on cross MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix `nix build .#pkgsCross.aarch64-multiplatform.ruby` failing with: ``` partial linking yjit/target/release/libyjit.a into yjit/target/release/libyjit.o /nix/store/…/bin/aarch64-unknown-linux-gnu-ld: yjit/target/release/libyjit.a(yjit.1fllkjkj80qowi7xzzkaw1xy8.rcgu.o): Relocations in generic ELF (EM: 62) /nix/store/…/bin/aarch64-unknown-linux-gnu-ld: yjit/target/release/libyjit.a(yjit.1fllkjkj80qowi7xzzkaw1xy8.rcgu.o): Relocations in generic ELF (EM: 62) /nix/store/…/bin/aarch64-unknown-linux-gnu-ld: yjit/target/release/libyjit.a(yjit.1fllkjkj80qowi7xzzkaw1xy8.rcgu.o): error adding symbols: file in wrong format ``` Co-authored-by: Sandro --- pkgs/development/interpreters/ruby/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix index d01980ee3a91..17f0f3df04e1 100644 --- a/pkgs/development/interpreters/ruby/default.nix +++ b/pkgs/development/interpreters/ruby/default.nix @@ -57,9 +57,13 @@ let }: let ver = version; + isCross = stdenv.buildPlatform != stdenv.hostPlatform; # https://github.com/ruby/ruby/blob/v3_2_2/yjit.h#L21 yjitSupported = - stdenv.hostPlatform.isx86_64 || (!stdenv.hostPlatform.isWindows && stdenv.hostPlatform.isAarch64); + !isCross + && ( + stdenv.hostPlatform.isx86_64 || (!stdenv.hostPlatform.isWindows && stdenv.hostPlatform.isAarch64) + ); rubyDrv = lib.makeOverridable ( { stdenv,