diff -urN binutils-2.18.1~cvs20071027/debian/patches/00list binutils-2.18.1~cvs20071027.cross/debian/patches/00list --- binutils-2.18.1~cvs20071027/debian/patches/00list 2007-11-23 01:53:03.000000000 +0000 +++ binutils-2.18.1~cvs20071027.cross/debian/patches/00list 2007-11-23 01:55:15.000000000 +0000 @@ -7,3 +7,4 @@ 304_pr4476 305_arm-dis 306_pr4453 +999_lib64_for_cross diff -urN binutils-2.18.1~cvs20071027/debian/patches/999_lib64_for_cross.dpatch binutils-2.18.1~cvs20071027.cross/debian/patches/999_lib64_for_cross.dpatch --- binutils-2.18.1~cvs20071027/debian/patches/999_lib64_for_cross.dpatch 1970-01-01 00:00:00.000000000 +0000 +++ binutils-2.18.1~cvs20071027.cross/debian/patches/999_lib64_for_cross.dpatch 2007-11-23 02:32:34.000000000 +0000 @@ -0,0 +1,41 @@ +#! /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: patches lib64 for crosscompiling +## DP: Add /usr/${target-alias}/lib${LIBPATH_SUFFIX} to ld's default +## DP: library search path for cross targets. Needed for cross targets that +## DP: try to support both 32bit and 64bit emulations. + +@DPATCH@ + +--- binutils-2.18.1~cvs20071027-1.cross/ld/genscripts.sh 2007-11-23 01:37:37.000000000 +0000 ++++ binutils-2.18.1~cvs20071027-1/ld/genscripts.sh 2007-11-23 01:46:27.000000000 +0000 +@@ -197,8 +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 + # sysrooted configurations and when LIBPATH=":". + if [ "x${use_sysroot}" != "xyes" ] ; then