Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@
libffi
];
};
llvm_cheri = pkgs.mkShell {
name = "llvm_cheri";
packages = with lowrisc_pkgs; [llvm_cheri];
};
};
formatter = pkgs.alejandra;
});
Expand Down
3 changes: 3 additions & 0 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
cheriot-sim = pkgs.callPackage ./cheriot-sim.nix {};
cheriot-audit = pkgs.callPackage ./cheriot-audit.nix {};

# Cheri
llvm_cheri = pkgs.callPackage ./llvm_cheri.nix {};

verilator_caliptra = pkgs.callPackage ./verilator_caliptra.nix {};

# IT packages
Expand Down
41 changes: 41 additions & 0 deletions pkgs/llvm_cheri.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright lowRISC contributors.
#
# SPDX-License-Identifier: MIT
{
fetchzip,
stdenv,
zlib,
zstd,
ncurses6,
autoPatchelfHook,
}:
stdenv.mkDerivation rec {
name = "cheri-llvm";
version = "17.0.1.r01";
src = fetchzip {
# We build the toolchain in another repository because derivations doesn't allow internet
# connection, which is required by cheribuild.
url = "https://github.com/engdoreis/cheribuild/releases/download/v${version}/cheri-std093-sdk.tar.gz";
hash = "sha256-/6FGm1Ot9sFZ71FIThtLV2KFjhSfnc5w32OucCZmDfc=";
};

dontConfigure = true;
dontBuild = true;

buildInputs = [
stdenv.cc.cc.lib
ncurses6
zlib
zstd
];
nativeBuildInputs = [autoPatchelfHook];

installPhase = ''
mkdir -p $out
cp -R ./cheri-std093-sdk/* $out
'';

meta = {
platforms = ["x86_64-linux"];
};
}