This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
teaching ld to look under 64 bit libraries when cross compiling
- From: "Hector Oron" <hector dot oron at gmail dot com>
- To: binutils at sources dot redhat dot com
- Date: Wed, 28 Nov 2007 20:10:15 +0100
- Subject: teaching ld to look under 64 bit libraries when cross compiling
Hello,
I have been patching binutils since version 2.15 with the following
patch so ld looks under 32-64 bit libraries (tested on Debian
distribution).
Comments are welcome
+--- 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,6 +197,27 @@
+ *:: | ::*) 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 [ "${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
--
Héctor Orón