Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Apr 2016 06:41:57 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r413171 - in head/devel: binutils cloudabi-binutils-aarch64 cloudabi-binutils-x86_64 cloudabi-toolchain
Message-ID:  <201604130641.u3D6fv0e024002@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed (src committer)
Date: Wed Apr 13 06:41:56 2016
New Revision: 413171
URL: https://svnweb.freebsd.org/changeset/ports/413171

Log:
  Switch the cloudabi-toolchain port over to llvm-devel.
  
  Farnsworth: "Good news, everyone!" The latest revisions of LLVM trunk
  not only have a version of LLD that creates usable binaries for x86-64
  and aarch64, it also does a better job at creating Position Independent
  Executables than the GNU linker.
  
  Because PIE is going to become pretty important for some of the upcoming
  projects (emulation on other OSes), I'd like to go ahead and switch the
  cloudabi-toolchain port over to the latest snapshot of LLVM. My goal is
  to revert back to a stable version (3.9) when available.
  
  Switching to LLD involves patching up the Binutils ports to no longer
  install the GNU linker (and remove the linker scripts that it uses). We
  can then simply add a couple of extra symlinks to cloudabi-toolchain to
  point to the LLD binary.
  
  At the same time, let's switch over to using the ELF toolchain tools on
  FreeBSD 11. That way we can even drop the dependency on Binutils on
  those systems.
  
  Reviewed by:	bapt, emaste
  Differential Revision:	https://reviews.freebsd.org/D5874

Modified:
  head/devel/binutils/Makefile
  head/devel/cloudabi-binutils-aarch64/Makefile
  head/devel/cloudabi-binutils-aarch64/pkg-plist
  head/devel/cloudabi-binutils-x86_64/Makefile
  head/devel/cloudabi-binutils-x86_64/pkg-plist
  head/devel/cloudabi-toolchain/Makefile

Modified: head/devel/binutils/Makefile
==============================================================================
--- head/devel/binutils/Makefile	Wed Apr 13 06:09:25 2016	(r413170)
+++ head/devel/binutils/Makefile	Wed Apr 13 06:41:56 2016	(r413171)
@@ -4,7 +4,7 @@
 PORTNAME=	binutils
 PORTVERSION=	2.25.1
 PORTEPOCH=	1
-PORTREVISION?=	1
+PORTREVISION?=	2
 CATEGORIES=	devel
 MASTER_SITES=	SOURCEWARE/binutils/releases
 
@@ -89,5 +89,8 @@ post-install:
 	    ${STAGEDIR}${PREFIX}/man/man1/${BUTARGET}-${tool}.1 \
 	    ${STAGEDIR}${PREFIX}/${BUTARGET}/bin/${tool}
 .endfor
+.if ${BUREMOVE:Mld}
+	@${RM} -rf ${STAGEDIR}${PREFIX}/${BUTARGET}/lib/ldscripts
+.endif
 
 .include <bsd.port.post.mk>

Modified: head/devel/cloudabi-binutils-aarch64/Makefile
==============================================================================
--- head/devel/cloudabi-binutils-aarch64/Makefile	Wed Apr 13 06:09:25 2016	(r413170)
+++ head/devel/cloudabi-binutils-aarch64/Makefile	Wed Apr 13 06:41:56 2016	(r413171)
@@ -12,6 +12,7 @@ PATCHDIR=	${.CURDIR}/files
 PLIST=		${.CURDIR}/pkg-plist
 
 BUTARGET=	aarch64-unknown-cloudabi
-BUREMOVE=	ar dlltool nlmconv nm objdump ranlib size windmc windres
+BUREMOVE=	ar dlltool ld ld.bfd nlmconv nm objdump ranlib size windmc \
+		windres
 
 .include "${MASTERDIR}/Makefile"

Modified: head/devel/cloudabi-binutils-aarch64/pkg-plist
==============================================================================
--- head/devel/cloudabi-binutils-aarch64/pkg-plist	Wed Apr 13 06:09:25 2016	(r413170)
+++ head/devel/cloudabi-binutils-aarch64/pkg-plist	Wed Apr 13 06:41:56 2016	(r413171)
@@ -3,8 +3,6 @@ bin/aarch64-unknown-cloudabi-as
 bin/aarch64-unknown-cloudabi-c++filt
 bin/aarch64-unknown-cloudabi-elfedit
 bin/aarch64-unknown-cloudabi-gprof
