bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cross-compiling with mingw


From: Neil Jerram
Subject: Re: Cross-compiling with mingw
Date: Thu, 25 Jun 2009 21:47:45 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Sylvain Beucler <address@hidden> writes:

>> i586-mingw32msvc-gcc -I/usr/local/cross-tools/i386-mingw32msvc/include -g 
>> -O2 -Wall -Wmissing-prototypes -Werror .libs/guile.exeS.o 
>> -I/usr/local/cross-tools/i386-mingw32msvc/include -o guile.exe guile-guile.o 
>> -Wl,--export-dynamic  -L/usr/local/cross-tools/i386-mingw32msvc/lib 
>> ./.libs/libguile.a /usr/local/cross-tools/i386-mingw32msvc/lib/libgmp.a 
>> -lws2_32 /usr/local/cross-tools/i386-mingw32msvc/lib/libltdl.dll.a   
>> -L/usr/local/cross-tools/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

The area of import/export/visibility has moved on a bit since this
report, and the only troublesome bindings now are 3 gdb_* ones, which
we don't actually need.  I've pushed the patch below, and hopefully
we'll now have a complete MinGW build (of branch_release-1-8).

Regards,
        Neil

>From 8510e39278161d3cbf8ec4ba87b123fe28763ed4 Mon Sep 17 00:00:00 2001
From: Neil Jerram <address@hidden>
Date: Thu, 25 Jun 2009 21:40:32 +0100
Subject: [PATCH] Remove GDB_INTERFACE stuff from guile's main program

The main motivation for this is wanting a successful MinGW build,
which is currently failing with:

guile-guile.o: In function `inner_main':
/home/neil/SW/Guile/ovnight/libguile/guile.c:55: undefined reference to 
`__imp__gdb_result'
/home/neil/SW/Guile/ovnight/libguile/guile.c:55: undefined reference to 
`__imp__gdb_output'
/home/neil/SW/Guile/ovnight/libguile/guile.c:55: undefined reference to 
`__imp__gdb_output_length'

The detailed problem here is to do with how those variables are
declared as exported from the libguile DLL and imported by the guile.c
main program.  But in fact we don't need to solve that problem because
the GDB interface is an idea that never actually happened.  So here we
just remove the offending variable references from guile.c.

For the record, Guile contains two kinds of GDB support, one of which
is real (and works, last time I tried it), and the other mythical.

The first kind is that libguile includes the utility functions
gdb_print, gdb_eval, etc., and the variable gdb_output.  These have no
purpose except for developers to use from GDB when debugging
something.  For example, if you have a SCM x and want to know what it
is, you can do:

(gdb) call gdb_print(x)
(gdb) p gdb_output

The second kind is that those utility functions are somehow declared
to GDB, and then GDB itself uses/calls them in some useful way.  This
was an interesting idea, but (AFAICT) never actually happened.

I think it's worth leaving gdb_interface.h in the repository and the
distribution, in case this idea is properly resurrected in the future.

* libguile/guile.c (top level): Remove GDB_INTERFACE declaration.
  (inner_main): Remove GDB_INTERFACE_INIT call.
---
 libguile/guile.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/libguile/guile.c b/libguile/guile.c
index c8341c2..3e01b57 100644
--- a/libguile/guile.c
+++ b/libguile/guile.c
@@ -40,11 +40,6 @@
 #include <winsock2.h>
 #endif
 
-/* Debugger interface (don't change the order of the following lines) */
-#define GDB_TYPE SCM
-#include <libguile/gdb_interface.h>
-GDB_INTERFACE;
-
 static void
 inner_main (void *closure SCM_UNUSED, int argc, char **argv)
 {
@@ -52,7 +47,6 @@ inner_main (void *closure SCM_UNUSED, int argc, char **argv)
   /* This is necessary to startup the Winsock API under Win32. */
   WSADATA WSAData;
   WSAStartup (0x0202, &WSAData);
-  GDB_INTERFACE_INIT;
 #endif /* __MINGW32__ */
 
   /* module initializations would go here */
-- 
1.5.6.5


reply via email to

[Prev in Thread] Current Thread [Next in Thread]