Re: [patch #6448] [MSVC 7/7] Add MSVC Support

2008-08-05 Thread Brian Dessent
Peter Rosin wrote:

 Ah, ok. That's bad. The misleading name i586-mingw32msvc-gcc caught
 me. Again. What in the world is msvc doing in there?

I believe this is to denote that it defaults to the MSVCRT runtime, as
opposed to the very old CRTDLL one, which the MinGW toolchain still
provides components for:

startup object for executable:
   crt1.o (CRTDLL) vs. crt2.o (MSVCRT)
startup object for shared library:
   dllcrt1.o (CRTDLL) vs. dllcrt2.o (MSVCRT)
import lib for runtime:
   libcrtdll.a vs. libmsvcrt.a
lib supplying aliases of common ANSI functions without underscores:
   libcoldname.a vs. libmoldname.a

So I guess they are just being explicit in their target name so that if
they ever wanted or needed to offer a toolchain that defaults to CRTDLL
it would not clash.  Not that I can imagine anyone wanting that.

Brian




Re: [patch #6448] [MSVC 7/7] Add MSVC Support

2008-08-05 Thread Peter Rosin

Peter Rosin skrev:

Attached, I'll work through all the failures to try to find out why
they fail...


  16: duplicate_conv.at:25 duplicate convenience archive names
MS link doesn't have reloadable objects (i.e. like ld -r).

  24: link-order.at:26   Link order test.
Exporting int c variable.

  25: link-order2.at:46  Link order of deplibs.
Don't know. Should defbindir=`pwd`/lib be defbindir=`pwd`/bin in
link-order2.at? Maybe the MSVC fixup of -L options is too coarse?

  29: static.at:68   static linking flags for programs
m-all-static.exe.manifest isn't installed

  30: static.at:357  ccache -all-static
cl.exe spews out a banner on stderr which isn't [ignore]d

  31: export.at:25   Export test
Exporting variables.

  37: localization.at:25 localized compiler messages
CR in stdout and CR/NL in expected-stdout

  39: destdir.at:48  Simple DESTDIR install
m.exe.manifest isn't installed

  40: destdir.at:75  DESTDIR with in-package deplibs
m.exe.manifest isn't installed

  46: lt_dladvise.at:28  lt_dlopenadvise library loading
-avoid-version causes the names of the import lib and the static
lib to be the same. But something elseTM also seems bad...

  47: need_lib_prefix.at:25 enforced lib prefix
-avoid-version problem from 46, but also needs -no-undefined.

  72: stresstest.at:31   Link option thorough search test
Automatic path conversion in MSYS doesn't kick in for the argument
-OUT:/some/absolute/path so lib.exe barfs.

  73: cmdline_wrap.at:28 Run tests with low max_cmd_len
I just ran out of steam...

Cheers,
Peter




Re: [patch #6448] [MSVC 7/7] Add MSVC Support

2008-08-05 Thread Ralf Wildenhues
* Peter Rosin wrote on Tue, Aug 05, 2008 at 10:38:14AM CEST:
 Peter Rosin skrev:
 Attached, I'll work through all the failures to try to find out why
 they fail...

   16: duplicate_conv.at:25 duplicate convenience archive names
 MS link doesn't have reloadable objects (i.e. like ld -r).

Should be fixed by at-file support I hope.

   25: link-order2.at:46  Link order of deplibs.
 Don't know. Should defbindir=`pwd`/lib be defbindir=`pwd`/bin in
 link-order2.at? Maybe the MSVC fixup of -L options is too coarse?

Forget about this failure for now.  The link-order tests all suffer a
bit from being too system-specific.

   29: static.at:68   static linking flags for programs
 m-all-static.exe.manifest isn't installed

What does the manifest file do?

   30: static.at:357  ccache -all-static
 cl.exe spews out a banner on stderr which isn't [ignore]d

I think that banner should just be ignored.

   46: lt_dladvise.at:28  lt_dlopenadvise library loading
 -avoid-version causes the names of the import lib and the static
 lib to be the same. But something elseTM also seems bad...

Several issues:
- the test is somewhat broken (also on other systems)
- maybe we need to forbid enabling both static and shared at the same
  time

   47: need_lib_prefix.at:25 enforced lib prefix
 -avoid-version problem from 46, but also needs -no-undefined.

Sigh.

   72: stresstest.at:31   Link option thorough search test
 Automatic path conversion in MSYS doesn't kick in for the argument
 -OUT:/some/absolute/path so lib.exe barfs.

Not the biggest problem.

   73: cmdline_wrap.at:28 Run tests with low max_cmd_len
 I just ran out of steam...

That's where I hope most of the failures are either
- failing for the same reason the non-low test is failing,
- and/or fixed with at-file support.

Please try the patch below for simplistic at-file support with $NM.
While testing, I set nm_file_list_spec to '@' and always_export_symbols
to yes on GNU/Linux, and saw no test failure, probably because my nm
also understands '@'.  :-)
(IOW, we could enable that for when 'nm --help' lists @FILE.)

Probably the setting of nm_file_list_spec should be moved to where $NM
is set; not sure, as this is actually a Windows feature, not a $NM one.

Cheers,
Ralf

2008-08-05  Ralf Wildenhues  [EMAIL PROTECTED]

* libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS) nm_file_list_spec:
New tag variable.
[ cygwin, mingw, cegcc ] cl*: Set to '@'.
(_LT_LANG_CXX_CONFIG): Likewise.
* libltdl/config/ltmain.m4sh (func_mode_link): When
nm_file_list_spec is nonempty, use it to avoid skipped_export.

diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 35ae02f..29f7fba 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -6613,14 +6613,30 @@ EOF
$opt_dry_run || $RM $export_symbols
cmds=$export_symbols_cmds
save_ifs=$IFS; IFS='~'
-   for cmd in $cmds; do
+   for cmd1 in $cmds; do
  IFS=$save_ifs
- eval cmd=\$cmd\
+ eval cmd=\$cmd1\
  func_len  $cmd
  len=$func_len_result
  if test $len -lt $max_cmd_len || test $max_cmd_len -le -1; 
then
func_show_eval $cmd 'exit $?'
skipped_export=false
+ elif test -n $nm_file_list_spec; then
+   output_la=`$ECHO X$output | $Xsed -e $basename`
+   save_libobjs=$libobjs
+   save_output=$output
+   output=${output_objdir}/${output_la}.nm
+   libobjs=$nm_file_list_spec$output
+   delfiles=$delfiles $output
+   func_verbose creating $NM input file list: $output
+   for obj in $save_libobjs; do
+ $ECHO $obj
+   done  $output
+   eval cmd=\$cmd1\
+   func_show_eval $cmd 'exit $?'
+   output=$save_output
+   libobjs=$save_libobjs
+   skipped_export=false
  else
# The command line is too long to execute in one step.
func_verbose using reloadable object file for export list...
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 37c0f71..c8b29ce 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -4785,6 +4785,7 @@ _LT_EOF
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_TAGVAR(always_export_symbols, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='@'
+   _LT_TAGVAR(nm_file_list_spec, $1)='@'
# Tell ltmain to make .lib files, not .a files.
libext=lib
# Tell ltmain to make .dll files, not .so files.
@@ -5358,6 +5359,8 @@ _LT_TAGDECL([], [prelink_cmds], [2],
 [Commands necessary for linking programs (against libraries) with 
templates])
 _LT_TAGDECL([], [file_list_spec], [1],
 [Specify filename containing input files])
+_LT_DECL([], [nm_file_list_spec], [1],
+[Specify filename containing input