ci: fix build error
All checks were successful
Build packages / build-packages (default) (push) Successful in 8m34s

This commit is contained in:
xinyangli 2024-08-15 10:08:28 +08:00
parent 57dde463fb
commit c0de3e619e
Signed by: xin
SSH key fingerprint: SHA256:qZ/tzd8lYRtUFSrfBDBMcUqV4GHKxqeqRA3huItgvbk
4 changed files with 46 additions and 0 deletions

View file

@ -5,6 +5,8 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_C_STANDARD 17) set(CMAKE_C_STANDARD 17)
include(FindPkgConfig) include(FindPkgConfig)
include(GNUInstallDirs)
pkg_check_modules(riscv-riscv REQUIRED IMPORTED_TARGET riscv-riscv) pkg_check_modules(riscv-riscv REQUIRED IMPORTED_TARGET riscv-riscv)
pkg_check_modules(riscv-fesvr REQUIRED IMPORTED_TARGET riscv-fesvr) pkg_check_modules(riscv-fesvr REQUIRED IMPORTED_TARGET riscv-fesvr)
find_package(spdlog REQUIRED) find_package(spdlog REQUIRED)

23
default.nix Normal file
View file

@ -0,0 +1,23 @@
{ stdenv
, cmake
, pkg-config
, spike
, mini-gdbstub
, spdlog
}: stdenv.mkDerivation {
pname = "spike-diff";
version = "0.0.1";
src = ./.;
nativeBuildInputs = [
cmake
pkg-config
mini-gdbstub
];
buildInputs = [
spike
spdlog
];
}

View file

@ -16,6 +16,23 @@
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
pkgs = import nixpkgs { inherit system; } // nur-xin.packages.${system}; pkgs = import nixpkgs { inherit system; } // nur-xin.packages.${system};
spike = pkgs.spike.overrideAttrs (self: super: {
pname = super.pname + "-rv32e";
src = pkgs.fetchFromGitHub {
owner = "riscv-software-src";
repo = "riscv-isa-sim";
rev = "2890ea72125b69eb96bb0458a5bbc00ce26e8872";
hash = "sha256-gCtTmq4GhxoZit8fqJT0+E4XJiltM2ArlmLkEyJ68vk=";
};
patches = [ ];
configureFlags = [ "--with-isa=RV32E" "--enable-optional-subprojects" ];
check = false;
doInstallCheck = false;
});
mini-gdbstub = nur-xin.packages.${system}.mini-gdbstub;
in in
{ {
checks = { checks = {
@ -33,6 +50,8 @@
}; };
}; };
packages.default = pkgs.callPackage ./default.nix { inherit spike mini-gdbstub; };
devShells.default = (pkgs.mkShell.override { stdenv = pkgs.ccacheStdenv; }) { devShells.default = (pkgs.mkShell.override { stdenv = pkgs.ccacheStdenv; }) {
inherit (self.checks.${system}.pre-commit-check) shellHook; inherit (self.checks.${system}.pre-commit-check) shellHook;
nativeBuildInputs = self.checks.${system}.pre-commit-check.enabledPackages; nativeBuildInputs = self.checks.${system}.pre-commit-check.enabledPackages;

View file

@ -7,3 +7,5 @@ target_link_libraries(spike-diff
set_property(TARGET PROPERTY POSITION_INDEPENDENT_CODE ON) set_property(TARGET PROPERTY POSITION_INDEPENDENT_CODE ON)
target_link_options(spike-diff PRIVATE -Wl,-E) target_link_options(spike-diff PRIVATE -Wl,-E)
install( TARGETS spike-diff )