aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2016-08-27 00:14:11 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2016-08-27 00:14:11 +0000
commit5af442e679c70d0024e1683e5ce001bf73991c4b (patch)
treea6e641f0102328614d401f042c055d4bb9aa8cf3
parentd6cf438faab891637021c195584977982e3d2ee2 (diff)
downloadports-5af442e679c70d0024e1683e5ce001bf73991c4b.tar.gz
ports-5af442e679c70d0024e1683e5ce001bf73991c4b.zip
WIP: external toolchain cross buildable: binutils
Add a cross buildable binutils package. The new category is not linked to the regular ports tree to avoid make install, poudriere and others to catch it automagically instead of ending with a very complex file removal in the stage, prefer to use specific plist per arch. For now only sparc64 tested and added. This version of binutils is stipped down only the components that are not supported by elftoolchain
Notes
Notes: svn path=/head/; revision=420954
-rw-r--r--base/README18
-rw-r--r--base/binutils/Makefile37
-rw-r--r--base/binutils/pkg-plist.sparc6459
-rw-r--r--devel/binutils/Makefile6
4 files changed, 118 insertions, 2 deletions
diff --git a/base/README b/base/README
new file mode 100644
index 000000000000..66431f7cd167
--- /dev/null
+++ b/base/README
@@ -0,0 +1,18 @@
+# $FreeBSD$
+
+How to cross build initial toolchain
+
+Example with sparc64
+
+1/ install a cross toolchain
+pkg install sparc64-xtoolchain-gcc
+
+2/ cross build world
+make CROSS_TOOLCHAIN=sparc64-gcc TARGET=sparc64 TARGET_ARCH=sparc64 buildworld
+
+3/ install the world in a sysroot
+make CROSS_TOOLCHAIN=sparc64-gcc TARGET=sparc64 TARGET_ARCH=sparc64 installworld DESTDIR=/sysroots/sparc64
+
+4/ build the required port
+$ cd base/binutils
+make CROSS_TOOLCHAIN=sparc64-gcc CROSS_SYSROOT=/sysroot/sparc64 package
diff --git a/base/binutils/Makefile b/base/binutils/Makefile
new file mode 100644
index 000000000000..efc61270d52c
--- /dev/null
+++ b/base/binutils/Makefile
@@ -0,0 +1,37 @@
+# $FreeBSD$
+
+PORTEPOCH= 0
+CATEGORIES= base
+PKGNAMEPREFIX= ${OPSYS}-
+VALID_CATEGORIES= base
+
+COMMENT= GNU binary tools for base
+
+MASTERDIR= ${.CURDIR}/../..//devel/binutils
+PLIST= ${.CURDIR}/pkg-plist.${TARGET_ARCH}
+
+.if !defined(CROSS_TOOLCHAIN)
+.error Please define CROSS_TOOLCHAIN before building
+.endif
+
+.if !defined(CROSS_SYSROOT)
+.error Please define CROSS_SYSROOT before building
+.endif
+
+TARGET_ARCH= ${CROSS_TOOLCHAIN:C,-.*$,,}
+BUTARGET= ${TARGET_ARCH}-${OPSYS:tl}
+CONFIGURE_ARGS+= --host=${BUTARGET} \
+ --disable-host-shared
+PREFIX= /usr
+
+.include "${MASTERDIR}/Makefile"
+.include "${LOCALBASE}/share/toolchains/${CROSS_TOOLCHAIN}.mk"
+
+PKG_ENV+= ABI_FILE=${CROSS_SYSROOT}/bin/sh
+CFLAGS+= --sysroot=${CROSS_SYSROOT} -isystem ${CROSS_SYSROOT}/usr/include
+CXXFLAGS+= --sysroot=${CROSS_SYSROOT}
+CC= ${XCC}
+CXX= ${XCXX}
+.for tool in AS AR LD NM OBJCOPY RANLIB SIZE STRINGS
+${tool}= ${CROSS_BINUTILS_PREFIX}/${tool}
+.endfor
diff --git a/base/binutils/pkg-plist.sparc64 b/base/binutils/pkg-plist.sparc64
new file mode 100644
index 000000000000..67f68b3c868c
--- /dev/null
+++ b/base/binutils/pkg-plist.sparc64
@@ -0,0 +1,59 @@
+bin/as
+bin/ld
+bin/ld.bfd
+bin/objcopy
+bin/objdump
+share/man/man1/as.1.gz
+share/man/man1/ld.1.gz
+share/man/man1/objcopy.1.gz
+share/man/man1/objdump.1.gz
+sparc64-freebsd/bin/ar
+sparc64-freebsd/bin/as
+sparc64-freebsd/bin/ld
+sparc64-freebsd/bin/ld.bfd
+sparc64-freebsd/bin/nm
+sparc64-freebsd/bin/objcopy
+sparc64-freebsd/bin/objdump
+sparc64-freebsd/bin/ranlib
+sparc64-freebsd/bin/readelf
+sparc64-freebsd/bin/size
+sparc64-freebsd/bin/strip
+sparc64-freebsd/lib/ldscripts/elf32_sparc.x
+sparc64-freebsd/lib/ldscripts/elf32_sparc.xbn
+sparc64-freebsd/lib/ldscripts/elf32_sparc.xc
+sparc64-freebsd/lib/ldscripts/elf32_sparc.xd
+sparc64-freebsd/lib/ldscripts/elf32_sparc.xdc
+sparc64-freebsd/lib/ldscripts/elf32_sparc.xdw
+sparc64-freebsd/lib/ldscripts/elf32_sparc.xn
+sparc64-freebsd/lib/ldscripts/elf32_sparc.xr
+sparc64-freebsd/lib/ldscripts/elf32_sparc.xs
+sparc64-freebsd/lib/ldscripts/elf32_sparc.xsc
+sparc64-freebsd/lib/ldscripts/elf32_sparc.xsw
+sparc64-freebsd/lib/ldscripts/elf32_sparc.xu
+sparc64-freebsd/lib/ldscripts/elf32_sparc.xw
+sparc64-freebsd/lib/ldscripts/elf64_sparc.x
+sparc64-freebsd/lib/ldscripts/elf64_sparc.xbn
+sparc64-freebsd/lib/ldscripts/elf64_sparc.xc
+sparc64-freebsd/lib/ldscripts/elf64_sparc.xd
+sparc64-freebsd/lib/ldscripts/elf64_sparc.xdc
+sparc64-freebsd/lib/ldscripts/elf64_sparc.xdw
+sparc64-freebsd/lib/ldscripts/elf64_sparc.xn
+sparc64-freebsd/lib/ldscripts/elf64_sparc.xr
+sparc64-freebsd/lib/ldscripts/elf64_sparc.xs
+sparc64-freebsd/lib/ldscripts/elf64_sparc.xsc
+sparc64-freebsd/lib/ldscripts/elf64_sparc.xsw
+sparc64-freebsd/lib/ldscripts/elf64_sparc.xu
+sparc64-freebsd/lib/ldscripts/elf64_sparc.xw
+sparc64-freebsd/lib/ldscripts/elf64_sparc_fbsd.x
+sparc64-freebsd/lib/ldscripts/elf64_sparc_fbsd.xbn
+sparc64-freebsd/lib/ldscripts/elf64_sparc_fbsd.xc
+sparc64-freebsd/lib/ldscripts/elf64_sparc_fbsd.xd
+sparc64-freebsd/lib/ldscripts/elf64_sparc_fbsd.xdc
+sparc64-freebsd/lib/ldscripts/elf64_sparc_fbsd.xdw
+sparc64-freebsd/lib/ldscripts/elf64_sparc_fbsd.xn
+sparc64-freebsd/lib/ldscripts/elf64_sparc_fbsd.xr
+sparc64-freebsd/lib/ldscripts/elf64_sparc_fbsd.xs
+sparc64-freebsd/lib/ldscripts/elf64_sparc_fbsd.xsc
+sparc64-freebsd/lib/ldscripts/elf64_sparc_fbsd.xsw
+sparc64-freebsd/lib/ldscripts/elf64_sparc_fbsd.xu
+sparc64-freebsd/lib/ldscripts/elf64_sparc_fbsd.xw
diff --git a/devel/binutils/Makefile b/devel/binutils/Makefile
index 11561e9e6387..45d467e74a0c 100644
--- a/devel/binutils/Makefile
+++ b/devel/binutils/Makefile
@@ -3,8 +3,8 @@
PORTNAME= binutils
PORTVERSION= 2.27
-PORTEPOCH= 1
-CATEGORIES= devel
+PORTEPOCH?= 1
+CATEGORIES?= devel
MASTER_SITES= SOURCEWARE/binutils/releases
MAINTAINER?= bapt@FreeBSD.org
@@ -13,10 +13,12 @@ COMMENT?= GNU binary tools
LICENSE= GPLv3 LGPL3
LICENSE_COMB= multi
+.if !defined(CROSS_TOOLCHAIN)
BUILD_DEPENDS= ${LOCALBASE}/lib/libgmp.so:math/gmp \
${LOCALBASE}/lib/libmpfr.so:math/mpfr
CONFLICTS= libbfd-[0-9]*
+.endif
OPTIONS_DEFINE= NLS RELRO