-bin/aarch64-unknown-cloudabi-ld
-bin/aarch64-unknown-cloudabi-ld.bfd
 bin/aarch64-unknown-cloudabi-objcopy
 bin/aarch64-unknown-cloudabi-readelf
 bin/aarch64-unknown-cloudabi-strings
@@ -14,39 +12,10 @@ man/man1/aarch64-unknown-cloudabi-as.1.g
 man/man1/aarch64-unknown-cloudabi-c++filt.1.gz
 man/man1/aarch64-unknown-cloudabi-elfedit.1.gz
 man/man1/aarch64-unknown-cloudabi-gprof.1.gz
-man/man1/aarch64-unknown-cloudabi-ld.1.gz
 man/man1/aarch64-unknown-cloudabi-objcopy.1.gz
 man/man1/aarch64-unknown-cloudabi-readelf.1.gz
 man/man1/aarch64-unknown-cloudabi-strings.1.gz
 man/man1/aarch64-unknown-cloudabi-strip.1.gz
-aarch64-unknown-cloudabi/lib/ldscripts/aarch64cloudabi.x
-aarch64-unknown-cloudabi/lib/ldscripts/aarch64cloudabi.xbn
-aarch64-unknown-cloudabi/lib/ldscripts/aarch64cloudabi.xc
-aarch64-unknown-cloudabi/lib/ldscripts/aarch64cloudabi.xd
-aarch64-unknown-cloudabi/lib/ldscripts/aarch64cloudabi.xdc
-aarch64-unknown-cloudabi/lib/ldscripts/aarch64cloudabi.xdw
-aarch64-unknown-cloudabi/lib/ldscripts/aarch64cloudabi.xn
-aarch64-unknown-cloudabi/lib/ldscripts/aarch64cloudabi.xr
-aarch64-unknown-cloudabi/lib/ldscripts/aarch64cloudabi.xs
-aarch64-unknown-cloudabi/lib/ldscripts/aarch64cloudabi.xsc
-aarch64-unknown-cloudabi/lib/ldscripts/aarch64cloudabi.xsw
-aarch64-unknown-cloudabi/lib/ldscripts/aarch64cloudabi.xu
-aarch64-unknown-cloudabi/lib/ldscripts/aarch64cloudabi.xw
-aarch64-unknown-cloudabi/lib/ldscripts/aarch64cloudabib.x
-aarch64-unknown-cloudabi/lib/ldscripts/aarch64cloudabib.xbn
-aarch64-unknown-cloudabi/lib/ldscripts/aarch64cloudabib.xc
-aarch64-unknown-cloudabi/lib/ldscripts/aarch64cloudabib.xd
-aarch64-unknown-cloudabi/lib/ldscripts/aarch64cloudabib.xdc
-aarch64-unknown-cloudabi/lib/ldscripts/aarch64cloudabib.xdw
-aarch64-unknown-cloudabi/lib/ldscripts/aarch64cloudabib.xn
-aarch64-unknown-cloudabi/lib/ldscripts/aarch64cloudabib.xr
-aarch64-unknown-cloudabi/lib/ldscripts/aarch64cloudabib.xs
-aarch64-unknown-cloudabi/lib/ldscripts/aarch64cloudabib.xsc
-aarch64-unknown-cloudabi/lib/ldscripts/aarch64cloudabib.xsw
-aarch64-unknown-cloudabi/lib/ldscripts/aarch64cloudabib.xu
-aarch64-unknown-cloudabi/lib/ldscripts/aarch64cloudabib.xw
 aarch64-unknown-cloudabi/bin/as
-aarch64-unknown-cloudabi/bin/ld
-aarch64-unknown-cloudabi/bin/ld.bfd
 aarch64-unknown-cloudabi/bin/objcopy
 aarch64-unknown-cloudabi/bin/strip

