tbinutils: new port - mkports - recipes for building multiple softwares with mk(1)
 (HTM) git clone git://z3bra.org/mkports
 (DIR) Log
 (DIR) Files
 (DIR) Refs
       ---
 (DIR) commit 2805da23f634a7f300d3894647d9353c796a9e35
 (DIR) parent 5e195101a34df744a0dbd87e0c38cf1f392d0c18
 (HTM) Author: z3bra <willyatmailoodotorg>
       Date:   Sat, 16 Jan 2016 14:06:10 +0100
       
       binutils: new port
       
       Diffstat:
         A binutils/mkfile                     |      17 +++++++++++++++++
         A binutils/patches/000-bfd-subdirs.d… |      12 ++++++++++++
         A binutils/patches/001-static-linkin… |      47 +++++++++++++++++++++++++++++++
       
       3 files changed, 76 insertions(+), 0 deletions(-)
       ---
 (DIR) diff --git a/binutils/mkfile b/binutils/mkfile
       t@@ -0,0 +1,17 @@
       +pkg = binutils
       +ver = 2.25
       +url = ftp://ftp.gnu.org/gnu/$pkg/$pkg-$ver.tar.bz2
       +
       +<../config.mk
       +<../default.mk
       +
       +build:QV: fetch patch
       +        mkdir -p $pkg-$ver/build
       +        cd $pkg-$ver/build
       +        ../configure $CONFIGURE_OPT
       +        make tooldir= CC=$CC LDFLAGS="$LDFLAGS"
       +
       +install:QV: build
       +        mkdir -p $destdir
       +        cd $pkg-$ver/build
       +        make tooldir= DESTDIR=$destdir install
 (DIR) diff --git a/binutils/patches/000-bfd-subdirs.diff b/binutils/patches/000-bfd-subdirs.diff
       t@@ -0,0 +1,12 @@
       +diff -urN a/bfd/Makefile.in b/bfd/Makefile.in
       +--- a/bfd/Makefile.in        2014-10-14 09:32:02.000000000 +0200
       ++++ b/bfd/Makefile.in        2016-01-15 23:27:09.201421310 +0100
       +@@ -339,7 +339,7 @@
       + ACLOCAL_AMFLAGS = -I . -I .. -I ../config
       + INCDIR = $(srcdir)/../include
       + CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
       +-SUBDIRS = doc po
       ++SUBDIRS =  po
       + bfddocdir = doc
       + libbfd_la_LDFLAGS = $(am__append_1) -release `cat libtool-soversion` \
       +         @SHARED_LDFLAGS@ $(am__empty)
 (DIR) diff --git a/binutils/patches/001-static-linking.patch b/binutils/patches/001-static-linking.patch
       t@@ -0,0 +1,47 @@
       +This fixes static linking for our hardened toolchain
       +diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
       +index e8126cb..9532bfb 100644
       +--- a/ld/scripttempl/elf.sc
       ++++ b/ld/scripttempl/elf.sc
       +@@ -235,8 +235,8 @@ test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS="
       + if test "${ENABLE_INITFINI_ARRAY}" = "yes"; then
       +   SORT_INIT_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))"
       +   SORT_FINI_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))"
       +-  CTORS_IN_INIT_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors"
       +-  DTORS_IN_FINI_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors"
       ++  CTORS_IN_INIT_ARRAY="EXCLUDE_FILE (*crtbegin*.o *crtend*.o $OTHER_EXCLUDE_FILES) .ctors"
       ++  DTORS_IN_FINI_ARRAY="EXCLUDE_FILE (*crtbegin*.o *crtend*.o $OTHER_EXCLUDE_FILES) .dtors"
       + else
       +   SORT_INIT_ARRAY="KEEP (*(SORT(.init_array.*)))"
       +   SORT_FINI_ARRAY="KEEP (*(SORT(.fini_array.*)))"
       +@@ -270,15 +270,14 @@ CTOR=".ctors        ${CONSTRUCTING-0} :
       +        doesn't matter which directory crtbegin.o
       +        is in.  */
       + 
       +-    KEEP (*crtbegin.o(.ctors))
       +-    KEEP (*crtbegin?.o(.ctors))
       ++    KEEP (*crtbegin*.o(.ctors))
       + 
       +     /* We don't want to include the .ctor section from
       +        the crtend.o file until after the sorted ctors.
       +        The .ctor section from the crtend file contains the
       +        end of ctors marker and it must be last */
       + 
       +-    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors))
       ++    KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .ctors))
       +     KEEP (*(SORT(.ctors.*)))
       +     KEEP (*(.ctors))
       +     ${CONSTRUCTING+${CTOR_END}}
       +@@ -286,9 +285,8 @@ CTOR=".ctors        ${CONSTRUCTING-0} :
       + DTOR=".dtors        ${CONSTRUCTING-0} :
       +   {
       +     ${CONSTRUCTING+${DTOR_START}}
       +-    KEEP (*crtbegin.o(.dtors))
       +-    KEEP (*crtbegin?.o(.dtors))
       +-    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors))
       ++    KEEP (*crtbegin*.o(.dtors))
       ++    KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .dtors))
       +     KEEP (*(SORT(.dtors.*)))
       +     KEEP (*(.dtors))
       +     ${CONSTRUCTING+${DTOR_END}}
       +