aboutsummaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2019-11-08 08:47:24 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2019-11-08 08:47:24 +0000
commit4d52edca2b031d4b89660e41c0d1ba924fef139d (patch)
tree4feb04444f112fdcec2a24f49b720e04a2c987d9 /base
parent9f81018336f27b83ad51b18cfe30f0cda18f6ef8 (diff)
downloadports-4d52edca2b031d4b89660e41c0d1ba924fef139d.tar.gz
ports-4d52edca2b031d4b89660e41c0d1ba924fef139d.zip
Update binutils to 2.33.1
While here, make the port autonomuous (not a slave port of devel/binutils anymore) The only dependency this port is keeping with devel/binutils is sharing the patch directory to avoid duplication.
Notes
Notes: svn path=/head/; revision=517034
Diffstat (limited to 'base')
-rw-r--r--base/binutils/Makefile81
-rw-r--r--base/binutils/distinfo3
-rw-r--r--base/binutils/pkg-descr15
3 files changed, 94 insertions, 5 deletions
diff --git a/base/binutils/Makefile b/base/binutils/Makefile
index 07ab26a46e66..910218f93004 100644
--- a/base/binutils/Makefile
+++ b/base/binutils/Makefile
@@ -1,20 +1,47 @@
# $FreeBSD$
+PORTNAME= binutils
+PORTVERSION= 2.33.1
PORTEPOCH= 0
CATEGORIES= base
+MASTER_SITES= SOURCEWARE/binutils/releases
PKGNAMEPREFIX= ${OPSYS:tl}-
VALID_CATEGORIES= base
COMMENT= GNU binary tools for base
-MASTERDIR= ${.CURDIR}/../../devel/binutils
-PLIST= ${.CURDIR}/pkg-plist
+LICENSE= GPLv3 LGPL3
+LICENSE_COMB= multi
+
+LICENSE_FILE_GPLv3= ${WRKSRC}/COPYING3
+LICENSE_FILE_LGPL3= ${WRKSRC}/COPYING3.LIB
TARGETARCH= ${ARCH:S/amd64/x86_64/}
BUTARGET= ${TARGETARCH}-unknown-${OPSYS:tl}${OSREL}
-CONFIGURE_ARGS+= --disable-host-shared
+USES= bison:alias cpe gmake libtool tar:bzip2 compiler:env
+CPE_VENDOR= gnu
+GNU_CONFIGURE= yes
+INFO_PATH= ${PKGNAMEPREFIX:S/-$//}/share/info
+
+BUTARGET?= ${PKGNAMEPREFIX}unknown-${OPSYS:tl}${OSREL}
+PLIST_SUB= BUTARGET=${BUTARGET}
+
+TEST_TARGET= check
+
+PATCHDIR= ${.CURDIR}/../../devel/binutils/files
+
+CONFIGURE_ARGS+= --disable-host-shared \
+ --disable-shared \
+ --disable-nls \
+ --with-system-zlib \
+ --enable-relro=no \
+ --enable-x86-relax-relocations=no \
+ --target=${BUTARGET}
PREFIX= /usr
+MAKE_ENV+= ac_cv_func_sbrk=0
+MAKE_ARGS+= LIBDL=""
+
BUREMOVE= addr2line \
ar \
c++filt \
@@ -31,11 +58,19 @@ BUREMOVE= addr2line \
windmc \
windres
-.include "${MASTERDIR}/Makefile"
-
PLIST_SUB+= OBJCOPY="@comment "
BUREMOVE+= objcopy
+OPTIONS_DEFINE= RELRO STATIC
+RELRO_DESC= enable -z relro in ELF linker by default
+
+RELRO_CONFIGURE_ON= --enable-relro
+RELRO_CONFIGURE_OFF= --enable-relro=no
+
+STATIC_LDFLAGS+= -all-static
+
+.include <bsd.port.pre.mk>
+
.if ${ARCH} == "amd64" || ${ARCH} == "i386"
PLIST_SUB+= I386=""
.else
@@ -61,3 +96,39 @@ PLIST_SUB+= SPARC=""
.else
PLIST_SUB+= SPARC="@comment "
.endif
+
+.if ${ARCH} == "amd64"
+CONFIGURE_TARGET= x86_64-portbld-freebsd${OSREL}
+.elif ${ARCH} == "powerpcspe"
+CONFIGURE_TARGET= powerpc-portbld-freebsd${OSREL}
+.else
+CONFIGURE_TARGET= ${ARCH}-portbld-freebsd${OSREL}
+.endif
+
+post-patch:
+ ${REINPLACE_CMD} -e "s/-ldl//g" ${WRKSRC}/gold/testsuite/Makefile.in
+
+post-install:
+ ${RM} -r ${STAGEDIR}${PREFIX}/${PKGNAMEPREFIX:S/-$//}
+ ${RM} ${STAGEDIR}${PREFIX}/${BUTARGET}/lib/ldscripts/i386bsd.*
+ @if [ -d ${STAGEDIR}${PREFIX}/${INFO_PATH:H} ] ; then rm -rf ${STAGEDIR}${PREFIX}/${INFO_PATH:H}; fi
+ ${LN} -fs /usr/bin/${BUTARGET}-as ${STAGEDIR}/usr/bin/as
+ ${LN} -fs /usr/bin/${BUTARGET}-ld ${STAGEDIR}/usr/bin/ld
+ ${LN} -fs /usr/bin/${BUTARGET}-ld.bfd ${STAGEDIR}/usr/bin/ld.bfd
+ ${LN} -fs /usr/bin/${BUTARGET}-objcopy ${STAGEDIR}/usr/bin/objcopy
+ ${LN} -fs /usr/bin/${BUTARGET}-objdump ${STAGEDIR}/usr/bin/objdump
+ ${LN} -fs ${BUTARGET}-as.1.gz ${STAGEDIR}/${MANDIR}1/as.1.gz
+ ${LN} -fs ${BUTARGET}-ld.1.gz ${STAGEDIR}/${MANDIR}1/ld.1.gz
+ ${LN} -fs ${BUTARGET}-objcopy.1.gz ${STAGEDIR}/${MANDIR}1/objcopy.1.gz
+ ${LN} -fs ${BUTARGET}-objdump.1.gz ${STAGEDIR}/${MANDIR}1/objdump.1.gz
+ @${RM} -r ${STAGEDIR}${PREFIX}/include
+ @${RM} -r ${STAGEDIR}${PREFIX}/lib
+.for tool in ${BUREMOVE}
+ @${RM} ${STAGEDIR}${PREFIX}/bin/${BUTARGET}-${tool} \
+ ${STAGEDIR}${PREFIX}/bin/${tool} \
+ ${STAGEDIR}${MANPREFIX}/man/man1/${BUTARGET}-${tool}.1 \
+ ${STAGEDIR}${MANPREFIX}/man/man1/${tool}.1 \
+ ${STAGEDIR}${PREFIX}/${BUTARGET}/bin/${tool}
+.endfor
+
+.include <bsd.port.post.mk>
diff --git a/base/binutils/distinfo b/base/binutils/distinfo
new file mode 100644
index 000000000000..19f14ada5ce8
--- /dev/null
+++ b/base/binutils/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1572956692
+SHA256 (binutils-2.33.1.tar.bz2) = 0cb4843da15a65a953907c96bad658283f3c4419d6bcc56bf2789db16306adb2
+SIZE (binutils-2.33.1.tar.bz2) = 32160315
diff --git a/base/binutils/pkg-descr b/base/binutils/pkg-descr
new file mode 100644
index 000000000000..419fe72da35e
--- /dev/null
+++ b/base/binutils/pkg-descr
@@ -0,0 +1,15 @@
+The GNU Binutils are a collection of binary tools. The main ones are:
+
+* ld - the GNU linker.
+* as - the GNU assembler.
+
+Most of these programs use BFD, the Binary File Descriptor library, to do
+low-level manipulation. Many of them also use the opcodes library to assemble
+and disassemble machine instructions.
+
+This port may be used as a replacement for the system binutils and support
+features from the latest versions of GCC.
+
+For cross-compilation, see the devel/cross-binutils port.
+
+WWW: https://www.gnu.org/software/binutils/