mail-archives/mono-bugs/2010-July/102081.html

216 строки
8.1 KiB
HTML
Исходник Обычный вид История

2019-06-06 22:03:35 +03:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-bugs] [Bug 621468] New: cross-compile script get confused by phread-win32 semaphore.h
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%20621468%5D%20New%3A%20cross-compile%20script%20get%20confused%20by%0A%20phread-win32%20semaphore.h&In-Reply-To=">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="102080.html">
<LINK REL="Next" HREF="102082.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-bugs] [Bug 621468] New: cross-compile script get confused by phread-win32 semaphore.h</H1>
<B>bugzilla_noreply at novell.com</B>
<A HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%20621468%5D%20New%3A%20cross-compile%20script%20get%20confused%20by%0A%20phread-win32%20semaphore.h&In-Reply-To="
TITLE="[Mono-bugs] [Bug 621468] New: cross-compile script get confused by phread-win32 semaphore.h">bugzilla_noreply at novell.com
</A><BR>
<I>Sun Jul 11 10:04:30 EDT 2010</I>
<P><UL>
<LI>Previous message: <A HREF="102080.html">[Mono-bugs] [Bug 609632] EGlib's g_get_home_dir() not able to read /etc/passwd
</A></li>
<LI>Next message: <A HREF="102082.html">[Mono-bugs] [Bug 621475] New: TextBox and RichTextBox crash on click when text value will be set to null
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#102081">[ date ]</a>
<a href="thread.html#102081">[ thread ]</a>
<a href="subject.html#102081">[ subject ]</a>
<a href="author.html#102081">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE><A HREF="http://bugzilla.novell.com/show_bug.cgi?id=621468">http://bugzilla.novell.com/show_bug.cgi?id=621468</A>
<A HREF="http://bugzilla.novell.com/show_bug.cgi?id=621468#c0">http://bugzilla.novell.com/show_bug.cgi?id=621468#c0</A>
Summary: cross-compile script get confused by phread-win32
semaphore.h
Classification: Mono
Product: Mono: Runtime
Version: SVN
Platform: x86-64
OS/Version: RHEL 5
Status: NEW
Severity: Normal
Priority: P5 - None
Component: io-layer
AssignedTo: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">lupus at novell.com</A>
ReportedBy: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">htl10 at users.sourceforge.net</A>
QAContact: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs at lists.ximian.com</A>
Found By: ---
Blocker: ---
User-Agent: Mozilla/5.0 (compatible; Konqueror/4.4; Linux) KHTML/4.4.4
(like Gecko) Fedora/4.4.4-1.fc13
It is on Fedora 13, which can optionally have mingw32-pthreads ; with current
svn head (r160202 today):
The problem is that fedora 13 's mingw32-pthreads comes with &lt;semaphore.h&gt; (
/usr/i686-pc-mingw32/sys-root/mingw/include/semaphore.h) which the configure
script can detect when driven by ./build-mingw32.sh . Now, of course if
building for windows (cross-compiling), one should be using windows semaphore
rather than pthread-win32 semaphore. Things gets very confused and broken due
to the presence of /usr/i686-pc-mingw32/sys-root/mingw/include/semaphore.h and
/configure setting HAVE_SEMAPHORE_H .
I found that I need to unset HAVE_SEMAPHORE_H like this below in two places for
svn r160202 to build. (or move the header
&quot;/usr/i686-pc-mingw32/sys-root/mingw/include/semaphore.h&quot;, for it not to be
detected, which is more troublesome).
-----------------
diff --git a/mono/io-layer/semaphores.c b/mono/io-layer/semaphores.c
index 73fda73..bb526b1 100644
--- a/mono/io-layer/semaphores.c
+++ b/mono/io-layer/semaphores.c
@@ -10,6 +10,9 @@
#include &lt;config.h&gt;
#include &lt;glib.h&gt;
#include &lt;pthread.h&gt;
+#if defined(__WIN32)
+#undef HAVE_SEMAPHORE_H
+#endif
#ifdef HAVE_SEMAPHORE_H
#include &lt;semaphore.h&gt;
#endif
diff --git a/mono/utils/mono-semaphore.h b/mono/utils/mono-semaphore.h
index d6be806..1ed0518 100644
--- a/mono/utils/mono-semaphore.h
+++ b/mono/utils/mono-semaphore.h
@@ -12,6 +12,9 @@
#include &lt;config.h&gt;
#include &lt;glib.h&gt;
+#if defined(__WIN32)
+#undef HAVE_SEMAPHORE_H
+#endif
#ifdef HAVE_SEMAPHORE_H
#include &lt;semaphore.h&gt;
#endif
--------------------------------------
Can you consider putting something similar (TARGET_WIN32?) to undef
HAVE_SEMAPHORE_H so as to use windows semaphore?
Reproducible: Always
Steps to Reproduce:
1. have semaphore.h from pthreads and put it somewhere findable by the mingw
cross-compiler
2. run ./build-mingw32.sh to attempt cross-compiling
3. compilation fails when compiling a file ...../mono-semephore.c , about
mode_t
Actual Results:
compilation fails
Expected Results:
compilation continues and build finishes.
The message:
--------
make[4]: Entering directory
`/home/Hin-Tak/tmp-git/mono-svn/build-cross-windows/mono/utils'
/bin/sh ../../libtool --tag=CC --mode=compile i686-pc-mingw32-gcc
-DHAVE_CONFIG_H -I. -I../../../mono/utils -I../.. -I../../.. -I../../../mono
-I../../../libgc/include -I../../../eglib/src -I../../eglib/src
-DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0501 -D_UNICODE -DUNICODE
-DWIN32_THREADS -DFD_SETSIZE=1024 -g -O2 -fno-strict-aliasing
-Wdeclaration-after-statement -g -Wall -Wunused -Wmissing-prototypes
-Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes
-Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings
-mno-tls-direct-seg-refs -MT mono-semaphore.lo -MD -MP -MF
deps/mono-semaphore.Tpo -c -o mono-semaphore.lo
./../../mono/utils/mono-semaphore.c
libtool: compile: i686-pc-mingw32-gcc -DHAVE_CONFIG_H -I.
-I../../../mono/utils -I../.. -I../../.. -I../../../mono
-I../../../libgc/include -I../../../eglib/src -I../../eglib/src -DWINVER=0x0500
-D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0501 -D_UNICODE -DUNICODE -DWIN32_THREADS
-DFD_SETSIZE=1024 -g -O2 -fno-strict-aliasing -Wdeclaration-after-statement -g
-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes
-Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual
-Wwrite-strings -mno-tls-direct-seg-refs -MT mono-semaphore.lo -MD -MP -MF
deps/mono-semaphore.Tpo -c ../../../mono/utils/mono-semaphore.c -DDLL_EXPORT
-DPIC -o .libs/mono-semaphore.o
./../../mono/utils/mono-semaphore.c: In function 'mono_sem_timedwait':
./../../mono/utils/mono-semaphore.c:37: error: storage size of 'ts' isn't
known
./../../mono/utils/mono-semaphore.c:37: error: storage size of 'copy' isn't
known
./../../mono/utils/mono-semaphore.c:51: warning: implicit declaration of
function 'gettimeofday'
./../../mono/utils/mono-semaphore.c:51: warning: nested extern declaration of
'gettimeofday'
./../../mono/utils/mono-semaphore.c:37: warning: unused variable 'copy'
./../../mono/utils/mono-semaphore.c:37: warning: unused variable 'ts'
make[4]: *** [mono-semaphore.lo] Error 1
-------------
--
Configure bugmail: <A HREF="http://bugzilla.novell.com/userprefs.cgi?tab=email">http://bugzilla.novell.com/userprefs.cgi?tab=email</A>
------- You are receiving this mail because: -------
You are the QA contact for the bug.
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="102080.html">[Mono-bugs] [Bug 609632] EGlib's g_get_home_dir() not able to read /etc/passwd
</A></li>
<LI>Next message: <A HREF="102082.html">[Mono-bugs] [Bug 621475] New: TextBox and RichTextBox crash on click when text value will be set to null
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#102081">[ date ]</a>
<a href="thread.html#102081">[ thread ]</a>
<a href="subject.html#102081">[ subject ]</a>
<a href="author.html#102081">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/mono-bugs">More information about the mono-bugs
mailing list</a><br>
</body></html>