Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
devel/llvm-cheriot: compiler for CHERIoT ISA
Add a port of the CHERIoT compiler. The CHERIoT ISA adds CHERI to RV32e (a microcontroller RISC-V variant). A number of products based on CHERIoT are in the pipeline including the Sonata board from lowRISC's Sunburst Project (https://www.sunburst-project.org). Requested by: emaste
- Loading branch information
1 parent
ead3707
commit bdbe535
Showing
10 changed files
with
2,943 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# llvm-cheriot | ||
|
||
LLVM_SUFFIX= -cheriot | ||
|
||
COMMENT= LLVM and Clang with support the CHERIoT microcontroller | ||
WWW= https://www.microsoft.com/en-us/research/publication/cheriot-rethinking-security-for-low-cost-embedded-systems/ | ||
|
||
DISTINFO_FILE= ${.CURDIR}/distinfo | ||
DESCR= ${.CURDIR}/pkg-descr | ||
PLIST= ${.CURDIR}/pkg-plist | ||
|
||
LLVM_TARGETS= RISCV | ||
CMAKE_FLAGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=riscv32-unknown-unknown | ||
|
||
.if exists(${.CURDIR}/files) | ||
EXTRA_PATCHES= ${.CURDIR}/files | ||
.endif | ||
|
||
.include "${.CURDIR}/Makefile.snapshot" | ||
|
||
MASTERDIR= ${.CURDIR}/../llvm-cheri | ||
|
||
.include "${MASTERDIR}/Makefile" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.include "${.CURDIR}/../llvm-cheri/Makefile.COMMANDS" | ||
|
||
# Work around version skew with llvm-cheri | ||
LLVM_COMMANDS:= ${LLVM_COMMANDS:Nllvm-debuginfod-find:Nllvm-tli-checker} | ||
CLANG_COMMANDS:=${CLANG_COMMANDS:Nclang-linker-wrapper:Nclang-nvlink-wrapper:Nclang-repl} | ||
LLD_COMMANDS+= ld64.lld.darwinnew ld64.lld.darwinold |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.include "${.PARSEDIR}/../llvm-cheri/Makefile.MAN1SRCS" | ||
|
||
# Workaround for llvm-cheri/llvm-morello version skew | ||
LLVM_MAN1SRCS:= ${LLVM_MAN1SRCS:Nllvm-tli-checker.1} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Generated file! Do not edit! | ||
# | ||
# Generated by: files/gen-Makefile.snapshot.sh. | ||
# | ||
LLVM_MAJOR= 13 | ||
LLVM_RELEASE= ${LLVM_MAJOR}.0.0 | ||
SNAPDATE= 20230706 | ||
|
||
LLVM_COMMIT= a6c9dc0a4232ed4a64acc6ba4fc7f2754de1ed45 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
TIMESTAMP = 1699044153 | ||
SHA256 (CTSRD-CHERI-llvm-project-13.0.d20230706-a6c9dc0a4232ed4a64acc6ba4fc7f2754de1ed45_GH0.tar.gz) = 955d8fb500a9512d1085caf3a6b250e3d297554d4905aa7e2b7b76fed8280c33 | ||
SIZE (CTSRD-CHERI-llvm-project-13.0.d20230706-a6c9dc0a4232ed4a64acc6ba4fc7f2754de1ed45_GH0.tar.gz) = 152251308 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/sh | ||
# | ||
# Simple script to fetch the latest commits via the github API. Requires | ||
# curl and jq. Uses unauthenticated access which is ratelimited to 60 | ||
# queries per hour. | ||
|
||
REPOS_URL=https://api.github.com/repos/CTSRD-CHERI | ||
MAX_DATE=1970101 | ||
|
||
tmpfile=`mktemp -t gen-Makefile.snapshot` | ||
|
||
query_repo() | ||
{ | ||
curl ${REPOS_URL}/$1/branches/cheriot > $tmpfile | ||
|
||
# Accumulate the dates of the last commits to find the snapshot date | ||
committime=`jq -r '.commit.commit.committer.date' $tmpfile` | ||
committime=${committime%%T*} | ||
year=${committime%%-*} | ||
month=${committime%-*} | ||
month=${month#*-} | ||
day=${committime##*-} | ||
dateint=${year}${month}${day} | ||
if [ $dateint -gt $MAX_DATE ]; then | ||
export MAX_DATE=$dateint | ||
fi | ||
|
||
SHA=`jq -r '.commit.sha' $tmpfile` | ||
} | ||
|
||
query_repo llvm-project | ||
LLVM_COMMIT=$SHA | ||
|
||
cat <<EOF > Makefile.snapshot | ||
# Generated file! Do not edit! | ||
# | ||
# Generated by: files/gen-Makefile.snapshot.sh. | ||
# | ||
LLVM_MAJOR= 13 | ||
LLVM_RELEASE= \${LLVM_MAJOR}.0.0 | ||
SNAPDATE= ${MAX_DATE} | ||
LLVM_COMMIT= ${LLVM_COMMIT} | ||
EOF | ||
|
||
rm -f $tmpfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
The LLVM Project is a collection of modular and reusable compiler and | ||
toolchain technologies. This version adds support for the Arm Morello | ||
prototype architecture (CHERI ported to ARMv8-A). | ||
|
||
This port includes Clang (a C/C++/Objective-C compiler), LLD (a linker), | ||
and the LLVM infrastructure these are built on. |
Oops, something went wrong.