Re: export_symbols_cmds erroneously expanded

2007-01-28 Thread Ralf Wildenhues
Hello Charles,

* Charles Wilson wrote on Fri, Dec 15, 2006 at 02:07:43AM CET:
 On Tue, 12 Dec 2006 01:03:41 +0100, Ralf Wildenhues
 [EMAIL PROTECTED] said:
 
  Please try this patch.

  * libtool.m4 (AC_LIBTOOL_PROG_LD_SHLIBS) [ cygwin, mingw ]
  export_symbols_cmds: Avoid shell expansion of '/s/.*' through
  double expansion, in case there is a 'S:' drive.
  Report by Charles Wilson.
 
 Yep, that fixes the problem too: tested on both cygwin and mingw.

Thanks, and sorry for the delay.  I inserted another [[ ]] before the /d
and applied the following to branch-1-5 and HEAD, respectively.

Cheers,
Ralf

HEAD:
2007-01-28  Ralf Wildenhues  [EMAIL PROTECTED]

* libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS) [ cygwin, mingw ]
export_symbols_cmds: Avoid shell expansion of '/s/.*' through
double expansion, in case there is a 'S:' drive.
Report by Charles Wilson.

Index: libltdl/m4/libtool.m4
===
RCS file: /cvsroot/libtool/libtool/libltdl/m4/libtool.m4,v
retrieving revision 1.87
diff -u -r1.87 libtool.m4
--- libltdl/m4/libtool.m4   21 Jan 2007 16:15:36 -  1.87
+++ libltdl/m4/libtool.m4   28 Jan 2007 12:54:19 -
@@ -3988,7 +3988,7 @@
 _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
   ;;
   cygwin* | mingw*)
-_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* 
__nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' 
| sort | uniq  $export_symbols'
+_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 
DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ 
]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq  $export_symbols'
   ;;
   *)
 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq  $export_symbols'
@@ -4130,7 +4130,7 @@
   _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
   _LT_TAGVAR(always_export_symbols, $1)=no
   _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | 
$SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq  $export_symbols'
+  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 
DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq  
$export_symbols'
 
   if $LD --help 21 | $GREP 'auto-import'  /dev/null; then
 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs 
$compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base 
-Xlinker --out-implib -Xlinker $lib'


branch-1-5:
2007-01-28  Ralf Wildenhues  [EMAIL PROTECTED]

* libtool.m4 (AC_LIBTOOL_PROG_LD_SHLIBS) [ cygwin, mingw ]
export_symbols_cmds: Avoid shell expansion of '/s/.*' through
double expansion, in case there is a 'S:' drive.
Report by Charles Wilson.

Index: libtool.m4
===
RCS file: /cvsroot/libtool/libtool/Attic/libtool.m4,v
retrieving revision 1.314.2.167
diff -u -r1.314.2.167 libtool.m4
--- libtool.m4  21 Jan 2007 16:16:05 -  1.314.2.167
+++ libtool.m4  28 Jan 2007 12:54:48 -
@@ -5490,7 +5490,7 @@
 _LT_AC_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
   ;;
   cygwin* | mingw*)
-_LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* 
__nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' 
| sort | uniq  $export_symbols'
+_LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 
DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ 
]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq  $export_symbols'
   ;;
   *)
 _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq  $export_symbols'
@@ -5629,7 +5629,7 @@
   _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
   _LT_AC_TAGVAR(always_export_symbols, $1)=no
   _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | 
$SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq  $export_symbols'
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 
DATA/'\'' -e 

Re: export_symbols_cmds erroneously expanded

2007-01-28 Thread Ralf Wildenhues
Hello Charles,

* Charles Wilson wrote on Fri, Dec 15, 2006 at 02:07:43AM CET:
 On Tue, 12 Dec 2006 01:03:41 +0100, Ralf Wildenhues
 [EMAIL PROTECTED] said:
 
  Please try this patch.

  * libtool.m4 (AC_LIBTOOL_PROG_LD_SHLIBS) [ cygwin, mingw ]
  export_symbols_cmds: Avoid shell expansion of '/s/.*' through
  double expansion, in case there is a 'S:' drive.
  Report by Charles Wilson.
 
 Yep, that fixes the problem too: tested on both cygwin and mingw.

Thanks, and sorry for the delay.  I inserted another [[ ]] before the /d
and applied the following to branch-1-5 and HEAD, respectively.

Cheers,
Ralf

HEAD:
2007-01-28  Ralf Wildenhues  [EMAIL PROTECTED]

* libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS) [ cygwin, mingw ]
export_symbols_cmds: Avoid shell expansion of '/s/.*' through
double expansion, in case there is a 'S:' drive.
Report by Charles Wilson.

