[Mono-dev] mono from git will not build on cygwin 32

Mark Lintner mlintner at sinenomine.net
Wed Sep 4 17:21:22 UTC 2013


The problems turns out to be in the mingw headers but since I get another error in mono later I don't know if it is this simple.



In file included from process.c:37:0:
/usr/i686-pc-mingw32/sys-root/mingw/include/ddk/ntapi.h:49:15: error: conflictin
g types for 'PEXECUTION_STATE'
In file included from /usr/i686-pc-mingw32/sys-root/mingw/include/windows.h:62:0
,
                 from /usr/i686-pc-mingw32/sys-root/mingw/include/winsock2.h:40,

                 from ../../mono/io-layer/io-layer.h:24,
                 from ../../mono/metadata/domain-internals.h:15,
                 from ../../mono/metadata/metadata-internals.h:8,
                 from ../../mono/metadata/class-internals.h:10,
                 from ../../mono/metadata/object-internals.h:8,
                 from process.c:16:
/usr/i686-pc-mingw32/sys-root/mingw/include/winbase.h:1973:33: note: previous de
claration of 'PEXECUTION_STATE' was here
process.c: In function 'ves_icall_System_Diagnostics_Process_GetProcesses_intern
al':
process.c:912:3: warning: passing argument 1 of 'EnumProcesses' from incompatibl
e pointer type [enabled by default]
In file included from ../../mono/io-layer/io-layer.h:34:0,
                 from ../../mono/metadata/domain-internals.h:15,
                 from ../../mono/metadata/metadata-internals.h:8,
                 from ../../mono/metadata/class-internals.h:10,
                 from ../../mono/metadata/object-internals.h:8,
                 from process.c:16:
