On OpenBSD, this: gcc -o prog /path/to/libfoo.so prog.o hardcodes `/path/to/libfoo.so' into DT_NEEDED of `prog'; it breaks the second DESTDIR test of CVS Libtool; and it means we should set hardcode_direct_absolute to yes, so -Wl,-rpath is instead used for installed libraries. Finally fixes the issue discussed in [1].
With this, the HEAD testsuite passes completely on OpenBSD 3.9, except for the issue discussed in [2], which I intend to fix by rewriting the test. OK to install? Cheers, and apologies for the huge delay, Ralf [1] http://lists.gnu.org/archive/html/libtool/2006-01/msg00090.html [2] http://lists.gnu.org/archive/html/libtool/2005-12/msg00075.html * libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG) [ openbsd ]: Set `hardcode_direct_absolute', to prefer rpath over putting absolute file names in NEEDED entries. * NEWS: Update. Reported by Jake Meuser and others. Index: NEWS =================================================================== RCS file: /cvsroot/libtool/libtool/NEWS,v retrieving revision 1.195 diff -u -r1.195 NEWS --- NEWS 25 Aug 2006 15:04:30 -0000 1.195 +++ NEWS 12 Sep 2006 19:20:18 -0000 @@ -67,6 +67,8 @@ * Improved support for linux-gnu/ia64. * Initial support for s390x-ibm-tpf. * Fixed some memory leaks in libltdl. +* Improved support for OpenBSD (use rpath instead of hardcoding absolute + file names). New in 1.9b: 2004-08-29; CVS version 1.5a, Libtool team: * The /^_?LT_[A-Z_]+$/ namespace is now reserved for Libtool's own macros. Index: libltdl/m4/libtool.m4 =================================================================== RCS file: /cvsroot/libtool/libtool/libltdl/m4/libtool.m4,v retrieving revision 1.82 diff -u -r1.82 libtool.m4 --- libltdl/m4/libtool.m4 25 Aug 2006 15:04:30 -0000 1.82 +++ libltdl/m4/libtool.m4 12 Sep 2006 19:20:21 -0000 @@ -4658,7 +4658,8 @@ openbsd*) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' @@ -5864,7 +5865,8 @@ openbsd*) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