Index: libltdl/m4/libtool.m4
===
RCS file: /cvsroot/libtool/libtool/libltdl/m4/libtool.m4,v
retrieving revision 1.87
diff -u -r1.87 libtool.m4
--- libltdl/m4/libtool.m4   21 Jan 2007 16:15:36 -  1.87
+++ libltdl/m4/libtool.m4   28 Jan 2007 12:54:19 -
@@ -3988,7 +3988,7 @@
 _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
   ;;
   cygwin* | mingw*)
-_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* 
__nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' 
| sort | uniq  $export_symbols'
+_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 
DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ 
]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq  $export_symbols'
   ;;
   *)
 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq  $export_symbols'
@@ -4130,7 +4130,7 @@
   _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
   _LT_TAGVAR(always_export_symbols, $1)=no
   _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | 
$SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq  $export_symbols'
+  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 
DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq  
$export_symbols'
 
   if $LD --help 21 | $GREP 'auto-import'  /dev/null; then
 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs 
$compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base 
-Xlinker --out-implib -Xlinker $lib'


branch-1-5:
2007-01-28  Ralf Wildenhues  [EMAIL PROTECTED]

* libtool.m4 (AC_LIBTOOL_PROG_LD_SHLIBS) [ cygwin, mingw ]
export_symbols_cmds: Avoid shell expansion of '/s/.*' through
double expansion, in case there is a 'S:' drive.
Report by Charles Wilson.

Index: libtool.m4
===
RCS file: /cvsroot/libtool/libtool/Attic/libtool.m4,v
retrieving revision 1.314.2.167
diff -u -r1.314.2.167 libtool.m4
--- libtool.m4  21 Jan 2007 16:16:05 -  1.314.2.167
+++ libtool.m4  28 Jan 2007 12:54:48 -
@@ -5490,7 +5490,7 @@
 _LT_AC_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
   ;;
   cygwin* | mingw*)
-_LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* 
__nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' 
| sort | uniq  $export_symbols'
+_LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 
DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ 
]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq  $export_symbols'
   ;;
   *)
 _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq  $export_symbols'
@@ -5629,7 +5629,7 @@
   _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
   _LT_AC_TAGVAR(always_export_symbols, $1)=no
   _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | 
$SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq  $export_symbols'
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 
DATA/'\'' -e 

Re: export_symbols_cmds erroneously expanded

2006-12-14 Thread Charles Wilson

On Tue, 12 Dec 2006 01:03:41 +0100, Ralf Wildenhues
[EMAIL PROTECTED] said:

 Please try this patch.
 
 Cheers,
 Ralf
 
   * libtool.m4 (AC_LIBTOOL_PROG_LD_SHLIBS) [ cygwin, mingw ]
 export_symbols_cmds: Avoid shell expansion of '/s/.*' through
 double expansion, in case there is a 'S:' drive.
 Report by Charles Wilson.

Yep, that fixes the problem too: tested on both cygwin and mingw.

--
Chuck



___
http://lists.gnu.org/mailman/listinfo/libtool


Re: export_symbols_cmds erroneously expanded

2006-12-11 Thread Ralf Wildenhues
Hello Charles,

Thanks for the bug report.

* Charles Wilson wrote on Mon, Dec 11, 2006 at 06:17:38PM CET:
 When building pcre (which uses libtool --export-symbols-regex) I get the
 following error (libtool cvs branch 1.5, 20061014 checkout):
 
 /bin/sh ./libtool --mode=link gcc -export-symbols-regex '^[^_]'  -I.
 -I/c/msys/1.0/local/src/pcre/cygports/pcre-6.7-1/src/pcre-6.7 -rpath
 /usr/lib -no-undefined -version-info \
[...]
 .libs/pcre_valid_utf8.o .libs/pcre_version.o .libs/pcre_xclass.o  | sed
 -n -e 's/^.*[   ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ 
 ]*_\([_A-Za-z][_A-Za-z0-9]*\)$/\1 _\2 \2/p' | /usr/bin/sed -e
 '/^[BCDGRS] /s/. /s/.. \([^ ]*\)/\1 DATA/' | /usr/bin/sed -e '/^[AITW]
 /s/. /s/.. //' | sort | uniq  .libs/libpcre.exp
 /usr/bin/sed: -e expression #1, char 20: unknown option to `s'
 /usr/bin/sed: -e expression #1, char 18: unknown option to `s'
 /usr/bin/grep -E -e ^[^_] .libs/libpcre.exp  .libs/libpcre.expT

 # The commands to list exported symbols.
 export_filter=sed -e '/^[BCDGRS] /s/.* \\([^ ]*\\)/\\1 DATA/' | sed -e
 '/^[AITW] /s/.* //'
 export_symbols_cmds=\$NM \$libobjs \$convenience | \$global_symbol_pipe
 | \$export_filter | sort | uniq  \$export_symbols