Modified: head/devel/cloudabi-binutils-x86_64/Makefile
==============================================================================
--- head/devel/cloudabi-binutils-x86_64/Makefile	Wed Apr 13 06:09:25 2016	(r413170)
+++ head/devel/cloudabi-binutils-x86_64/Makefile	Wed Apr 13 06:41:56 2016	(r413171)
@@ -12,6 +12,7 @@ PATCHDIR=	${.CURDIR}/files
 PLIST=		${.CURDIR}/pkg-plist
 
 BUTARGET=	x86_64-unknown-cloudabi
-BUREMOVE=	ar dlltool nlmconv nm objdump ranlib size windmc windres
+BUREMOVE=	ar dlltool ld ld.bfd nlmconv nm objdump ranlib size windmc \
+		windres
 
 .include "${MASTERDIR}/Makefile"

Modified: head/devel/cloudabi-binutils-x86_64/pkg-plist
==============================================================================
--- head/devel/cloudabi-binutils-x86_64/pkg-plist	Wed Apr 13 06:09:25 2016	(r413170)
+++ head/devel/cloudabi-binutils-x86_64/pkg-plist	Wed Apr 13 06:41:56 2016	(r413171)
@@ -3,8 +3,6 @@ bin/x86_64-unknown-cloudabi-as
 bin/x86_64-unknown-cloudabi-c++filt
 bin/x86_64-unknown-cloudabi-elfedit
 bin/x86_64-unknown-cloudabi-gprof
-bin/x86_64-unknown-cloudabi-ld
-bin/x86_64-unknown-cloudabi-ld.bfd
 bin/x86_64-unknown-cloudabi-objcopy
 bin/x86_64-unknown-cloudabi-readelf
 bin/x86_64-unknown-cloudabi-strings
@@ -14,26 +12,10 @@ man/man1/x86_64-unknown-cloudabi-as.1.gz
 man/man1/x86_64-unknown-cloudabi-c++filt.1.gz
 man/man1/x86_64-unknown-cloudabi-elfedit.1.gz
 man/man1/x86_64-unknown-cloudabi-gprof.1.gz
-man/man1/x86_64-unknown-cloudabi-ld.1.gz
 man/man1/x86_64-unknown-cloudabi-objcopy.1.gz
 man/man1/x86_64-unknown-cloudabi-readelf.1.gz
 man/man1/x86_64-unknown-cloudabi-strings.1.gz
 man/man1/x86_64-unknown-cloudabi-strip.1.gz
-x86_64-unknown-cloudabi/lib/ldscripts/elf_x86_64_cloudabi.x
-x86_64-unknown-cloudabi/lib/ldscripts/elf_x86_64_cloudabi.xbn
-x86_64-unknown-cloudabi/lib/ldscripts/elf_x86_64_cloudabi.xc
-x86_64-unknown-cloudabi/lib/ldscripts/elf_x86_64_cloudabi.xd
-x86_64-unknown-cloudabi/lib/ldscripts/elf_x86_64_cloudabi.xdc
-x86_64-unknown-cloudabi/lib/ldscripts/elf_x86_64_cloudabi.xdw
-x86_64-unknown-cloudabi/lib/ldscripts/elf_x86_64_cloudabi.xn
-x86_64-unknown-cloudabi/lib/ldscripts/elf_x86_64_cloudabi.xr
-x86_64-unknown-cloudabi/lib/ldscripts/elf_x86_64_cloudabi.xs
-x86_64-unknown-cloudabi/lib/ldscripts/elf_x86_64_cloudabi.xsc
-x86_64-unknown-cloudabi/lib/ldscripts/elf_x86_64_cloudabi.xsw
-x86_64-unknown-cloudabi/lib/ldscripts/elf_x86_64_cloudabi.xu
-x86_64-unknown-cloudabi/lib/ldscripts/elf_x86_64_cloudabi.xw
 x86_64-unknown-cloudabi/bin/as
-x86_64-unknown-cloudabi/bin/ld
-x86_64-unknown-cloudabi/bin/ld.bfd
 x86_64-unknown-cloudabi/bin/objcopy
 x86_64-unknown-cloudabi/bin/strip

Modified: head/devel/cloudabi-toolchain/Makefile
==============================================================================
--- head/devel/cloudabi-toolchain/Makefile	Wed Apr 13 06:09:25 2016	(r413170)
+++ head/devel/cloudabi-toolchain/Makefile	Wed Apr 13 06:41:56 2016	(r413171)
@@ -2,7 +2,7 @@
 # $FreeBSD$
 
 PORTNAME=	cloudabi-toolchain
