Re: [Patch] cwrapper invokes target directly

2008-04-30 Thread Bob Friesenhahn

On Tue, 29 Apr 2008, Charles Wilson wrote:


If I can get some feedback on the '*_with_wine.sh' script I could update the 
patch to also support $build=some_unixy_platform_with_wine and $host=mingw.


I have a MinGW cross-compiler hosted off of FreeBSD 7.0.  Presumably I 
can run Wine on it.  I know that Linux has special hooks in order to 
automatically run Windows executables using Wine.  Is the Wine 
execution support dependent on this Linux feature?


Bob
==
Bob Friesenhahn
[EMAIL PROTECTED], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,http://www.GraphicsMagick.org/





libltdl and cygwin 1.7.0

2008-04-30 Thread Eric Blake
Cygwin 1.7.0 will change the size of MAX_PATH in its headers, but the old 
cygwin_conv_to_* API silently suffers from buffer overrun if more than 256 
bytes occur in the conversion.  As a result, cygwin developers wisely 
deprecated the old API when adding the new cygwin_path_conv, and compilation 
now issues a warning (which in turn cripples -Werror builds):

libltdl/loaders/loadlibrary.c: In function `vm_open':
libltdl/loaders/loadlibrary.c:147: warning: `cygwin_conv_to_full_win32_path' is 
deprecated (declared at /usr/include/sys/cygwin.h:52)
make[2]: *** [libltdl/loaders/loadlibrary.lo] Error 1

OK to apply?


From 2db764974e01cc576dd1bcfb7afad2ec7d64217a Mon Sep 17 00:00:00 2001
From: Eric Blake [EMAIL PROTECTED]
Date: Wed, 30 Apr 2008 10:49:45 -0600
Subject: [PATCH] Support cygwin 1.7.0 in loadlibrary loader.

* libltdl/m4/ltdl.m4 (LT_LIB_DLLOAD) cygwin: Check for modern
function.
* libltdl/loaders/loadlibrary.c (vm_open): Avoid deprecated
cygwin_conv_to_full_win32_path.

Signed-off-by: Eric Blake [EMAIL PROTECTED]
---
 ChangeLog |8 
 libltdl/loaders/loadlibrary.c |9 -
 libltdl/m4/ltdl.m4|3 ++-
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ca8c2a1..b3c0616 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-04-30  Eric Blake  [EMAIL PROTECTED]
+
+   Support cygwin 1.7.0 in loadlibrary loader.
+   * libltdl/m4/ltdl.m4 (LT_LIB_DLLOAD) cygwin: Check for modern
+   function.
+   * libltdl/loaders/loadlibrary.c (vm_open): Avoid deprecated
+   cygwin_conv_to_full_win32_path.
+
 2008-04-29  Gary V. Vaughan  [EMAIL PROTECTED]
 
New libtoolize --no-warn option and LIBTOOLIZE_OPTIONS parsing.
diff --git a/libltdl/loaders/loadlibrary.c b/libltdl/loaders/loadlibrary.c
index 609870c..6558d43 100644
--- a/libltdl/loaders/loadlibrary.c
+++ b/libltdl/loaders/loadlibrary.c
@@ -136,7 +136,14 @@ vm_open (lt_user_data LT__UNUSED loader_data, const char 
*filename,
  return 0;
}
 
-#if defined(__CYGWIN__)
+#if HAVE_DECL_CYGWIN_CONV_PATH
+  if (cygwin_conv_path (CCP_POSIX_TO_WIN_A, filename, wpath, MAX_PATH))
+{
+ LT__SETERROR (CANNOT_OPEN);
+ return 0;
+   }
+  len = 0;
+#elif defined(__CYGWIN__)
   cygwin_conv_to_full_win32_path (filename, wpath);
   len = 0;
 #else
diff --git a/libltdl/m4/ltdl.m4 b/libltdl/m4/ltdl.m4
index f6b1064..ed71570 100644
--- a/libltdl/m4/ltdl.m4
+++ b/libltdl/m4/ltdl.m4
@@ -711,6 +711,7 @@ beos*)
   LT_DLLOADERS=$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la
   ;;
 cygwin* | mingw* | os2* | pw32*)
