From adfac122cd6a669c65dcf5a7d51544d9c122b977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 8 Mar 2023 19:31:14 +0100 Subject: [PATCH] glibc_multi: fix invalid 32bit glibc when cross compiling The issue this fixes happens when cross compilation is used. The pkgsCross.*.buildPackages.glibc_multi actually combined x86_64 with target's. That is because pkgsi686Linux actually is package set where target and host are the same and thus buildPackages.pkgsi686Linux actually is the same as using directly pkgsi686Linux. To overcome that we need packages that have cross platform target but host and build platform has to be set to i686. This change does not affect usage outside cross compilation because in that case buildPackages set is the same as the current set. --- pkgs/top-level/all-packages.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fe54bf0cc8d2..f23b163942b8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20722,7 +20722,11 @@ with pkgs; glibcInfo = callPackage ../development/libraries/glibc/info.nix { }; glibc_multi = callPackage ../development/libraries/glibc/multi.nix { - glibc32 = pkgsi686Linux.glibc; + # The buildPackages is required for cross-compilation. The pkgsi686Linux set + # has target and host always set to the same value based on target platform + # of the current set. We need host to be same as build to correctly get i686 + # variant of glibc. + glibc32 = pkgsi686Linux.buildPackages.glibc; }; glm = callPackage ../development/libraries/glm { };