testsuite performance (was: [PATCH] [cygwin|mingw] Fix compile warnings when -std=c89.)

2009-01-22 Thread Ralf Wildenhues
* Charles Wilson wrote on Wed, Jan 21, 2009 at 08:47:42PM CET:
 [...] EVERY separate patchset requires an independent full testsuite
 run.  Until recently, that was 5 hours of sitting in front of my
 computer waiting for popups, while that computer was completely useless
 for anything else (100% cpu).

That is horrible.  May I ask what kind of CPU you have, and which Cygwin
version?  Can you work on a Linux system with Wine, for at least those
changes for which the difference shouldn't matter that much?  Can you
work on a GCC cfarm system for those tests where Cygwin isn't a premium,
and ask the people running the mingw-w64 system for an account to test
there?

FWIW, on a two-way system here, the Libtool testsuite finishes in a
little less than 6 minutes.  However that is a bit cheated, as it uses
parallel Autotest (from git Autoconf) and as yet unpublished parallel
Automake TESTS (yes I need to clean up patches for Automake and Libtool
and publish them).  On a GCC compile farm 8-way I think I brought the
test suite below a minute at one time, when excluding stress test and
low max_cmd_len test.  These two tests need to be split up and/or moved
earlier in the suite in order to allow for better parallelism.

Cheers,
Ralf




Re: [PATCH] [cygwin|mingw] Fix compile warnings when -std=c89.

2009-01-22 Thread Charles Wilson
Charles Wilson wrote:

 The bits removed from this commit are attached as
 cygwin-cwrapper-cleanups.patch.

Will start a new thread with these cleanups.

--
Chuck





Re: [PATCH] [cygwin|mingw] Fix compile warnings when -std=c89.

2009-01-21 Thread Charles Wilson
Peter Rosin wrote:
 Den 2009-01-16 15:15 skrev Charles Wilson:
 Charles Wilson wrote:
 Charles Wilson wrote:
 * libltdl/config/ltmain.m4sh: Update copyright date.
 (func_emit_wrapper_part1): move contents to...
 (func_emit_wrapper_part2): move contents to...
 (func_emit_wrapper): here.
 (func_emit_cwrapperexe_src) [file scope]: re-organized
 includes and portability macros. Avoid oldnames on MINGW32
 and MSVC for setmode/stat/chmod/getcwd/putenv. Declare
 _putenv on MINGW32 when -ansi. Use namespaced macro
 LT_DEBUGWRAPPER. Remove variables script_text_part1 and
 script_text_part2.
 (func_emit_cwrapperexe_src) [lt_dump_script]: New function.
 (func_emit_cwrapperexe_src) [main]: Call it.
 Ping?

 Ping x 2?
 
 I tried this patch on the pr-msvc-support branch and it seems
 to work just fine there as well (tested with MSVC 2005).

Thanks, Peter; your validation on msvc is useful and encouraging.  Now
I'm just waiting for a go/no-go from one of the four libtool
maintainers: Gary Vaughan, Peter O'Gorman, Ralf Wildenhues, or Bob
Friesenhahn.

Status:
This patch was successfully tested by Roumen Petrov (on master,
unix-mingw cross)
http://lists.gnu.org/archive/html/libtool-patches/2009-01/msg00012.html
and by Peter Rosin (on pr-msvc-support branch, msys/msvc2005 native)
http://lists.gnu.org/archive/html/libtool-patches/2009-01/msg00060.html
-- and me, msys/mingw native
http://lists.gnu.org/archive/html/libtool-patches/2009-01/msg5.html

--
Chuck




Re: [PATCH] [cygwin|mingw] Fix compile warnings when -std=c89.

2009-01-21 Thread Ralf Wildenhues
* Charles Wilson wrote on Wed, Jan 21, 2009 at 08:47:42PM CET:
 Ralf Wildenhues wrote:
  I am very sorry that reviewing takes so long.  Mostly this is due to
  time constraints on my side.
 
 On the plus side, your reviews are usually insightful, and lead to ideas
 for better code, like the libfile_$(transliterated implib name) thing.

