1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-23 04:23:08 +00:00

CHERI-Clang is a fork of the Clang compiler with support for the CHERI

(Capability Hardware Enhanced RISC Instructions) ISA.

It also has enhanced support for MIPS CPUs, particularly MIPS64.

Sponsored by:	DARPA, AFRL
This commit is contained in:
Brooks Davis 2014-04-21 22:16:33 +00:00
parent 4053a4a28f
commit b4bbb4895c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=351727
6 changed files with 1466 additions and 0 deletions

View File

@ -30,6 +30,7 @@
SUBDIR += cfortran
SUBDIR += chicken
SUBDIR += cint
SUBDIR += clang-cheri
SUBDIR += clang-devel
SUBDIR += clang32
SUBDIR += clang33

121
lang/clang-cheri/Makefile Normal file
View File

@ -0,0 +1,121 @@
# $FreeBSD$
PORTNAME= clang-cheri
PORTVERSION= 3.4.20140416
CATEGORIES= lang devel
MASTER_SITES= ${MASTER_SITE_LOCAL}
MASTER_SITE_SUBDIR= brooks
MAINTAINER= brooks@FreeBSD.org
COMMENT= C, Objective-C, and C++ compiler with CHERI CPU support
USES= cmake:outsource compiler:c++11-lib ninja perl5 shebangfix
USE_BZIP2= yes
USE_PYTHON= yes
TRIPLE= cheri-unknown-freebsd
SYSROOT= ${PREFIX}/sysroots/${TRIPLE}
LLVM_PREFIX= ${SYSROOT}/tools
TOOL_PREFIX= ${TRIPLE}-
CMAKE_INSTALL_PREFIX= ${LLVM_PREFIX}
CMAKE_ARGS= -DDEFAULT_SYSROOT=${SYSROOT} \
-DLLVM_DEFAULT_TARGET_TRIPLE=${TRIPLE} \
-DLLVM_ENABLE_CXX11=ON
SHEBANG_FILES= \
tools/clang/tools/clang-format/git-clang-format \
tools/clang/tools/clang-format/clang-format-diff.py
SUB_FILES= llvm-wrapper.sh
SUB_LIST= LLVM_PREFIX="${LLVM_PREFIX}" \
TOOL_PREFIX="${TOOL_PREFIX}" \
TOOL_SUFFIX="${TOOL_SUFFIX}"
OPTIONS_DEFINE= DOCS
PLIST_SUB+= CLANG_RELEASE=${CLANG_RELEASE}
COMMANDS= \
bugpoint \
clang \
clang++ \
clang-3.5 \
clang-check \
clang-cl \
clang-cpp \
clang-format \
git-clang-format \
llc \
lli \
lli-child-target \
llvm-ar \
llvm-as \
llvm-bcanalyzer \
llvm-c-test \
llvm-config \
llvm-cov \
llvm-diff \
llvm-dis \
llvm-dwarfdump \
llvm-extract \
llvm-link \
llvm-lto \
llvm-mc \
llvm-mcmarkup \
llvm-nm \
llvm-objdump \
llvm-readobj \
llvm-rtdyld \
llvm-size \
llvm-stress \
llvm-symbolizer \
llvm-tblgen \
macho-dump \
opt
FIRST_COMMAND= ${COMMANDS:C/^/XXXX/1:MXXXX*:C/^XXXX//}
.include <bsd.port.pre.mk>
.if defined(BOOTSTRAP) || defined(SVN_FETCH)
FETCH_DEPENDS+= svn:${PORTSDIR}/devel/subversion
do-fetch:
${MKDIR} ${WRKDIR}
svn export --force https://github.com/CTSRD-CHERI/llvm/trunk ${WRKSRC}
svn export --force https://github.com/CTSRD-CHERI/clang/trunk \
${WRKSRC}/tools/clang
# svn export --force https://github.com/CTSRD-CHERI/lldb/trunk \
# ${WRKSRC}/tools/lldb
cd ${WRKDIR}; tar cvfy ${DISTDIR}/${DISTNAME}.tar.bz2 ${DISTNAME}
.if ${USER} == brooks || ${USER} == bed22
scp ${DISTDIR}/${DISTNAME}.tar.bz2 \
brooks@freefall.freebsd.org:public_distfiles/
.endif
.endif
post-patch:
${REINPLACE_CMD} -e 's|\(PROJ_docsdir.*:=\).*$$|\1${DOCSDIR}|g' \
${WRKSRC}/Makefile.config.in
${REINPLACE_CMD} -e 's|\(PROJ_mandir.*:=\).*$$|\1${MANPREFIX}/man|g' \
${WRKSRC}/Makefile.config.in
${REINPLACE_CMD} -e 's|/usr/local/|${LOCALBASE}/|g' \
${WRKSRC}/tools/clang/lib/Frontend/InitHeaderSearch.cpp
post-install:
${LN} -f ${STAGEDIR}${LLVM_PREFIX}/bin/clang \
${STAGEDIR}${LLVM_PREFIX}/bin/clang-cpp
${INSTALL_SCRIPT} ${WRKDIR}/llvm-wrapper.sh \
${STAGEDIR}${PREFIX}/bin/${TOOL_PREFIX}${FIRST_COMMAND}
.for command in ${COMMANDS:C/^/XXXX/1:NXXXX*}
test -e ${STAGEDIR}${LLVM_PREFIX}/bin/${command}
${LN} -f ${STAGEDIR}${PREFIX}/bin/${TOOL_PREFIX}${FIRST_COMMAND} \
${STAGEDIR}${PREFIX}/bin/${TOOL_PREFIX}${command}
.endfor
build-plist:
${RM} -f ${PLIST}
${MAKE} makeplist | \
${GREP} -v /you/have/to/check/what/makeplist/gives/you | \
${SED} -e 's/%%PERL_ARCH%%/${PERL_ARCH}/' >> ${PLIST}
.include <bsd.port.post.mk>

View File

@ -0,0 +1,2 @@
SHA256 (clang-cheri-3.4.20140416.tar.bz2) = 161508b1c18307bad097e352b48b3e1d363de28a9cf7631d5a29c12baaf42448
SIZE (clang-cheri-3.4.20140416.tar.bz2) = 20505943

View File

@ -0,0 +1,10 @@
#!/bin/sh
# $FreeBSD$
LLVM_PREFIX="%%LLVM_PREFIX%%"
LLVM_SUFFIX="%%LLVM_SUFFIX%%"
tool=$(basename $0)
tool="${LLVM_PREFIX}/bin/${tool%${LLVM_SUFFIX}}"
LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${LLVM_PREFIX}/lib" \
"${tool}" "${@}"

View File

@ -0,0 +1,6 @@
CHERI-Clang is a fork of the Clang compiler with support for the CHERI
(Capability Hardware Enhanced RISC Instructions) ISA.
It also has enhanced support for MIPS CPUs, particularly MIPS64.
WWW: http://www.cl.cam.ac.uk/research/security/ctsrd/cheri.html

1326
lang/clang-cheri/pkg-plist Normal file

File diff suppressed because it is too large Load Diff