freebsd-ports/devel/xtoolchain-llvm-devel/Makefile
Brooks Davis 7155256ee0 Add experimental xtoolchain ports for llvm-devel and llvm40.
With an appropriate port installed, in principle you can build a cross
world and/or kernel without a bootstrap compiler or binutils with:

make CROSS_TOOLCHAIN=llvm40 TARGET=arm64 buildworld buildkernel

In practice, this only has a chance of working on platforms with solid
LLD support.  At the moment I've had some success with i386, amd64, and
arm64.

Sponsored by:	DARPA, AFRL
2017-04-08 00:13:58 +00:00

47 lines
1.2 KiB
Makefile

# $FreeBSD$
PORTNAME= xtoolchain
PORTVERSION= 0.1
CATEGORIES= devel
MASTER_SITES= # none
DISTFILES= # none
PKGNAMESUFFIX?= -llvm${LLVM_SUFFIX}
MAINTAINER?= brooks@FreeBSD.org
COMMENT= Pre seeded toolchain to cross build FreeBSD base
LLVM_SUFFIX?= -devel
NO_BUILD= yes
XCC?= clang${LLVM_SUFFIX}
XCXX?= clang++${LLVM_SUFFIX}
XCPP?= clang-cpp${LLVM_SUFFIX}
XLD?= ${LOCALBASE}/llvm${LLVM_SUFFIX}/bin/ld.lld
X_COMPILER_TYPE?= clang
RUN_DEPENDS?= ${XCC}:devel/llvm${LLVM_SUFFIX}
SUB_FILES= xtoolchain.mk
SUB_LIST= XCC=${XCC} \
XCXX=${XCXX} \
XCPP=${XCPP} \
XLD=${XLD} \
X_COMPILER_TYPE=${X_COMPILER_TYPE}
PLIST_FILES= share/toolchains/llvm${LLVM_SUFFIX}.mk \
llvm${LLVM_SUFFIX}/bin/ld
do-install:
@${MKDIR} ${STAGEDIR}${PREFIX}/share/toolchains/
@${INSTALL_DATA} ${WRKDIR}/xtoolchain.mk \
${STAGEDIR}${PREFIX}/share/toolchains/llvm${LLVM_SUFFIX}.mk
# XXX: would be better to add -fuse-ld=lld to LDFLAGS, but there isn't
# yet a mechansim for that. Link added here, not in devel/llvm* to avoid
# forcing lld on all users.
post-install:
@${MKDIR} ${STAGEDIR}${LOCALBASE}/llvm${LLVM_SUFFIX}/bin
@${LN} -s ld.lld ${STAGEDIR}${LOCALBASE}/llvm${LLVM_SUFFIX}/bin/ld
.include <bsd.port.mk>