ports

recipes for building multiple softwares
git clone git://z3bra.org/ports
Log | Files | Refs

commit 61d03d31c5d567088f9f462de6165c5c700c1c67
parent abed6738dafe8ff2bde2020e90062117dc97fd7d
Author: z3bra <willyatmailoodotorg>
Date:   Tue Sep 15 20:36:39 2015

binutils: fix cross-packaging

Diffstat:
 binutils/makeme                                       | 18 ++------
 binutils/patches/binutils-ld-fix-static-linking.patch | 47 ++++++++++++++++++++-
 2 files changed, 53 insertions(+), 12 deletions(-)

diff --git a/binutils/makeme b/binutils/makeme @@ -7,18 +7,12 @@ package() { sed -i '/^SUBDIRS/s/doc//' $name-$version/bfd/Makefile.in - mkdir $name-$version/build - cd $name-$version/build + cd $name-$version + cat ../patches/*.patch | patch -Np1 || true + mkdir -p build && cd build - ../configure --target=${TOOLCHAIN_TRIPLET} \ - --mandir=/share/man \ - --disable-nls \ - --disable-share \ - --disable-multilib + ../configure $CONFIGURE_OPT - make LDFLAGS="$LDFLAGS -all-static" - make DESTDIR=$WORKDIR/$name install - - cd .. - rm -r $name-$version + make tooldir= CC=$CC LDFLAGS="$LDFLAGS" + make tooldir= DESTDIR=$WORKDIR/$name install } diff --git a/binutils/patches/binutils-ld-fix-static-linking.patch b/binutils/patches/binutils-ld-fix-static-linking.patch @@ -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}} +