forked from Yehowshua/RiscV-Formal
Fix shell.nix
``` [nix-shell:~/joyofhardware/RiscV-Formal]$ riscv64-unknown-linux-gnu-gcc bash: /nix/store/xq4q2vv9ii7z2k2qp82jd180xdb0r4fv-gcc-riscv64-unknown-linux-gnu-14-20241116/bin/riscv64-unknown-linux-gnu-gcc: cannot execute binary file: Exec format error ``` `pkgs.pkgsCross.riscv64` is for running on riscv64 `pkgs.pkgsCross.riscv64.buildPackages` is for running on the build system and compiling code for riscv64 `nativeBuildInputs` is for packages which run on the build system and compile code for riscv64 with `__splicedPackages` we can avoid having to specify `buildPackages` and have the dependency attributes (`nativeBuildInputs`) pick the `buildHost` version of the package
This commit is contained in:
parent
003a1c8545
commit
eed328e68a
|
@ -1,10 +1,10 @@
|
|||
{ pkgs ? import <nixpkgs> {} }:
|
||||
|
||||
let
|
||||
riscv64-linux = pkgs.pkgsCross.riscv64;
|
||||
riscv64-linux = pkgs.pkgsCross.riscv64.__splicedPackages;
|
||||
in
|
||||
pkgs.mkShell {
|
||||
buildInputs = [
|
||||
nativeBuildInputs = [
|
||||
riscv64-linux.gcc
|
||||
riscv64-linux.binutils
|
||||
riscv64-linux.glibc
|
||||
|
@ -13,4 +13,4 @@ pkgs.mkShell {
|
|||
shellHook = ''
|
||||
echo "RISC-V Linux cross-compilation environment initialized!"
|
||||
'';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue