From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sylvain Beucler Newsgroups: gmane.lisp.guile.bugs Subject: Cross-compiling with mingw Date: Mon, 26 May 2008 22:43:44 +0200 Message-ID: <20080526204344.GA14261@perso.beuc.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1211834640 27746 80.91.229.12 (26 May 2008 20:44:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 26 May 2008 20:44:00 +0000 (UTC) To: bug-guile@gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Mon May 26 22:44:40 2008 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K0jYe-0002GR-G7 for guile-bugs@m.gmane.org; Mon, 26 May 2008 22:44:40 +0200 Original-Received: from localhost ([127.0.0.1]:41852 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K0jXt-0007Tq-Fd for guile-bugs@m.gmane.org; Mon, 26 May 2008 16:43:53 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K0jXp-0007TX-0z for bug-guile@gnu.org; Mon, 26 May 2008 16:43:49 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K0jXm-0007Sg-31 for bug-guile@gnu.org; Mon, 26 May 2008 16:43:48 -0400 Original-Received: from [199.232.76.173] (port=47733 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K0jXm-0007Sd-0B for bug-guile@gnu.org; Mon, 26 May 2008 16:43:46 -0400 Original-Received: from smtp3-g19.free.fr ([212.27.42.29]:58320) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K0jXl-0004RW-F3 for bug-guile@gnu.org; Mon, 26 May 2008 16:43:45 -0400 Original-Received: from smtp3-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp3-g19.free.fr (Postfix) with ESMTP id 7D5A717B5B5 for ; Mon, 26 May 2008 22:43:44 +0200 (CEST) Original-Received: from localhost.localdomain (unknown [82.238.35.175]) by smtp3-g19.free.fr (Postfix) with ESMTP id 4CE7817B52B for ; Mon, 26 May 2008 22:43:44 +0200 (CEST) Original-Received: from me by localhost.localdomain with local (Exim 4.69) (envelope-from ) id 1K0jXk-0003jc-1e for bug-guile@gnu.org; Mon, 26 May 2008 22:43:44 +0200 Content-Disposition: inline X-Operating-System: GNU/Linux User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:3878 Archived-At: Hi, I'm tring to cross-compile Guile from GNU/Linux with mingw (so I can statically build guile in a .exe without having to use that other OS). I cross-compiled gmp and libltdl (dependencies). Now I have a few troubles with guile: Act I) Configuration $ CPPFLAGS=3D"-I/usr/local/cross-tools/i386-mingw32msvc/include" \ LDFLAGS=3D"-L/usr/local/cross-tools/i386-mingw32msvc/lib" \ ./configure --host=3Di586-mingw32msvc --build=3Di686-pc-linux-gnu [...] checking for restartable system calls... configure: error: cannot run tes= t program while cross compiling The problem apparently lies in configure.in, macro AC_SYS_RESTARTABLE_SYS= CALLS Note that the autoconf documentation deprecates this macro: "These days portable programs [...] should not rely on `HAVE_RESTARTABLE_SYSCALLS', since nowadays whether a system call is restartable is a dynamic issue, not a configuration-time issue." I commented it out for a start. Act II) Compilation $ make [...] DLL_EXPORT -DPIC -o .libs/libguile_la-stime.o cc1: warnings being treated as errors stime.c:85: warning: =E2=80=98tzname=E2=80=99 redeclared without dllimpor= t attribute: previous dllimport ignored I found 2 references to this issue: - http://cygwin.com/ml/cygwin/2008-01/msg00491.html =3D> removed tzname - http://www.nabble.com/getdate-on-mingw:-tzname-problems-td14855896.html =3D> use HAVE_DECL_TZNAME instead I used the 2nd option: # if !HAVE_DECL_TZNAME /* For SGI. */ extern char *tzname[]; /* RS6000 and others reject char **tzname. */ #endif #if defined (__MINGW32__) # define tzname _tzname #endif Act III) Linking i586-mingw32msvc-gcc -I/usr/local/cross-tools/i386-mingw32msvc/include -g= -O2 -Wall -Wmissing-prototypes -Werror .libs/guile.exeS.o -I/usr/local/c= ross-tools/i386-mingw32msvc/include -o guile.exe guile-guile.o -Wl,--expo= rt-dynamic -L/usr/local/cross-tools/i386-mingw32msvc/lib ./.libs/libguil= e.a /usr/local/cross-tools/i386-mingw32msvc/lib/libgmp.a -lws2_32 /usr/lo= cal/cross-tools/i386-mingw32msvc/lib/libltdl.dll.a -L/usr/local/cross-t= ools/i386-mingw32msvc/lib -L/usr/local/cross-tools/i386-mingw32msvc/lib guile-guile.o: In function `main': /usr/src/guile-1.8.5/libguile/guile.c:74: undefined reference to `__imp__= scm_boot_guile' guile-guile.o: In function `inner_main': /usr/src/guile-1.8.5/libguile/guile.c:55: undefined reference to `__imp__= gdb_options' /usr/src/guile-1.8.5/libguile/guile.c:55: undefined reference to `__imp__= gdb_language' /usr/src/guile-1.8.5/libguile/guile.c:55: undefined reference to `__imp__= gdb_result' /usr/src/guile-1.8.5/libguile/guile.c:55: undefined reference to `__imp__= gdb_output' /usr/src/guile-1.8.5/libguile/guile.c:55: undefined reference to `__imp__= gdb_output_length' /usr/src/guile-1.8.5/libguile/guile.c:55: undefined reference to `__imp__= gdb_maybe_valid_type_p' /usr/src/guile-1.8.5/libguile/guile.c:55: undefined reference to `__imp__= gdb_read' /usr/src/guile-1.8.5/libguile/guile.c:55: undefined reference to `__imp__= gdb_eval' /usr/src/guile-1.8.5/libguile/guile.c:55: undefined reference to `__imp__= gdb_print' /usr/src/guile-1.8.5/libguile/guile.c:55: undefined reference to `__imp__= gdb_binding' /usr/src/guile-1.8.5/libguile/guile.c:59: undefined reference to `__imp__= scm_shell' collect2: ld returned 1 exit status rm -f .libs/guile.exeS.o make[3]: *** [guile.exe] Erreur 1 Duh! I'm out of ideas. Help? :) --=20 Sylvain