* PATCH: Add LIBPATH_SUFFIX for ${tool_lib}. @ 2003-08-13 22:52 H. J. Lu 2003-08-14 0:00 ` PATCH: Add LIBPATH_SUFFIX for ${tool_lib} (take 2) H. J. Lu 2003-08-14 0:07 ` PATCH: Add LIBPATH_SUFFIX for ${tool_lib} Alan Modra 0 siblings, 2 replies; 7+ messages in thread From: H. J. Lu @ 2003-08-13 22:52 UTC (permalink / raw) To: binutils [-- Attachment #1: Type: text/plain, Size: 240 bytes --] 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. [-- Attachment #2: ld-ml.patch --] [-- Type: text/plain, Size: 1309 bytes --] 2003-08-13 H.J. Lu <hongjiu.lu@intel.com> * 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 15:50:20.000000000 -0700 @@ -123,6 +123,41 @@ if [ "x${use_sysroot}" != "xyes" ] ; the ::) LIB_PATH=${tool_lib} ;; *) LIB_PATH=${tool_lib}:${LIB_PATH} ;; esac + LIB_SEARCH_DIRS=`echo ${LIB_PATH} | sed -e 's/:/ /g'` + LIB_PATH= + LIB_PATH2= + for lib in ${LIB_SEARCH_DIRS}; do + 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_PATH2=${lib} + ;; + *) + LIB_PATH=${LIB_PATH}:${lib}${LIBPATH_SUFFIX} + 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 fi LIB_SEARCH_DIRS=`echo ${LIB_PATH} | sed -e 's/:/ /g' -e 's/\([^ ][^ ]*\)/SEARCH_DIR(\\"\1\\");/g'` ^ permalink raw reply [flat|nested] 7+ messages in thread
* PATCH: Add LIBPATH_SUFFIX for ${tool_lib} (take 2) 2003-08-13 22:52 PATCH: Add LIBPATH_SUFFIX for ${tool_lib} H. J. Lu @ 2003-08-14 0:00 ` H. J. Lu 2003-08-14 0:07 ` PATCH: Add LIBPATH_SUFFIX for ${tool_lib} Alan Modra 1 sibling, 0 replies; 7+ messages in thread From: H. J. Lu @ 2003-08-14 0:00 UTC (permalink / raw) To: binutils [-- Attachment #1: Type: text/plain, Size: 504 bytes --] 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 <hongjiu.lu@intel.com> > > * genscripts.sh (LIB_PATH): Add LIBPATH_SUFFIX for ${tool_lib}. > This is wrong for native build. Here is an updated patch. H.J. [-- Attachment #2: ld-ml.patch --] [-- Type: text/plain, Size: 3387 bytes --] 2003-08-13 H.J. Lu <hongjiu.lu@intel.com> * 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. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PATCH: Add LIBPATH_SUFFIX for ${tool_lib}. 2003-08-13 22:52 PATCH: Add LIBPATH_SUFFIX for ${tool_lib} H. J. Lu 2003-08-14 0:00 ` PATCH: Add LIBPATH_SUFFIX for ${tool_lib} (take 2) H. J. Lu @ 2003-08-14 0:07 ` Alan Modra 2003-08-14 0:20 ` H. J. Lu 1 sibling, 1 reply; 7+ messages in thread From: Alan Modra @ 2003-08-14 0:07 UTC (permalink / raw) To: H. J. Lu; +Cc: binutils 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"); I think this would be wrong. By adding a /lib64 version of ${tooldir}/lib you seem to be inferring that ${tooldir}/lib is now for 32 bit libraries. -- Alan Modra IBM OzLabs - Linux Technology Centre ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PATCH: Add LIBPATH_SUFFIX for ${tool_lib}. 2003-08-14 0:07 ` PATCH: Add LIBPATH_SUFFIX for ${tool_lib} Alan Modra @ 2003-08-14 0:20 ` H. J. Lu 2003-08-14 0:54 ` Alan Modra 0 siblings, 1 reply; 7+ messages in thread From: H. J. Lu @ 2003-08-14 0:20 UTC (permalink / raw) To: binutils On Thu, Aug 14, 2003 at 09:37:02AM +0930, Alan Modra wrote: > 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"); > > I think this would be wrong. By adding a /lib64 version of > ${tooldir}/lib you seem to be inferring that ${tooldir}/lib is now for > 32 bit libraries. Isn't that true? When you configure binutils with ..../configure --target=ppc64-linux --prefix=/export/tools where are 32 bit libraries? where are 64bit libraries? H.J. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PATCH: Add LIBPATH_SUFFIX for ${tool_lib}. 2003-08-14 0:20 ` H. J. Lu @ 2003-08-14 0:54 ` Alan Modra 2003-08-14 1:02 ` H. J. Lu 0 siblings, 1 reply; 7+ messages in thread From: Alan Modra @ 2003-08-14 0:54 UTC (permalink / raw) To: H. J. Lu; +Cc: binutils On Wed, Aug 13, 2003 at 05:20:02PM -0700, H. J. Lu wrote: > On Thu, Aug 14, 2003 at 09:37:02AM +0930, Alan Modra wrote: > > 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"); > > > > I think this would be wrong. By adding a /lib64 version of > > ${tooldir}/lib you seem to be inferring that ${tooldir}/lib is now for > > 32 bit libraries. > > Isn't that true? When you configure binutils with > > ..../configure --target=ppc64-linux --prefix=/export/tools > > where are 32 bit libraries? where are 64bit libraries? In /export/tools/lib, /export/tools/lib64 and so on. ie. in the normal system lib dirs. I'm very nervous about changing the meaning of ${tooldir}/lib without some serious thought as to the consequences. Also, to achieve anything, you'll need to change a whole lot of other tools, eg. gcc, that know that $prefix/$target/* contain headers and libs for $target. -- Alan Modra IBM OzLabs - Linux Technology Centre ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PATCH: Add LIBPATH_SUFFIX for ${tool_lib}. 2003-08-14 0:54 ` Alan Modra @ 2003-08-14 1:02 ` H. J. Lu 2003-08-14 1:34 ` Alan Modra 0 siblings, 1 reply; 7+ messages in thread From: H. J. Lu @ 2003-08-14 1:02 UTC (permalink / raw) To: binutils On Thu, Aug 14, 2003 at 10:20:20AM +0930, Alan Modra wrote: > On Wed, Aug 13, 2003 at 05:20:02PM -0700, H. J. Lu wrote: > > On Thu, Aug 14, 2003 at 09:37:02AM +0930, Alan Modra wrote: > > > 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"); > > > > > > I think this would be wrong. By adding a /lib64 version of > > > ${tooldir}/lib you seem to be inferring that ${tooldir}/lib is now for > > > 32 bit libraries. > > > > Isn't that true? When you configure binutils with > > > > ..../configure --target=ppc64-linux --prefix=/export/tools > > > > where are 32 bit libraries? where are 64bit libraries? > > In /export/tools/lib, /export/tools/lib64 and so on. ie. in the normal > system lib dirs. I thought /export/tools/lib was for host, not target. The current cross linker won't even look at /export/tools/lib. > > I'm very nervous about changing the meaning of ${tooldir}/lib without > some serious thought as to the consequences. Also, to achieve anything, > you'll need to change a whole lot of other tools, eg. gcc, that know > that $prefix/$target/* contain headers and libs for $target. How does one setup a 32/64 bit cross compiler? H.J. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PATCH: Add LIBPATH_SUFFIX for ${tool_lib}. 2003-08-14 1:02 ` H. J. Lu @ 2003-08-14 1:34 ` Alan Modra 0 siblings, 0 replies; 7+ messages in thread From: Alan Modra @ 2003-08-14 1:34 UTC (permalink / raw) To: H. J. Lu; +Cc: binutils On Wed, Aug 13, 2003 at 06:02:36PM -0700, H. J. Lu wrote: > I thought /export/tools/lib was for host, not target. The current > cross linker won't even look at /export/tools/lib. Yes, you're right. > How does one setup a 32/64 bit cross compiler? --with-sysroot. -- Alan Modra IBM OzLabs - Linux Technology Centre ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2003-08-14 1:34 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2003-08-13 22:52 PATCH: Add LIBPATH_SUFFIX for ${tool_lib} H. J. Lu 2003-08-14 0:00 ` PATCH: Add LIBPATH_SUFFIX for ${tool_lib} (take 2) H. J. Lu 2003-08-14 0:07 ` PATCH: Add LIBPATH_SUFFIX for ${tool_lib} Alan Modra 2003-08-14 0:20 ` H. J. Lu 2003-08-14 0:54 ` Alan Modra 2003-08-14 1:02 ` H. J. Lu 2003-08-14 1:34 ` Alan Modra
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).