This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Add hppa*64* support to libtool in binutils


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]