+  AC_CHECK_DECLS([cygwin_conv_path], [], [], [[#include sys/cygwin.h]])
   LT_DLLOADERS=$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la
   ;;
 esac
-- 
1.5.5.1







Re: libltdl and cygwin 1.7.0

2008-04-30 Thread Bob Friesenhahn

On Wed, 30 Apr 2008, Eric Blake wrote:


Cygwin 1.7.0 will change the size of MAX_PATH in its headers, but the old
cygwin_conv_to_* API silently suffers from buffer overrun if more than 256
bytes occur in the conversion.  As a result, cygwin developers wisely
deprecated the old API when adding the new cygwin_path_conv, and compilation
now issues a warning (which in turn cripples -Werror builds):

libltdl/loaders/loadlibrary.c: In function `vm_open':
libltdl/loaders/loadlibrary.c:147: warning: `cygwin_conv_to_full_win32_path' is
deprecated (declared at /usr/include/sys/cygwin.h:52)
make[2]: *** [libltdl/loaders/loadlibrary.lo] Error 1

OK to apply?


This looks good to apply to me except for the minor nit that the 
bracing indentation within the HAVE_DECL_CYGWIN_CONV_PATH is wrong 
(and should be corrected).



-#if defined(__CYGWIN__)
+#if HAVE_DECL_CYGWIN_CONV_PATH
+  if (cygwin_conv_path (CCP_POSIX_TO_WIN_A, filename, wpath, MAX_PATH))
+{
+ LT__SETERROR (CANNOT_OPEN);
+ return 0;
+   }
+  len = 0;


Bob
==
Bob Friesenhahn
[EMAIL PROTECTED], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,http://www.GraphicsMagick.org/





Re: [Patch] cwrapper invokes target directly

2008-04-30 Thread libtool

On Wed, 30 Apr 2008 10:12:36 -0500 (CDT), Bob Friesenhahn
xxx said:
 I have a MinGW cross-compiler hosted off of FreeBSD 7.0.  Presumably I 
 can run Wine on it.  I know that Linux has special hooks in order to 
 automatically run Windows executables using Wine.  Is the Wine 
 execution support dependent on this Linux feature?

No, the compile phase requires the $build (linux, unix?) executable
'winepath' only, and does not rely on the binfmt extension present in
linux.  The wrapper itself is already running in the emulation
environment, and uses Win32 spawnv (and other functions from the win32 C
runtime library) to launch the target executable -- within the same
emulation env, so no need for binfmt there, either.  However, actually
running the test suite is going to try to invoke the wrapper.exe, so
that would require binfmt (or another solution; I have ideas).  This may
(or may not) represent a regression from 1.5.x+explicit $TARGETSHELL
specification, I'm not sure.

When I (later) add support for $build=*nix+wine, $host=cygwin
cross-compiles, I'll also need either the 'wine' executable (which
itself is a $build=*nix program) or the binfmt extension, because I need
to execute 'cygpath' *in the $host environment* for step 2 of the
following conversion:

*nix [$build] path --( winepath )-- 
   native win32 [$host] path --( 'cygpath -u' under wine )-- 
  cygwin [$host] path

All of these difficulties and ripples are why I originally thought
'eliminate the wrapper script entirely for $host=cygwin|mingw' was a
libtool-2.4 project.  However, the current libtool-2.2 behavior was an
unreported (!) regression over 1.5.x, and the conversation last week
seemed to imply that it was important enough to try to fasttrack before
2.4...but that doesn't mean it will or can get completely fixed in one
simple patch. It may require iteration and public testing -- over a few
2.2.x releases -- before we get it right. :-(

--
Chuck




Re: libltdl and cygwin 1.7.0

2008-04-30 Thread Charles Wilson

On Wed, 30 Apr 2008 17:03:19 + (UTC), Eric Blake [EMAIL PROTECTED]
said:
 Cygwin 1.7.0 will change the size of MAX_PATH in its headers, but the old 
 cygwin_conv_to_* API silently suffers from buffer overrun if more than
 256 
 bytes occur in the conversion.  As a result, cygwin developers wisely 
 deprecated the old API when adding the new cygwin_path_conv, and
 compilation 
 now issues a warning (which in turn cripples -Werror builds):

Oh, yeah. Eric, could you take a quick look at the cwrapper source code.
I think it uses MAX_PATH somewhere...but it doesn't include config.h
IIRC, so it can't use HAVE_DECL_CYGWIN_CONV_PATH to determine the
correct func.   OTOH, the shell function func_emit_cwrapperexe_src()
could check $host and uname [Ugh!], and explicitly emit the correct code
for 1.7.0.

Or maybe the cwrapper itself could do a runtime check.

Also, I think the cwrapper uses static buffers of size MAX_PATH, too.

Suggestions?

--
Chuck