From 000ee23cbc8c8bbbd48c35a21538659269390566 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Thu, 15 Sep 2022 20:35:48 -0700 Subject: [PATCH] stage.nix: revert deletion of gcc.abi="elfv2" from 82ff1f5 Commit 82ff1f5db12f862e226e84254e54a10879f1629b in #182807 removed two lines from stage.nix which were responsible for making sure the `gcc` for `pkgsStatic` on powerpc64 was built with the `--with-abi=elfv2` flag. Unfortunately this causes build failures for `pkgsCross.ppc64.pkgsStatic`, as reported here: https://github.com/NixOS/nixpkgs/pull/182807#issuecomment-1247268226 This commit reverts the deletion. Unfortunately ugly kludges like this are necessary because nixpkgs' `lib/systems/` doesn't understand the difference between a libc and an abi. So we have no clean way to tell nixpkgs "musl on big-endian powerpc64 always uses the ELFv2 ABI" -- it thinks that musl is an ABI. Until that gets fixed there is no better way to add the flag. --- pkgs/top-level/stage.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/top-level/stage.nix b/pkgs/top-level/stage.nix index 21bbb52cc63c09c..e78197bd0363c5c 100644 --- a/pkgs/top-level/stage.nix +++ b/pkgs/top-level/stage.nix @@ -259,6 +259,8 @@ let crossSystem = { isStatic = true; parsed = makeMuslParsedPlatform stdenv.hostPlatform.parsed; + } // lib.optionalAttrs (stdenv.hostPlatform.system == "powerpc64-linux") { + gcc.abi = "elfv2"; }; }); };