diff options
Diffstat (limited to 'lang/mono/patches')
-rw-r--r-- | lang/mono/patches/patch-bb | 66 | ||||
-rw-r--r-- | lang/mono/patches/patch-cc | 34 | ||||
-rw-r--r-- | lang/mono/patches/patch-cf | 16 | ||||
-rw-r--r-- | lang/mono/patches/patch-cg | 155 | ||||
-rw-r--r-- | lang/mono/patches/patch-ch | 11 | ||||
-rw-r--r-- | lang/mono/patches/patch-ci | 21 | ||||
-rw-r--r-- | lang/mono/patches/patch-dd | 23 |
7 files changed, 5 insertions, 321 deletions
diff --git a/lang/mono/patches/patch-bb b/lang/mono/patches/patch-bb deleted file mode 100644 index 5bb1ae2eba8..00000000000 --- a/lang/mono/patches/patch-bb +++ /dev/null @@ -1,66 +0,0 @@ -$NetBSD: patch-bb,v 1.4 2008/11/19 11:17:49 kefren Exp $ ---- mono/io-layer/atomic.h.orig 2008-07-01 20:50:32.000000000 +0300 -+++ mono/io-layer/atomic.h 2008-11-19 11:37:19.000000000 +0200 -@@ -10,11 +10,61 @@ - #ifndef _WAPI_ATOMIC_H_ - #define _WAPI_ATOMIC_H_ - -+#if defined(__NetBSD__) -+#include <sys/param.h> -+ -+#if __NetBSD_Version__ > 499004000 -+#include <sys/atomic.h> -+#define HAVE_ATOMIC_OPS -+#endif -+ -+#endif -+ - #include <glib.h> - - #include "mono/io-layer/wapi.h" - --#if defined(__i386__) || defined(__x86_64__) -+#if defined(__NetBSD__) && defined(HAVE_ATOMIC_OPS) -+ -+#define WAPI_ATOMIC_ASM -+static inline gint32 InterlockedCompareExchange(volatile gint32 *dest, -+ gint32 exch, gint32 comp) -+{ -+ return atomic_cas_32((uint32_t*)dest, comp, exch); -+} -+ -+static inline gpointer InterlockedCompareExchangePointer(volatile gpointer *dest, gpointer exch, gpointer comp) -+{ -+ return atomic_cas_ptr(dest, comp, exch); -+} -+ -+static inline gint32 InterlockedIncrement(volatile gint32 *val) -+{ -+ return atomic_inc_32_nv((uint32_t*)val); -+} -+ -+static inline gint32 InterlockedDecrement(volatile gint32 *val) -+{ -+ return atomic_dec_32_nv((uint32_t*)val); -+} -+ -+static inline gint32 InterlockedExchange(volatile gint32 *val, gint32 new_val) -+{ -+ return atomic_swap_32((uint32_t*)val, new_val); -+} -+ -+static inline gpointer InterlockedExchangePointer(volatile gpointer *val, -+ gpointer new_val) -+{ -+ return atomic_swap_ptr(val, new_val); -+} -+ -+static inline gint32 InterlockedExchangeAdd(volatile gint32 *val, gint32 add) -+{ -+ return atomic_add_32_nv((uint32_t*)val, add) - add; -+} -+ -+#elif defined(__i386__) || defined(__x86_64__) - #define WAPI_ATOMIC_ASM - - /* diff --git a/lang/mono/patches/patch-cc b/lang/mono/patches/patch-cc deleted file mode 100644 index 9c8a9553fa1..00000000000 --- a/lang/mono/patches/patch-cc +++ /dev/null @@ -1,34 +0,0 @@ -$NetBSD: patch-cc,v 1.2 2008/11/21 08:00:49 kefren Exp $ ---- mono/mini/mini-amd64.h.orig 2008-09-02 18:42:54.000000000 +0300 -+++ mono/mini/mini-amd64.h 2008-11-21 09:42:31.000000000 +0200 -@@ -229,7 +229,29 @@ - - #endif /* PLATFORM_WIN32 */ - --#ifdef __FreeBSD__ -+#if defined (__NetBSD__) -+ -+#define REG_RAX 14 -+#define REG_RCX 3 -+#define REG_RDX 2 -+#define REG_RBX 13 -+#define REG_RSP 24 -+#define REG_RBP 12 -+#define REG_RSI 1 -+#define REG_RDI 0 -+#define REG_R8 4 -+#define REG_R9 5 -+#define REG_R10 6 -+#define REG_R11 7 -+#define REG_R12 8 -+#define REG_R13 9 -+#define REG_R14 10 -+#define REG_R15 11 -+#define REG_RIP 21 -+ -+#define MONO_ARCH_NOMAP32BIT -+ -+#elif defined (__FreeBSD__) - - #define REG_RAX 7 - #define REG_RCX 4 diff --git a/lang/mono/patches/patch-cf b/lang/mono/patches/patch-cf deleted file mode 100644 index 081f3019d9b..00000000000 --- a/lang/mono/patches/patch-cf +++ /dev/null @@ -1,16 +0,0 @@ -$NetBSD: patch-cf,v 1.4 2009/01/19 22:35:53 kefren Exp $ ---- mono/metadata/class.c.orig 2009-01-09 04:48:42.000000000 +0200 -+++ mono/metadata/class.c 2009-01-19 08:27:07.000000000 +0200 -@@ -7534,7 +7534,12 @@ - mono_class_generic_sharing_enabled (MonoClass *class) - { - #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__ppc__) || defined(__powerpc__) -+#if defined(__NetBSD__) && defined(__x86_64__) -+ /* https://bugzilla.novell.com/show_bug.cgi?id=434457 */ -+ static gboolean supported = FALSE; -+#else - static gboolean supported = TRUE; -+#endif - #else - /* Not supported by the JIT backends */ - static gboolean supported = FALSE; diff --git a/lang/mono/patches/patch-cg b/lang/mono/patches/patch-cg deleted file mode 100644 index 39216e7bc16..00000000000 --- a/lang/mono/patches/patch-cg +++ /dev/null @@ -1,155 +0,0 @@ -$NetBSD: patch-cg,v 1.3 2009/01/19 22:35:53 kefren Exp $ ---- mono/utils/mono-mmap.c.orig 2009-01-19 10:32:55.000000000 +0200 -+++ mono/utils/mono-mmap.c 2009-01-19 18:29:41.000000000 +0200 -@@ -7,6 +7,9 @@ - #include <sys/types.h> - #include <sys/stat.h> - #include <sys/mman.h> -+#ifdef __NetBSD__ -+#include <sys/shm.h> -+#endif - #include <fcntl.h> - #include <string.h> - #include <unistd.h> -@@ -402,7 +405,11 @@ - const char *name; - int i = 0; - int curpid = getpid (); -+#ifdef __NetBSD__ -+ GDir *dir = g_dir_open ("/tmp/", 0, NULL); -+#else - GDir *dir = g_dir_open ("/dev/shm/", 0, NULL); -+#endif - if (!dir) - return mono_shared_area_instances_slow (array, count, cleanup); - while ((name = g_dir_read_name (dir))) { -@@ -421,8 +428,13 @@ - } - if (curpid != pid && kill (pid, SIGCONT) == -1 && errno == ESRCH) { - char buf [128]; -+#ifdef __NetBSD__ -+ g_snprintf (buf, sizeof (buf), "/tmp/mono.%d", pid); -+ unlink (buf); -+#else - g_snprintf (buf, sizeof (buf), "/mono.%d", pid); - shm_unlink (buf); -+#endif - } - } - g_dir_close (dir); -@@ -439,10 +451,23 @@ - char buf [128]; - void *res; - SAreaHeader *header; -+#ifdef __NetBSD__ -+ key_t skey; -+ int shms; -+#endif - - /* perform cleanup of segments left over from dead processes */ - mono_shared_area_instances_helper (NULL, 0, TRUE); -+#ifdef __NetBSD__ -+ g_snprintf(buf, sizeof (buf), "/tmp/mono.%d", pid); - -+ fd = open(buf, O_CREAT|O_EXCL|O_RDWR, S_IRUSR|S_IWUSR|S_IRGRP); -+ if (fd == -1 && errno == EEXIST) { -+ /* leftover */ -+ unlink(buf); -+ fd = open(buf, O_CREAT|O_EXCL|O_RDWR, S_IRUSR|S_IWUSR|S_IRGRP); -+ } -+#else - g_snprintf (buf, sizeof (buf), "/mono.%d", pid); - - fd = shm_open (buf, O_CREAT|O_EXCL|O_RDWR, S_IRUSR|S_IWUSR|S_IRGRP); -@@ -451,11 +476,21 @@ - shm_unlink (buf); - fd = shm_open (buf, O_CREAT|O_EXCL|O_RDWR, S_IRUSR|S_IWUSR|S_IRGRP); - } -+#endif - /* in case of failure we try to return a memory area anyway, - * even if it means the data can't be read by other processes - */ - if (fd == -1) - return malloc_shared_area (pid); -+#ifdef __NetBSD__ -+ if ((skey = ftok(buf, 'M')) == ((key_t)-1) || -+ (shms = shmget(skey, size, IPC_CREAT)) == -1 || -+ (res = shmat(shms, NULL, 0)) == ((void*)-1)) { -+ close(fd); -+ unlink(buf); -+ return malloc_shared_area(pid); -+ } -+#else - if (ftruncate (fd, size) != 0) { - shm_unlink (buf); - close (fd); -@@ -466,6 +501,7 @@ - close (fd); - return malloc_shared_area (pid); - } -+#endif - /* we don't need the file descriptor anymore */ - close (fd); - header = res; -@@ -482,8 +518,18 @@ - mono_shared_area_remove (void) - { - char buf [128]; -+#ifdef __NetBSD__ -+ key_t skey; -+ int shms; -+ struct shmid_ds shmds; -+ g_snprintf(buf, sizeof (buf), "/tmp/mono.%d", getpid()); -+ if ((skey = ftok(buf, 'M')) != ((key_t)-1) && -+ (shms = shmget(skey, mono_pagesize(), IPC_CREAT)) != -1) -+ shmctl(shms, IPC_RMID, &shmds); -+#else - g_snprintf (buf, sizeof (buf), "/mono.%d", getpid ()); - shm_unlink (buf); -+#endif - if (malloced_shared_area) - g_free (malloced_shared_area); - } -@@ -497,6 +543,22 @@ - char buf [128]; - void *res; - -+#ifdef __NetBSD__ -+ key_t skey; -+ int shms; -+ -+ g_snprintf (buf, sizeof (buf), "/tmp/mono.%d", GPOINTER_TO_INT (pid)); -+ -+ fd = open(buf, O_RDONLY, S_IRUSR|S_IRGRP); -+ if (fd == -1) -+ return NULL; -+ if ((skey = ftok(buf, 'M')) != ((key_t)-1) || -+ (shms = shmget(skey, mono_pagesize(), IPC_CREAT)) != -1 || -+ (res = shmat(shms, NULL, 0)) == ((void*)-1)) { -+ close(fd); -+ return NULL; -+ } -+#else - g_snprintf (buf, sizeof (buf), "/mono.%d", GPOINTER_TO_INT (pid)); - - fd = shm_open (buf, O_RDONLY, S_IRUSR|S_IRGRP); -@@ -507,6 +569,7 @@ - close (fd); - return NULL; - } -+#endif - /* FIXME: validate the area */ - /* we don't need the file descriptor anymore */ - close (fd); -@@ -517,7 +580,11 @@ - mono_shared_area_unload (void *area) - { - /* FIXME: currently we load only a page */ -+#ifdef __NetBSD__ -+ shmdt(area); -+#else - munmap (area, mono_pagesize ()); -+#endif - } - - int diff --git a/lang/mono/patches/patch-ch b/lang/mono/patches/patch-ch index 909a3866e67..c3f23387c14 100644 --- a/lang/mono/patches/patch-ch +++ b/lang/mono/patches/patch-ch @@ -1,11 +1,10 @@ -$NetBSD: patch-ch,v 1.3 2009/01/19 22:35:53 kefren Exp $ ---- mcs/tools/csharplib/Makefile.orig 2009-01-19 19:19:08.000000000 +0200 -+++ mcs/tools/csharplib/Makefile 2009-01-19 19:14:53.000000000 +0200 -@@ -31,6 +31,6 @@ +--- mcs/tools/csharplib/Makefile.orig 2009-04-07 07:16:59.000000000 +0300 ++++ mcs/tools/csharplib/Makefile 2009-04-07 07:17:14.000000000 +0300 +@@ -33,6 +33,6 @@ $(the_lib): $(the_libdir)/.stamp Makefile Mono.CSharp.dll.sources $(build_lib) $(MKINSTALLDIRS) fixup -- $(MONO_PATH) $(RUNTIME) ../linker/monolinker.exe -d fixup/$(PROFILE) -o out -l none -c skip -b true -x link.xml -s Mono.Tuner.AdjustVisibility,Mono.Tuner:OutputStep -s Mono.Tuner.PrintStatus,Mono.Tuner:OutputStep -i compiler.info -+ $(MONO_PATH) $(RUNTIME) ../linker/monolinker.exe -d fixup/$(PROFILE) -o out -lnone -c skip -b true -x link.xml -s Mono.Tuner.AdjustVisibility,Mono.Tuner:OutputStep -s Mono.Tuner.PrintStatus,Mono.Tuner:OutputStep -i compiler.info +- $(MONO_PATH) $(RUNTIME) $(LINKER) -d fixup/$(PROFILE) -o out -l none -c skip -b true -x link.xml -s Mono.Tuner.AdjustVisibility,Mono.Tuner:OutputStep -s Mono.Tuner.PrintStatus,Mono.Tuner:OutputStep -i compiler.info ++ $(MONO_PATH) $(RUNTIME) $(LINKER) -d fixup/$(PROFILE) -o out -lnone -c skip -b true -x link.xml -s Mono.Tuner.AdjustVisibility,Mono.Tuner:OutputStep -s Mono.Tuner.PrintStatus,Mono.Tuner:OutputStep -i compiler.info $(SN) $(SNFLAGS) out/Mono.CSharp.dll $(topdir)/class/mono.snk cp out/Mono.CSharp.dll $(the_lib) diff --git a/lang/mono/patches/patch-ci b/lang/mono/patches/patch-ci deleted file mode 100644 index a9fe375d413..00000000000 --- a/lang/mono/patches/patch-ci +++ /dev/null @@ -1,21 +0,0 @@ -$NetBSD: patch-ci,v 1.3 2009/02/12 19:44:50 kefren Exp $ ---- mono/mini/mini-amd64.c.orig 2008-11-11 06:56:14.000000000 +0200 -+++ mono/mini/mini-amd64.c 2009-02-12 21:06:56.000000000 +0200 -@@ -6300,10 +6300,14 @@ - else - item->chunk_size += MOV_REG_IMM_SIZE + CMP_REG_REG_SIZE; - } -- if (vtable_is_32bit) -- item->chunk_size += MOV_REG_IMM_32BIT_SIZE; -- else -+ if (fail_tramp) { - item->chunk_size += MOV_REG_IMM_SIZE; -+ } else { -+ if (vtable_is_32bit) -+ item->chunk_size += MOV_REG_IMM_32BIT_SIZE; -+ else -+ item->chunk_size += MOV_REG_IMM_SIZE; -+ } - item->chunk_size += BR_SMALL_SIZE + JUMP_REG_SIZE; - } else { - if (fail_tramp) { diff --git a/lang/mono/patches/patch-dd b/lang/mono/patches/patch-dd deleted file mode 100644 index b9d260b957e..00000000000 --- a/lang/mono/patches/patch-dd +++ /dev/null @@ -1,23 +0,0 @@ ---- mono/metadata/attach.c.orig 2009-03-03 15:32:27 -0800 -+++ mono/metadata/attach.c 2009-03-03 15:48:41 -0800 -@@ -366,12 +366,20 @@ ipc_connect (void) - */ - /* FIXME: Use TMP ? */ - pw = NULL; -+#ifndef HAVE_GETPWUID_R -+ pw = getpwuid(getuid()); -+ if (pw == NULL) { -+ fprintf(stderr, "attach: getpwuid () failed.\n"); -+ return; -+ } -+#else - res = getpwuid_r (getuid (), &pwbuf, buf, sizeof (buf), &pw); - if (res != 0) { - fprintf (stderr, "attach: getpwuid_r () failed.\n"); - return; - } - g_assert (pw); -+#endif - directory = g_strdup_printf ("/tmp/mono-%s", pw->pw_name); - res = mkdir (directory, S_IRUSR | S_IWUSR | S_IXUSR); - if (res != 0) { |