This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH,Take 3] Fix make closures.c use dlmmap,dlmunmap on cygwin.


[ refs: http://gcc.gnu.org/ml/gcc-patches/2009-06/threads.html#02228
        http://gcc.gnu.org/ml/gcc-patches/2009-07/threads.html#00352 ]


    Hi again,

  This time I let it complete bootstrap before posting and ran the testsuite too.

>                 === libffi tests ===
> 
> 
> Running target unix
> FAIL: libffi.call/cls_1_1byte.c output pattern test, is 12 178: 190
> FAIL: libffi.call/cls_2byte.c output pattern test, is 12 127 1 13: 13 140
> FAIL: libffi.call/cls_align_pointer.c (test for excess errors)
> FAIL: libffi.call/return_sc.c execution test
> FAIL: libffi.call/struct5.c execution test
> FAIL: libffi.call/cls_1_1byte.c output pattern test, is 12 178: 190
> FAIL: libffi.call/cls_2byte.c output pattern test, is 12 127 1 13: 13 140
> FAIL: libffi.call/return_sc.c execution test
> FAIL: libffi.call/struct5.c execution test
> FAIL: libffi.call/cls_1_1byte.c output pattern test, is 12 178: 190
> FAIL: libffi.call/cls_2byte.c output pattern test, is 12 127 1 13: 13 140
> FAIL: libffi.call/return_sc.c execution test
> FAIL: libffi.call/struct5.c execution test
> FAIL: libffi.call/cls_1_1byte.c output pattern test, is 12 178: 190
> FAIL: libffi.call/cls_2byte.c output pattern test, is 12 127 1 13: 13 140
> FAIL: libffi.call/struct5.c execution test
> FAIL: libffi.call/cls_1_1byte.c output pattern test, is 12 178: 190
> FAIL: libffi.call/cls_2byte.c output pattern test, is 12 127 1 13: 13 140
> FAIL: libffi.call/return_sc.c execution test
> FAIL: libffi.call/struct5.c execution test
> 
>                 === libffi Summary ===
> 
> # of expected passes            1609
> # of unexpected failures        20
> # of expected failures          10

  These are comparable to the last recorded results on the
-testresults list:

  http://gcc.gnu.org/ml/gcc-testresults/2009-06/msg00433.html

although there appears to be one regression:

+FAIL: libffi.call/cls_align_pointer.c (test for excess errors)

which is an unrelated format string warning.  The remaining new failures are
in new tests.  At least it builds again now and works comparably to how it
used to.

libffi/ChangeLog:

	* src/closures.c (is_selinux_enabled):  Define to 0 for cygwin.
	(dlmmap, dlmunmap):  Use POSIX versions on cygwin.

  Ok?

    cheers,
      DaveK

Index: libffi/src/closures.c
===================================================================
--- libffi/src/closures.c	(revision 149338)
+++ libffi/src/closures.c	(working copy)
@@ -165,7 +165,13 @@
 
 #define is_selinux_enabled() 0
 
-#endif
+#endif /* !FFI_MMAP_EXEC_SELINUX */
+
+#elif defined (__CYGWIN__)
+
+/* Cygwin is Linux-like, but not quite that Linux-like.  */
+#define is_selinux_enabled() 0
+
 #endif /* !defined(X86_WIN32) && !defined(X86_WIN64) */
 
 /* Declare all functions defined in dlmalloc.c as static.  */
@@ -185,11 +191,11 @@
 static size_t dlmalloc_usable_size(void*) MAYBE_UNUSED;
 static void dlmalloc_stats(void) MAYBE_UNUSED;
 
-#if !defined(X86_WIN32) && !defined(X86_WIN64)
+#if !(defined(X86_WIN32) || defined(X86_WIN64)) || defined (__CYGWIN__)
 /* Use these for mmap and munmap within dlmalloc.c.  */
 static void *dlmmap(void *, size_t, int, int, int, off_t);
 static int dlmunmap(void *, size_t);
-#endif /* !defined(X86_WIN32) && !defined(X86_WIN64) */
+#endif /* !(defined(X86_WIN32) || defined(X86_WIN64)) || defined (__CYGWIN__) */
 
 #define mmap dlmmap
 #define munmap dlmunmap
@@ -199,7 +205,7 @@
 #undef mmap
 #undef munmap
 
-#if !defined(X86_WIN32) && !defined(X86_WIN64)
+#if !(defined(X86_WIN32) || defined(X86_WIN64)) || defined (__CYGWIN__)
 
 /* A mutex used to synchronize access to *exec* variables in this file.  */
 static pthread_mutex_t open_temp_exec_file_mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -514,7 +520,7 @@
 }
 #endif
 
-#endif /* !defined(X86_WIN32) && !defined(X86_WIN64) */
+#endif /* !(defined(X86_WIN32) || defined(X86_WIN64)) || defined (__CYGWIN__) */
 
 /* Allocate a chunk of memory with the given size.  Returns a pointer
    to the writable address, and sets *CODE to the executable

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]