public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "John David Anglin" <dave@hiauly1.hia.nrc.ca>
To: binutils@sources.redhat.com, gcc-patches@gcc.gnu.org
Cc: aoliva@redhat.com, sje@cup.hp.com
Subject: Add hppa*64* support to libtool in binutils
Date: Tue, 09 Jul 2002 11:16:00 -0000	[thread overview]
Message-ID: <200207091733.g69HX6jG008421@hiauly1.hia.nrc.ca> (raw)

This is a first cut at adding hppa64 support to libtool in binutils.
The same needs to done in gcc and in the libtool source.  Unfortunately,
the binutils and gcc sources are somewhat out of sync, so it seems
separate patches will be needed in each case.

Basically, it appears the capabilities of the ia64 and hppa64 linkers
are very similar.  The only differences appear to be the library
locations and the file magic needed for detecting shared libraries.

There are some differences between the ia64 implementation and the
hppa64 proposed here.  The ia64 defines in ltcf-cxx.sh look suspect
to me.  It seems defines appropriate to the 32-bit SOM linker are
being used.

I have revised sys_lib_search_path_spec and sys_lib_dlsearch_path_spec
for the 32-bit SOM linker.  I added /usr/ccs/lib and removed /usr/local/lib
from sys_lib_search_path_spec.  The is some question as to whether
we need /lib as it is normally a link to /usr/lib under hpux10 and 11.
I left it because I think it was a separate directory under hpux9.
The define for sys_lib_dlsearch_path_spec reflects the documented
behavior for dld.sl.

The hpux11 dynamic loader uses LD_LIBRARY_PATH, SHLIB_PATH and
the embedded patch in that order when searching dynamically for
shared libraries.  The code here sets shlibpath_var to LD_LIBRARY_PATH
for hppa*64*.  SHLIB_PATH isn't being checked but I was wondering
if there was a way to add this somehow.

I have tested this patch with several binutils builds under
hppa64-hp-hpux11.00 with --enable-shared shared.  I have built gcc
with the resulting tools.  The basic approach was derived from a
hack to libtool in the gettext package which involves building a
number of shared libraries with dependent libraries.  This testing
was done using the GNU linker.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

2002-07-09  John David Anglin  <dave@hiauly1.hia.nrc.ca>

	* libtool.m4 (hpux10.20*|hpux11*): Add lt_cv_deplibs_check_method and
	lt_cv_file_magic_test_file defines for hppa*64*.
	* ltcf-c.sh (hpux9* | hpux10* | hpux11*): Add hardcode_direct,
	hardcode_shlibpath_var and hardcode_libdir_flag_spec defines for
	hppa*64*.
	* ltcf-cxx.sh (hpux*): Likewise.
	* ltcf-gcj.sh (hpux9* | hpux10* | hpux11*): Likewise.
	* ltconfig (hpux9* | hpux10* | hpux11*): Add dynamic_linker,
	shlibpath_var, shlibpath_overrides_runpath, library_names_spec,
	soname_spec, sys_lib_search_path_spec and sys_lib_dlsearch_path_spec
	for hppa*64*.  Update default values for sys_lib_search_path_spec and
	sys_lib_dlsearch_path_spec.

Index: libtool.m4
===================================================================
RCS file: /cvs/src/src/libtool.m4,v
retrieving revision 1.8
diff -u -3 -p -r1.8 libtool.m4
--- libtool.m4	28 Jan 2002 04:59:30 -0000	1.8
+++ libtool.m4	7 Jul 2002 18:16:03 -0000
@@ -584,15 +584,18 @@ gnu*)
   ;;
 
 hpux10.20*|hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
   case $host_cpu in
+  hppa*64*)
+    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
   hppa*)
     [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library']
-    lt_cv_file_magic_cmd=/usr/bin/file
     lt_cv_file_magic_test_file=/usr/lib/libc.sl
     ;;
   ia64*)
     [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64']
-    lt_cv_file_magic_cmd=/usr/bin/file
     lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
     ;;
   esac
Index: ltcf-c.sh
===================================================================
RCS file: /cvs/src/src/ltcf-c.sh,v
retrieving revision 1.11
diff -u -3 -p -r1.11 ltcf-c.sh
--- ltcf-c.sh	28 Jan 2002 04:59:30 -0000	1.11
+++ ltcf-c.sh	7 Jul 2002 18:16:03 -0000
@@ -422,7 +422,8 @@ else
       hardcode_direct=no
       hardcode_shlibpath_var=no
       archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec='-L$libdir' ;;
+      hardcode_libdir_flag_spec='-L$libdir'
+      ;;
     *)
       if test $with_gcc = yes; then
         case "$host_os" in
@@ -435,14 +436,23 @@ else
         *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
         esac
       fi
-      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-      hardcode_libdir_separator=:
-      hardcode_minus_L=yes # Not in the search PATH, but as the default
-			   # location of the library.
+      case "$host_cpu" in
+      hppa*64*)
+	hardcode_direct=no
+	hardcode_shlibpath_var=no
+	hardcode_libdir_flag_spec='-L$libdir'
+	;;
+      *)
+	hardcode_direct=yes
+	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator=:
+	hardcode_minus_L=yes # Not in the search PATH, but as the default
+			     # location of the library.
+	export_dynamic_flag_spec='${wl}-E'
+	;;
+      esac
       ;;
     esac
