Skip to content

Commit

Permalink
Added the CHERIoT LLVM compiler
Browse files Browse the repository at this point in the history
Signed-off-by: Hugo McNally <[email protected]>
  • Loading branch information
HU90m committed Jan 4, 2024
1 parent ffe3a76 commit d9f03a3
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
5 changes: 4 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Licensed under the MIT License, see LICENSE for details.
# SPDX-License-Identifier: MIT
{
description = "lowRISC CIC's Nix Packages and Environments";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
flake-utils.url = "github:numtide/flake-utils";
Expand All @@ -22,8 +24,9 @@
pkgs = import nixpkgs {
inherit system;
};
lowrisc_pkgs = import ./pkgs {inherit pkgs inputs;};
in {
packages = import ./pkgs {inherit pkgs inputs;};
packages = lowrisc_pkgs;
formatter = pkgs.alejandra;
});
in
Expand Down
1 change: 1 addition & 0 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
{
verilator_ot = import ./verilator {inherit pkgs;};
python_ot = pkgs.callPackage ./python_ot {inherit inputs;};
llvm_cheriot = import ./llvm_cheriot.nix {inherit pkgs;};
}
// pkgs.lib.optionalAttrs (pkgs.system == "x86_64-linux") {
lowrisc-toolchain-gcc-rv32imcb = pkgs.callPackage ./lowrisc-toolchain-gcc-rv32imcb.nix {};
Expand Down
28 changes: 28 additions & 0 deletions pkgs/llvm_cheriot.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
{pkgs, ...}:
pkgs.stdenv.mkDerivation rec {
name = "llvm-cheriot";
src = pkgs.fetchFromGitHub {
owner = "CHERIoT-Platform";
repo = "llvm-project";
rev = "432ef65c96c9f8be8b7802a8bfb9bcf3609b2b79";
sha256 = "sha256-ddLnG1olyRYxvKJ0zKEbThq/ZnxP68X32+1ws76WeV4=";
};
sourceRoot = "${src.name}/llvm";
nativeBuildInputs = with pkgs; [cmake ninja lld python3];
cmakeFlags = [
"-DCMAKE_BUILD_TYPE=Release"
"-DLLVM_ENABLE_ASSERTIONS=True"
"-DLLVM_ENABLE_PROJECTS='clang;clang-tools-extra;lld'"
"-DLLVM_ENABLE_UNWIND_TABLES=NO"
"-DLLVM_TARGETS_TO_BUILD=RISCV"
"-DLLVM_DISTRIBUTION_COMPONENTS='clang;clangd;lld;llvm-objdump'"
];
meta = {
description = "The clang/LLVM compiler with CHERIoT support.";
homepage = "https://cheriot.org/";
license = pkgs.lib.licenses.asl20-llvm;
};
}

0 comments on commit d9f03a3

Please sign in to comment.