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]

utilizing $LIBPATH_SUFFIX with non-sysroot cross-ld


the other thread reminded me of this ...

any reason the $LIBPATH_SUFFIX setting is ignored when creating a cross-ld and 
when --with-sysroot is not used ?

attached is a PoC for utilizing $LIBPATH_SUFFIX in this case 
(cross-ld/non-sysroot) ... iirc, i saw the idea somewhere else (crossgcc list 
maybe) and then wrote this patch ...
-mike
If we don't use --with-sysroot for cross-compilers, the $LIBPATH_SUFFIX 
setting is ignored when generating the default lib search path.

--- binutils/ld/genscripts.sh
+++ binutils/ld/genscripts.sh
@@ -186,6 +186,14 @@
   ::) LIB_PATH=${tool_lib} ;;
   *) LIB_PATH=${tool_lib}:${LIB_PATH} ;;
   esac
+  # For multilib targets, search both $tool_lib dirs
+  if [ "x${LIBPATH_SUFFIX}" != "x" ] ; then
+    case :${LIB_PATH}: in
+      ::: | *:${tool_lib}${LIBPATH_SUFFIX}:*) ;;
+      ::) LIB_PATH=${tool_lib}${LIBPATH_SUFFIX} ;;
+      *) LIB_PATH=${tool_lib}${LIBPATH_SUFFIX}:${LIB_PATH} ;;
+    esac
+  fi
 fi
 
 LIB_SEARCH_DIRS=`echo ${LIB_PATH} | sed -e 's/:/ /g' -e 's/\([^ ][^ ]*\)/SEARCH_DIR(\\"\1\\");/g'`

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