set interpreter for gnu cross targets
All checks were successful
CI / checks (push) Successful in 21s

This commit is contained in:
Robin Appelman 2025-11-19 23:37:43 +01:00
commit 2d9b2da2c9

View file

@ -4,8 +4,9 @@
stdenv, stdenv,
lib, lib,
}: let }: let
inherit (lib) hasInfix replaceStrings toUpper concatStrings; inherit (lib) hasInfix replaceStrings toUpper concatStrings optionalString;
isMusl = hasInfix "-musl"; isMusl = hasInfix "-musl";
isGnu = hasInfix "-gnu";
crossOpts = callPackage ./crossOpts.nix {}; crossOpts = callPackage ./crossOpts.nix {};
buildCrossArgs = target: { buildCrossArgs = target: {
@ -41,6 +42,11 @@
"CCX_${targetUnderscore}" = "${targetCc.targetPrefix}ccx"; "CCX_${targetUnderscore}" = "${targetCc.targetPrefix}ccx";
"HOST_CC" = "${stdenv.cc.targetPrefix}cc"; "HOST_CC" = "${stdenv.cc.targetPrefix}cc";
"CFLAGS_${targetUnderscore}" = cFlags; "CFLAGS_${targetUnderscore}" = cFlags;
postFixup = optionalString (isGnu target) ''
for bin in $out/bin/*; do
patchelf --set-interpreter /lib64/ld-linux-x86-64.so.2 $bin
done
'';
} }
// rest // rest
); );