[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: Incorrect PathName for $exported_symbols on Cygwin
From: |
Ralf Wildenhues |
Subject: |
FYI: Incorrect PathName for $exported_symbols on Cygwin |
Date: |
Thu, 3 Feb 2005 13:57:51 +0100 |
User-agent: |
Mutt/1.5.6+20040907i |
Hi Reid,
* Reid Spencer wrote on Fri, Dec 24, 2004 at 01:39:52AM CET:
>
> In building LLVM (http://llvm.cs.uiuc.edu/) on Cygwin, I noticed a
> problem with the following symptom from libtool (line 4332):
>
> eval:
> /proj/work/llvm/build/Debug/bin/.libs//proj/work/llvm/build/Debug/bin/lli.exe.exp:No
> such file or directory
>
> We only see this problem Cygwin. We know it doesn't occur on Linux,
> Darwin, Solaris, or FreeBSD. Not sure about other platforms.
Confirmed.
> The problem is that when we invoke libtool, we pass the entire path to
> libtool to be built, not just the filename. The libtool script is is
> using $output_objdir/$output.exp to formulate the name of a temporary
> file for the exported symbols. However, the script does not ensure that
> all intermediate directories are created. Instead of creating them, I
> figured the file should be named $output_objdir/$outputname.exp instead.
> The following patch makes that change.
The patch was reversed, as I had already noted some time before.
Now I actually managed to reproduce this failure, and thus convince
myself that your patch was correct (when applied in reverse).
However, you could not possibly have exerciced the second code path
(the `else' branch). Because it's broken.
Guess what: It's been broken ever since revision 1.127 of ltmain.in,
which dates back to 1999/03/11. :)))
To hit it, do the following:
- be on cygwin
- have args `-dlopen self -export-symbols expsymsfile'
- link a program
To see where it actually makes a difference, you additionally need to
- have an old-style object `foo.o' on the command line.
To detect the fix in the patch below: look at the spaces in the sed
script. :)
FYI: I'm checking in the following patch (yes, eventually there will be
a test case for this) on branch-1-5. The other ones need a non-trivial
forward-port.
Cheers,
Ralf
2005-02-03 Reid Spencer <address@hidden>,
Ralf Wildenhues <address@hidden>
* ltmain.in (link mode) [cygwin]: Fix broken subdir path
computation, exposed by using `-dlopen self'. Fix broken sed
script exposed by additionally using `-export-symbols FILE'.
Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/ltmain.in,v
retrieving revision 1.334.2.54
diff -u -r1.334.2.54 ltmain.in
--- ltmain.in 3 Feb 2005 03:53:07 -0000 1.334.2.54
+++ ltmain.in 3 Feb 2005 12:54:41 -0000
@@ -4364,12 +4364,12 @@
# Prepare the list of exported symbols
if test -z "$export_symbols"; then
- export_symbols="$output_objdir/$output.exp"
+ export_symbols="$output_objdir/$outputname.exp"
$run $rm $export_symbols
$run eval "${SED} -n -e '/^: @address@hidden/d' -e 's/^.*
\(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
else
- $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e
's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
- $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" >
"$nlist"T'
+ $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e
's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+ $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" >
"$nlist"T'
$run eval 'mv "$nlist"T "$nlist"'
fi
fi
- FYI: Incorrect PathName for $exported_symbols on Cygwin,
Ralf Wildenhues <=