The above looks like a cleaner approach to me than the second one you
offer; but it means we'd need to change the definition of
export_symbols_cmds for each and every system, not just Cygin/MinGW.
(There is no need for two sed scripts here, by the way, one would be
just fine.)

Another thing that worries me is I'm pretty certain the use of
export_symbols_cmds in the too-many-objects case will cause another,
differently-looking failure.  IOW, tests for both use cases are needed.

I can look into this in a couple of days probably.

 There's also the (uglier, but less invasive -- doesn't require a new
 _LT_TAG_VAR for each tag):
 
 # The commands to list exported symbols.
 export_symbols_cmds=DOTSTAR='.*'~\$NM \$libobjs \$convenience |
 \$global_symbol_pipe | \$SED -e '/^[BCDGRS] /s/\$DOTSTAR ([^
 ]*)/1 DATA/' | \$SED -e '/^[AITW] /s/\$DOTSTAR //' | sort | uniq
  \$export_symbols

Cheers,
Ralf


___
http://lists.gnu.org/mailman/listinfo/libtool


Re: export_symbols_cmds erroneously expanded

2006-12-11 Thread Charles Wilson

On Mon, 11 Dec 2006 18:36:56 +0100, Ralf Wildenhues
[EMAIL PROTECTED] said:
 Hello Charles,
 
 Thanks for the bug report.
 
  [[ bug report and export_filter variable fix snipped ]]

 The above looks like a cleaner approach to me than the second one you
 offer; but it means we'd need to change the definition of
 export_symbols_cmds for each and every system, not just Cygin/MinGW.

Yes, I figured that.  I believe it would also be true for the other
solution, as well.  The problem is we need to expand *part* of cmd, but
not *all* of it -- and this is true on every system and every tag,
including the default definition of export_symbols_cmds.

 (There is no need for two sed scripts here, by the way, one would be
 just fine.)

That particular expression is already written as two sed invokations;
merging to one invokation would be fine, but since that's not germane to
the problem here I didn't bother.

 Another thing that worries me is I'm pretty certain the use of
 export_symbols_cmds in the too-many-objects case will cause another,
 differently-looking failure.  IOW, tests for both use cases are needed.

You're probably right.

 I can look into this in a couple of days probably.

