From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: cross building 1.9.14 for mingw Date: Sat, 29 Jan 2011 22:34:12 +0100 Message-ID: <874o8r8kdn.fsf@gnu.org> References: <1296330082.8111.371.camel@vuurvlieg> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1296336882 6164 80.91.229.12 (29 Jan 2011 21:34:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 29 Jan 2011 21:34:42 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Jan 29 22:34:38 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PjIRJ-0003bB-Sv for guile-devel@m.gmane.org; Sat, 29 Jan 2011 22:34:38 +0100 Original-Received: from localhost ([127.0.0.1]:56889 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PjIRJ-0004RV-G3 for guile-devel@m.gmane.org; Sat, 29 Jan 2011 16:34:37 -0500 Original-Received: from [140.186.70.92] (port=60644 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PjIRB-0004QA-BB for guile-devel@gnu.org; Sat, 29 Jan 2011 16:34:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PjIR9-0002Cs-Mq for guile-devel@gnu.org; Sat, 29 Jan 2011 16:34:29 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:49672) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PjIR9-0002CP-Ax for guile-devel@gnu.org; Sat, 29 Jan 2011 16:34:27 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PjIR7-0003V0-5E for guile-devel@gnu.org; Sat, 29 Jan 2011 22:34:25 +0100 Original-Received: from reverse-83.fdn.fr ([80.67.176.83]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 29 Jan 2011 22:34:25 +0100 Original-Received: from ludo by reverse-83.fdn.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 29 Jan 2011 22:34:25 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 165 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: reverse-83.fdn.fr X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 10 =?iso-8859-1?Q?Pluvi=F4se?= an 219 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:eK/Tfl4HZnY7P4w2mv/Rr9vy24g= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:11413 Archived-At: Hi Jan, Thanks for the report and patches! Jan Nieuwenhuizen writes: > To get guile-1.9.14 cross built for mingw, I re-updated gnulib > to include socket-related modules (starting with accept here) > > gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --libtool --macro-prefix=gl --no-vc-files alignof alloca-opt announce-gen autobuild byteswap canonicalize-lgpl duplocale environ extensions flock fpieee full-read full-write func gendocs getaddrinfo git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton isinf isnan lib-symbol-versions lib-symbol-visibility libunistring locale maintainer-makefile nproc putenv stat-time stdlib strcase strftime striconveh string sys_stat verify version-etc-fsf vsnprintf warnings accept bind close connect getpeername getsockname getsockopt listen malloc malloca recv recv recvfrom send sendto setsockopt shutdown socket socket s OK, I’ll add them on the next Gnulib update (soon). > and used the attached patches. Without this update you get things > like > > .libs/socket.o:socket.c:(.text+0xc72): undefined reference to `_accept_used_without_requesting_gnulib_module_accept' OK but all the modules listed after ‘accept’ above are needed too, right? > Another small gripe, this handy thing in configure.ac > > m4_esyscmd([build-aux/git-version-gen\ > .tarball-version\ > 's/^release_\([0-9][0-9]*\)-\([0-9][0-9]*\)-\([0-9][0-9]*\)/v\1.\2\.\3/g']), > > makes it tricky to patch configure.ac when working from a tarball > release, I got > > $ autoreconf > Usage: build-aux/git-version-gen $srcdir/.tarball-version Hmm could it be that there was a typo? Here running ‘git-version-gen’ outside of a Git tree works fine: $ guile/build-aux/git-version-gen .tarball-version s/foo/bar/ UNKNOWN > From ed1507425da819363cc6592ee033076838c82051 Mon Sep 17 00:00:00 2001 > From: Jan Nieuwenhuizen > Date: Sat, 29 Jan 2011 17:31:17 +0100 > Subject: [PATCH 1/4] Add dynamic relocation support, default off. I’ll write about it separately. > From 4aeb4bb48423d87001b598030afed0a2dc03e747 Mon Sep 17 00:00:00 2001 > From: Jan Nieuwenhuizen > Date: Sat, 29 Jan 2011 19:42:46 +0100 > Subject: [PATCH 2/4] Use AC_CHECK_LIB rather than AC_LIB_HAVE_LINKFLAGS. Fixes cross configuring. > > AC_LIB_HAVE_LINKFLAGS blondly looks in $prefix etc. for libraries. > Not only is that unnecessary, it also breaks cross building. > > Here's what config.log says: > > configure:33053: i686-mingw32-gcc -mms-bitfields -std=gnu99 -o conftest.exe -O2 -DHAVE_CONFIG_H=1 -I/home/janneke/vc/gub/target/mingw/build/guile-1.9.14 -I/home/janneke/vc/gub/target/mingw/root/usr/include -L/home/janneke/vc/gub/target/mingw/root/usr/lib -L/home/janneke/vc/gub/target/mingw/root/usr/bin -L/home/janneke/vc/gub/target/mingw/root/usr/lib/w32api conftest.c /usr/lib/libltdl.a /usr/lib/libdl.a >&5 > /tmp/cc5v8vq5.o:conftest.c:(.text+0x1e): undefined reference to `_lt_dlopenext' > > note that using -lltdl -ldl instead of /usr/lib/libltdl.a > /usr/lib/libdl.la works fine. Ouch. May I suggest reporting it to bug-gnulib@gnu.org? :-) I think people there would be happy to provide an appropriate fix and we wouldn’t even have to worry. ;-) > From 90631baf616303e1a8983b3b1eca101f5c5ac0ac Mon Sep 17 00:00:00 2001 > From: Jan Nieuwenhuizen > Date: Sat, 29 Jan 2011 19:51:37 +0100 > Subject: [PATCH 3/4] When cross building, run GUILE_FOR_BUILD instead of just-built guile. Applied. > From a597cd2edd0ebe3341e435ad08af4450b43beb31 Mon Sep 17 00:00:00 2001 > From: Jan Nieuwenhuizen > Date: Sat, 29 Jan 2011 19:52:39 +0100 > Subject: [PATCH 4/4] Mingw compile fixes. [...] > --- a/libguile/bdw-gc.h > +++ b/libguile/bdw-gc.h > @@ -30,7 +30,9 @@ > allocation. */ > > # define GC_THREADS 1 > +#ifndef __MINGW32__ > # define GC_REDIRECT_TO_LOCAL 1 > +#endif /* __MINGW32__ */ Why? > --- a/libguile/deprecated.c > +++ b/libguile/deprecated.c > @@ -1639,7 +1639,7 @@ scm_i_fluidp (SCM x) > > /* Networking. */ > > -#ifdef HAVE_NETWORKING > +#ifdef HAVE_IPV6 > > SCM_DEFINE (scm_inet_aton, "inet-aton", 1, 0, 0, > (SCM address), > @@ -1674,7 +1674,7 @@ SCM_DEFINE (scm_inet_ntoa, "inet-ntoa", 1, 0, 0, > } > #undef FUNC_NAME > > -#endif /* HAVE_NETWORKING */ > +#endif /* HAVE_IPV6 */ Commit e91f21dc1093dc7be139f99d211edee01a64705f should fix it, differently. > --- a/libguile/filesys.c > +++ b/libguile/filesys.c > @@ -523,7 +523,7 @@ static int fstat_Win32 (int fdes, struct stat *buf) > /* Is this a socket ? */ > if (getsockopt (fdes, SOL_SOCKET, SO_ERROR, (void *) &error, &optlen) >= 0) > { > - buf->st_mode = _S_IFSOCK | _S_IREAD | _S_IWRITE | _S_IEXEC; > + buf->st_mode = _S_IREAD | _S_IWRITE | _S_IEXEC; Why? Isn’t ‘_S_IFSOCK’ defined on all MinGW? > --- a/libguile/net_db.c > +++ b/libguile/net_db.c > @@ -456,6 +456,7 @@ SCM_DEFINE (scm_setserv, "setserv", 0, 1, 0, > > SCM_SYMBOL (sym_getaddrinfo_error, "getaddrinfo-error"); > > +#ifndef __MINGW32__ > /* Make sure the `AI_*' flags can be stored as INUMs. */ > verify (SCM_I_INUM (SCM_I_MAKINUM (AI_ALL)) == AI_ALL); Does MinGW lack getaddrinfo? Gnulib’s ‘getaddrinfo’ module, which we use, is supposed to take care of this, i.e., it should fall back to ‘gethostbyname’ if needed. > --- a/libguile/ports.h > +++ b/libguile/ports.h > @@ -26,6 +26,7 @@ > > #include "libguile/__scm.h" > > +#include Applied. > --- a/libguile/socket.c > +++ b/libguile/socket.c > @@ -40,6 +40,7 @@ > > #ifdef __MINGW32__ > #include "win32-socket.h" > +#include > #endif > > #ifdef HAVE_STDINT_H Applied. Thanks! Ludo’.