From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20912 invoked by alias); 14 Aug 2003 00:00:33 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 20895 invoked from network); 14 Aug 2003 00:00:32 -0000 Received: from unknown (HELO sccrmhc12.comcast.net) (204.127.202.56) by sources.redhat.com with SMTP; 14 Aug 2003 00:00:32 -0000 Received: from lucon.org ([12.234.88.5]) by comcast.net (sccrmhc12) with ESMTP id <2003081400003201200pvid1e>; Thu, 14 Aug 2003 00:00:32 +0000 Received: by lucon.org (Postfix, from userid 1000) id 0CCBF2C4EB; Thu, 14 Aug 2003 00:00:32 +0000 (UTC) Date: Thu, 14 Aug 2003 00:00:00 -0000 From: "H. J. Lu" To: binutils@sources.redhat.com Subject: PATCH: Add LIBPATH_SUFFIX for ${tool_lib} (take 2) Message-ID: <20030814000032.GA21724@lucon.org> References: <20030813225242.GA20434@lucon.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="liOOAslEiF7prFVr" Content-Disposition: inline In-Reply-To: <20030813225242.GA20434@lucon.org> User-Agent: Mutt/1.4.1i X-SW-Source: 2003-08/txt/msg00220.txt.bz2 --liOOAslEiF7prFVr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 504 On Wed, Aug 13, 2003 at 03:52:42PM -0700, H. J. Lu wrote: > We didn't add LIBPATH_SUFFIX for ${tool_lib}. As the result, we got > > SEARCH_DIR("/export/tools/ppc64-linux/lib"); > > This patch changed it to > > SEARCH_DIR("/export/tools/ppc64-linux/lib64"); SEARCH_DIR("/export/tools/ppc64-linux/lib"); > > > H.J. > 2003-08-13 H.J. Lu > > * genscripts.sh (LIB_PATH): Add LIBPATH_SUFFIX for ${tool_lib}. > This is wrong for native build. Here is an updated patch. H.J. --liOOAslEiF7prFVr Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ld-ml.patch" Content-length: 3387 2003-08-13 H.J. Lu * genscripts.sh (LIB_PATH): Add LIBPATH_SUFFIX for ${tool_lib}. --- ld/genscripts.sh.ml 2003-08-13 07:29:53.000000000 -0700 +++ ld/genscripts.sh 2003-08-13 16:57:15.000000000 -0700 @@ -73,58 +73,67 @@ fi # If the emulparams file set LIBPATH_SUFFIX, prepend an extra copy of # the library path with the suffix applied. +LIB_SEARCH_DIRS= if [ "x${LIB_PATH}" = "x" ] && [ "x${USE_LIBPATH}" = xyes ] ; then - LIB_PATH2= - if [ x"$use_sysroot" != xyes ] ; then - LIB_PATH2=${libdir} - fi 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 - addsuffix= - case "${LIBPATH_SUFFIX}:${lib}" in - :*) ;; - *:*${LIBPATH_SUFFIX}) ;; - *) addsuffix=yes ;; + case :${LIB_SEARCH_DIRS}: in + *:${lib}:*) ;; + ::) LIB_SEARCH_DIRS=${lib} ;; + *) LIB_SEARCH_DIRS=${LIB_SEARCH_DIRS}:${lib} ;; 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} ;; - *) LIB_PATH2=${LIB_PATH2}:${lib} ;; - esac - else - case :${LIB_PATH2}: in - *:${lib}:*) ;; - ::) LIB_PATH2=${lib} ;; - *) LIB_PATH2=${LIB_PATH2}:${lib} ;; - esac - fi done - case :${LIB_PATH}:${LIB_PATH2}: in - *:: | ::*) LIB_PATH=${LIB_PATH}${LIB_PATH2} ;; - *) LIB_PATH=${LIB_PATH}:${LIB_PATH2} ;; - esac + if [ "x${use_sysroot}" != "xyes" ] ; then + LIB_SEARCH_DIRS=${libdir}:${LIB_SEARCH_DIRS} + fi fi - # Always search $(tooldir)/lib, aka /usr/local/TARGET/lib, except for # sysrooted configurations and when LIBPATH=":". if [ "x${use_sysroot}" != "xyes" ] ; then - case :${LIB_PATH}: in - ::: | *:${tool_lib}:*) ;; - ::) LIB_PATH=${tool_lib} ;; - *) LIB_PATH=${tool_lib}:${LIB_PATH} ;; + case :${LIB_SEARCH_DIRS}: in + ::: | *:${tool_lib}:*) ;; + ::) LIB_SEARCH_DIRS=${tool_lib} ;; + *) LIB_SEARCH_DIRS=${tool_lib}:${LIB_SEARCH_DIRS} ;; esac fi +LIB_PATH2= +LIB_SEARCH_DIRS=`echo ${LIB_SEARCH_DIRS} | sed -e 's/:/ /g'` +for lib in ${LIB_SEARCH_DIRS}; do + # The "=" is harmless if we aren't using a sysroot, but also needless. + if [ "x${use_sysroot}" = "xyes" ] ; then + lib="=${lib}" + fi + 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} ;; + *) LIB_PATH2=${LIB_PATH2}:${lib} ;; + esac + else + case :${LIB_PATH2}: in + *:${lib}:*) ;; + ::) LIB_PATH2=${lib} ;; + *) LIB_PATH2=${LIB_PATH2}:${lib} ;; + esac + fi +done +case :${LIB_PATH}:${LIB_PATH2}: in + *:: | ::*) LIB_PATH=${LIB_PATH}${LIB_PATH2} ;; + *) LIB_PATH=${LIB_PATH}:${LIB_PATH2} ;; +esac + LIB_SEARCH_DIRS=`echo ${LIB_PATH} | sed -e 's/:/ /g' -e 's/\([^ ][^ ]*\)/SEARCH_DIR(\\"\1\\");/g'` # We need it for testsuite. --liOOAslEiF7prFVr--