On Sat, Jan 07, 2006 at 03:02:52AM -0800, Jacob Meuser wrote: > try the following.
since that patch works by checking if library search paths coincide with not-yet-installed library paths, it doesn't help when libtool relinks at install time, because then the libraries have been installed (into the fake dirs), and so their paths are not added to the not-yet-installed library path list ... but we probably don't want to relink libraries during fake install anyway. so, below is a new diff, which also sets the configuration parameter 'hardcode_automatic' to 'yes' for OpenBSD. this stops libtool from relinking libraries when they are installed. it also very slightly changes some other logic with regards to relinking at install time, but it doesn't really change anything, because we have already patched away the other logic that would make libtool relink binaries. hardcode_automatic only appears 3 times in libtool logic, so it's not too hard to see what this affects. a nice side effect of this patch is that fake is way faster now that there is no relinking done. I've tested this with about 100 ports on i386 now. build of infrastructure/plist/i386 under way, no issues yet. comments? -- <[EMAIL PROTECTED]> Index: devel/libtool/Makefile =================================================================== RCS file: /cvs/ports/devel/libtool/Makefile,v retrieving revision 1.52 diff -u -r1.52 Makefile --- devel/libtool/Makefile 7 Jan 2006 21:28:41 -0000 1.52 +++ devel/libtool/Makefile 9 Jan 2006 05:57:01 -0000 @@ -6,6 +6,7 @@ VERSION= 1.5.22 DISTNAME= libtool-${VERSION} +PKGNAME= ${DISTNAME}p0 PKGNAME-ltdl= libltdl-${VERSION}p1 SHARED_LIBS= ltdl 4.3 MODGNU_SHARED_LIBS= ltdl '-no-undefined' Index: devel/libtool/patches/patch-configure =================================================================== RCS file: /cvs/ports/devel/libtool/patches/patch-configure,v retrieving revision 1.3 diff -u -r1.3 patch-configure --- devel/libtool/patches/patch-configure 7 Jan 2006 09:58:39 -0000 1.3 +++ devel/libtool/patches/patch-configure 9 Jan 2006 05:56:19 -0000 @@ -1,7 +1,15 @@ $OpenBSD: patch-configure,v 1.3 2006/01/07 09:58:39 brad Exp $ ---- configure.orig Sun Dec 18 17:13:49 2005 -+++ configure Thu Jan 5 18:11:30 2006 -@@ -9282,6 +9282,13 @@ if test "$GCC" = yes; then +--- configure.orig Sun Dec 18 14:13:49 2005 ++++ configure Sun Jan 8 19:31:02 2006 +@@ -8991,6 +8991,7 @@ if test -z "$aix_libpath"; then aix_libp + + openbsd*) + hardcode_direct=yes ++ hardcode_automatic=yes + hardcode_shlibpath_var=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' +@@ -9282,6 +9283,13 @@ if test "$GCC" = yes; then else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi @@ -15,3 +23,27 @@ need_lib_prefix=unknown hardcode_into_libs=no +@@ -12215,6 +12223,7 @@ if test -z "$aix_libpath"; then aix_libp + ;; + openbsd*) + hardcode_direct_CXX=yes ++ hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=no + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' +@@ -15541,6 +15550,7 @@ if test -z "$aix_libpath"; then aix_libp + + openbsd*) + hardcode_direct_F77=yes ++ hardcode_automatic_F77=yes + hardcode_shlibpath_var_F77=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' +@@ -18143,6 +18153,7 @@ if test -z "$aix_libpath"; then aix_libp + + openbsd*) + hardcode_direct_GCJ=yes ++ hardcode_automatic_GCJ=yes + hardcode_shlibpath_var_GCJ=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' Index: devel/libtool/patches/patch-libtool_m4 =================================================================== RCS file: devel/libtool/patches/patch-libtool_m4 diff -N devel/libtool/patches/patch-libtool_m4 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ devel/libtool/patches/patch-libtool_m4 9 Jan 2006 05:56:19 -0000 @@ -0,0 +1,19 @@ +$OpenBSD$ +--- libtool.m4.orig Sun Jan 8 18:59:34 2006 ++++ libtool.m4 Sun Jan 8 18:59:51 2006 +@@ -3392,6 +3392,7 @@ case $host_os in + ;; + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes ++ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +@@ -6013,6 +6014,7 @@ _LT_EOF + + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes ++ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' Index: devel/libtool/patches/patch-ltmain_in =================================================================== RCS file: /cvs/ports/devel/libtool/patches/patch-ltmain_in,v retrieving revision 1.18 diff -u -r1.18 patch-ltmain_in --- devel/libtool/patches/patch-ltmain_in 7 Jan 2006 09:58:39 -0000 1.18 +++ devel/libtool/patches/patch-ltmain_in 9 Jan 2006 05:56:19 -0000 @@ -1,6 +1,6 @@ $OpenBSD: patch-ltmain_in,v 1.18 2006/01/07 09:58:39 brad Exp $ ---- ltmain.in.orig Thu Jan 5 18:24:18 2006 -+++ ltmain.in Thu Jan 5 18:25:53 2006 +--- ltmain.in.orig Sun Dec 18 13:43:52 2005 ++++ ltmain.in Sat Jan 7 02:38:20 2006 @@ -2073,6 +2073,17 @@ EOF ;; esac @@ -82,7 +82,135 @@ # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= -@@ -6257,40 +6275,6 @@ relink_command=\"$relink_command\"" +@@ -3807,33 +3825,44 @@ EOF + deplibs=$newdeplibs + fi + +- + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= +- for path in $notinst_path; do +- case " $new_libs " in +- *" -L$path/$objdir "*) ;; +- *) +- case " $deplibs " in +- *" -L$path/$objdir "*) +- new_libs="$new_libs -L$path/$objdir" ;; +- esac +- ;; +- esac +- done +- for deplib in $deplibs; do ++ notinst_libs= ++ for deplib in $deplibs ; do + case $deplib in +- -L*) +- case " $new_libs " in +- *" $deplib "*) ;; ++ -L*) ++ dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'` ++ # We need an absolute path. ++ case $dir in ++ [\\/]* | [A-Za-z]:[\\/]*) ;; ++ *) ++ absdir=`cd "$dir" && pwd` ++ if test -z "$absdir"; then ++ $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 ++ exit $EXIT_FAILURE ++ fi ++ dir="$absdir" ++ ;; ++ esac ++ case " $notinst_libs $new_libs " in ++ *" -L$dir "*) ;; ++ *) ++ case " $notinst_path " in ++ *" ${dir:%/$objdir} "*) ++ notinst_libs="$notinst_libs -L$dir" ++ ;; ++ *) ++ new_libs="$new_libs -L$dir" ++ ;; ++ esac ++ ;; ++ esac ++ ;; + *) new_libs="$new_libs $deplib" ;; +- esac +- ;; +- *) new_libs="$new_libs $deplib" ;; + esac + done +- deplibs="$new_libs" ++ deplibs="$notinst_libs $new_libs" + + + # All the library-specific variables (install_libdir is set above). +@@ -4355,31 +4384,42 @@ EOF + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= +- for path in $notinst_path; do +- case " $new_libs " in +- *" -L$path/$objdir "*) ;; +- *) +- case " $compile_deplibs " in +- *" -L$path/$objdir "*) +- new_libs="$new_libs -L$path/$objdir" ;; +- esac +- ;; +- esac +- done +- for deplib in $compile_deplibs; do ++ notinst_libs= ++ for deplib in $compile_deplibs ; do + case $deplib in +- -L*) +- case " $new_libs " in +- *" $deplib "*) ;; ++ -L*) ++ dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'` ++ # We need an absolute path. ++ case $dir in ++ [\\/]* | [A-Za-z]:[\\/]*) ;; ++ *) ++ absdir=`cd "$dir" && pwd` ++ if test -z "$absdir"; then ++ $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 ++ exit $EXIT_FAILURE ++ fi ++ dir="$absdir" ++ ;; ++ esac ++ case " $notinst_libs $new_libs " in ++ *" -L$dir "*) ;; ++ *) ++ case " $notinst_path " in ++ *" ${dir:%/$objdir} "*) ++ notinst_libs="$notinst_libs -L$dir" ++ ;; ++ *) ++ new_libs="$new_libs -L$dir" ++ ;; ++ esac ++ ;; ++ esac ++ ;; + *) new_libs="$new_libs $deplib" ;; +- esac +- ;; +- *) new_libs="$new_libs $deplib" ;; + esac + done +- compile_deplibs="$new_libs" ++ compile_deplibs="$notinst_libs $new_libs" + +- + compile_command="$compile_command $compile_deplibs" + finalize_command="$finalize_command $finalize_deplibs" + +@@ -6257,40 +6297,6 @@ relink_command=\"$relink_command\"" # Exit here if they wanted silent mode. test "$show" = : && exit $EXIT_SUCCESS