Commit 4fce4c99 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

ruby: disable yjit on cross



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: default avatarSandro <sandro.jaeckel@gmail.com>
parent 0a71472c
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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,