From 635935cd09ad3e26b9a93ed311a70fbe5957ea2e Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Fri, 19 Jan 2024 16:35:45 +0100 Subject: [PATCH] Build packages without compressed instructions --- overlay.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/overlay.nix b/overlay.nix index 112ca8f..9cc6df6 100644 --- a/overlay.nix +++ b/overlay.nix @@ -31,6 +31,12 @@ final: prev: filesToInstall = ["u-boot.bin" "u-boot"]; }; + # To cross compile for riscv64, we need to populate this env variable, not + # NIX_CFLAGS_COMPILE, otherwise we affect the packages for x86. + stdenv = prev.stdenvAdapters.addAttrsToDerivation { + NIX_CFLAGS_COMPILE_riscv64_unknown_linux_gnu = "-march=rv64g"; + } prev.stdenv; + opensbi-uboot = prev.opensbi.overrideAttrs (old: { makeFlags = old.makeFlags ++ [ # Build OpenSBI without compressed instructions