# HG changeset patch # User Rob Landley # Date 1434907918 18000 # Node ID eca87f8f58fb595a986b0494196e7ca747ec331b # Parent cd90d547dba8489ac25bc9548f46a980d7247748 Changes to build cross-compiler-sh2eb. diff -r cd90d547dba8 -r eca87f8f58fb sources/patches/binutils-bfd.patch --- a/sources/patches/binutils-bfd.patch Mon Jun 15 15:26:38 2015 -0500 +++ b/sources/patches/binutils-bfd.patch Sun Jun 21 12:31:58 2015 -0500 @@ -1,17 +1,59 @@ -Building elf2flt needs libbfd, and installing it in a gratuitously different -directory than libdeath is silly. We're not doing multilib, stoppit. - -diff -ru binutils/bfd/configure binutils.bak/bfd/configure +diff -ruN binutils/bfd/configure binutils.bak/bfd/configure --- binutils/bfd/configure 2012-09-23 01:02:58.000000000 -0500 -+++ binutils.bak/bfd/configure 2014-11-06 21:05:29.009063812 -0600 -@@ -10709,10 +10709,6 @@ - # libbfd.a is a host library containing target dependent code - bfdlibdir='$(libdir)' - bfdincludedir='$(includedir)' ++++ binutils.bak/bfd/configure 2015-06-20 22:30:34.088466082 -0500 +@@ -10703,21 +10703,9 @@ + + # Need _noncanonical variables for this. + +- +- +- +- # libbfd.a is a host library containing target dependent code +- bfdlibdir='$(libdir)' +- bfdincludedir='$(includedir)' - if test "${host}" != "${target}"; then - bfdlibdir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/lib' - bfdincludedir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/include' - fi +- +- +- +- +- ++# libbfd.a is a host library containing target dependent code ++bfdlibdir='$(exec_prefix)/host/lib' ++bfdincludedir='$(exec_prefix)/host/include' + host64=false + target64=false +diff -ruN binutils/opcodes/configure binutils.bak/opcodes/configure +--- binutils/opcodes/configure 2012-09-23 01:03:01.000000000 -0500 ++++ binutils.bak/opcodes/configure 2015-06-20 22:31:22.316466235 -0500 +@@ -9847,23 +9847,11 @@ + INSTALL_LIBBFD_FALSE= + fi +- # Need _noncanonical variables for this. +- +- +- +- +- # libbfd.a is a host library containing target dependent code +- bfdlibdir='$(libdir)' +- bfdincludedir='$(includedir)' +- if test "${host}" != "${target}"; then +- bfdlibdir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/lib' +- bfdincludedir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/include' +- fi +- +- +- +- ++# Need _noncanonical variables for this. ++# libbfd.a is a host library containing target dependent code ++bfdlibdir='$(exec_prefix)/host/lib' ++bfdincludedir='$(exec_prefix)/host/include' + + # host-specific stuff: + diff -r cd90d547dba8 -r eca87f8f58fb sources/sections/binutils.build --- a/sources/sections/binutils.build Mon Jun 15 15:26:38 2015 -0500 +++ b/sources/sections/binutils.build Sun Jun 21 12:31:58 2015 -0500 @@ -35,7 +35,6 @@ # existing host ($HOST_ARCH) _and_ target ($ARCH) cross compilers as # prerequisites. - AR="${HOST_ARCH}-ar" CC="${HOST_ARCH}-cc" configure_binutils \ --build="$CROSS_HOST" --host="$CROSS_TARGET" fi @@ -50,9 +49,10 @@ # Fix up install -mkdir -p "$STAGE_DIR/include" && -cp "$CURSRC/include/libiberty.h" "$STAGE_DIR/include" || dienow - +mkdir -p "$STAGE_DIR"/host/{include,lib} && +cp {"$CURSRC","$STAGE_DIR"/host}/include/libiberty.h && +mv "$STAGE_DIR/"{lib/libiberty.a,host/lib} || + dienow if [ -z "$NO_CLEANUP" ] then diff -r cd90d547dba8 -r eca87f8f58fb sources/sections/elf2flt.build --- a/sources/sections/elf2flt.build Mon Jun 15 15:26:38 2015 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -./configure --with-bfd-include-dir="$STAGE_DIR/include" \ - --with-binutils-include-dir="$STAGE_DIR/include" \ - --with-libbfd="$STAGE_DIR/lib/libbfd.a" \ - --with-libiberty="$STAGE_DIR/lib/libiberty.a" \ - --target="$ELF2FLT" --prefix="$STAGE_DIR" && -make -j $CPUS && -make install TARGET="$CROSS_TARGET" PREFIX="$TOOLCHAIN_PREFIX" diff -r cd90d547dba8 -r eca87f8f58fb sources/sections/elf2flt.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sources/sections/elf2flt.sh Sun Jun 21 12:31:58 2015 -0500 @@ -0,0 +1,20 @@ +# This pile of crap cannot be built without zlib. Even if you're not using +# it, neither the autoconf nor the C has any concept of _not_ using zlib. + +setupfor zlib +CC=${HOST_ARCH:+${HOST_ARCH}-}$CC ./configure && +make -j $CPUS && +install -D z*.h "$STAGE_DIR/host/include" && +install -D libz.a "$STAGE_DIR/host/lib" && +cleanup + +setupfor elf2flt +CC=${HOST_ARCH:+${HOST_ARCH}-}$CC CFLAGS="$CFLAGS $STATIC_FLAGS" \ + ./configure --with-bfd-include-dir="$STAGE_DIR/host/include" \ + --with-binutils-include-dir="$STAGE_DIR/host/include" \ + --with-libiberty="$STAGE_DIR/host/lib/libiberty.a" --prefix="$STAGE_DIR" \ + --with-libbfd="$STAGE_DIR/host/lib/libbfd.a" --target="$ELF2FLT" \ + --with-zlib-prefix="$STAGE_DIR/host" && +make -j $CPUS && +make install TARGET="$CROSS_TARGET" PREFIX="$TOOLCHAIN_PREFIX" +cleanup