default.nix: fix

This commit is contained in:
Astro 2020-01-26 01:45:02 +01:00
parent 1f7014877a
commit 606ebb0bfb
6 changed files with 40 additions and 22 deletions

29
Cargo.lock generated
View File

@ -15,10 +15,27 @@ name = "byteorder"
version = "1.3.2" version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "compiler_builtins"
version = "0.1.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "experiments"
version = "0.0.0"
dependencies = [
"libboard_zc706 0.0.0",
"libboard_zynq 0.0.0",
"libcortex_a9 0.0.0",
"libregister 0.0.0",
"smoltcp 0.5.0 (git+https://github.com/m-labs/smoltcp.git?rev=8eb01aca364aefe5f823d68d552d62c76c9be4a3)",
]
[[package]] [[package]]
name = "libboard_zc706" name = "libboard_zc706"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"compiler_builtins 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
"libboard_zynq 0.0.0", "libboard_zynq 0.0.0",
"libcortex_a9 0.0.0", "libcortex_a9 0.0.0",
"libregister 0.0.0", "libregister 0.0.0",
@ -100,21 +117,11 @@ dependencies = [
"vcell 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "vcell 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]]
name = "zc706-experiments"
version = "0.0.0"
dependencies = [
"libboard_zc706 0.0.0",
"libboard_zynq 0.0.0",
"libcortex_a9 0.0.0",
"libregister 0.0.0",
"smoltcp 0.5.0 (git+https://github.com/m-labs/smoltcp.git?rev=8eb01aca364aefe5f823d68d552d62c76c9be4a3)",
]
[metadata] [metadata]
"checksum bit_field 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a165d606cf084741d4ac3a28fb6e9b1eb0bd31f6cd999098cfddb0b2ab381dc0" "checksum bit_field 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a165d606cf084741d4ac3a28fb6e9b1eb0bd31f6cd999098cfddb0b2ab381dc0"
"checksum bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d155346769a6855b86399e9bc3814ab343cd3d62c7e985113d46a0ec3c281fd" "checksum bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d155346769a6855b86399e9bc3814ab343cd3d62c7e985113d46a0ec3c281fd"
"checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5"
"checksum compiler_builtins 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "b9975aefa63997ef75ca9cf013ff1bb81487aaa0b622c21053afd3b92979a7af"
"checksum linked_list_allocator 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "47314ec1d29aa869ee7cb5a5be57be9b1055c56567d59c3fb6689926743e0bea" "checksum linked_list_allocator 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "47314ec1d29aa869ee7cb5a5be57be9b1055c56567d59c3fb6689926743e0bea"
"checksum managed 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fdcec5e97041c7f0f1c5b7d93f12e57293c831c646f4cc7a5db59460c7ea8de6" "checksum managed 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fdcec5e97041c7f0f1c5b7d93f12e57293c831c646f4cc7a5db59460c7ea8de6"
"checksum r0 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e2a38df5b15c8d5c7e8654189744d8e396bddc18ad48041a500ce52d6948941f" "checksum r0 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e2a38df5b15c8d5c7e8654189744d8e396bddc18ad48041a500ce52d6948941f"

View File

@ -4,7 +4,7 @@
nix-shell --command "cargo xbuild --release" nix-shell --command "cargo xbuild --release"
``` ```
Currently the ELF output is placed at `target/armv7-none-eabihf/release/zc706-experiments` Currently the ELF output is placed at `target/armv7-none-eabihf/release/experiments`
# Debug # Debug

View File

@ -24,7 +24,7 @@ let
cargo = rust; cargo = rust;
}); });
gcc = pkgs.pkgsCross.armv7l-hf-multiplatform.buildPackages.gcc; gcc = pkgs.pkgsCross.armv7l-hf-multiplatform.buildPackages.gcc;
xbuildRustPackage = attrs: xbuildRustPackage = { cargoFeatures, crateSubdir, ... } @ attrs:
let let
buildPkg = rustPlatform.buildRustPackage attrs; buildPkg = rustPlatform.buildRustPackage attrs;
in in
@ -32,23 +32,32 @@ let
nativeBuildInputs = nativeBuildInputs =
nativeBuildInputs ++ [ pkgs.cargo-xbuild ]; nativeBuildInputs ++ [ pkgs.cargo-xbuild ];
buildPhase = '' buildPhase = ''
cargo xbuild --release --frozen set -x
pushd ${crateSubdir}
cargo xbuild --release --frozen \
--no-default-features \
--features=${cargoFeatures}
popd
''; '';
XARGO_RUST_SRC = "${rustcSrc}/src"; XARGO_RUST_SRC = "${rustcSrc}/src";
installPhase = '' installPhase = ''
mkdir $out mkdir $out
ls -la target/armv7-none-eabihf/release/
cp target/armv7-none-eabihf/release/${name} $out/${name}.elf cp target/armv7-none-eabihf/release/${name} $out/${name}.elf
''; '';
}); });
zc706 = xbuildRustPackage { xbuildCrate = crate: features: xbuildRustPackage rec {
name = "zc706"; name = "${crate}";
src = ./.; src = ./.;
cargoSha256 = "15icqy72dck82czpsqz41yjsdar17vpi15v22j6z0zxhzf517rf7"; crateSubdir = crate;
nativeBuildInputs = [ cargoSha256 = "1wvj585vylbjlab7cxbkr4f60km5y7s8knxxvcixmqywdldnh7g2";
gcc cargoFeatures = features;
];
doCheck = false; doCheck = false;
}; };
in { in {
inherit pkgs rustPlatform rustcSrc zc706 gcc; inherit pkgs rustPlatform rustcSrc gcc;
zc706 = {
zc706-experiments = xbuildCrate "experiments" "target_zc706";
cora-experiments = xbuildCrate "experiments" "target_cora_z7_10";
};
} }

View File

@ -1,5 +1,5 @@
[package] [package]
name = "zc706-experiments" name = "experiments"
description = "Developing bare-metal Rust on Zynq" description = "Developing bare-metal Rust on Zynq"
version = "0.0.0" version = "0.0.0"
authors = ["Astro <astro@spaceboyz.net>"] authors = ["Astro <astro@spaceboyz.net>"]

View File

@ -11,6 +11,7 @@ target_cora_z7_10 = ["libboard_zynq/target_cora_z7_10"]
[dependencies] [dependencies]
r0 = "0.2" r0 = "0.2"
compiler_builtins = "0.1"
linked_list_allocator = { version = "0.6", default-features = false } linked_list_allocator = { version = "0.6", default-features = false }
libregister = { path = "../libregister" } libregister = { path = "../libregister" }
libcortex_a9 = { path = "../libcortex_a9" } libcortex_a9 = { path = "../libcortex_a9" }

View File

@ -5,6 +5,7 @@
#![feature(panic_info_message)] #![feature(panic_info_message)]
pub extern crate alloc; pub extern crate alloc;
pub extern crate compiler_builtins;
pub mod boot; pub mod boot;
mod abort; mod abort;