teaching ld to look under 64 bit libraries when cross compiling
Hector Oron
hector.oron@gmail.com
Wed Nov 28 19:10:00 GMT 2007
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
More information about the Binutils
mailing list