From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs Subject: bug#10474: Building guile 2.x under mingw + msys Date: Tue, 19 Feb 2013 22:39:01 +0100 Message-ID: <87y5ekx9u2.fsf@pobox.com> References: <87pqerdxq4.fsf@pobox.com> <83ehuy698u.fsf@gnu.org> <8362ga5h7h.fsf@gnu.org> <87r4ywpnv0.fsf@gnu.org> <83r4yw49u6.fsf@gnu.org> <87y5smnj86.fsf@pobox.com> <83ehudp29y.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1361310012 12861 80.91.229.3 (19 Feb 2013 21:40:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 19 Feb 2013 21:40:12 +0000 (UTC) Cc: ludo@gnu.org, 10474@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Tue Feb 19 22:40:33 2013 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U7uvO-0002pe-JH for guile-bugs@m.gmane.org; Tue, 19 Feb 2013 22:40:30 +0100 Original-Received: from localhost ([::1]:43245 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7uv1-0002Eo-Fd for guile-bugs@m.gmane.org; Tue, 19 Feb 2013 16:40:07 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:42148) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7uuw-0002D1-KJ for bug-guile@gnu.org; Tue, 19 Feb 2013 16:40:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U7uus-0007Se-97 for bug-guile@gnu.org; Tue, 19 Feb 2013 16:40:01 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60241) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7uus-0007SX-5n for bug-guile@gnu.org; Tue, 19 Feb 2013 16:39:58 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1U7uvw-00087A-Qr for bug-guile@gnu.org; Tue, 19 Feb 2013 16:41:05 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andy Wingo Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Tue, 19 Feb 2013 21:41:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10474 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 10474-submit@debbugs.gnu.org id=B10474.136131003731155 (code B ref 10474); Tue, 19 Feb 2013 21:41:03 +0000 Original-Received: (at 10474) by debbugs.gnu.org; 19 Feb 2013 21:40:37 +0000 Original-Received: from localhost ([127.0.0.1]:37472 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U7uvU-00086Q-60 for submit@debbugs.gnu.org; Tue, 19 Feb 2013 16:40:37 -0500 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:62971 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U7uv7-00085s-4P for 10474@debbugs.gnu.org; Tue, 19 Feb 2013 16:40:29 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 53BF7CE7D; Tue, 19 Feb 2013 16:39:05 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=/+O7e1/ny1BI+pqSztzr+yWtgYU=; b=aawbGQ vGfArPw0m5KD64cO4ZDrCZUUiFFUkhMkJV492QSoGR7n8rGWT6hKbPY8cAXxMLWS 2m2N3+TErJ0OKrg/IuiN8jO4/IhGpJy1A7Qw+w0S38FS6JXnNfg937vnZpz6Tq7r 22LOgbUHFHUL5Ph0/DC2etHHwHhMOKlluTfcE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=UEfnzXRTqrwNL2nuZKortwUJEK+tFDKE qmxrX3vhBa3mmqlV/veSHIpyeK3IhW6z8/owgbmg3MtqN3sy4QG1Gv7TaieZW5Ny pYm5qmsgA58alSIP+FV+NleqH0vofQI33lJTV+B+mFbzpGbVrS22d1dnScJQGJIh l0upNmgQ8FA= Original-Received: from a-pb-sasl-quonix.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 45D1FCE7B; Tue, 19 Feb 2013 16:39:05 -0500 (EST) Original-Received: from badger (unknown [88.160.190.192]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 9797ECE7A; Tue, 19 Feb 2013 16:39:04 -0500 (EST) In-Reply-To: <83ehudp29y.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 02 Feb 2012 19:34:49 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) X-Pobox-Relay-ID: C85D50A8-7ADC-11E2-9EC5-BB980E5B5709-02397024!a-pb-sasl-quonix.pobox.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:6760 Archived-At: Hi Eli, Sorry for the large number of mails. You sent this patch: On Thu 02 Feb 2012 18:34, Eli Zaretskii writes: > Avoid compiler warnings on MS-Windows. > > * libguile/print.c (display_string_using_iconv): Cast 2nd arg of > `iconv' to `const char **', to avoid compiler warnings. > > * libguile/ports.c (get_iconv_codepoint): Cast 2nd arg of `iconv' > to `const char **', to avoid compiler warnings. > > > --- libguile/print.c~0 2011-10-08 01:49:48.000000000 +0200 > +++ libguile/print.c 2012-01-15 15:10:51.450848400 +0200 > @@ -899,7 +899,7 @@ display_string_using_iconv (const void * > output = encoded_output; > output_left = sizeof (encoded_output); > > - done = iconv (pt->output_cd, &input, &input_left, > + done = iconv (pt->output_cd, (const char **)&input, &input_left, > &output, &output_left); > > output_len = sizeof (encoded_output) - output_left; > > > --- libguile/ports.c~0 2011-10-08 01:49:48.000000000 +0200 > +++ libguile/ports.c 2012-01-15 15:11:11.856706600 +0200 > @@ -1305,7 +1305,7 @@ get_iconv_codepoint (SCM port, scm_t_wch > input_left = bytes_consumed + 1; > output_left = sizeof (utf8_buf); > > - done = iconv (pt->input_cd, &input, &input_left, > + done = iconv (pt->input_cd, (const char **)&input, &input_left, > &output, &output_left); > if (done == (size_t) -1) > { > However iconv is specified (http://pubs.opengroup.org/onlinepubs/009695399/functions/iconv.html) to take a char** as the first argument. Don't we end up using a GNU iconv on mingw32 anyway? > * libguile/deprecation.c (vsnprintf) [__MINGW32__]: Don't redefine > if already defined. Avoids compiler warnings. > > --- libguile/deprecation.c~0 2011-07-07 02:49:59.000000000 +0300 > +++ libguile/deprecation.c 2012-01-15 14:48:55.966092400 +0200 > @@ -36,7 +36,7 @@ > > > /* Windows defines. */ > -#ifdef __MINGW32__ > +#if defined (__MINGW32__) && !defined (vsnprintf) > #define vsnprintf _vsnprintf > #endif It seems that gnulib handles this already, and this block is no longer present in Guile source (since last January). > * libguile/filesys.c (mkdir) [__MINGW32__]: Don't redefine if > GNULIB_defined_rpl_mkdir is defined, meaning that the gnulib > replacement is being used. > (fchmod) [__MINGW32__]: Define to zero, to avoid gratuitous failures > of many file operations on MS-Windows. > > --- libguile/filesys.c~0 2011-10-08 01:49:48.000000000 +0200 > +++ libguile/filesys.c 2012-01-18 08:29:49.629722000 +0200 > @@ -116,11 +116,24 @@ > > /* Some more definitions for the native Windows port. */ > #ifdef __MINGW32__ > -# define mkdir(path, mode) mkdir (path) > +/* When configured to use the gnulib replacement, don't redefine > + mkdir, as it is already redirected to the replacement, see > + lib/sys/stat.h. */ > +# if !GNULIB_defined_rpl_mkdir > +# define mkdir(path, mode) mkdir (path) > +# endif > # define fsync(fd) _commit (fd) > -# define fchmod(fd, mode) (-1) > +# define fchmod(fd, mode) (0) > #endif /* __MINGW32__ */ Likewise, this block is no longer present in Guile; we depend on Gnulib for mkdir, and we have an explicit check for fchmod. > +#ifndef O_BINARY > +# ifdef _O_BINARY > +# define O_BINARY _O_BINARY > +# else > +# define O_BINARY 0 > +# endif > +#endif > + I assume this won't be needed for filesys.c, as it does not use O_BINARY (any more?). > Read and write *.go files and copy files in binary mode on > MS-Windows. > > * libguile/objcodes.c (O_BINARY): Define on all platforms. Gnulib's fcntl.h defines O_BINARY on all platforms already, so this should be fixed already. > (make_objcode_from_file): Zero out errno before calling full_read, > to make sure the value after the call reflects errors inside > full_read. This seems like a bug to me, that the behavior of full_read can depend on the incoming errno. I mailed bug-gnulib and put you on copy to see what they would say. > (scm_load_objcode): Open objcode files in binary mode, so that > *.go files are read verbatim on MS-Windows. Applied, thanks. > * libguile/mkstemp.c (O_BINARY): Define for all platforms. > (mkstemp): Open the temporary file in binary mode, so that > compiled *.go files are written verbatim on MS-Windows. Hummmmmmm. It's true that the only user of mkstemp in Guile is the compilation code. OTOH it's a public interface, and this change might affect someone. OTOH MinGW is not well-served currently and probably there are ~0 active users. Any other thoughts here? > * libguile/filesys.c (O_BINARY): Define for all platforms. > (scm_copy_file): Use O_BINARY in the call to open_or_open64. Applied, thanks. > Fix compilation warnings and errors on MS-Windows when > compiling network-related code due to missing macros and > prototypes. > > * libguile/net_db.c [HAVE_WINSOCK2_H]: Add !GNULIB_TEST_SOCKET to > the condition, to include sys/socket.h and netdb.h when gnulib's > socket module is being used. Fixes compiler warnings and errors > on MS-Windows. > > * libguile/socket.c: Likewise. > > > --- libguile/net_db.c~0 2011-07-07 02:49:59.000000000 +0300 > +++ libguile/net_db.c 2012-01-15 16:22:56.366898100 +0200 > @@ -49,8 +49,11 @@ > > #include > > -#ifdef HAVE_WINSOCK2_H > +#if HAVE_WINSOCK2_H && !GNULIB_TEST_SOCKET > #include > +# if HAVE_WS2TCPIP_H > +# include > +# endif > #else > #include > #include Surely we should just rely on Gnulib here and not include the winsock headers. In what condition would these headers be included otherwise? A visual studio build or something? Regards, Andy -- http://wingolog.org/