Cool -- I'd appreciate your efforts [*].  I'm going to go ahead, for
cygwin, and do a quickie release of 'libtool1.5-1.5.23a-2' (still branch
1.5, still 20061014 checkout) but with your --version patch
(http://lists.gnu.org/archive/html/libtool/2006-12/msg00015.html) and
the quick-n-dirty DOTSTAR fix for this bug assuming it passes the
testsuite (as well as 1.5.23a-1 did).  [Why? Cause it works, and I
personally need a properly symbol-exported pcre Right Now...]

[*] I'm a bit daunted by the prospect of adding a new LT_TAG_VAR
variable -- I'm not sure what all the ramifications are and I'm afraid
I'll miss some fiddly little but critically necessary item to 'make it
all work' -- which is why I'm happy to leave this to an expert.  But
I'll be glad to test any patch you generate...

Then I'll update cygwin's official release to a new -D date on branch
1.5 with your changes.

Cruddy DOTSTAR patch attached

--
Chuck
diff -urN origsrc/libtool/libtool.m4 src/libtool/libtool.m4 src/libtool/libtool.m4
--- origsrc/libtool/libtool.m4	2006-08-25 11:04:54.0 -0400
+++ src/libtool/libtool.m4	2006-12-11 12:22:29.921833600 -0500
@@ -5440,7 +5440,7 @@
 AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
 [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
 ifelse([$1],[CXX],[
-  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq  $export_symbols'
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='DOTSTAR='\''.*'\''~$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/$DOTSTAR //'\'' | sort | uniq  $export_symbols'
   case $host_os in
   aix4* | aix5*)
 # If we're using GNU nm, then we don't want the -C option.
@@ -5455,10 +5455,10 @@
 _LT_AC_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
   ;;
   cygwin* | mingw*)
-_LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq  $export_symbols'
+_LT_AC_TAGVAR(export_symbols_cmds, $1)='DOTSTAR='\''.*'\''~$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/$DOTSTAR \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^$DOTSTAR __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/$DOTSTAR //'\'' | sort | uniq  $export_symbols'
   ;;
   *)
-_LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq  $export_symbols'
+_LT_AC_TAGVAR(export_symbols_cmds, $1)='DOTSTAR='\''.*'\''~$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/$DOTSTAR //'\'' | sort | uniq  $export_symbols'
   ;;
   esac
 ],[
@@ -5483,7 +5483,7 @@
   _LT_AC_TAGVAR(module_cmds, $1)=
   _LT_AC_TAGVAR(module_expsym_cmds, $1)=
   _LT_AC_TAGVAR(always_export_symbols, $1)=no
-  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq  $export_symbols'
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='DOTSTAR='\''.*'\''~$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/$DOTSTAR //'\'' | sort | uniq  $export_symbols'
   # include_expsyms should be a list of space-separated symbols to be *always*
   # included in the symbol list
   _LT_AC_TAGVAR(include_expsyms, $1)=
@@ -5594,7 +5594,7 @@
   _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
   _LT_AC_TAGVAR(always_export_symbols, $1)=no
   _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq  $export_symbols'
+  

Re: export_symbols_cmds erroneously expanded

2006-12-11 Thread Ralf Wildenhues
* Charles Wilson wrote on Mon, Dec 11, 2006 at 06:58:56PM CET:
 On Mon, 11 Dec 2006 18:36:56 +0100, Ralf Wildenhues said:
  
   [[ bug report and export_filter variable fix snipped ]]
 
  The above looks like a cleaner approach to me than the second one you
  offer; but it means we'd need to change the definition of
  export_symbols_cmds for each and every system, not just Cygin/MinGW.
 
 Yes, I figured that.  I believe it would also be true for the other
 solution, as well.  The problem is we need to expand *part* of cmd, but
 not *all* of it -- and this is true on every system and every tag,
 including the default definition of export_symbols_cmds.

Or we need to make sure the extra expansion does not matter.
Arguably, this is a hack, but in practice it may be enough for now.
I had to create a directory /s to expose the bug -- do you have an
S: drive?

Please try this patch.

Cheers,
Ralf

* libtool.m4 (AC_LIBTOOL_PROG_LD_SHLIBS) [ cygwin, mingw ]
export_symbols_cmds: Avoid shell expansion of '/s/.*' through
double expansion, in case there is a 'S:' drive.
Report by Charles Wilson.

Index: libtool.m4
===
RCS file: /cvsroot/libtool/libtool/Attic/libtool.m4,v
retrieving revision 1.314.2.166
diff -u -r1.314.2.166 libtool.m4
--- libtool.m4  19 Oct 2006 05:05:55 -  1.314.2.166
+++ libtool.m4  11 Dec 2006 23:59:40 -
@@ -5490,7 +5490,7 @@
 _LT_AC_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
   ;;
   cygwin* | mingw*)
-_LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* 
__nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' 
| sort | uniq  $export_symbols'
+_LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 
DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I 
/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq  $export_symbols'
   ;;
   *)
 _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq  $export_symbols'
@@ -5629,7 +5629,7 @@
   _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
   _LT_AC_TAGVAR(always_export_symbols, $1)=no
   _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | 
$SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq  $export_symbols'
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 
DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq  
$export_symbols'
 
   if $LD --help 21 | grep 'auto-import'  /dev/null; then
 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs 
$compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base 
-Xlinker --out-implib -Xlinker $lib'


___
http://lists.gnu.org/mailman/listinfo/libtool


Re: export_symbols_cmds erroneously expanded

2006-12-11 Thread Charles Wilson

On Tue, 12 Dec 2006 01:03:41 +0100, Ralf Wildenhues said
 Or we need to make sure the extra expansion does not matter.
 Arguably, this is a hack, but in practice it may be enough for now.
 I had to create a directory /s to expose the bug -- do you have an
 S: drive?

Hmm.  As a matter of fact, I do.  On cygwin, I guess you'd only see this
problem if you've explicitly done

$ mkdir /s
$ mount opts S: /s

(which I have)

or

$ mount --change-cygdrive-prefix /

(which I have not)

However, you'd always get this bug under MSys/mingw.

 
 Please try this patch.

Ookay, but: you're still expanding the value of cmd.  You're just
hoping that, for $PLATFORM, the value of export_symbols_cmds contains
nothing that might expand to a directory/file list on the current
machine.  E.g. on unix, if there were an 's' directory in the root /,
you'd also need some version of the patch below -- but in a different
spot in libtool.m4.

Anyway, testing will have to wait a few hours.

--
Chuck


___
http://lists.gnu.org/mailman/listinfo/libtool