diff options
author | ed <ed@FreeBSD.org> | 2016-04-13 06:41:56 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2016-04-13 06:41:56 +0000 |
commit | d29e9e7c5d82bac60a0cafeb314fdb0b921876f3 (patch) | |
tree | 491b5a44216cf550e6781acd22d465f98cde9f3c | |
parent | e41f13c8559011261f888c5e21995b1fc6b71c40 (diff) | |
download | FreeBSD-ports-d29e9e7c5d82bac60a0cafeb314fdb0b921876f3.zip FreeBSD-ports-d29e9e7c5d82bac60a0cafeb314fdb0b921876f3.tar.gz |
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
-rw-r--r-- | devel/binutils/Makefile | 5 | ||||
-rw-r--r-- | devel/cloudabi-binutils-aarch64/Makefile | 3 | ||||
-rw-r--r-- | devel/cloudabi-binutils-aarch64/pkg-plist | 31 | ||||
-rw-r--r-- | devel/cloudabi-binutils-x86_64/Makefile | 3 | ||||
-rw-r--r-- | devel/cloudabi-binutils-x86_64/pkg-plist | 18 | ||||
-rw-r--r-- | devel/cloudabi-toolchain/Makefile | 38 |
6 files changed, 37 insertions, 61 deletions
diff --git a/devel/binutils/Makefile b/devel/binutils/Makefile index 6781e62..0a1a548 100644 --- a/devel/binutils/Makefile +++ b/devel/binutils/Makefile @@ -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> diff --git a/devel/cloudabi-binutils-aarch64/Makefile b/devel/cloudabi-binutils-aarch64/Makefile index fc772a1..fcc39aa 100644 --- a/devel/cloudabi-binutils-aarch64/Makefile +++ b/devel/cloudabi-binutils-aarch64/Makefile @@ -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" diff --git a/devel/cloudabi-binutils-aarch64/pkg-plist b/devel/cloudabi-binutils-aarch64/pkg-plist index c1cf7a9..78a771c 100644 --- a/devel/cloudabi-binutils-aarch64/pkg-plist +++ b/devel/cloudabi-binutils-aarch64/pkg-plist @@ -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.gz 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 diff --git a/devel/cloudabi-binutils-x86_64/Makefile b/devel/cloudabi-binutils-x86_64/Makefile index b9aff6d..992e671 100644 --- a/devel/cloudabi-binutils-x86_64/Makefile +++ b/devel/cloudabi-binutils-x86_64/Makefile @@ -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" diff --git a/devel/cloudabi-binutils-x86_64/pkg-plist b/devel/cloudabi-binutils-x86_64/pkg-plist index 22a96c8..8a34741 100644 --- a/devel/cloudabi-binutils-x86_64/pkg-plist +++ b/devel/cloudabi-binutils-x86_64/pkg-plist @@ -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 diff --git a/devel/cloudabi-toolchain/Makefile b/devel/cloudabi-toolchain/Makefile index 1b3d8b3..05c484d 100644 --- a/devel/cloudabi-toolchain/Makefile +++ b/devel/cloudabi-toolchain/Makefile @@ -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 CloudABI 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> |