diff --git a/ChangeLog b/ChangeLog index b01a42f..4999ea3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2009-05-26 Michael Haubenwallner + + Fix DESTDIR install for hppa-hpux10 and hppa-hpux11. + * libltdl/m4/libtool.m4: Set hardcode_into_libs=yes. + Set hardcode_minus_L back to 'no', as the stored path only is used as + fallback when the library is not found via runpath. + Do not set runpath with "+b $install_libdir", as this would ignore the + collected runpath subsequently set with "+b $libdir". + Set hardcode_libdir_flag_spec_ld along direct use of $LD only (hpux10). + * tests/demo-hardcode.test: Try 'chatr' to read hardcoded paths, to allow + for filtering out library paths being used as fallback. + 2009-05-05 Rainer Emrich (tiny change) Peter Rosin Ralf Wildenhues diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4 index 8af17a8..df64654 100644 --- a/libltdl/m4/libtool.m4 +++ b/libltdl/m4/libtool.m4 @@ -2316,6 +2316,9 @@ hpux9* | hpux10* | hpux11*) ;; *) shrext_cmds='.sl' + case $host_os in hpux9*) ;; + *) hardcode_into_libs=yes ;; + esac dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH @@ -4713,20 +4716,20 @@ _LT_EOF hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else - _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=no fi ;; @@ -4740,7 +4743,7 @@ _LT_EOF _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac else @@ -4757,9 +4760,9 @@ _LT_EOF # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], - [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi @@ -4779,7 +4782,7 @@ _LT_EOF # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=no ;; esac fi @@ -5714,7 +5717,7 @@ if test "$_lt_caught_CXX_error" != yes; then *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + _LT_TAGVAR(hardcode_minus_L, $1)=no # Not in the search PATH, # but as the default # location of the library. ;; @@ -5734,7 +5737,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists @@ -5758,7 +5761,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi diff --git a/tests/demo-hardcode.test b/tests/demo-hardcode.test index 31b2e1d..da6a96d 100755 --- a/tests/demo-hardcode.test +++ b/tests/demo-hardcode.test @@ -39,6 +39,7 @@ func_make "hardcode" # Extra tools we might need : ${DUMPSTABS=dumpstabs} +: ${CHATR=chatr} # Suck in all the hardcode_* variable settings. func_msg "Finding libtool.m4's guesses at hardcoding values" @@ -70,11 +71,30 @@ for file in hc-*; do # Discover whether the objdir really was hardcoded. hardcoded=no + # hppa-hpux (SOM) stores the path of a shared library as found + # at linktime in the 'shared library list' of the resulting binary. + # When the type of such an entry is 'static', the runpath is ignored + # for that library. If the type is 'dynamic', the runpath is used, + # and we have to ignore that line when searching for hardcoded paths. + # For hppa64-hpux (ELF) and ia64-hpux (ELF), 'chatr' does not tell whether + # the shared library location is 'static' or 'dynamic', as the path + # component is not stored anyway when the library was found via '-L'. + # Additionally, aCC/cc store commandline and other information used to + # create object files into these (as 'ccom options', 'driver_command'), + # which may also lead to false positives when using 'cat'. + if { $CHATR $file ;} >/dev/null 2>&1; then + if $CHATR $file 2>/dev/null \ + | $SED -n -e '/shared library dynamic path search/,/shared library binding/ {/^[ ]*dynamic/!p;}' \ + | $FGREP "$objdir" >/dev/null 2>&1; then + hardcoded=yes + else + hardcoded=no + fi # Solaris cc may store the command line in a debugging section, # which leads to false positives. Unfortunately, Solaris strip # is not capable to remove the section (unlike GNU binutils strip). # So we use dumpstabs if it seems to work. - if { $DUMPSTABS -d $file; } >/dev/null 2>&1; then + elif { $DUMPSTABS -d $file; } >/dev/null 2>&1; then if $DUMPSTABS -d $file 2>/dev/null | $FGREP "$objdir" >/dev/null 2>&1; then hardcoded=yes else