Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Apr 2017 00:13:58 +0000 (UTC)
From:      Brooks Davis <brooks@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r437976 - in head/devel: . xtoolchain-llvm-devel xtoolchain-llvm-devel/files xtoolchain-llvm40
Message-ID:  <201704080013.v380DwC4038708@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brooks
Date: Sat Apr  8 00:13:58 2017
New Revision: 437976
URL: https://svnweb.freebsd.org/changeset/ports/437976

Log:
  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

Added:
  head/devel/xtoolchain-llvm-devel/
     - copied from r437962, head/devel/powerpc64-xtoolchain-gcc/
  head/devel/xtoolchain-llvm40/
  head/devel/xtoolchain-llvm40/Makefile   (contents, props changed)
Modified:
  head/devel/Makefile
  head/devel/xtoolchain-llvm-devel/Makefile
  head/devel/xtoolchain-llvm-devel/files/xtoolchain.mk.in

Modified: head/devel/Makefile
==============================================================================
--- head/devel/Makefile	Fri Apr  7 23:20:31 2017	(r437975)
+++ head/devel/Makefile	Sat Apr  8 00:13:58 2017	(r437976)
@@ -5817,6 +5817,8 @@
     SUBDIR += xparam
     SUBDIR += xsd
     SUBDIR += xtl
+    SUBDIR += xtoolchain-llvm-devel
+    SUBDIR += xtoolchain-llvm40
     SUBDIR += xwpe
     SUBDIR += xxgdb
     SUBDIR += xxhash

Modified: head/devel/xtoolchain-llvm-devel/Makefile
==============================================================================
--- head/devel/powerpc64-xtoolchain-gcc/Makefile	Fri Apr  7 22:32:01 2017	(r437962)
+++ head/devel/xtoolchain-llvm-devel/Makefile	Sat Apr  8 00:13:58 2017	(r437976)
@@ -1,43 +1,47 @@
 # $FreeBSD$
 
 PORTNAME=	xtoolchain
-PORTVERSION=	0.2
+PORTVERSION=	0.1
 CATEGORIES=	devel
 MASTER_SITES=	# none
 DISTFILES=	# none
-PKGNAMEPREFIX?=	powerpc64-
-PKGNAMESUFFIX?=	-gcc
+PKGNAMESUFFIX?=	-llvm${LLVM_SUFFIX}
 
-MAINTAINER?=	bapt@FreeBSD.org
+MAINTAINER?=	brooks@FreeBSD.org
 COMMENT=	Pre seeded toolchain to cross build FreeBSD base
 
+LLVM_SUFFIX?=	-devel
+
 NO_BUILD=	yes
 
-.if ${PKGNAMEPREFIX} == "amd64-"
-TOOLCHAIN_PREFIX=	x86_64-
-.else
-TOOLCHAIN_PREFIX=	${PKGNAMEPREFIX}
-.endif
-XCC?=		${TOOLCHAIN_PREFIX}unknown-${OPSYS:tl}${OSREL}-gcc
-XCXX?=		${TOOLCHAIN_PREFIX}unknown-${OPSYS:tl}${OSREL}-g++
-XCPP?=		${TOOLCHAIN_PREFIX}unknown-${OPSYS:tl}${OSREL}-cpp
-X_COMPILER_TYPE?=	${PKGNAMESUFFIX:C/-//g}
+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/${PKGNAMEPREFIX}${X_COMPILER_TYPE}
+RUN_DEPENDS?=	${XCC}:devel/llvm${LLVM_SUFFIX}
 
 SUB_FILES=	xtoolchain.mk
-SUB_LIST=	TARGETARCH=${TOOLCHAIN_PREFIX:C/-//g} \
-		OPSYS=${OPSYS:tl} \
-		XCC=${XCC} \
+SUB_LIST=	XCC=${XCC} \
 		XCXX=${XCXX} \
 		XCPP=${XCPP} \
+		XLD=${XLD} \
 		X_COMPILER_TYPE=${X_COMPILER_TYPE}
 
-PLIST_FILES=	share/toolchains/${PKGNAMEPREFIX}${X_COMPILER_TYPE}.mk
+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/${PKGNAMEPREFIX}${X_COMPILER_TYPE}.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>

Modified: head/devel/xtoolchain-llvm-devel/files/xtoolchain.mk.in
==============================================================================
--- head/devel/powerpc64-xtoolchain-gcc/files/xtoolchain.mk.in	Fri Apr  7 22:32:01 2017	(r437962)
+++ head/devel/xtoolchain-llvm-devel/files/xtoolchain.mk.in	Sat Apr  8 00:13:58 2017	(r437976)
@@ -1,5 +1,6 @@
 XCC=%%LOCALBASE%%/bin/%%XCC%%
 XCXX=%%LOCALBASE%%/bin/%%XCXX%%
 XCPP=%%LOCALBASE%%/bin/%%XCPP%%
-CROSS_BINUTILS_PREFIX=%%LOCALBASE%%/%%TARGETARCH%%-%%OPSYS%%/bin/
+XLD=%%XLD%%
+CROSS_BINUTILS_PREFIX=/var/empty
 X_COMPILER_TYPE=%%X_COMPILER_TYPE%%

Added: head/devel/xtoolchain-llvm40/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/xtoolchain-llvm40/Makefile	Sat Apr  8 00:13:58 2017	(r437976)
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+LLVM_SUFFIX=40
+
+MASTERDIR=	${.CURDIR}/../xtoolchain-llvm-devel
+
+.include "${MASTERDIR}/Makefile"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201704080013.v380DwC4038708>