From 4f8f36e5ad34f6503203d28fae9b90aa37ea0cde Mon Sep 17 00:00:00 2001 From: Fernando Rodrigues Date: Mon, 7 Oct 2024 02:54:49 +0000 Subject: [PATCH] xen: replace binutils override with binutils-unwrapped-all-targets Signed-off-by: Fernando Rodrigues --- pkgs/build-support/xen/default.nix | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/pkgs/build-support/xen/default.nix b/pkgs/build-support/xen/default.nix index fee16a67de53..9b57c335c8dd 100644 --- a/pkgs/build-support/xen/default.nix +++ b/pkgs/build-support/xen/default.nix @@ -34,7 +34,7 @@ OVMF, ipxe, checkpolicy, - binutils-unwrapped, + binutils-unwrapped-all-targets, # Documentation pandoc, @@ -91,7 +91,7 @@ let lgpl21Only mit ; - inherit (lib.meta) getExe; + inherit (lib.meta) getExe'; inherit (lib.lists) count flatten @@ -183,20 +183,6 @@ let else [ ]; - ## Binutils Override ## - - # Originally, there were two versions of binutils being used: the standard one and - # this patched one. Unfortunately, that required patches to the Xen Makefiles, and - # quickly became too complex to maintain. The new solution is to simply build this - # efi-binutils derivation and use it for the whole build process, except if - # enableEFI is disabled; it'll then use `binutils`. - efiBinutils = binutils-unwrapped.overrideAttrs (oldAttrs: { - name = "efi-binutils"; - configureFlags = oldAttrs.configureFlags ++ [ "--enable-targets=x86_64-pep" ]; - doInstallCheck = false; # We get a spurious failure otherwise, due to a host/target mismatch. - meta.mainProgram = "ld"; # We only really care for `ld`. - }); - #TODO: fix paths instead. scriptEnvPath = makeSearchPathOutput "out" "bin" [ bridge-utils @@ -298,7 +284,7 @@ stdenv.mkDerivation (finalAttrs: { ++ optionals withEFI [ "EFI_VENDOR=${vendor}" "INSTALL_EFI_STRIP=1" - "LD=${getExe efiBinutils}" # See the comment in the efiBinutils definition above. + "LD=${getExe' binutils-unwrapped-all-targets "ld"}" ] # These flags set the CONFIG_* options in /boot/xen.config # and define if the default policy file is built. However,