Thanks.

  You can make things easier by splitting them into logically independent
  (hopefully small) pieces.  I acknowledge that some of your other patches
  may not be splittable further.
 
 Part of my tendency to include minor -- easy to review -- changes with
 larger ones is due to (a) see it, fix it, otherwise it'll be forgotten
 and (b) EVERY separate patchset requires an independent full testsuite
 run.

Ah, ok.  I can feel the pain.  Let's relieve that a wee bit, without
compromising quality too much:
(a) can be addressed with git.  Really, git's is flexible enough to
allow for doing many many small commits, even ugly ones, and cleaning up
afterwards.  AIUI git is available for Cygwin and MinGW.
(b) There is no need for full testsuite runs for every patch.  If two
patches are clearly independent, then one run with both of them should
suffice.  If you have a (not too huge) patch series, where things belong
together, and the end point passes the testsuite, then while that is not
ideal, it is still a lot better than nothing; in that case, please note
this, and we can still ask for results of intermediate states if
necessary.

 Not fun. And I don't get many blocks of 5 hours to waste listening for
 the Windows Popup Alert sound.  This has little to do with any delays in
 reviewing -- but does tend to make the reviewing process harder. And
 take longer.  Which means more !...@#$ testsuite runs. It's a vicious
 cycle, honestly.

I can feel the pain.

 Recent improvements in cygwin-1.7 have once again tamed the popup
 problem on vista -- so at least I don't have to personally attend each
 testsuite run. It's still 5 hours of useless computer tho.

Good.

 MinGW/Msys native test runs are still an exercise in whack-a-mole with
 the popups.

Which however makes testsuite additions all the more important: that
way, at least, when we run the suite before a release, we can find
potential regressions.  Think of testsuite additions as a way to shift
some of the testing grunt work from yourself over to other users.

 Actually, for 2.4 I think the cwrapper should no longer include the
 --lt-dump-script option; it is no longer really necessary.  But I'm
 extremely hesistant to remove it before then; we've had enough
 destabilizing changes in a stable release already.

OK.

  Why is this patch not accompanied by a testsuite addition using
  -std=c89 -Werror on a program that creates a C wrapper?
 
 Because I am well trained to be allergic to making the test suite take
 even longer. I know it is not fully rational, because tests help us
 avoid these problems in the future. But sweet mother of god is it painful.

We need to work against this allergy.  Hope the above to be a first
step.

Just to be sure: you are aware of limiting the testsuite runs to just
those bits that you are adding?
old suite:
  make check TESTSUITEFLAGS=-V TESTS=tests/foo.test tests/bar.test \
 VERBOSE=yes
new suite:
  make check-local TESTSUITEFLAGS='-v -d -x 27-33'

(another mail coming up for the rest)

Cheers,
Ralf




Re: [PATCH] [cygwin|mingw] Fix compile warnings when -std=c89.

2009-01-21 Thread Charles Wilson
Ralf Wildenhues wrote:
 * Charles Wilson wrote on Wed, Jan 21, 2009 at 08:47:42PM CET:
 Part of my tendency to include minor -- easy to review -- changes with
 larger ones is due to (a) see it, fix it, otherwise it'll be forgotten
 and (b) EVERY separate patchset requires an independent full testsuite
 run.
 
 Ah, ok.  I can feel the pain.  Let's relieve that a wee bit, without
 compromising quality too much:
 (a) can be addressed with git.  Really, git's is flexible enough to
 allow for doing many many small commits, even ugly ones, and cleaning up
 afterwards.  AIUI git is available for Cygwin and MinGW.

Yep. I'm using it on cygwin. For mingw stuff I usually make dist on
cygwin, and send the tarball across to mingw.

 (b) There is no need for full testsuite runs for every patch.  If two
 patches are clearly independent, then one run with both of them should
 suffice.  If you have a (not too huge) patch series, where things belong
 together, and the end point passes the testsuite, then while that is not
 ideal, it is still a lot better than nothing; in that case, please note
 this, and we can still ask for results of intermediate states if
 necessary.

