[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: hppa*64* and dependent libraries
From: |
Albert Chin |
Subject: |
Re: hppa*64* and dependent libraries |
Date: |
Thu, 19 Dec 2002 16:56:16 -0600 |
User-agent: |
Mutt/1.4i |
On Thu, Dec 19, 2002 at 03:13:13PM -0500, John David Anglin wrote:
> > I agree that we should use +b to embed the path. Is everyone else in
> > agreement?
>
> What about the alternative "-L" and "-l" approach which ia64 uses and
> I adopted in my original patch? I tried to stay away from using "+b".
> Maybe I am missing something but the package which I have built seem
> to have a reasonable embedded path. For example,
I integrated your -L patch and get the following with libpng-1.2.4:
...
/bin/sh ./libtool --mode=link cc +DD64 +O2 +ESlit +Onofltacc
+Oentrysched +Odataprefetch +Onolimit
-L/opt/TWWfsw/zlib11/lib/pa20_64 -o libpng.la -rpath
/opt/TWWfsw/libpng12/lib/pa20_64 -version-info 2:2:0 -module png.lo
pngerror.lo pngget.lo pngmem.lo pngpread.lo pngrio.lo pngread.lo
pngrtran.lo pngrutil.lo pngset.lo pngtrans.lo pngwio.lo pngwrite.lo
pngwtran.lo pngwutil.lo -lz -lm
rm -fr .libs/libpng.la .libs/libpng.* .libs/libpng.*
/usr/ccs/bin/ld -b +h libpng.sl.2 -o .libs/libpng.sl.2.2 png.o
pngerror.o pngget.o pngmem.o pngpread.o pngrio.o pngread.o pngrtran.o
pngrutil.o pngset.o pngtrans.o pngwio.o pngwrite.o pngwtran.o
pngwutil.o -L/opt/TWWfsw/zlib11/lib/pa20_64
-L/opt/TWWfsw/zlib11/lib/pa20_64 -L/opt/TWWfsw/zlib11/lib/pa20_64
/opt/TWWfsw/zlib11/lib/pa20_64/libz.sl -lm -lc
(cd .libs && rm -f libpng.sl.2 && ln -s libpng.sl.2.2 libpng.sl.2)
(cd .libs && rm -f libpng.sl && ln -s libpng.sl.2.2 libpng.sl)
ar cru .libs/libpng.a png.o pngerror.o pngget.o pngmem.o pngpread.o
pngrio.o pngread.o pngrtran.o pngrutil.o pngset.o pngtrans.o pngwio.o
pngwrite.o pngwtran.o pngwutil.o
...
$ elfdump -L .libs/libnpg.sl | grep Rpath
4 Rpath
/opt/TWWfsw/zlib11/lib/pa20_64:/opt/TWWfsw/zlib11/lib/pa20_64:/opt/TWWfsw/zlib11/lib/pa20_64
Ick!
What I really like about +b is that it makes it explicit. The big
advantage of -L is that it is additive whereas +b is not (i.e. +b /a
+b /b => +b /b, where you want /a:/b). However, libtool will add in
the necessary `:' but if someone has LDFLAGS="-Wl,+b,/path", then
/path won't be in the colon-separated path built by libtool.
Below is the patch against 1.4 with your -L addition.
--
albert chin (address@hidden)
-- snip snip
Index: libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/libtool.m4,v
retrieving revision 1.166.2.45
diff -u -3 -p -r1.166.2.45 libtool.m4
--- libtool.m4 11 Oct 2002 16:06:07 -0000 1.166.2.45
+++ libtool.m4 19 Dec 2002 22:50:39 -0000
@@ -910,7 +910,14 @@ AC_CACHE_VAL(lt_cv_prog_cc_pic,
# Is there a better lt_cv_prog_cc_static that works with the bundled CC?
lt_cv_prog_cc_wl='-Wl,'
lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
- lt_cv_prog_cc_pic='+Z'
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_cv_prog_cc_pic='+Z'
+ ;;
+ esac
;;
irix5* | irix6* | nonstopux*)
@@ -1627,23 +1634,43 @@ else
hpux9* | hpux10* | hpux11*)
case $host_os in
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' ;;
+ *)
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ *)
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs
$deplibs $linker_flags'
+ ;;
+ esac
+ ;;
+ esac
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ hardcode_into_libs=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ *)
+ export_dynamic_flag_spec='${wl}-E'
+ 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
+ ;;
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'
;;
irix5* | irix6* | nonstopux*)
if test "$GCC" = yes; then
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname
${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring`
${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
else
archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname
$soname `test -n "$verstring" && echo -set_version $verstring` -update_registry
${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='-rpath $libdir'
fi
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
link_all_deplibs=yes
;;
@@ -2122,12 +2150,21 @@ hpux9* | hpux10* | hpux11*)
version_type=sunos
need_lib_prefix=no
need_version=no
- 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'
# HP-UX runs *really* slowly unless shared libraries are mode 555.
postinstall_cmds='chmod 555 $lib'
+ case "$host_cpu" in
+ hppa*64*)
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ esac
;;
irix5* | irix6* | nonstopux*)
@@ -3370,9 +3409,17 @@ gnu*)
;;
hpux10.20*|hpux11*)
- 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
+ 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
+ ;;
+ *)
+ [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_test_file=/usr/lib/libc.sl
+ ;;
+ esac
;;
irix5* | irix6* | nonstopux*)