-    export_dynamic_flag_spec='${wl}-E'
-    hardcode_direct=yes
     ;;
 
   irix5* | irix6*)
Index: ltcf-cxx.sh
===================================================================
RCS file: /cvs/src/src/ltcf-cxx.sh,v
retrieving revision 1.13
diff -u -3 -p -r1.13 ltcf-cxx.sh
--- ltcf-cxx.sh	4 Jul 2002 22:51:16 -0000	1.13
+++ ltcf-cxx.sh	7 Jul 2002 18:16:03 -0000
@@ -252,17 +252,29 @@ case $host_os in
     if test $with_gnu_ld = no; then
       case "$host_cpu" in
 	ia64*)
+	  hardcode_direct=yes
 	  hardcode_libdir_flag_spec='-L$libdir'
-	  hardcode_shlibpath_var=no ;;
+	  hardcode_shlibpath_var=no
+	  hardcode_libdir_separator=:
+	  export_dynamic_flag_spec='${wl}-E'
+	  hardcode_minus_L=yes # Not in the search PATH, but as the default
+			       # location of the library.
+	  ;;
+	hppa*64*)
+	  hardcode_direct=no
+	  hardcode_libdir_flag_spec='-L$libdir'
+	  hardcode_shlibpath_var=no
+	  ;;
 	*)
-	  hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' ;;
+	  hardcode_direct=yes
+	  hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_separator=:
+	  export_dynamic_flag_spec='${wl}-E'
+	  hardcode_minus_L=yes # Not in the search PATH, but as the default
+			       # location of the library.
+	  ;;
       esac
-      hardcode_direct=yes
-      hardcode_libdir_separator=:
-      export_dynamic_flag_spec='${wl}-E'
     fi
-    hardcode_minus_L=yes # Not in the search PATH, but as the default
-			 # location of the library.
 
     case $cc_basename in
       CC)
Index: ltcf-gcj.sh
===================================================================
RCS file: /cvs/src/src/ltcf-gcj.sh,v
retrieving revision 1.8
diff -u -3 -p -r1.8 ltcf-gcj.sh
--- ltcf-gcj.sh	14 Nov 2001 06:24:41 -0000	1.8
+++ ltcf-gcj.sh	7 Jul 2002 18:16:03 -0000
@@ -414,12 +414,21 @@ else
     hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
     *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
     esac
-    hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-    hardcode_libdir_separator=:
-    hardcode_direct=yes
-    hardcode_minus_L=yes # Not in the search PATH, but as the default
-			 # location of the library.
-    export_dynamic_flag_spec='${wl}-E'
+    case "$host_cpu" in
+    hppa*64*)
+      hardcode_direct=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='-L$libdir'
+      ;;
+    *)
+      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_direct=yes
+      hardcode_minus_L=yes # Not in the search PATH, but as the default
+			   # location of the library.
+      export_dynamic_flag_spec='${wl}-E'
+      ;;
+    esac
     ;;
 
   irix5* | irix6*)
Index: ltconfig
===================================================================
RCS file: /cvs/src/src/ltconfig,v
retrieving revision 1.16
diff -u -3 -p -r1.16 ltconfig
--- ltconfig	28 Jan 2002 04:59:30 -0000	1.16
+++ ltconfig	7 Jul 2002 18:16:04 -0000
@@ -1173,12 +1173,23 @@ hpux9* | hpux10* | hpux11*)
     fi
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
+  hppa*64*)
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH?
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
+    soname_spec='${libname}${release}.sl$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
   *)
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
     library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
     soname_spec='${libname}${release}.sl$major'
+    sys_lib_search_path_spec="/lib /usr/lib /usr/ccs/lib"
+    sys_lib_dlsearch_path_spec="/usr/lib /usr/ccs/lib"
     ;;
   esac
   # HP-UX runs *really* slowly unless shared libraries are mode 555.

             reply	other threads:[~2002-07-09 17:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-09 11:16 John David Anglin [this message]
2002-07-10 14:40 Steve Ellcey
2002-07-10 15:22 ` John David Anglin
2002-07-15  9:51 Steve Ellcey
2002-07-15 10:25 ` John David Anglin
2002-07-15 19:28 ` Loren James Rittle
2002-07-29  4:17 ross.alexander
2002-07-29 14:07 ` John David Anglin
2002-08-12 10:46 ` Jeff Law
2002-08-13  8:54 ross.alexander
2002-08-13  9:40 ` John David Anglin
2002-08-13 10:42   ` Jeff Law
2002-08-13 11:39     ` John David Anglin
2002-08-14  8:09       ` Jeff Law
2002-08-14 10:52         ` John David Anglin
2002-08-13 13:07     ` John David Anglin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200207091733.g69HX6jG008421@hiauly1.hia.nrc.ca \
    --to=dave@hiauly1.hia.nrc.ca \
    --cc=aoliva@redhat.com \
    --cc=binutils@sources.redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=sje@cup.hp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).