public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] elf64_sparc default search dirs
@ 1999-07-05  8:57 Jakub Jelinek
  1999-07-08 16:44 ` Richard Henderson
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 1999-07-05  8:57 UTC (permalink / raw)
  To: binutils

Hi!

This patch sets the default SEARCH_DIR for elf64_sparc on sparc*-linux* and
sparc*-solaris*. On Linux to /lib64, /usr/lib64 etc. style of paths, on
Solaris to /lib/sparcv9/, /usr/lib/sparcv9/ style of paths.
Without it, users cannot link even simple 64bit binaries unless they use
-rpath explicitely.

1999-07-05  Jakub Jelinek  <jj@ultra.linux.cz>

	ld/emulparams/elf64_sparc.sh: Set LIB_PATH on sparc*-linux*
	and sparc*-solaris* to 64bit libraries locations.

--- ld/emulparams/elf64_sparc.sh.jj	Thu Apr 22 10:15:45 1999
+++ ld/emulparams/elf64_sparc.sh	Fri Jun  4 15:54:28 1999
@@ -10,3 +10,31 @@
 DATA_PLT=
 GENERATE_SHLIB_SCRIPT=yes
 NOP=0x01000000
+if [ "x${host}" = "x${target}" ] ; then
+  # Native
+  case "$target" in
+    sparc*-linux*)
+      SPARC_ELF64_SUFFIX=64 ;;
+    sparc*-solaris*)
+      SPARC_ELF64_SUFFIX=/sparcv9 ;;
+  esac
+fi
+if [ -n "${SPARC_ELF64_SUFFIX}" ]; then
+  LIB_PATH=/lib${SPARC_ELF64_SUFFIX}:/lib:/usr/lib${SPARC_ELF64_SUFFIX}:/usr/lib
+  if [ "x${DEFAULT_EMULATION}" = "x${EMULATION_NAME}" ] ; then
+    if [ -n "${NATIVE_LIB_DIRS}" ]; then
+      LIB_PATH=${LIB_PATH}:`echo ${NATIVE_LIB_DIRS} | sed 's_/lib\(\|/\)$_/lib'${SPARC_ELF64_SUFFIX}_`
+    fi
+    if [ "${libdir}" != /usr/lib -a "${libdir}" != /usr/lib${SPARC_ELF64_SUFFIX} ]; then
+      LIB_PATH=${LIB_PATH}:`echo ${libdir} | sed 's_/lib\(\|/\)$_/lib'${SPARC_ELF64_SUFFIX}_`
+    fi
+    if [ "${libdir}" != /usr/local/lib -a "${libdir}" != /usr/local/lib${SPARC_ELF64_SUFFIX} ]; then
+      LIB_PATH=${LIB_PATH}:/usr/local/lib${SPARC_ELF64_SUFFIX}:/usr/local/lib
+    fi
+  else
+    LIB_PATH=${LIB_PATH}:/usr/local/lib${SPARC_ELF64_SUFFIX}:/usr/local/lib
+  fi
+  if [ "x${DEFAULT_EMULATION}" = "xelf32_sparc" ]; then
+    COMPILE_IN=true
+  fi
+fi

Cheers,
    Jakub
___________________________________________________________________
Jakub Jelinek | jj@sunsite.mff.cuni.cz | http://sunsite.mff.cuni.cz
Administrator of SunSITE Czech Republic, MFF, Charles University
___________________________________________________________________
UltraLinux  |  http://ultra.linux.cz/  |  http://ultra.penguin.cz/
Linux version 2.2.10 on a sparc64 machine (1343.49 BogoMips)
___________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] elf64_sparc default search dirs
  1999-07-05  8:57 [PATCH] elf64_sparc default search dirs Jakub Jelinek
@ 1999-07-08 16:44 ` Richard Henderson
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 1999-07-08 16:44 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: binutils

On Mon, Jul 05, 1999 at 05:58:34PM +0200, Jakub Jelinek wrote:
>
> +  if [ "x${DEFAULT_EMULATION}" = "x${EMULATION_NAME}" ] ; then

Please update from cvs more often.  This wouldn't have worked anymore,
since DEFAULT_EMULATION is now replaced in favour of EMULATION_LIBPATH
so that ppc-linux can have two `default' emulations.

> +    if [ -n "${NATIVE_LIB_DIRS}" ]; then
> +      LIB_PATH=${LIB_PATH}:`echo ${NATIVE_LIB_DIRS} | sed 's_/lib\(\|/\)$_/lib'${SPARC_ELF64_SUFFIX}_`
> +    fi

Is all this seding really necessary?  Did you forget to add in 
an unadorned ${NATIVE_LIB_DIRS}, or what that intentional?

Does the following work for you?


r~



Index: emulparams/elf64_sparc.sh
===================================================================
RCS file: /cvs/binutils/binutils/ld/emulparams/elf64_sparc.sh,v
retrieving revision 1.1.1.1
diff -c -p -d -r1.1.1.1 elf64_sparc.sh
*** elf64_sparc.sh	1999/05/03 07:29:07	1.1.1.1
--- elf64_sparc.sh	1999/07/08 23:41:15
*************** MACHINE=
*** 10,12 ****
--- 10,46 ----
  DATA_PLT=
  GENERATE_SHLIB_SCRIPT=yes
  NOP=0x01000000
+ 
+ if [ "x${host}" = "x${target}" ]; then
+   case " $EMULATION_LIBPATH " in
+     *" ${EMULATION_NAME} "*)
+       # Native, and default or emulation requesting LIB_PATH.
+ 
+       # Linux and Solaris modify the default library search path
+       # to first include a 64-bit specific directory.  It's put
+       # in slightly different places on the two systems.
+       case "$target" in
+         sparc*-linux*)
+           suffix=64 ;;
+         sparc*-solaris*)
+           suffix=/sparcv9 ;;
+       esac
+ 
+       if [ -n "${suffix}" ]; then
+ 
+ 	LIB_PATH=/lib${suffix}:/lib
+ 	LIB_PATH=${LIB_PATH}:/usr/lib${suffix}:/usr/lib
+ 	if [ -n "${NATIVE_LIB_DIRS}" ]; then
+ 	  LIB_PATH=${LIB_PATH}:${NATIVE_LIB_DIRS}${suffix}:${NATIVE_LIB_DIRS}
+ 	fi
+ 	if [ "${libdir}" != /usr/lib ]; then
+ 	  LIB_PATH=${LIB_PATH}:${libdir}${suffix}:${libdir}
+ 	fi
+ 	if [ "${libdir}" != /usr/local/lib ]; then
+ 	  LIB_PATH=${LIB_PATH}:/usr/local/lib${suffix}:/usr/local/lib
+ 	fi
+ 
+       fi
+     ;;
+   esac
+ fi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-07-08 16:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-05  8:57 [PATCH] elf64_sparc default search dirs Jakub Jelinek
1999-07-08 16:44 ` Richard Henderson

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).