Skip to content

Commit

Permalink
Merge pull request #776 from Unity-Technologies/unity-master-staging
Browse files Browse the repository at this point in the history
Mono Bleeding Edge for Trunk
case 980742 - Fix 32-bit Windows Standalone failing to load Mono
  • Loading branch information
joncham authored Jan 2, 2018
2 parents 320954f + 37ff3f5 commit 29cbfa1
Show file tree
Hide file tree
Showing 350 changed files with 8,297 additions and 4,088 deletions.
File renamed without changes.
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Steps to Reproduce

1.
2.
3.

## Current Behavior

What is the current behavior?

## Expected Behavior

Please describe the behavior you are expecting

### On which platforms did you notice this

- [ ] macOS
- [ ] Linux
- [ ] Windows

**Version Used**:

You can use `mono --version` or About dialog to obtain this information

### Stacktrace

```
Please copy paste the Stacktrace here if available
```

13 changes: 1 addition & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,7 @@ section.
Reporting bugs
==============

To submit bug reports, please use [Xamarin's
Bugzilla](https://bugzilla.xamarin.com/)
To submit bug reports, please [open an issue on the mono GitHub repo](https://github.com/mono/mono/issues/new).

Please use the search facility to ensure the same bug hasn't already
been submitted and follow our
Expand Down Expand Up @@ -358,16 +357,6 @@ should be used.

* Or you can specify a path to a libgdiplus.

* `--disable-shared-memory`

* Use this option to disable the use of shared memory in
Mono (this is equivalent to setting the MONO_DISABLE_SHM
environment variable, although this removes the feature
completely).

* Disabling the shared memory support will disable certain
features like cross-process named mutexes.

* `--enable-minimal=LIST`

* Use this feature to specify optional runtime
Expand Down
37 changes: 12 additions & 25 deletions acceptance-tests/profiler-stress/runner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,16 @@ static class Program {
static readonly TimeSpan _timeout = TimeSpan.FromHours (9);

static readonly Dictionary<string, Predicate<Benchmark>> _filters = new Dictionary<string, Predicate<Benchmark>> {
{ "ironjs-v8", FilterArmArchitecture },
{ "ironjs-v8", FilterNotOnArm },
{ "msbiology", FilterNever },
};

static readonly Dictionary<string, Action<TestResult>> _processors = new Dictionary<string, Action<TestResult>> {
{ "msbiology", Process32BitOutOfMemory },
};

static string FilterInvalidXmlChars (string text) {
return Regex.Replace (text, @"[^\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]", string.Empty);
static bool FilterNever (Benchmark benchmark)
{
return false;
}

static bool FilterArmArchitecture (Benchmark benchmark)
static bool FilterNotOnArm (Benchmark benchmark)
{
#if ARCH_arm || ARCH_arm64
return false;
Expand All @@ -80,23 +78,15 @@ static bool FilterArmArchitecture (Benchmark benchmark)
#endif
}

static void Process32BitOutOfMemory (TestResult result)
{
if (Environment.Is64BitProcess)
return;

if (result.ExitCode == null || result.ExitCode == 0)
return;

if (result.StandardError.Contains ("OutOfMemoryException"))
result.ExitCode = 0;
}

static bool IsSupported (Benchmark benchmark)
{
return _filters.TryGetValue (benchmark.Name, out var filter) ? filter (benchmark) : true;
}

static string ReplaceInvalidXmlChars (string text) {
return Regex.Replace (text, @"[^\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]", string.Empty);
}

static int Main ()
{
var depDir = Path.Combine ("..", "external", "benchmarker");
Expand Down Expand Up @@ -227,9 +217,6 @@ static int Main ()
Console.WriteLine (result.StandardError);
}

if (_processors.TryGetValue (bench.Name, out var processor))
processor (result);

results.Add (result);
}

Expand Down Expand Up @@ -307,11 +294,11 @@ static int Main ()
writer.WriteStartElement ("failure");

writer.WriteStartElement ("message");
writer.WriteCData (FilterInvalidXmlChars (result.StandardOutput));
writer.WriteCData (ReplaceInvalidXmlChars (result.StandardOutput));
writer.WriteEndElement ();

writer.WriteStartElement ("stack-trace");
writer.WriteCData (FilterInvalidXmlChars (result.StandardError));
writer.WriteCData (ReplaceInvalidXmlChars (result.StandardError));
writer.WriteEndElement ();

writer.WriteEndElement ();
Expand Down
6 changes: 3 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Process this file with autoconf to produce a configure script.
#AC_PREREQ([2.62])

AC_INIT(mono, [5.9.0],
AC_INIT(mono, [5.11.0],
[http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])

AC_CONFIG_SRCDIR([README.md])
Expand Down Expand Up @@ -123,6 +123,7 @@ CFLAGS="$CFLAGS -D_REENTRANT -D_GNU_SOURCE -DNO_UNALIGNED_ACCESS -s WASM=1"
CPPFLAGS="$CPPFLAGS -D_REENTRANT -DUSE_MMAP -D_GNU_SOURCE -DNO_UNALIGNED_ACCESS -s WASM=1"
libdl="-ldl"
libgc_threads=pthreads
platform_wasm=yes

else

Expand Down Expand Up @@ -368,8 +369,6 @@ case "$host" in
AC_DEFINE(PTHREAD_POINTER_ID)
dnl Haiku does not support static TLS with __thread
with_tls=pthread
dnl Boehm is too much work to backport Haiku support for
support_boehm=no
libgc_threads=pthreads
use_sigposix=yes
;;
Expand Down Expand Up @@ -413,6 +412,7 @@ AM_CONDITIONAL(HOST_SIGPOSIX, test x$use_sigposix = xyes)
AM_CONDITIONAL(HOST_ANDROID, test x$platform_android = xyes)
AM_CONDITIONAL(HOST_TIZEN, test x$platform_tizen = xyes)
AM_CONDITIONAL(HOST_IOS, test x$platform_ios = xyes)
AM_CONDITIONAL(HOST_WASM, test x$platform_wasm = xyes)

if test -z "$HOST_DARWIN_TRUE"; then :
PLATFORM_AOT_SUFFIX=.dylib
Expand Down
2 changes: 1 addition & 1 deletion external/bockbuild
Submodule bockbuild updated 1 files
+2 −1 packages/expat.py
2 changes: 1 addition & 1 deletion external/corefx
4 changes: 4 additions & 0 deletions libgc/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ case "$THREADS" in
AC_DEFINE(GC_AIX_THREADS)
AC_DEFINE(_REENTRANT)
;;
*-*-haiku*)
AC_DEFINE(GC_HAIKU_THREADS)
AC_DEFINE(_REENTRANT)
;;
*-*-hpux*)
AC_MSG_WARN("Only HP/UX 11 threads are supported.")
AC_DEFINE(GC_HPUX_THREADS)
Expand Down
19 changes: 18 additions & 1 deletion libgc/dyn_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
!(defined(FREEBSD) && defined(__ELF__)) && \
!(defined(OPENBSD) && (defined(__ELF__) || defined(M68K))) && \
!(defined(NETBSD) && defined(__ELF__)) && !defined(HURD) && \
!defined(DARWIN)
!defined(DARWIN) && !defined(HAIKU)
--> We only know how to find data segments of dynamic libraries for the
--> above. Additional SVR4 variants might not be too
--> hard to add.
Expand Down Expand Up @@ -1258,6 +1258,23 @@ GC_bool GC_register_main_static_data()

#endif /* DARWIN */

#if defined(HAIKU)

#include <kernel/image.h>

void GC_register_dynamic_libraries()
{
image_info info;
int32 cookie = 0;
while (get_next_image_info(0, &cookie, &info) == B_OK)
{
void *data = info.data;
GC_add_roots_inner(data, data + info.data_size, TRUE);
}
}

#endif /* HAIKU */

#else /* !DYNAMIC_LOADING */

#ifdef PCR
Expand Down
2 changes: 1 addition & 1 deletion libgc/include/gc_config_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS) || \
defined(GC_DGUX386_THREADS) || defined(GC_DARWIN_THREADS) || \
defined(GC_AIX_THREADS) || defined(GC_NETBSD_THREADS) || \
defined(GC_OPENBSD_THREADS) || \
defined(GC_OPENBSD_THREADS) || defined(GC_HAIKU_THREADS) ||\
(defined(GC_WIN32_THREADS) && defined(__CYGWIN32__))
# define GC_PTHREADS
# endif
Expand Down
33 changes: 32 additions & 1 deletion libgc/include/private/gcconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,16 @@
# define BEOS
# define mach_type_known
# endif
# if defined(__HAIKU__) && defined(_X86_)
# define I386
# define HAIKU
# define mach_type_known
# endif
# if defined(__HAIKU__) && defined(__amd64__)
# define X86_64
# define HAIKU
# define mach_type_known
# endif
# if defined(LINUX) && (defined(i386) || defined(__i386__))
# define I386
# define mach_type_known
Expand Down Expand Up @@ -1164,6 +1174,15 @@
extern int etext[];
# define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))
# endif
# ifdef HAIKU
# define OS_TYPE "HAIKU"
# include <OS.h>
# define GETPAGESIZE() B_PAGE_SIZE
extern int etext[];
# define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))
# define DYNAMIC_LOADING
# define MPROTECT_VDB
# endif
# ifdef SUNOS5
# define OS_TYPE "SUNOS5"
extern int _etext[], _end[];
Expand Down Expand Up @@ -2134,6 +2153,15 @@
/* There seems to be some issues with trylock hanging on darwin. This
should be looked into some more */
# endif
# ifdef HAIKU
# define OS_TYPE "HAIKU"
# include <OS.h>
# define GETPAGESIZE() B_PAGE_SIZE
extern int etext[];
# define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))
# define DYNAMIC_LOADING
# define MPROTECT_VDB
# endif
# ifdef FREEBSD
# define OS_TYPE "FREEBSD"
# ifndef GC_FREEBSD_THREADS
Expand Down Expand Up @@ -2251,7 +2279,7 @@
# if defined(SVR4) || defined(LINUX) || defined(IRIX5) || defined(HPUX) \
|| defined(OPENBSD) || defined(NETBSD) || defined(FREEBSD) \
|| defined(DGUX) || defined(BSD) || defined(SUNOS4) \
|| defined(_AIX) || defined(DARWIN) || defined(OSF1)
|| defined(_AIX) || defined(DARWIN) || defined(OSF1) || defined(HAIKU)
# define UNIX_LIKE /* Basic Unix-like system calls work. */
# endif

Expand Down Expand Up @@ -2507,6 +2535,9 @@
# if defined(SN_TARGET_PS3)
extern void *ps3_get_mem (size_t size);
# define GET_MEM(bytes) (struct hblk*) ps3_get_mem (bytes)
# elif defined(HAIKU)
ptr_t GC_haiku_get_mem(GC_word bytes);
# define GET_MEM(bytes) (struct hblk*)GC_haiku_get_mem(bytes)
# else
extern ptr_t GC_unix_get_mem(word size);
# define GET_MEM(bytes) (struct hblk *)GC_unix_get_mem(bytes)
Expand Down
Loading

0 comments on commit 29cbfa1

Please sign in to comment.