This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH] Fix SEARCH_DIR statements on multi-abi arches
- From: Jakub Jelinek <jakub at redhat dot com>
- To: binutils at sources dot redhat dot com
- Date: Thu, 6 Feb 2003 18:26:50 +0100
- Subject: [PATCH] Fix SEARCH_DIR statements on multi-abi arches
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
ATM I get on
Hammer something like:
SEARCH_DIR("/usr/x86_64-redhat-linux/lib"); SEARCH_DIR("/usr/lib6464");
SEARCH_DIR("/usr/local/lib64"); SEARCH_DIR("/lib64");
SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/lib64");
SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
Note the duplicates, wrong search order and bogus /usr/lib6464.
The following patch should fix this, so that I get the expected:
SEARCH_DIR("/usr/x86_64-redhat-linux/lib"); SEARCH_DIR("/usr/lib64");
SEARCH_DIR("/usr/local/lib64"); SEARCH_DIR("/lib64");
SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
Ok to commit?
2003-02-06 Jakub Jelinek <jakub@redhat.com>
* genscripts.sh (LIB_PATH): Don't append LIBPATH_SUFFIX to paths
which already have it. Avoid duplicates.
--- ld/genscripts.sh.jj 2003-01-08 10:02:41.000000000 -0500
+++ ld/genscripts.sh 2003-02-06 12:16:35.000000000 -0500
@@ -77,20 +77,37 @@ if [ "x${LIB_PATH}" = "x" ] && [ "x${USE
if [ x"$use_sysroot" != xyes ] ; then
LIB_PATH=${libdir}
fi
+ LIB_PATH2=""
for lib in ${NATIVE_LIB_DIRS}; do
# The "=" is harmless if we aren't using a sysroot, but also needless.
if [ "x${use_sysroot}" = "xyes" ] ; then
lib="=${lib}"
fi
- case :${LIB_PATH}: in
- *:${lib}:*) ;;
- ::) LIB_PATH=${lib} ;;
- *) LIB_PATH=${LIB_PATH}:${lib} ;;
+ addsuffix=
+ case "${LIBPATH_SUFFIX}:${lib}" in
+ :*) ;;
+ *:*${LIBPATH_SUFFIX}) ;;
+ *) addsuffix=yes ;;
esac
+ if test -n "$addsuffix"; then
+ case :${LIB_PATH}: in
+ *:${lib}${LIBPATH_SUFFIX}:*) ;;
+ ::) LIB_PATH=${lib}${LIBPATH_SUFFIX} ;;
+ *) LIB_PATH=${LIB_PATH}:${lib}${LIBPATH_SUFFIX} ;;
+ esac
+ case :${LIB_PATH}${LIB_PATH2}: in
+ *:${lib}:*) ;;
+ *) LIB_PATH2=${LIB_PATH2}:${lib} ;;
+ esac
+ else
+ case :${LIB_PATH}: in
+ *:${lib}:*) ;;
+ ::) LIB_PATH=${lib} ;;
+ *) LIB_PATH=${LIB_PATH}:${lib} ;;
+ esac
+ fi
done
- if test -n "$LIBPATH_SUFFIX" ; then
- LIB_PATH=`echo ${LIB_PATH}: | sed -e s,:,${LIBPATH_SUFFIX}:,g`$LIB_PATH
- fi
+ LIB_PATH=${LIB_PATH}${LIB_PATH2}
fi
Jakub