Well that'd be easier.

 Which however makes testsuite additions all the more important: that
 way, at least, when we run the suite before a release, we can find
 potential regressions.  Think of testsuite additions as a way to shift
 some of the testing grunt work from yourself over to other users.

This only matters if an full and successful testsuite run is not
required after each patch (sequence?), or if all you're worried about is
when patchA (submitted for unix, or cygwin) might break mingw but the
original submitter only tested on his platform. Which is an important
case, of course.

But if you're fixing a cygwin bug, you need to test on cygwin (full
testsuite? see below...)

 Just to be sure: you are aware of limiting the testsuite runs to just
 those bits that you are adding?
 old suite:
   make check TESTSUITEFLAGS=-V TESTS=tests/foo.test tests/bar.test \
  VERBOSE=yes
 new suite:
   make check-local TESTSUITEFLAGS='-v -d -x 27-33'

Sure, but how do you then *know* that your change didn't break something
else? At some point you still have to run the full testsuite before
committing to master, at least on the platform for which you're fixing a
bug. These shortcuts can speed up development while coding the fix, but
not the final submission/review process for the change.

--
Chuck




Re: [PATCH] [cygwin|mingw] Fix compile warnings when -std=c89.

2009-01-21 Thread Charles Wilson
Ralf Wildenhues wrote:
 Part (1) is easy to review: it is obvious that regressions are very
 unlikely to be system-dependent.  One does get the impression that it
 might just be more efficient to let libtool save the cwrapper text
 somewhere and the program just cat that.  But still, this part is ok,
 please apply.

This part pushed...

 Why is this patch not accompanied by a testsuite addition using
 -std=c89 -Werror on a program that creates a C wrapper?

...but without an additional test. Ralf, how should such a test be
structured? Do we need (like Darwin) a separate category of windows-ish
tests, that are skipped elsewhere, or what?


The bits removed from this commit are attached as
cygwin-cwrapper-cleanups.patch. I did not run a full test suite with
just the pushed bits; however, those bits plus the
cygwin-cwrapper-cleanups did pass, and the pushed bits alone passed a
bootstrap/configure/make cycle and some (old) testsuite spot checks.
Also, the generated cwrapper code compiled when -std=c89 without error
(cygwin).

As pushed
(0010--cygwin-mingw-Fix-compile-warnings-when-std-c89.patch-pushed):

[cygwin|mingw] Fix compile warnings when -std=c89.

* libltdl/config/ltmain.m4sh (func_emit_wrapper_part1):
move contents to...
(func_emit_wrapper_part2): move contents to...
(func_emit_wrapper): here.
(func_emit_cwrapperexe_src) [file scope]: Remove
variables script_text_part1 and script_text_part2.
(func_emit_cwrapperexe_src) [lt_dump_script]: New function.
(func_emit_cwrapperexe_src) [main]: Call it.

--
Chuck

diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 760f647..8728a7c 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -2746,18 +2716,11 @@ EOF
 # include direct.h
 # include process.h
 # include io.h
-# define setmode _setmode
 #else
 # include unistd.h
 # include stdint.h
 # ifdef __CYGWIN__
 #  include io.h
-#  define HAVE_SETENV
-#  ifdef __STRICT_ANSI__
-char *realpath (const char *, char *);
-int putenv (char *);
-int setenv (const char *, const char *, int);
-#  endif
 # endif
 #endif
 #include malloc.h
@@ -2771,6 +2734,33 @@ int setenv (const char *, const char *, int);
 #include fcntl.h
 #include sys/stat.h
 
+/* declarations of non-ANSI functions */
+#if defined(__MINGW32__)
+# ifdef __STRICT_ANSI__
+int _putenv (const char *);
+# endif
+#elif defined(__CYGWIN__)
+# ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+# endif
+#endif
+
+/* portability #defines */
+#if defined(_MSC_VER) || defined(__MINGW32__)
+# ifndef __MINGW32CE__
+#  define setmode _setmode
+#  define stat_stat
+#  define chmod   _chmod
+#  define getcwd  _getcwd
+#  define putenv  _putenv
+# endif
+#endif
+#ifdef __CYGWIN__
+# define HAVE_SETENV
+#endif
+
 #if defined(PATH_MAX)
 # define LT_PATHMAX PATH_MAX
 #elif defined(MAXPATHLEN)
