libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch for error during install due to relink. (repost)


From: Mo DeJong
Subject: Patch for error during install due to relink. (repost)
Date: Fri, 5 Oct 2001 12:52:59 -0700

Hi all.

There is a small bug in libtool that only seems to show up
when running an install command like so:

libtool --mode=install install -c  subdir/libdemo.la /tmp/demo/libdemo.la

This only happens when the relink_command inside the .la file
does a cd to some other directory. After the relink_command
is run the rest of the install will error out. This also
only seems to happen when one .la file depends on another
.la file. Here is some example error output:

libtool: install: warning: relinking `subdir/libdemo.la'
cd /home/mo/project/build/libtool_full_bug/subdir; /bin/sh ../libtool 
--mode=relink gcc -o libdemo.la -rpath 
/home/mo/project/build/libtool_full_bug/install/lib demo.lo -L. -lbug
gcc -shared  demo.lo  -Wl,--rpath 
-Wl,/home/mo/project/build/libtool_full_bug/install/lib  
-L/home/mo/project/build/libtool_full_bug/subdir 
-L/home/mo/project/build/libtool_full_bug/install/lib -lbug   -Wl,-soname 
-Wl,libdemo.so.0 -o .libs/libdemo.so.0.0.0
install -c subdir/.libs/libdemo.so.0.0.0T 
/home/mo/project/build/libtool_full_bug/install/lib/libdemo.so.0.0.0
install: subdir/.libs/libdemo.so.0.0.0T: No such file or directory


The relink command in the .la file might look like so:

relink_command="cd /usr/build/foo ; /bin/sh /usr/foo/libtool ..."

That makes the next install fail since the CWD will then be /usr/build/foo.
The fix is appended. It would also be great if this fix were added to
a 1.4.3 release at some point.

thanks
Mo


2001-10-05  Mo DeJong  <address@hidden>

        * ltmain.in: Place parens around a generated relink_command
        so it is run is a subshell. This avoids an install error
        where libtool ended up in the wrong directory after
        relinking a .la file.

Index: ltmain.in
===================================================================
RCS file: /cvs/libtool/ltmain.in,v
retrieving revision 1.278
diff -u -r1.278 ltmain.in
--- ltmain.in   2001/09/22 13:39:21     1.278
+++ ltmain.in   2001/09/23 21:19:39
@@ -4011,7 +4011,7 @@
            relink_command="$var=\"$var_value\"; export $var; $relink_command"
          fi
        done
-       relink_command="cd `pwd`; $relink_command"
+       relink_command="(cd `pwd`; $relink_command)"
        relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
       fi
 
@@ -4355,7 +4355,7 @@
        fi
       done
       # Quote the link command for shipping.
-      relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args"
+      relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args)"
       relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
 
       # Only create the output if not a dry run.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]