-PORTVERSION=	1.3
+PORTVERSION=	1.4
 CATEGORIES=	devel
 MASTER_SITES=	# None
 DISTFILES=	# None
@@ -13,22 +13,36 @@ COMMENT=	C and C++ toolchain for CloudAB
 LICENSE=	MIT
 
 RUN_DEPENDS=	clang${LLVM_SUFFIX}:devel/llvm${LLVM_SUFFIX} \
-		pkgconf:devel/pkgconf \
-		aarch64-unknown-cloudabi-ld:devel/cloudabi-binutils-aarch64 \
-		x86_64-unknown-cloudabi-ld:devel/cloudabi-binutils-x86_64
+		lld${LLVM_SUFFIX}:devel/llvm${LLVM_SUFFIX} \
+		pkgconf:devel/pkgconf
 
-LLVM_SUFFIX=	38
+LLVM_SUFFIX=	-devel
 
 CLOUDABI_ARCHS=	aarch64-unknown-cloudabi x86_64-unknown-cloudabi
 
 LLVM_TOOLS=	ar nm objdump ranlib size
 SHELL_TOOLS=	man pkg-config
 
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} >= 1100100
+# Depend on ELF tools provided by the base system. They work well with
+# CloudABI executables.
+BASE_TOOLS=	addr2line c++filt objcopy readelf strings strip
+CONFLICTS=	cloudabi-binutils-*
+.else
+# The tools in the base system are too old to properly support CloudABI
+# and aarch64. Depend on versions provided by GNU Binutils instead.
+RUN_DEPENDS+=	aarch64-unknown-cloudabi-readelf:devel/cloudabi-binutils-aarch64 \
+		x86_64-unknown-cloudabi-readelf:devel/cloudabi-binutils-x86_64
+.endif
+
 .for arch in ${CLOUDABI_ARCHS}
-. for tool in ${LLVM_TOOLS} ${SHELL_TOOLS}
+. for tool in ${BASE_TOOLS} ${LLVM_TOOLS} ${SHELL_TOOLS}
 PLIST_FILES+=	bin/${arch}-${tool}
 . endfor
-PLIST_FILES+=	bin/${arch}-cc bin/${arch}-c++ llvm${LLVM_SUFFIX}/${arch}
+PLIST_FILES+=	bin/${arch}-cc bin/${arch}-c++ bin/${arch}-ld \
+		llvm${LLVM_SUFFIX}/${arch}
 .endfor
 
 do-build:
@@ -42,19 +56,25 @@ do-build:
 do-install:
 	@${MKDIR} ${STAGEDIR}${PREFIX}/llvm${LLVM_SUFFIX}
 .for arch in ${CLOUDABI_ARCHS}
+. for tool in ${BASE_TOOLS}
+	@${LN} -s /usr/bin/${tool} \
+		${STAGEDIR}${PREFIX}/bin/${arch}-${tool}
+. endfor
 . for tool in ${LLVM_TOOLS}
 	@${LN} -s ../llvm${LLVM_SUFFIX}/bin/llvm-${tool} \
 		${STAGEDIR}${PREFIX}/bin/${arch}-${tool}
 . endfor
 . for tool in ${SHELL_TOOLS}
-	@${INSTALL_SCRIPT} ${WRKDIR}/${arch}-${tool} \
+	${INSTALL_SCRIPT} ${WRKDIR}/${arch}-${tool} \
 		${STAGEDIR}${PREFIX}/bin/${arch}-${tool}
 . endfor
 	@${LN} -s ../llvm${LLVM_SUFFIX}/bin/clang \
 		${STAGEDIR}${PREFIX}/bin/${arch}-cc
 	@${LN} -s ../llvm${LLVM_SUFFIX}/bin/clang++ \
 		${STAGEDIR}${PREFIX}/bin/${arch}-c++
+	@${LN} -s ../llvm${LLVM_SUFFIX}/bin/lld \
+		${STAGEDIR}${PREFIX}/bin/${arch}-ld
 	@${LN} -s ../${arch} ${STAGEDIR}${PREFIX}/llvm${LLVM_SUFFIX}/${arch}
 .endfor
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>



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