[Top][All Lists]

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

Again on Windows support

From: carlo\.bramix
Subject: Again on Windows support
Date: Wed, 18 Mar 2009 12:05:06 +0100

I saw there was a try for fixing the bug with guile and pthreads-w32.
I just wanted to say, although the fix seems to work, in my opinion this is the 
wrong way to proceed.
"struct timespec" does not exist under Windows, this is the truth.
It has been added as an hack into pthreads-w32 just for prototype compatibility 
with some functions.
I do not think it is a good idea to rely on that.
I believe it's MUCH better and safe to have it declared as "struct 
BTW, beside this problem, Guile 1.8.6 has still troubles when linking under 
It cannot create shared libraries because (unexisting) problems with Winsock 
It says:
"*** Warning: linker path does not have real file for library -lws2_32."
Perhaps you are using too old stuff or something because I fixed this problem 
by using a recent stable version of autotools and libtool.
I deleted all generated files and I reconfigured everything with:

autoconf 2.61
automake 1.10.1
libtool 1.5.26

and it worked fine.

With a number of difficulties that I prefer to not tell, I was able to get a 
recent snapshot of your GIT repository on my Windows PC.
Then I tried to compile.
Here there are some fixes and some problems still unresolved.
I understand that a patch would be better, but at the time of writing GIT and 
Windows do not seem to be good friends.
So I hope that a good soul will be able to do some of the very simple fixes 
described here:

function alloca() is undefined because under Windows the intrinsic function is 
called _alloca().
The compatibility is got by adding:

# include <malloc.h>

Hopefully, the presence of malloc.h is already tested by configure script.

sys/mmap.h is absent.
We need to modify in this file:

#  include <sys/mman.h>

and add the check of presence into configure script.


'ulong' is undefined. I temporary added its declaration in this file for 
allowing the compilation.


compilation of function make_objcode_by_mmap() fails because function mmap() 
does not exist.
There is already a macro called USE_MMAP that may help us.
I fixed the function by writing a thing like this one:

#ifdef USE_MMAP

I got a conflict type with tzname[] because it enters into #ifndef tzname ... 
#endif for SGI.
Into Windows includes, this vector is declared with dllimport and here it is 
not, that's why they conflict.
I believe it would be better remove that test and leave the detection of 
tzname[] to configure script.

#if !defined HAVE_TZNAME && !defined __MINGW32__
extern char *tzname[];

I was not able to compile Guile without threads.
If you do it, you get these warnings (since there is -Werror, compilation is 

../../guile-git/libguile/threads.c: In function `scm_i_with_guile_and_parent':
../../guile-git/libguile/threads.c:850: warning: statement with no effect
../../guile-git/libguile/threads.c:852: warning: statement with no effect
../../guile-git/libguile/threads.c: In function `scm_cancel_thread':
../../guile-git/libguile/threads.c:1059: warning: statement with no effect

I had to force --with-threads for bypassing this trouble.
Normally the threads are not enabled under Windows because you must use 
-lpthreadGC2 instead of -lpthread, that's why I had to force the option and add 

I have not really understood this error:

../../guile-git/libguile/vm-engine.c: In function `vm_regular_engine':
../../guile-git/libguile/vm-engine.c:277: error: unable to find a register to 
spill in class `SIREG'
../../guile-git/libguile/vm-engine.c:277: error: this is the insn:
(insn:HI 1398 1397 1399 72 ../../guile-git/libguile/vm-i-system.c:167 (parallel 
            (set (reg:SI 2 cx [398])
                (const_int 0 [0x0]))
            (set (reg/f:SI 1 dx [396])
                (plus:SI (ashift:SI (reg:SI 2 cx [398])
                        (const_int 2 [0x2]))
                    (reg/f:SI 1 dx [396])))
            (set (reg:SI 3 bx [orig:397 sp ] [397])
                (plus:SI (ashift:SI (reg:SI 2 cx [398])
                        (const_int 2 [0x2]))
                    (reg:SI 3 bx [orig:397 sp ] [397])))
            (set (mem:BLK (reg/f:SI 1 dx [396]) [0 A8])
                (mem:BLK (reg:SI 3 bx [orig:397 sp ] [397]) [0 A8]))
            (use (reg:SI 2 cx [398]))
            (use (reg:SI 19 dirflag))
        ]) 447 {*rep_movsi} (insn_list 1396 (insn_list 1397 (nil)))
    (expr_list:REG_DEAD (reg:SI 19 dirflag)
        (expr_list:REG_UNUSED (reg:SI 3 bx [orig:397 sp ] [397])
            (expr_list:REG_UNUSED (reg/f:SI 1 dx [396])
                (expr_list:REG_UNUSED (reg:SI 2 cx [398])
../../guile-git/libguile/vm-engine.c:277: confused by earlier errors, bailing 
make[3]: *** [libguile_la-vm.lo] Error 1

It happens with GCC3.4.5, GCC4.1.3 and GCC4.3.0.

I was able to compile with attribute "internal" only with GCC3.
GCC 4.x says that it's ignored and compilation is interrupted.
why not checking it too with configure script?

That's all for now.
I hope you will find it useful.


Carlo Bramini.

reply via email to

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