/usr/i686-pc-mingw32/sys-root/mingw/include/psapi.h:108:13: note: expected 'DWOR
D *' but argument is of type 'guint32 *'
Reaping losing child 0x802750c0 PID 8236
Makefile:2221: recipe for target `libmonoruntime_la-process.lo' failed
make: *** [libmonoruntime_la-process.lo] Error 1
Removing child 0x802750c0 PID 8236 from chain.

This seems to be a problem:

/usr/i686-pc-mingw32/sys-root/mingw/include/ddk/ntapi.h:49:15: error: conflictin
g types for 'PEXECUTION_STATE'



I found this in mingw/include/ddk/ntapi.h

/* FIXME: Unknown definitions */

typedef PVOID POBJECT_TYPE_LIST;

typedef PVOID PEXECUTION_STATE;

typedef PVOID PLANGID;

commenting out as follows:

/* FIXME: Unknown definitions */

typedef PVOID POBJECT_TYPE_LIST;

//typedef PVOID PEXECUTION_STATE;

typedef PVOID PLANGID;

----------------------------------------------
went back to the mono directory and

did make clean
followed by make

It looks like a mingw header problem not mono as I thought. It would seem like everyone should hit this now that mono must use mingw to do cygwin build. I guess this has to be fixed by mingw.



-------------------------------------------------------------------------------------------------------------------



Unfortunately build does not complete. Next stop is here.



ogc.a -L../../eglib/src /usr/src/mono/eglib/src/.libs/libeglib.a -lws2_32 -lpsap
i -lole32 -lwinmm -loleaut32 -ladvapi32 -lversion
../utils/.libs/libmonoutils.a(atomic.o): In function `InterlockedCompareExchange
64':
/usr/src/mono/mono/utils/atomic.c:240: undefined reference to `_imp__pthread_mut
ex_lock'
/usr/src/mono/mono/utils/atomic.c:246: undefined reference to `_imp__pthread_mut
ex_unlock'
collect2: error: ld returned 1 exit status
Reaping losing child 0x8029f118 PID 6776
Makefile:1243: recipe for target `pedump.exe' failed
make[3]: *** [pedump.exe] Error 1
Removing child 0x8029f118 PID 6776 from chain.
make[3]: Leaving directory `/usr/src/mono/mono/metadata'
Reaping losing child 0x800652c0 PID 8344
Makefile:429: recipe for target `all-recursive' failed
make[2]: *** [all-recursive] Error 1
Removing child 0x800652c0 PID 8344 from chain.
make[2]: Leaving directory `/usr/src/mono/mono'
Reaping losing child 0x80060de8 PID 8968
Makefile:510: recipe for target `all-recursive' failed
make[1]: *** [all-recursive] Error 1
Removing child 0x80060de8 PID 8968 from chain.
make[1]: Leaving directory `/usr/src/mono'
Reaping losing child 0x80088b28 PID 8692
Makefile:437: recipe for target `all' failed
make: *** [all] Error 2
Removing child 0x80088b28 PID 8692 from chain.



grep tells me this really is not defined



me at My-PC<mailto:me at My-PC> /usr/src/mono
$ grep -rl _imp__pthread_mutex_unlock .
./mono/utils/.libs/atomic.o
./mono/utils/.libs/libmonoutils.a
./mono/utils/atomic.o





So looking at atomic.c



#if defined (TARGET_MACH) && defined (TARGET_ARM) && (defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7S__))

gint64 InterlockedCompareExchange64(volatile gint64 *dest, gint64 exch, gint64 comp)  __attribute__ ((naked));

gint64
InterlockedCompareExchange64(volatile gint64 *dest, gint64 exch, gint64 comp)
{
 __asm__ (
 "push {r4, r5, r6, r7}\n"
 "ldr r4, [sp, #16]\n"
 "dmb\n"
"1:\n"
 "ldrexd r6, r7, [r0]\n"
 "cmp r7, r4\n"
 "bne 2f\n"
 "cmp r6, r3\n"
 "bne 2f\n"
 "strexd r5, r1, r2, [r0]\n"
 "cmp r5, #0\n"
 "bne 1b\n"
"2:\n"
 "dmb\n"
 "mov r0, r6\n"
 "mov r1, r7\n"
 "pop {r4, r5, r6, r7}\n"
 "bx lr\n"
 );
}

#else

gint64
InterlockedCompareExchange64(volatile gint64 *dest, gint64 exch, gint64 comp)
{
 gint64 old;

 pthread_mutex_lock (&spin);

 old = *dest;
 if(old == comp)
  *dest = exch;

 pthread_mutex_unlock (&spin);
 return old;
}

Windows has interlockedcompares. The if statement does not seem to be relevant to windows, neither option is correct for windows, I don't believe it should be building this file on windows and intel hardware. This all built fine a couple of months ago and it builds fine on Centos 6.4.

________________________________
From: Zoltan Varga [vargaz at gmail.com]
Sent: Tuesday, September 03, 2013 11:45 PM
To: Mark Lintner
Cc: mono-devel
Subject: Re: [Mono-dev] mono from git will not build on cygwin 32

Hi,

  Try running with make V=1, that will print more information.

           Zoltan


On Wed, Sep 4, 2013 at 6:05 AM, mlgo <mlintner at sinenomine.net<mailto:mlintner at sinenomine.net>> wrote:
I updated Cygwin and now it no longer supports compilation of mono with gcc.
There is no way to backlevel it. I found Zoltan's suggestion to use this
configure statement:

"Hi,

  mono master can be built on windows using the mingw cross-compiler gcc,
i.e. install the mingw-gcc package, and configure using:

./autogen.sh --host=i686-pc-mingw32
                  Zoltan"


I'm using mono from git. Cygwin has all the recommended packages and I did
not install the gcc-g++ but installed all mingw packages.  The build now
always stops here. I have reinstalled Cygwin several times and pulled a new
mono each time. I'm wondering now since there is a 64 bit Cygwin and a I
have 64 bit machine should I be configuring with mingw64 or something.
However I had the old Cygwin environment down to a science and now I'm
crippled again. Has anybody seen this yet. This seems like something
configure is failing to generate properly to map ming types to mono types.
Zoltan will know what to do about this if anybody. It doesn't seem like it
could be a bug in ming.

al':
process.c:912:3: warning: passing argument 1 of 'EnumProcesses' from
incompatibl
e pointer type [enabled by default]
In file included from ../../mono/io-layer/io-layer.h:34:0,
                 from ../../mono/metadata/domain-internals.h:15,
                 from ../../mono/metadata/metadata-internals.h:8,
                 from ../../mono/metadata/class-internals.h:10,
                 from ../../mono/metadata/object-internals.h:8,
                 from process.c:16:
/usr/i686-pc-mingw32/sys-root/mingw/include/psapi.h:108:13: note: expected
'DWOR
D *' but argument is of type 'guint32 *'
Makefile:2221: recipe for target `libmonoruntime_la-process.lo' failed
make[3]: *** [libmonoruntime_la-process.lo] Error 1
make[3]: Leaving directory `/usr/src/mono/mono/metadata'
Makefile:429: recipe for target `all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/src/mono/mono'
Makefile:510: recipe for target `all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/mono'
Makefile:437: recipe for target `all' failed
make: *** [all] Error 2



--
View this message in context: http://mono.1490590.n4.nabble.com/mono-from-git-will-not-build-on-cygwin-32-tp4660749.html
Sent from the Mono - Dev mailing list archive at Nabble.com.
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com<mailto:Mono-devel-list at lists.ximian.com>
http://lists.ximian.com/mailman/listinfo/mono-devel-list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20130904/d595b7b4/attachment.html>


More information about the Mono-devel-list mailing list