mono.git
2 years agoMerge pull request #5714 from alexischr/update_bockbuild master
Alexis Christoforides [Tue, 10 Oct 2017 00:05:45 +0000 (20:05 -0400)]
Merge pull request #5714 from alexischr/update_bockbuild

Update Bockbuild

2 years ago[utils] Add check for ANDROID_UNIFIED_HEADERS to mono-compiler.h (#5742)
Alexander Köplinger [Mon, 9 Oct 2017 23:08:17 +0000 (01:08 +0200)]
[utils] Add check for ANDROID_UNIFIED_HEADERS to mono-compiler.h (#5742)

https://github.com/mono/mono/pull/5680 added mmap/sendfile prototypes
but we should only use those when ANDROID_UNIFIED_HEADERS is defined
to avoid getting errors like:

```
/Users/alexander/dev/xamarin-android/external/mono/mono/utils/mono-compiler.h:157:7: error: conflicting types for 'mmap'
void* mmap (void*, size_t, int, int, int, __mono_off32_t);
        ^
/Users/alexander/android-toolchain/toolchains/arm-linux-androideabi-clang/bin/../sysroot/usr/include/sys/mman.h:47:15: note: previous declaration is here
extern void*  mmap(void *, size_t, int, int, int, off_t);
                ^

/Users/alexander/dev/xamarin-android/external/mono/mono/utils/mono-compiler.h:166:9: error: conflicting types for 'sendfile'
ssize_t sendfile (int out_fd, int in_fd, __mono_off32_t* offset, size_t count);
        ^
/Users/alexander/android-toolchain/toolchains/arm-linux-androideabi-clang/bin/../sysroot/usr/include/sys/sendfile.h:36:16: note: previous declaration is here
extern ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count);
```

2 years ago[msvc] Update csproj files (#5745)
monojenkins [Mon, 9 Oct 2017 19:40:39 +0000 (21:40 +0200)]
[msvc] Update csproj files (#5745)

2 years ago[corlib] Use temp directory for assemblies in SaveTest.Save() (#5727)
Alexander Köplinger [Mon, 9 Oct 2017 18:08:25 +0000 (20:08 +0200)]
[corlib] Use temp directory for assemblies in SaveTest.Save() (#5727)

It was writing to the current working directory before which
doesn't work on platforms where that directory is read-only.

Using the same setup/teardown methods as TypeBuilderTest we
instead create a directory in the temporary location and put
the files there.

2 years ago[corlib] Fixes make dist (#5735)
Marek Safar [Mon, 9 Oct 2017 13:44:11 +0000 (15:44 +0200)]
[corlib] Fixes make dist (#5735)

2 years ago[runtime] Don't insta-fail when a faulty COM type is encountered. (#5616)
vkargov [Fri, 6 Oct 2017 20:07:33 +0000 (13:07 -0700)]
[runtime] Don't insta-fail when a faulty COM type is encountered. (#5616)

* [jit] Don't insta-fail on faulty cominterop invocations.

* [runtime] New test for bug 8477.

* [jit] Implement mono_error_get_exception_name() and mono_mb_emit_exception_for_error()

* [jit] Throw an exception when a static method on a ComImport class is called.

2 years agoUpdate Bockbuild
Alexis Christoforides [Thu, 5 Oct 2017 23:05:50 +0000 (19:05 -0400)]
Update Bockbuild

2 years ago[corlib] Makes GetReferencedAssemblies test more reliable
Marek Safar [Fri, 6 Oct 2017 11:56:14 +0000 (13:56 +0200)]
[corlib] Makes GetReferencedAssemblies test more reliable

2 years agoMerge pull request #5327 from marek-safar/corefx-bump
Marek Safar [Fri, 6 Oct 2017 10:07:58 +0000 (12:07 +0200)]
Merge pull request #5327 from marek-safar/corefx-bump

Bump corefx

2 years ago[runtime] Fix Empty generic enumerator equality
Alexander Kyte [Mon, 2 Oct 2017 18:59:16 +0000 (14:59 -0400)]
[runtime] Fix Empty generic enumerator equality

On the CLR, two enumerators containing zero elements will
have reference equality if they are inflated with the same
generic type.

If comparing two enumerators which are not inflated (Array.Empty, for
instance), they are not equal when they contain zero elements.

This reference equality behavior is not compatible with treating
the enumerators as structs, as value types will not have reference
equality.

2 years agoBump API snapshot submodule
monojenkins [Fri, 6 Oct 2017 06:45:43 +0000 (06:45 +0000)]
Bump API snapshot submodule

2 years ago[appletls] Trust SecTrustResult.Proceed as well. Fixes #58411.
Rolf Bjarne Kvinge [Thu, 5 Oct 2017 09:46:45 +0000 (11:46 +0200)]
[appletls] Trust SecTrustResult.Proceed as well. Fixes #58411.

Apple states clearly in their documentation about SecTrustResult.Proceed [1]:

    The user explicitly chose to trust a certificate in the chain (usually by
    clicking a button in a certificate trust panel).

    Your app should trust the chain.

This fixes bug #[58411][2], where SecTrustEvaluate returns
SecTrustResult.Proceed starting with iOS 11.

[1]: https://developer.apple.com/documentation/security/1394363-sectrustevaluate
[2]: https://bugzilla.xamarin.com/show_bug.cgi?id=58411

2 years agoInitial set of Ward sgen annotations (#5705)
Aleksey Kliger (λgeek) [Thu, 5 Oct 2017 21:31:11 +0000 (17:31 -0400)]
Initial set of Ward sgen annotations (#5705)

* [ward] Expand MONO_PERMIT to empty string when not running Ward
  See https://github.com/evincarofautumn/Ward#annotating-your-code for the Ward
  permissions syntax
* sgen_gc_locked
* sgen_world_stopped
* sgen_lock_gc
* sgen_stop_world

2 years agoBump corefx
Marek Safar [Mon, 7 Aug 2017 14:39:39 +0000 (16:39 +0200)]
Bump corefx

2 years ago[mcs] Fixes codegen for pattern probing with value-type variables
Marek Safar [Thu, 5 Oct 2017 08:28:06 +0000 (10:28 +0200)]
[mcs] Fixes codegen for pattern probing with value-type variables

2 years ago[aot] Don't error out if a method fails to JIT in full-aot mode. This was a regressio...
Zoltan Varga [Thu, 5 Oct 2017 15:54:16 +0000 (17:54 +0200)]
[aot] Don't error out if a method fails to JIT in full-aot mode. This was a regression caused by 9302c31f81abd2f5bbf9a8ddd27993e1ece55db2. Fixes #59832. (#5686)

2 years ago[runtime] Coverage profiler fixes (#5698)
Zoltan Varga [Thu, 5 Oct 2017 15:15:36 +0000 (17:15 +0200)]
[runtime] Coverage profiler fixes (#5698)

* [runtime] Avoid collecting coverage data for wrappers.

* [runtime] Return sensible information for methods which have no coverage info in mono_profiler_get_coverage_data ().

* [profiler] Emit coverage info for uncovered methods as well.

2 years ago[corlib] Fixes array enumerator to match .net behaviour
Marek Safar [Thu, 5 Oct 2017 11:54:35 +0000 (13:54 +0200)]
[corlib] Fixes array enumerator to match .net behaviour

2 years ago[jit] In native-to-managed wrappers, emit the initlocals code for vtypes after the...
Zoltan Varga [Thu, 5 Oct 2017 12:10:20 +0000 (14:10 +0200)]
[jit] In native-to-managed wrappers, emit the initlocals code for vtypes after the code for CEE_JIT_ATTACH, since the init code can make calls to methods like memset () which can go through the trampoline code. Fixes #59182. (#5678)

2 years agoAdd new profile for monodroid tools (#5699)
Alexander Köplinger [Thu, 5 Oct 2017 00:37:24 +0000 (02:37 +0200)]
Add new profile for monodroid tools (#5699)

* Add new profile for monodroid tools

This allows the XA build to use these instead of needing to build net_4_x.
We build the assemblies against the .NET 4.6 reference assemblies.

* Skip monodroid_tools in verify (aka mcs-compileall)

Exclude it from the test_profiles since running tests makes no sense there.

Also refactor to exclude binary_reference_assemblies as well,
it was already excluded manually in mcs-compileall before.

2 years ago[monodroid] Fix Mono.Posix tests build (#5697)
Marek Habersack [Wed, 4 Oct 2017 17:18:32 +0000 (19:18 +0200)]
[monodroid] Fix Mono.Posix tests build (#5697)

TestHelper was previously excluded because the XA tests weren't built
as part of Mono but rather as part of XA test suite which included
its own version of the helper. Now, however (https://github.com/xamarin/xamarin-android/commit/e9daf5ea35709ce1bc6ba81c7c37d72d385bace2),
XA uses BCL+friends test assemblies built by Mono itself and so
we need to restore TestHelper in the build.

2 years ago[mcs] Allows shadowing of probing pattern variables
Marek Safar [Wed, 4 Oct 2017 10:40:13 +0000 (12:40 +0200)]
[mcs] Allows shadowing of probing pattern variables

2 years ago[System] Ignore FtpWebRequestTest.DownloadFile2_v6 test when IPv6 isn't available...
Alexander Köplinger [Wed, 4 Oct 2017 09:51:48 +0000 (11:51 +0200)]
[System] Ignore FtpWebRequestTest.DownloadFile2_v6 test when IPv6 isn't available (#5695)

It fails on some systems otherwise. The other tests already had this check.

2 years agoMerge pull request #5693 from lateralusX/lateralusX/disable-stack-overflow-win-x64
Johan Lorensson [Wed, 4 Oct 2017 08:21:02 +0000 (10:21 +0200)]
Merge pull request #5693 from lateralusX/lateralusX/disable-stack-overflow-win-x64

[Windows] Temporary disable none-working stack overflow implementation on Windows x64 full AOT.

2 years ago[coverage-profiler] Collect coverage data at IL seq point locations. (#5667)
Zoltan Varga [Wed, 4 Oct 2017 06:34:31 +0000 (08:34 +0200)]
[coverage-profiler] Collect coverage data at IL seq point locations. (#5667)

* [coverage-profiler] Collect coverage data at IL seq point locations.

* [coverage-profiler] Emit IL offsets instead of offsets between IL offsets. Bump format version.

2 years agoMerge pull request #5664 from lateralusX/lateralusX/mkbundle-windows-toolchains
Johan Lorensson [Wed, 4 Oct 2017 06:22:29 +0000 (08:22 +0200)]
Merge pull request #5664 from lateralusX/lateralusX/mkbundle-windows-toolchains

[Windows] Major improvement of Visual Studio toolchain and Windows SDK support in mkbundle.

2 years agoBump version to 5.9.0 (#5692)
Ludovic Henry [Tue, 3 Oct 2017 20:52:32 +0000 (16:52 -0400)]
Bump version to 5.9.0 (#5692)

2 years agoPrepare Mono for Android NDK with unified headers (#5680)
Marek Habersack [Tue, 3 Oct 2017 18:17:26 +0000 (20:17 +0200)]
Prepare Mono for Android NDK with unified headers (#5680)

Up until NDK release 14 Android SDK included a separate set of C header
files for each supported platform. NDK 14 introduced a new set of those
headers (they are NOT the same as the old ones) which unifies support
for all of the platforms so that bug fixes are available for all the
API levels without having to backport etc. With NDK 15 the unified headers
become the default ones (including when creating standalone toolchains)
and with NDK 16 (in beta currently) the old per-platform headers are removed.

Unfortunately, the new headers introduce breaking changes which made it
impossible to build Mono with NDK configured to use them. This commit makes
a handful of changes to Mono which make it build with unified headers.

2 years ago[System.Net.Http] Updates range check from 3741d16503a973a99c724bdab9a255a5f07a3637
Marek Safar [Tue, 3 Oct 2017 14:32:15 +0000 (16:32 +0200)]
[System.Net.Http] Updates range check from 3741d16503a973a99c724bdab9a255a5f07a3637

2 years agoMerge pull request #5636 from BrzVlad/fix-xmm-scan
Vlad Brezae [Tue, 3 Oct 2017 15:51:20 +0000 (18:51 +0300)]
Merge pull request #5636 from BrzVlad/fix-xmm-scan

[sgen] Scan simd registers on linux amd64 + apple arm64

2 years ago[mcs] Implements C# 7.2 readonly structs
Marek Safar [Tue, 3 Oct 2017 13:27:11 +0000 (15:27 +0200)]
[mcs] Implements C# 7.2 readonly structs

2 years agoDisable none-working stack overflow implementation on Windows x64 full AOT.
lateralusX [Tue, 3 Oct 2017 15:01:43 +0000 (17:01 +0200)]
Disable none-working stack overflow implementation on Windows x64 full AOT.

Temporary disable stack overflow implementation on Windows x64 full AOT until
we have a proper fix for:

https://bugzilla.xamarin.com/show_bug.cgi?id=59913

2 years ago[w32file] Push win32 specific error to win32 specific implementation (#5665)
Ludovic Henry [Tue, 3 Oct 2017 14:38:09 +0000 (10:38 -0400)]
[w32file] Push win32 specific error to win32 specific implementation (#5665)

ERROR_SHARING_VIOLATION can only happen on win32, so pushing the code to deal with this error to w32file-win32.c file.

2 years ago[mcs] Adds minor langversion support
Marek Safar [Tue, 3 Oct 2017 10:21:57 +0000 (12:21 +0200)]
[mcs] Adds minor langversion support

2 years agoMerge pull request #5656 from lateralusX/lateralusX/dynamic-static-windows-build
Johan Lorensson [Tue, 3 Oct 2017 12:20:14 +0000 (14:20 +0200)]
Merge pull request #5656 from lateralusX/lateralusX/dynamic-static-windows-build

[Windows] Mono build project restructure dropping .def file enabling full static and dynamic mono builds.

2 years ago[interp] fix using conv.u with string
Bernhard Urban [Tue, 3 Oct 2017 08:37:05 +0000 (10:37 +0200)]
[interp] fix using conv.u with string

2 years ago[jit] Fix using conv.u with string.
Rodrigo Kumpera [Mon, 2 Oct 2017 23:31:40 +0000 (16:31 -0700)]
[jit] Fix using conv.u with string.

2 years ago[mcs] Allow properties and indexers of by-ref values to be set without setter
Marek Safar [Tue, 3 Oct 2017 00:27:20 +0000 (02:27 +0200)]
[mcs] Allow properties and indexers of by-ref values to be set without setter

2 years ago[runtime] Store implmap_idx as a guint32 to avoid overflows if the implmap table...
Zoltan Varga [Mon, 2 Oct 2017 21:31:00 +0000 (23:31 +0200)]
[runtime] Store implmap_idx as a guint32 to avoid overflows if the implmap table has more than 64k rows. Fixes #59881.

2 years agoMerged changes in master libmonoruntime into PR.
lateralusX [Tue, 3 Oct 2017 07:26:11 +0000 (09:26 +0200)]
Merged changes in master libmonoruntime into PR.

2 years agoUpdated with review feedback.
lateralusX [Fri, 29 Sep 2017 12:19:44 +0000 (14:19 +0200)]
Updated with review feedback.

2 years agoUpdate msvc README file.
lateralusX [Thu, 28 Sep 2017 13:43:21 +0000 (15:43 +0200)]
Update msvc README file.

2 years agoAdd missing dependency for libmini.
lateralusX [Thu, 28 Sep 2017 13:43:10 +0000 (15:43 +0200)]
Add missing dependency for libmini.

2 years agoAlign libgc vcxproj with makefile.
lateralusX [Thu, 28 Sep 2017 13:15:35 +0000 (15:15 +0200)]
Align libgc vcxproj with makefile.

2 years agoAlign libgcmonosgen vcxproj with makefile.
lateralusX [Thu, 28 Sep 2017 12:51:49 +0000 (14:51 +0200)]
Align libgcmonosgen vcxproj with makefile.

2 years agoAlign eglib vcxproj with makefile.
lateralusX [Thu, 28 Sep 2017 11:59:30 +0000 (13:59 +0200)]
Align eglib vcxproj with makefile.

2 years agoAlign libmonoruntime vcxproj with makefile.
lateralusX [Thu, 28 Sep 2017 11:41:49 +0000 (13:41 +0200)]
Align libmonoruntime vcxproj with makefile.

2 years agoAlign libmonoutils vcxproj with makefile.
lateralusX [Thu, 28 Sep 2017 10:39:36 +0000 (12:39 +0200)]
Align libmonoutils vcxproj with makefile.

2 years agoFix libmini targets and filters.
lateralusX [Thu, 28 Sep 2017 09:23:27 +0000 (11:23 +0200)]
Fix libmini targets and filters.

2 years agoAdded labels to eglib and libmonoutils.
lateralusX [Wed, 27 Sep 2017 15:45:11 +0000 (17:45 +0200)]
Added labels to eglib and libmonoutils.

2 years agoFix libmonoruntime targets and filters.
lateralusX [Wed, 27 Sep 2017 15:28:37 +0000 (17:28 +0200)]
Fix libmonoruntime targets and filters.

2 years agoFix libmonoutils targets and filters.
lateralusX [Wed, 27 Sep 2017 12:11:07 +0000 (14:11 +0200)]
Fix libmonoutils targets and filters.

2 years agoFix eglib targets and filters.
lateralusX [Wed, 27 Sep 2017 12:10:29 +0000 (14:10 +0200)]
Fix eglib targets and filters.

2 years agoDrop use of def files for x86, x64 mono-2.0-sgen|boehm.dll Windows build.
lateralusX [Tue, 26 Sep 2017 15:15:16 +0000 (17:15 +0200)]
Drop use of def files for x86, x64 mono-2.0-sgen|boehm.dll Windows build.

2 years agoRestructure of mono.sln and build properties to better fix static/dynamic library...
lateralusX [Fri, 22 Sep 2017 07:44:04 +0000 (09:44 +0200)]
Restructure of mono.sln and build properties to better fix static/dynamic library support.

2 years agoMerge all static runtime libs into libmono-static.
lateralusX [Mon, 18 Sep 2017 14:00:35 +0000 (16:00 +0200)]
Merge all static runtime libs into libmono-static.

Make libmono-static lib file include all needed runtime libs making it easier to
link and distribute as part of Mono SDK.

Commit also updates linking of vcxprojs in mono.sln to use merged static lib.

2 years agoReview feedback + drop VS2013 support.
lateralusX [Mon, 2 Oct 2017 10:46:58 +0000 (12:46 +0200)]
Review feedback + drop VS2013 support.

2 years agoMerge pull request #5668 from kumpera/wasm-work-p4
Rodrigo Kumpera [Mon, 2 Oct 2017 23:36:39 +0000 (16:36 -0700)]
Merge pull request #5668 from kumpera/wasm-work-p4

More WASM fixes.

2 years ago[ci] Small improvements for run-jenkins and collect-coverage. (#5669)
vkargov [Mon, 2 Oct 2017 22:16:39 +0000 (15:16 -0700)]
[ci] Small improvements for run-jenkins and collect-coverage. (#5669)

* [ci] Allow setting custom mono flags for test runs via MONO_TEST_FLAGS.

* [ci] Make the handling of CFLAGS a bit more flexible in run-jenkins.sh.

* [ci] Generalize collect-coverage to handle more targets.

2 years agoMerge pull request #5675 from mono/glib-debug-symbols
Alexis Christoforides [Mon, 2 Oct 2017 17:46:14 +0000 (13:46 -0400)]
Merge pull request #5675 from mono/glib-debug-symbols

Add glib to the list of packages with debugging symbols.

2 years agoBump mono-extensions to fix build break (#5677)
Alexander Köplinger [Mon, 2 Oct 2017 17:45:13 +0000 (19:45 +0200)]
Bump mono-extensions to fix build break (#5677)

The driver.c patch from mono-extensions no longer applied after https://github.com/mono/mono/commit/30cddad5fb4c3d290906a6e6c33ecd8b07d8b48c

2 years agoBump NuGet.BuildTasks to get new updates and switch to `dev` branch (#5566)
Ankit Jain [Mon, 2 Oct 2017 16:18:08 +0000 (12:18 -0400)]
Bump NuGet.BuildTasks to get new updates and switch to `dev` branch (#5566)

2 years agoAdd glib to the list of packages with debugging symbols.
Cody Russell [Thu, 28 Sep 2017 20:11:01 +0000 (15:11 -0500)]
Add glib to the list of packages with debugging symbols.

2 years ago[profiler] log profiler: limit method instrumentation to selected methods (#5517)
Uri Simchoni [Mon, 2 Oct 2017 14:29:49 +0000 (17:29 +0300)]
[profiler] log profiler: limit method instrumentation to selected methods (#5517)

* [trace] remove code that has no effect

* [trace] move program assembly out of MonoTraceSpec

The assembly member represents the program assembly. It's
information the trace spec is matched against, not part of
the trace spec per-se (if two trace specs exist for two purposes
we would still have one program assembly)

* [trace] remove side effects from get_string()

On the way towards supporting multiple trace specs,
remove side effects from get_string() function.

* [trace] remove side effects from get_token()

Remove side effects from get_token() to allow handling
multiple trace specs.

* [trace] fix handling of double exclusion and disabled

When encountering "disabled", do not add an entry to
the trace spec

Fix error handling around double "-" - get_spec()
never returns TOKEN_EXCLUDE and the recursion can
be easily avoided.

* [trace] remove side effects from get_spec()

Another step in making the trace options reusable.

* [trace] rename mono_trace_parse_options() to mono_trace_set_options()

This routine actually sets the tracing options, not just parses an
option string, so set_ is more suitable. This frees up the
mono_trace_parse_options() name for pure parsing, when we later
reuse the parsing code.

* [trace] make tracing options API reusable

Add APIs that parse tracing options and evaluate a method
against the parsed options. The tracing functionality now uses
this API, but other components can use this to apply an operation
to a method based on policy (e.g. profiling)

* [trace] rename MonoTraceSpec to MonoCallSpec

In preparation for reusing call specification beyond the
tracer, rename the data structure - it now only specifies
a set of calls, without indication what should be done with
them.

* [trace] rename mono_trace_set_assembly to mono_callspec_set_assembly

As it becoming a reuse candidate, we remove the "trace" component
from the name.

* [trace-metadata] move callspec code into its own module

Introduce callspec.c/h which encapsulate the call specification
functionality.

* [profiler] add "callspec" option to log profiler

The callspec option define which methods get instrumented
at JIT time with entry/exit calls to the profiler. The
syntax is same as the tracer (--trace=) syntax. To
distinguish between profiler options and callspec, wrap the
callspec with double quotes, as in:
--profile=log:callspec="all-mscorlib",calls

Since this typically runs from a shell, the double quotes have to be
escaped or wrapped in single quotes, as in:
mono '--profile=log:callspec="all-mscorlib",calls' prog.exe

* [metadata] add an error return string to callspec parsing

Instead of printing parsing error messages to standard error,
return an error string. That allows the client to do the right thing
with the error.

2 years ago[jit] Fix the saving of the 'cfg->ret_var_set' flag when inlining, it was set to...
Zoltan Varga [Mon, 2 Oct 2017 14:26:17 +0000 (16:26 +0200)]
[jit] Fix the saving of the 'cfg->ret_var_set' flag when inlining, it was set to FALSE before it was saved, causing invalid code to be generated in some cases when doing nested inlining. Fixes #59608. (#5654)

2 years ago[mcs] Initial by ref returns and variables support
Marek Safar [Tue, 19 Sep 2017 13:47:31 +0000 (15:47 +0200)]
[mcs] Initial by ref returns and variables support

2 years agoFix ninja BTLS build for verbose builds (#5673)
Marek Habersack [Mon, 2 Oct 2017 14:15:45 +0000 (16:15 +0200)]
Fix ninja BTLS build for verbose builds (#5673)

ninja treats `VERBOSE=1` as a target and, failing to find one, aborts
the build with an error. Pass `-v` in this case instead.

2 years agoFix LinearGradientMode parameter validation to match corefx (#5672)
Hugh Bellamy [Mon, 2 Oct 2017 14:15:28 +0000 (15:15 +0100)]
Fix LinearGradientMode parameter validation to match corefx (#5672)

2 years agoMajor improvement of Visual Studio toolchain and Windows SDK support in mkbundle.
lateralusX [Thu, 24 Aug 2017 11:54:34 +0000 (13:54 +0200)]
Major improvement of Visual Studio toolchain and Windows SDK support in mkbundle.

Current implementation of Windows builds in mkbundle is not supporting
Visual Studio toolchains and Windows SDK's in a working way. Windows version
of mkbundle also lacked support for 64-bit builds together with a dependency on
GCC assembler etc.

This commit improves things in many different areas. The following toolchains
are intended to work together with this commit:

VS2013, VS2015, VS2017.

NOTE, default Mono SDK distribution is build targeting VS2015/VS2017 and static
version of libmono-static.lib won’t work with VS2013. If static use case is needed
with VS2013, a custom build mono under VS2013 must be used.  Dynamic use case is
working as expected for all three versions.

The commit also improves the support for Cygwin GCC compatible toolchains on Windows.

The commit adds support to use installed versions of both Windows 8.1 as well
as Windows 10 SDK's together with all above VS toolchains.

The commit extends support to include 64-bit mkbundle builds (using all supported
Windows toolchains). The target is decided based on mkbundle process type, 32-bit
mono builds 32-bit bundle and 64-bit mono builds 64-bit bundle.

mkbundle might still need to have a working GCC as.exe when running, but this commit
also adds support for Clang for VS CodeGen as assembler available in VS2015 Update3
and VS2017 (separate option in VS setup). When using this option there is no needed
for available GCC toolchains when running mkbundle on Windows.

A recommended way of running mkbundle on Windows is by using one of the targeted toolchains
development consoles. This way mkbundle will get all needed paths and installation folders
directly from the development consoles environment, matching a predefined setup.

Old mkbundle environment variables on Windows will continue to work. There are also a number
of new variables that can be set (or are set by the VS development consoles). The important ones
are:

VisualStudioVersion: set to pick a specific VS version, like 12.0, 14.0 or 15.0. If a none existing
version is specified, mkbundle will fallback to latest installed version.

WindowsSdkVersion: set to pick a specific Windows SDK version, like 8.1, 10.0.10240.0, 10.0.15063.0 etc.
If a none existing version is specified, mkbundle will fallback to latest installed version.

AS: If Clang for VS CodeGen is not installed this must point to a working as.exe assembler.

MONOPREFIX: set to pick a custom Mono SDK install root directory (need to match the architecture of mkbundle
process running). If not set, mkbundle will look for installed Mono SDK’s matching targeted architecture.

MONOLIB: if a different library name is used, it can be specified here. It is also possible to add an absolute
path to the mono library used in linking. NOTE, correct library needs to be supplied for static/dynamic use cases.

INCLUDE: override all custom include path handling, normally set by VS developer consoles.

LIB: override all custom lib path handling, normally set by VS developer consoles.

VCCRT: Gives possibility to use static or dynamic C-Runtime linking. By default mkbundle will use dynamic C-Runtime
linking on Windows to be compatible with default Mono SDK distribution. If a custom build Mono
using static C-Runtime linkage is used, setting this variable to MT (default MD), will link using static
C-Runtime.

VCSUBSYSTEM: mkbundle will by default use windows subsystem. If console subsystem is preferred this variable
can be set to console.

Should resolve:

https://bugzilla.xamarin.com/show_bug.cgi?id=57893

and partial resolves (needs https://github.com/mono/mono/pull/5656 as well):

https://bugzilla.xamarin.com/show_bug.cgi?id=57892

2 years agoAllow passing null to JsonArray.Add()
Steffen Kieß [Tue, 19 Sep 2017 18:41:16 +0000 (20:41 +0200)]
Allow passing null to JsonArray.Add()

null is a valid value in a JSON array, so there is no reason forbid
adding null to the array. JsonArray.Save() already handles null values in
the array.

2 years agoRemove invalid tests for image palettes in GdiPlusTest (#5671)
Hugh Bellamy [Mon, 2 Oct 2017 00:28:25 +0000 (01:28 +0100)]
Remove invalid tests for image palettes in GdiPlusTest (#5671)

C.r. https://github.com/mono/libgdiplus/pull/112

2 years ago[corlib] Make Marshal.BufferToBSTR(Array, int) non-public again (#5670)
Alexander Köplinger [Sat, 30 Sep 2017 19:51:42 +0000 (21:51 +0200)]
[corlib] Make Marshal.BufferToBSTR(Array, int) non-public again (#5670)

* [corlib] Make Marshal.BufferToBSTR(Array, int) non-public again

It was accidentally made public in https://github.com/mono/mono/commit/c5cdfaec1e0973ced3f97ef589cd0bece56067ad.
Unfortunately this was before we had the API diff check on Mono and the manual checks in XI/XA integration didn't catch it either.

* Bump API snapshot submodule

2 years agoMerge pull request #5659 from kumpera/fix_59824
Rodrigo Kumpera [Fri, 29 Sep 2017 23:17:03 +0000 (16:17 -0700)]
Merge pull request #5659 from kumpera/fix_59824

[runtime] Synthesize IList and IReadOnlyList for the element type of enum errays. Fixes #59824

2 years ago[wasm] We can't free memory in wasm as it uses the malloc mmap backend.
Rodrigo Kumpera [Fri, 29 Sep 2017 23:14:22 +0000 (16:14 -0700)]
[wasm] We can't free memory in wasm as it uses the malloc mmap backend.

2 years ago[wasm] Add new missing signature.
Rodrigo Kumpera [Fri, 29 Sep 2017 22:45:00 +0000 (15:45 -0700)]
[wasm] Add new missing signature.

2 years ago[wasm] Disable test that doesn't work with WASM
Rodrigo Kumpera [Fri, 29 Sep 2017 22:44:41 +0000 (15:44 -0700)]
[wasm] Disable test that doesn't work with WASM

2 years ago[System.Net.Http] HttpClient timeout range checks. Fixes #25755
Marek Safar [Fri, 29 Sep 2017 14:08:49 +0000 (16:08 +0200)]
[System.Net.Http] HttpClient timeout range checks. Fixes #25755

2 years agocodeowners update
Marek Safar [Fri, 29 Sep 2017 09:52:48 +0000 (11:52 +0200)]
codeowners update

2 years ago[w32file] Move MonoIO.Find{First,Next,Close} to managed
Ludovic Henry [Wed, 27 Sep 2017 15:28:16 +0000 (11:28 -0400)]
[w32file] Move MonoIO.Find{First,Next,Close} to managed

2 years ago[w32file] Remove dead code
Ludovic Henry [Wed, 27 Sep 2017 15:35:36 +0000 (11:35 -0400)]
[w32file] Remove dead code

2 years ago[sre] register a canonical MonoReflectionMethod for a methodref token
Aleksey Kliger [Wed, 27 Sep 2017 18:01:47 +0000 (14:01 -0400)]
[sre] register a canonical MonoReflectionMethod for a methodref token

In mono_image_create_token we are passed in a managed reflection object and we
need to create a token for it and optionally register it so that we can resolve
that token back to a runtime structure and managed object later.

For a MonoReflectionMethod object that refers to a method from outside the
current dynamic image, we need to generate a memberref token.  It will be the
same token for the same underlying MonoMethod*.  When we go to register the
token with mono_dynamic_image_register_token we need to pass a managed object.
Unfortunately two MonoReflectionMethod objects could refer to the same
MonoMethod* but differ in their ReflectedType, so just registering the
passed-in MonoReflectionMethod means we could assert in
mono_dynamic_image_register_token because previously we may have registered the
same method via a different ReflectedType.

So what we do is we cal mono_method_get_object_handle with NULL for the
reflected type - which corresponds to just using the DeclaringType of the given
MonoMethod*.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=59364

2 years ago[sre] Expect a new token for MonoArrayMethod and SignatureHelper
Aleksey Kliger [Wed, 27 Sep 2017 22:30:13 +0000 (18:30 -0400)]
[sre] Expect a new token for MonoArrayMethod and SignatureHelper

2 years ago[sre] Remove MonoDynamicImage:handleref_managed field
Aleksey Kliger [Wed, 27 Sep 2017 21:32:19 +0000 (17:32 -0400)]
[sre] Remove MonoDynamicImage:handleref_managed field

It's now unused.

2 years ago[sre] Map fieldref tokens to MonoClassField*
Aleksey Kliger [Wed, 27 Sep 2017 21:23:54 +0000 (17:23 -0400)]
[sre] Map fieldref tokens to MonoClassField*

Previously, we mapped fieldref tokens to MonoReflectionField managed objects,
But the object is just used as a key for caching the token so we may as well
use the native field instead of a managed object.

2 years ago[sre] Wrap mono_image_create_token with HANDLE_FUNCTION_{ENTER,RETURN}
Aleksey Kliger [Wed, 27 Sep 2017 17:56:56 +0000 (13:56 -0400)]
[sre] Wrap mono_image_create_token with HANDLE_FUNCTION_{ENTER,RETURN}

We will allocate a handle for the object that we will register.  For now it's
just an alias of the object passed in, but it could differ.

2 years ago[test] SRE ILGenerator test for methodref and fieldref token caching
Aleksey Kliger [Thu, 28 Sep 2017 20:24:30 +0000 (16:24 -0400)]
[test] SRE ILGenerator test for methodref and fieldref token caching

Regression test for https://bugzilla.xamarin.com/show_bug.cgi?id=59364

We need to cause SRE to generate the same methodref/fieldref token from two
different reflection objects.  That happens if you get the same method or field
via a base and a derived class so that the MemberInfo:DeclaredType is different
but the underlying MonoMethod* or MonoClassField* is the same.

2 years ago[System] HttpListenerRequest: ignore bad cookies and keep request alive (#5657)
Alexander Köplinger [Thu, 28 Sep 2017 23:19:09 +0000 (01:19 +0200)]
[System] HttpListenerRequest: ignore bad cookies and keep request alive (#5657)

HttpRequestListener throws on incorrect cookie name. It throws CookieException ("Name contains invalid characters"). There are many cookies out there that unfortunately do not conform to the guidelines and HttpRequestListener will kill the request in such a case. The .Net framework under windows lets the request through however.

Included is a patch HttpListenerRequest as well as a test with a bad cookie name.

I have tested this under linux(master branch) and .net (4.0), they now both have the same behavior.

2 years ago[msbuild] Bump msbuild to fix test failures on wrench (#5660)
Ankit Jain [Thu, 28 Sep 2017 22:55:07 +0000 (18:55 -0400)]
[msbuild] Bump msbuild to fix test failures on wrench (#5660)

2 years agoMerge pull request #5560 from kumpera/wasm-work-p3
Rodrigo Kumpera [Thu, 28 Sep 2017 22:06:02 +0000 (18:06 -0400)]
Merge pull request #5560 from kumpera/wasm-work-p3

More WASM fixes, with this I can get half of the mini test suite to run without crashing.

2 years agoMerge pull request #5567 from kumpera/fix_59334
Rodrigo Kumpera [Thu, 28 Sep 2017 20:50:07 +0000 (16:50 -0400)]
Merge pull request #5567 from kumpera/fix_59334

[runtime] Handle RuntimeWrappedException and dynamic methods. Fixes #59334

2 years ago[runtime] Synthesize IList and IReadOnlyList for the element type of enum errays...
Rodrigo Kumpera [Thu, 28 Sep 2017 20:45:54 +0000 (13:45 -0700)]
[runtime] Synthesize IList and IReadOnlyList for the element type of enum errays. Fixes #59824

Make sure array of enums can be casted to interfaces of their element types.

2 years ago[mini] Fix test compiling when running !MOBILE
Rodrigo Kumpera [Thu, 28 Sep 2017 17:11:19 +0000 (10:11 -0700)]
[mini] Fix test compiling when running !MOBILE

2 years ago[runtime] Fix icall signature and change comment to fixme.
Rodrigo Kumpera [Thu, 28 Sep 2017 17:01:11 +0000 (10:01 -0700)]
[runtime] Fix icall signature and change comment to fixme.

2 years ago[wasm] Implement GC support. Embedder must provide main loop pumping function request...
Rodrigo Kumpera [Thu, 28 Sep 2017 00:30:49 +0000 (17:30 -0700)]
[wasm] Implement GC support. Embedder must provide main loop pumping function request_gc_cycle.

2 years ago[runtime] Fix DISABLE_REFLECTION_EMIT build.
Rodrigo Kumpera [Wed, 27 Sep 2017 22:06:23 +0000 (15:06 -0700)]
[runtime] Fix DISABLE_REFLECTION_EMIT build.

2 years ago[amd64] Save missing register
Vlad Brezae [Tue, 26 Sep 2017 21:15:41 +0000 (00:15 +0300)]
[amd64] Save missing register

2 years ago[arm64] Scan simd registers on apple
Vlad Brezae [Mon, 25 Sep 2017 23:30:33 +0000 (02:30 +0300)]
[arm64] Scan simd registers on apple

Fix for #50190

2 years ago[runtime] Avoid indirection when building MonoContext on darwin
Vlad Brezae [Mon, 25 Sep 2017 20:14:19 +0000 (23:14 +0300)]
[runtime] Avoid indirection when building MonoContext on darwin

2 years ago[arm64] Add the full neon regs to the context
Vlad Brezae [Fri, 22 Sep 2017 22:42:43 +0000 (01:42 +0300)]
[arm64] Add the full neon regs to the context

The full regs are still not handled in the trampolines. Only the lower half is saved.

2 years ago[amd64] Add XMM registers to MonoContext on linux
Vlad Brezae [Thu, 21 Sep 2017 22:36:07 +0000 (01:36 +0300)]
[amd64] Add XMM registers to MonoContext on linux

Fix for #50189