@@ -2788,7 +2778,6 @@ int setenv (const char *, const char *, int);
 
 #ifdef _MSC_VER
 # define S_IXUSR _S_IEXEC
-# define stat _stat
 # ifndef _INTPTR_T_DEFINED
 #  define intptr_t int
 # endif
@@ -2841,7 +2830,7 @@ int setenv (const char *, const char *, int);
 } while (0)
 
 #undef LTWRAPPER_DEBUGPRINTF
-#if defined DEBUGWRAPPER
+#if defined LT_DEBUGWRAPPER
 # define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
 static void
 ltwrapper_debugprintf (const char *fmt, ...)
diff --git a/ChangeLog b/ChangeLog
index b702907..8d83a7b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2009-01-21  Charles Wilson  libt...@cwilson.fastmail.fm
 
+   [cygwin|mingw] Fix compile warnings when -std=c89.
+   * libltdl/config/ltmain.m4sh (func_emit_wrapper_part1):
+   move contents to...
+   (func_emit_wrapper_part2): move contents to...
+   (func_emit_wrapper): here.
+   (func_emit_cwrapperexe_src) [file scope]: Remove
+   variables script_text_part1 and script_text_part2.
+   (func_emit_cwrapperexe_src) [lt_dump_script]: New function.
+   (func_emit_cwrapperexe_src) [main]: Call it.
+
+2009-01-21  Charles Wilson  libt...@cwilson.fastmail.fm
+
Minor cygwin cleanup
* libltdl/config/ltmain.m4sh (func_generate_dlsyms): Correct
case pattern for cygwin.
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 760f647..3f1a30c 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -2308,15 +2308,23 @@ func_extract_archives ()
 }
 
 
-
-# func_emit_wrapper_part1 [arg=no]
+# func_emit_wrapper [arg=no]
 #
-# Emit the first part of a libtool wrapper script on stdout.
-# For more information, see the description associated with
-# func_emit_wrapper(), below.
-func_emit_wrapper_part1 ()
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable.  Must ONLY be called from within
+# func_mode_link because it depends on a 

Re: [PATCH] [cygwin|mingw] Fix compile warnings when -std=c89.

2009-01-21 Thread Ralf Wildenhues
* Charles Wilson wrote on Wed, Jan 21, 2009 at 10:10:08PM CET:
 Ralf Wildenhues wrote:
  Part (1) is easy to review: it is obvious that regressions are very
  unlikely to be system-dependent.  One does get the impression that it
  might just be more efficient to let libtool save the cwrapper text
  somewhere and the program just cat that.  But still, this part is ok,
  please apply.
 
 This part pushed...

Thanks.

  Why is this patch not accompanied by a testsuite addition using
  -std=c89 -Werror on a program that creates a C wrapper?
 
 ...but without an additional test. Ralf, how should such a test be
 structured? Do we need (like Darwin) a separate category of windows-ish
 tests, that are skipped elsewhere, or what?

