This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]