diff -urN binutils-2.18.1~cvs20080103/debian/patches/00list binutils-2.18.1~cvs20080103.cross/debian/patches/00list --- binutils-2.18.1~cvs20080103/debian/patches/00list 2008-06-01 17:13:02.000000000 +0000 +++ binutils-2.18.1~cvs20080103.cross/debian/patches/00list 2008-06-01 17:13:54.000000000 +0000 @@ -11,3 +11,4 @@ 308_mips-pic 309_m68k-pie 310_hppa-gas-unused +999_lib64_for_cross diff -urN binutils-2.18.1~cvs20080103/debian/patches/999_lib64_for_cross.dpatch binutils-2.18.1~cvs20080103.cross/debian/patches/999_lib64_for_cross.dpatch --- binutils-2.18.1~cvs20080103/debian/patches/999_lib64_for_cross.dpatch 1970-01-01 00:00:00.000000000 +0000 +++ binutils-2.18.1~cvs20080103.cross/debian/patches/999_lib64_for_cross.dpatch 2008-06-01 17:10:03.000000000 +0000 @@ -0,0 +1,40 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 999_lib64_for_cross.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad binutils-2.18.1~cvs20080103.cross~/ld/genscripts.sh binutils-2.18.1~cvs20080103.cross/ld/genscripts.sh +--- binutils-2.18.1~cvs20080103.cross~/ld/genscripts.sh 2007-08-12 08:00:32.000000000 +0000 ++++ binutils-2.18.1~cvs20080103.cross/ld/genscripts.sh 2008-06-01 17:09:54.000000000 +0000 +@@ -197,6 +197,29 @@ + *:: | ::*) LIB_PATH=${LIB_PATH}${LIB_PATH2} ;; + *) LIB_PATH=${LIB_PATH}:${LIB_PATH2} ;; + esac ++ ++ # For multilib'ed targets, ensure both ${target_alias}/lib${LIBPATH_SUFFIX} ++ # and ${TOOL_LIB}/lib${LIBPATH_SUFFIX} to default search path, because ++ # 64bit libraries may be in both places, depending on cross-development ++ # setup method (e.g.: /usr/s390x-linux/lib64 vs /usr/s390-linux/lib64) ++ case "${LIBPATH_SUFFIX}:${tool_lib}" in ++ :*) ;; ++ *:*${LIBPATH_SUFFIX}) ;; ++ *) ++ paths="${exec_prefix}/${target_alias}/lib${LIBPATH_SUFFIX}" ++ if [ "x${TOOL_LIB}" != x ]; then ++ paths="${paths} ${exec_prefix}/${TOOL_LIB}/lib${LIBPATH_SUFFIX}" ++ fi ++ for path in $paths; do ++ case :${LIB_PATH}: in ++ ::: | *:${path}:*) ;; ++ *) LIB_PATH=${path}:${LIB_PATH} ;; ++ esac ++ done ++ ;; ++ esac ++ ++ + fi + + # Always search $(tooldir)/lib, aka /usr/local/TARGET/lib, except for