I don't see a need to skip the test elsewhere.  Here's what I'd do:
transform $LIBTOOL to have CFLAGS and LTCFLAGS also contain -std=c89
-Werror.  (The test would be even cleaner with a re-configured libtool,
but let's not go overboard here.)

With that, compile a library, and a program linked against it (so that,
on w32, a wrapper is compiled).  In order to avoid false failures due
to non-GCC or so, you can also compile a trivial program and skip if the
above flags cause an error.

Cheers,
Ralf




Re: [PATCH] [cygwin|mingw] Fix compile warnings when -std=c89.

2009-01-21 Thread Charles Wilson
Ralf Wildenhues wrote:

 I don't see a need to skip the test elsewhere.  Here's what I'd do:
 transform $LIBTOOL to have CFLAGS and LTCFLAGS also contain -std=c89
 -Werror.  (The test would be even cleaner with a re-configured libtool,
 but let's not go overboard here.)

Being a total novice with autotest, I couldn't figure out how to do the
former, so I did the latter. Attached is my first attempt.  It probably
should be named something other than 'c89 test' because that name
implies building all of libtool (including libltdl) with -std=c89. But I
couldn't think of anything else to call it.

If you'd like to knock it into better shape, I wouldn't mind...

--
Chuck

diff --git a/Makefile.am b/Makefile.am
index 790..726b898 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -467,6 +467,7 @@ TESTSUITE_AT= tests/testsuite.at \
  tests/indirect_deps.at \
  tests/archive-in-archive.at \
  tests/execute-mode.at \
+ tests/c89.at \
  tests/infer-tag.at \
  tests/localization.at \
  tests/install.at \
--- a/tests/c89.at  2006-11-30 19:00:00.0 -0500
+++ b/tests/c89.at  2009-01-21 21:32:01.79210 -0500
@@ -0,0 +1,85 @@
+# c89.at -- test compliance with c89 standard -*- Autotest -*-
+
+#   Copyright (C) 2009 Free Software Foundation, Inc.
+#   Written by Charles Wilson, 2009
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from  http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+AT_SETUP([c89 test])
+AT_KEYWORDS([libtool])
+
+# make sure existing libtool is configured for shared libraries
+AT_CHECK([$LIBTOOL --features | grep 'disable shared libraries'  (exit 77)],
+[1], [ignore])
+
+# make sure CFLAGS -std=c89 -Werror do not cause a failure 
+# themselves (e.g. because a non-gcc compiler doesn't support
+# those flags).
+AT_DATA([trivial.c],
+[[
+int main (void)
+{
+  return 0;
+}
+]])
+AT_CHECK([$LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -std=c89 -Werror -c 
trivial.c || exit 77],[0],[ignore],[ignore])
+
+AT_DATA([configure.ac],
+[[AC_INIT([app-uses-sharedlib-demo], ]AT_PACKAGE_VERSION[, 
]AT_PACKAGE_BUGREPORT[)
+AC_CONFIG_AUX_DIR([config])
+AC_CONFIG_MACRO_DIR([m4])
+AM_INIT_AUTOMAKE([foreign])
+LT_INIT([win32-dll disable-static])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+]])
+AT_DATA([Makefile.am],
+[[ACLOCAL_AMFLAGS = -I m4
+AUTOMAKE_OPTIONS = 1.7
+lib_LTLIBRARIES = liba.la
+liba_la_LDFLAGS = -version-info 0:0:0 -no-undefined
+liba_la_SOURCES = liba.c
+bin_PROGRAMS = usea
+usea_SOURCES = usea.c
+usea_LDADD = liba.la
+]])
+AT_DATA([liba.c],
+[[int liba_func1 (int arg)
+{
+  return arg + 1;
+}
+]])
+AT_DATA([usea.c],
+[[extern int liba_func1(int arg);
+int main (void)
+{
+  int a = 2;
+  int b = liba_func1 (a);
+  if (b == 3) return 0;
+  return 1;
+}
+]])
+
+LT_AT_BOOTSTRAP([--copy --force], [-I m4 --force], [ignore],
+  [--add-missing --copy --force-missing], [--force], [CFLAGS='-std=c89 
-Werror'], [])
+AT_CHECK([test -f liba.la])
+LT_AT_EXEC_CHECK([./usea], [0], [ignore], [ignore], [])
+
+AT_CLEANUP


Re: [PATCH] [cygwin|mingw] Fix compile warnings when -std=c89.

2009-01-16 Thread Charles Wilson
Charles Wilson wrote:
 Charles Wilson wrote:
 * libltdl/config/ltmain.m4sh: Update copyright date.
 (func_emit_wrapper_part1): move contents to...
 (func_emit_wrapper_part2): move contents to...
 (func_emit_wrapper): here.
 (func_emit_cwrapperexe_src) [file scope]: re-organized
 includes and portability macros. Avoid oldnames on MINGW32
 and MSVC for setmode/stat/chmod/getcwd/putenv. Declare
 _putenv on MINGW32 when -ansi. Use namespaced macro
 LT_DEBUGWRAPPER. Remove variables script_text_part1 and
 script_text_part2.
 (func_emit_cwrapperexe_src) [lt_dump_script]: New function.
 (func_emit_cwrapperexe_src) [main]: Call it.
 
 Ping?
 
Ping x 2?

--
Chuck





Re: [PATCH] [cygwin|mingw] Fix compile warnings when -std=c89.

2009-01-16 Thread Peter Rosin

Den 2009-01-16 15:15 skrev Charles Wilson:

Charles Wilson wrote:

Charles Wilson wrote:

* libltdl/config/ltmain.m4sh: Update copyright date.
(func_emit_wrapper_part1): move contents to...
(func_emit_wrapper_part2): move contents to...
(func_emit_wrapper): here.
(func_emit_cwrapperexe_src) [file scope]: re-organized
includes and portability macros. Avoid oldnames on MINGW32
and MSVC for setmode/stat/chmod/getcwd/putenv. Declare
_putenv on MINGW32 when -ansi. Use namespaced macro
LT_DEBUGWRAPPER. Remove variables script_text_part1 and
script_text_part2.
(func_emit_cwrapperexe_src) [lt_dump_script]: New function.
(func_emit_cwrapperexe_src) [main]: Call it.

Ping?


Ping x 2?


I tried this patch on the pr-msvc-support branch and it seems
to work just fine there as well (tested with MSVC 2005).

Cheers,
Peter




Re: [PATCH] [cygwin|mingw] Fix compile warnings when -std=c89.

2009-01-08 Thread Charles Wilson
Charles Wilson wrote:
 * libltdl/config/ltmain.m4sh: Update copyright date.
 (func_emit_wrapper_part1): move contents to...
 (func_emit_wrapper_part2): move contents to...
 (func_emit_wrapper): here.
 (func_emit_cwrapperexe_src) [file scope]: re-organized
 includes and portability macros. Avoid oldnames on MINGW32
 and MSVC for setmode/stat/chmod/getcwd/putenv. Declare
 _putenv on MINGW32 when -ansi. Use namespaced macro
 LT_DEBUGWRAPPER. Remove variables script_text_part1 and
 script_text_part2.
 (func_emit_cwrapperexe_src) [lt_dump_script]: New function.
 (func_emit_cwrapperexe_src) [main]: Call it.

Ping?





Re: [PATCH] [cygwin|mingw] Fix compile warnings when -std=c89.

2009-01-04 Thread Charles Wilson
Roumen Petrov wrote:
 Charles Wilson wrote:
 [SNIP]
 This patch attempts to correct the issues raised in this thread:
 msys/mingw warnings about string length and putenv absence with gcc
 -Wall -ansi
 http://lists.gnu.org/archive/html/bug-libtool/2008-12/msg00038.html

 [SNIP]
 Patch fail for trunk(origin):
 10 out of 11 hunks FAILED -- saving rejects to file
 libltdl/config/ltmain.m4sh.rej

I'm confused. I just did a 'git pull' on master, and my master was
up-to-date. Then I did a 'git rebase master' on my branch, and it said
'Current branch cygwin-c89-fix is up to date.'

So then I tried to apply the patch to my master (dry-run):

patch -p1 --dry-run 
../0010--cygwin-mingw-Fix-compile-warnings-when-std-c89.patch
patching file libltdl/config/ltmain.m4sh

and it worked fine.  Maybe the patch got mangled in the mail. I'll send
it privately to you as an attachment.

--
Chuck




Re: [PATCH] [cygwin|mingw] Fix compile warnings when -std=c89.

2009-01-04 Thread Roumen Petrov

Charles Wilson wrote:
[SNIP]

This patch attempts to correct the issues raised in this thread:
msys/mingw warnings about string length and putenv absence with gcc -Wall 
-ansi
http://lists.gnu.org/archive/html/bug-libtool/2008-12/msg00038.html


[SNIP]
Patch fail for trunk(origin):
$ patch -p1 --dry-run  .../Fix\ compile\ warnings...
patching file libltdl/config/ltmain.m4sh
Reversed (or previously applied) patch detected!  Assume -R? [n] n
Apply anyway? [n] y
Hunk #1 FAILED at 5.
Hunk #2 FAILED at 2309.
Hunk #3 FAILED at 2406.
Hunk #4 FAILED at 2526.
Hunk #5 FAILED at 2717.
Hunk #6 succeeded at 2725 with fuzz 2 (offset -10 lines).
Hunk #7 FAILED at 2769.
Hunk #8 FAILED at 2821.
Hunk #9 FAILED at 2855.
Hunk #10 FAILED at 2952.
Hunk #11 FAILED at 3712.
10 out of 11 hunks FAILED -- saving rejects to file 
libltdl/config/ltmain.m4sh.rej


Roumen




Re: [PATCH] [cygwin|mingw] Fix compile warnings when -std=c89.

2009-01-04 Thread Roumen Petrov

Charles Wilson wrote:

Now I get completely new working cross-environment: git show correctly 
modified files, patch work too :) .

[SNIP]

No regressions on msys/mingw from the last time I ran the testsuite on
that platform (2.2.5a).  IOW:

Old testsuite results:

[SNIP]
No regression on unix/mingw too.


New testsuite results:
ERROR: 77 tests were run,
6 failed (3 expected failures).
4 tests were skipped.
 65: compiling softlinked libltdl   FAILED (recursive.at:71)
 66: compiling copied libltdl   FAILED (recursive.at:91)
 67: installable libltdlFAILED (recursive.at:113)
 80: Run tests with low max_cmd_len (ctrl-C'ed, so not incl. in tally)



The results:
17: preserve duplicate convenience deps expected failure
29: static linking flags for programs   skipped
32: sys_lib_search_path skipped
35: static library contains static library  expected failure
74: build tree relpaths expected failure
80: Run tests with low max_cmd_len(CANCELED)

For 32: My new build environment is with incorrect path to libz :(.
For 23: Java convenience archives is ok as my build env. contain one 
$EXEEXT more.



OK to push?


Fine with me.

Roumen




Re: [PATCH] [cygwin|mingw] Fix compile warnings when -std=c89.

2009-01-03 Thread Charles Wilson
Charles Wilson wrote:

 Spot checked some regression tests on cygwin (all passed).
 Running full regression suite on mingw.  OK to push, pending
 testsuite results?

No regressions on msys/mingw from the last time I ran the testsuite on
that platform (2.2.5a).  IOW:

Old testsuite results:

5 of 106 tests failed
(18 tests were not run)
Please report to bug-libt...@gnu.org

FAIL: tests/mdemo-dryrun.test
FAIL: tests/demo-exec.test (after demo-shared [*])
FAIL: tests/f77demo-static.test
FAIL: tests/f77demo-conf.test
FAIL: tests/f77demo-shared.test

[*] probably fixed by my other patch


New testsuite results:
ERROR: 77 tests were run,
6 failed (3 expected failures).
4 tests were skipped.
 65: compiling softlinked libltdl   FAILED (recursive.at:71)
 66: compiling copied libltdl   FAILED (recursive.at:91)
 67: installable libltdlFAILED (recursive.at:113)
 80: Run tests with low max_cmd_len (ctrl-C'ed, so not incl. in tally)

OK to push?

--
Chuck




[PATCH] [cygwin|mingw] Fix compile warnings when -std=c89.

2009-01-02 Thread Charles Wilson
* libltdl/config/ltmain.m4sh: Update copyright date.
(func_emit_wrapper_part1): move contents to...
(func_emit_wrapper_part2): move contents to...
(func_emit_wrapper): here.
(func_emit_cwrapperexe_src) [file scope]: re-organized
includes and portability macros. Avoid oldnames on MINGW32
and MSVC for setmode/stat/chmod/getcwd/putenv. Declare
_putenv on MINGW32 when -ansi. Use namespaced macro
LT_DEBUGWRAPPER. Remove variables script_text_part1 and
script_text_part2.
(func_emit_cwrapperexe_src) [lt_dump_script]: New function.
(func_emit_cwrapperexe_src) [main]: Call it.
---

This patch attempts to correct the issues raised in this thread:
msys/mingw warnings about string length and putenv absence with gcc -Wall 
-ansi
http://lists.gnu.org/archive/html/bug-libtool/2008-12/msg00038.html

There was an earlier, similar patch related to errors that occurred
when -std=c99.  One of those errors, related to a limitation on const
char* arrays to less than 4096 bytes, led to splitting the existing
function 'func_emit_wrapper' into two different pieces, each less
than 4096 characters. However, the string limitation in c89 is 509
characters, which would lead to too many such subfunctions. Futher,
it would be very difficult to chose breakpoints to ensure this char
length limit, when some chunks would include long variable values
such as LD_LIBRARY_PATH or PATH.

To achieve this more stringent limitation, the best we can (easily)
do is to emit each line of the script as a single const char*. Thus,
we require -- but do not check -- that each line in the wrapper
script has less than 509 characters.  However, we do not want 127
'func_emit_wrapper_partN' functions.  So, in this patch I reverted
the split and moved all of the script contents back into 
func_emit_wrapper.  However, when building the cwrapper source
code, each line of the script is turned into a separate C string:
   fputs (one line\n, stdout);
I probably should have done it this way to start with, but was
trying to avoid 127 different function calls. Oh well.

Also took the opportunity here to move the DEBUGWRAPPER macro 
into the LT_* namespace, and to reorganize the #includes and
the portability #defines into separate sections.

Spot checked some regression tests on cygwin (all passed).
Running full regression suite on mingw.  OK to push, pending
testsuite results?

=


 libltdl/config/ltmain.m4sh |  132 
 1 files changed, 59 insertions(+), 73 deletions(-)

diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 20ca07b..ebedf69 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -5,7 +5,7 @@ m4_divert_push([SCRIPT])# @configure_input@
 # Written by Gordon Matzigkeit g...@gnu.ai.mit.edu, 1996
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008 Free Software Foundation, Inc.
+# 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 # This is free software; see the source for copying conditions.  There is NO
 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
@@ -2309,15 +2309,23 @@ func_extract_archives ()
 }
 
 
-
-# func_emit_wrapper_part1 [arg=no]
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable.  Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
 #
-# Emit the first part of a libtool wrapper script on stdout.
-# For more information, see the description associated with
-# func_emit_wrapper(), below.
-func_emit_wrapper_part1 ()
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take.  If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the $objdir directory.  This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
 {
-   func_emit_wrapper_part1_arg1=${1-no}
+   func_emit_wrapper_arg1=${1-no}
 
$ECHO \
 #! $SHELL
@@ -2398,24 +2406,10 @@ _LTECHO_EOF'
 file=\`\$ECHO \\$file\ | $SED 's%^.*/%%'\`
 file=\`ls -ld \\$thisdir/\$file\ | $SED -n 's/.*- //p'\`
   done
-
-}
-# end: func_emit_wrapper_part1
-
-# func_emit_wrapper_part2 [arg=no]
-#
-# Emit the second part of a libtool wrapper script on stdout.
-# For more information, see the description associated with
-# func_emit_wrapper(), below.
-func_emit_wrapper_part2 ()
-{
-func_emit_wrapper_part2_arg1=${1-no}
-
-   $ECHO \
 
   # Usually 'no', except on cygwin/mingw when embedded into
   # the cwrapper.
-  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
+  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
   if test \\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\ = \yes\; then
 # special case for '.'
 if test \\$thisdir\ = \.\; then
@@ -2532,30 +2526,6 @@ func_emit_wrapper_part2 ()
 fi\
 
 }
-# end: