Compare commits

...
286 Commits
Author SHA1 Message Date
Alexis Christoforides feca91f7eb Improve robustness of post-install script
We have several issues (e.g. https://github.com/mono/mono/issues/14181) where the installer occasionally fails in the postinstall script for unknown causes, on some hosts.

This seems to be sometimes the culpable section and this patch should help trace the issue or alleviate the common symptoms of it (see https://github.com/mono/mono/issues/14181)
2019-06-28 15:38:14 +03:00
monojenkins 06cf039948 [2018-10] [arm64] Correct exception filter stack frame size (#14767)
[2018-10] [arm64] Correct exception filter stack frame size

Fixes: https://github.com/mono/mono/issues/14170
Fixes: https://github.com/xamarin/xamarin-android/issues/3112

The `call_filter()` function generated by `mono_arch_get_call_filter()`
was overwriting a part of the previous stack frame because it was not
creating a large enough new stack frame for itself.  This had been
working by luck before the switch to building the runtime with Android
NDK r19.

I used a local build of [xamarin/xamarin-android/d16-1@87a80b][0] to
verify that this change resolved both of the issues linked above.  I
also confirmed that I was able to reintroduce the issues in my local
environment by removing the change and rebuilding.

After this change, the generated `call_filter()` function now starts by
reserving sufficient space on the stack to hold a 64-bit value at the
`ctx_offset` location.  The 64-bit `ctx` value is saved to the
`ctx_offset` location (offset 344 in the new stack frame) shortly
afterwards:

    stp	x29, x30, [sp,#-352]!
    mov	x29, sp
    str	x0, [x29,#344]

As expected, the invocation of `call_filter()` now no longer modifies
the top of the previous stack frame.

Top of the stack before `call_filter()`:

    (gdb) x/8x $sp
    0x7fcd2774a0:	0x7144d250	0x00000000	0x2724b700	0x00000000
    0x7fcd2774b0:	0x1ee19ff0	0x00000071	0x0cc00300	0x00000071

Top of the stack after `call_filter()` (unchanged):

    (gdb) x/8x $sp
    0x7fcd2774a0:	0x7144d250	0x00000000	0x2724b700	0x00000000
    0x7fcd2774b0:	0x1ee19ff0	0x00000071	0x0cc00300	0x00000071

<details>
<summary>Additional background information</summary>

### The original lucky, "good" behavior for [mono/mono/2018-08@725ba2a built with Android NDK r14][1]

 1. The `resume` parameter for `mono_handle_exception_internal()` is
    held in register `w23`.

 2. That register is saved into the current stack frame at offset 20 by
    a `str` instruction:

           0x00000000000bc1bc <+3012>:	str	w23, [sp,#20]

 3. `handle_exception_first_pass()` invokes `call_filter()` via a `blr`
    instruction:

        2279							filtered = call_filter (ctx, ei->data.filter);
           0x00000000000bc60c <+4116>:	add	x9, x22, x24, lsl #6
           0x00000000000bc610 <+4120>:	ldr	x8, [x8,#3120]
           0x00000000000bc614 <+4124>:	ldr	x1, [x9,#112]
           0x00000000000bc618 <+4128>:	add	x0, sp, #0x110
           0x00000000000bc61c <+4132>:	blr	x8

    Before the `blr` instruction, the top of the stack looks like this:

        (gdb) x/8x $sp
        0x7fcd2774a0:	0x7144d250	0x00000000	0x0a8b31d8	0x00000071
        0x7fcd2774b0:	0x00000000	0x00000000	0x1ef51980	0x00000071

 4. `call_filter()` runs.  This function is generated by
    `mono_arch_get_call_filter()` and starts with:

           stp	x29, x30, [sp,#-336]!
           mov	x29, sp
           str	x0, [x29,#344]

    Note in particular how the first line subtracts 336 from `sp` to
    start a new stack frame, but the third line writes to a position
    that is 344 bytes beyond that, back within the *previous* stack
    frame.

 5. After the invocations of `call_filter()` and
    `handle_exception_first_pass()`, `w23` is restored from the stack:

           0x00000000000bc820 <+4648>:	ldr	w23, [sp,#20]

    At this step, the top of the stack looks like this:

        (gdb) x/8x $sp
        0x7fcd2774a0:	0x7144d250	0x00000000	0xcd2775b0	0x0000007f
        0x7fcd2774b0:	0x00000000	0x00000000	0x1ef51980	0x00000071

    Notice how `call_filter()` has overwritten bytes 8 through 15 of the
    stack frame.  In this original lucky scenario, this does not affect
    the value restored into register `w23` because that value starts at
    byte 20.

 6. `mono_handle_exception_internal()` tests the value of `w23` to
    decide how to set the `ji` local variable:

        2574			if (resume) {
           0x00000000000bb960 <+872>:	cbz	w23, 0xbb9c4 <mono_handle_exception_internal+972>

    Since `w23` is `0`, `mono_handle_exception_internal()` correctly
    continues into the `else` branch.

### The bad behavior for [mono/mono/2018-08@725ba2a built with Android NDK r19][2] works slightly differently

 1. As before, the local `resume` parameter starts in register `w23`.
 2. This time, the register is saved into the stack frame at offset 12
    (instead of 20):

           0x00000000000bed7c <+3200>:	str	w23, [sp,#12]

 3. As before, `handle_exception_first_pass()` invokes `call_filter()`
    via a `blr` instruction.

    At this step, the top of the stack looks like this:

        (gdb) x/8x $sp
        0x7fcd2774a0:	0x7144d250	0x00000000	0x2724b700	0x00000000
        0x7fcd2774b0:	0x1ee19ff0	0x00000071	0x0cc00300	0x00000071

 4. `call_filter()` runs as before.  And the first few instructions of
    that function are the same as before:

        stp	x29, x30, [sp,#-336]!
        mov	x29, sp
        str	x0, [x29,#344]

 5. `w23` is again restored from the stack, but this time from offset 12:

           0x00000000000bf2c0 <+4548>:	ldr	w23, [sp,#12]

    The problem is that `call_filter()` has again overwritten bytes 8
    through 15 of the stack frame:

        (gdb) x/8x $sp
        0x7fcd2774a0:	0x7144d250	0x00000000	0xcd2775b0	0x0000007f
        0x7fcd2774b0:	0x1ee19ff0	0x00000071	0x0cc00300	0x00000071

    So after the `ldr` instruction, `w23` has an incorrect value of
    `0x7f` rather than the correct value `0`.

 6. As before, `mono_handle_exception_internal()` tests the value of `w23` to
    decide how to set the `ji` local variable:

        2574			if (resume) {
           0x00000000000be430 <+820>:	cbz	w23, 0xbe834 <mono_handle_exception_internal+1848>

    But this time because `w23` is *not* zero, execution continues
    *incorrectly* into the `if` branch rather than the `else` branch.
    The result is that `ji` is set to `0` rather than a valid
    `(MonoJitInfo *)` value.  This incorrect value for `ji` leads to a
    null pointer dereference, as seen in the bug reports.

[0]: https://github.com/xamarin/xamarin-android/tree/xamarin-android-9.3.0.22
[1]: https://jenkins.xamarin.com/view/Xamarin.Android/job/xamarin-android-freestyle/1432/Azure/
[2]: https://jenkins.xamarin.com/view/Xamarin.Android/job/xamarin-android-freestyle/1436/Azure/

</details>

Backport of #14757.

/cc @lambdageek @brendanzagaeski
2019-06-03 20:35:53 -04:00
monojenkins 5ec4718267 [MacSDK] Properly handle PATHs with spaces during package post-install (#14739) 2019-06-03 12:49:57 +02:00
Thays Grazia 68c6ae5805 A deadlock happens when during a process_suspend there is a pending invoke and then when it's calling the invoke there is another call to process_suspend in the same thread. 2019-05-10 10:29:44 +02:00
Alexander Köplinger 904bd79d9d Fix Windows MSI build
(cherry picked from commit 8aaf420efe)
2019-04-29 13:51:59 -04:00
Alexander Köplinger 04dc2f342c More Windows MSI fixes
(cherry picked from commit e0326df7c6)
2019-04-29 13:51:49 -04:00
Alexander Köplinger 1be30ef4c7 Fix Windows MSI build, msbuild is now in Current instead of 15.0
(cherry picked from commit 0ae04b8e80)
2019-04-29 13:51:03 -04:00
monojenkins e76e09d6f6 [2018-10] Clean up .o files from System.Native during make dist (#14185)
* Clean up .o files from System.Native during `make dist`

Closes: https://github.com/mono/mono/issues/11501

* Delete more useless binary cruft from `make dist`
2019-04-24 10:02:32 +02:00
Ankit Jain 1717687e16 [2018-10] Update msbuild to vs16 (#14060)
* Bump msbuild to track mono-2018-10

* [msbuild] Bump to update-msbuild-16 branch HEAD

.. and track the build command line changes.

(cherry picked from commit 7100368ddb5821851e6ef19d262c64b0520fdf5d)

* [msbuild] Install msbuild bits in to Current instead of 15.0

This is to prepare for the update to msbuild which expects
	`lib/mono/{xbuild,msbuild}/Current`

Except for Roslyn which still installs and expects to be in
	`lib/mono/msbuild/15.0/bin/Roslyn`
.. but we install it to `Current` here and create the symlink for it at
msbuild installation time. This allows us to have consistent symlinks:
	15.0 -> Current

Note: That *Current* is the new ToolsVersion, it isn't meant to just
point to the current *version*.

(cherry picked from commit cc23e2fc242ac5ed55ad3caab3fba91603e14af8)
(cherry picked from commit 001f8bf0fc48f66354489fc55b5d258a2dd02e17)

* [msbuild] fsharp: Install msbuild files for 16.0

(cherry picked from commit dbfedcf430968eb4a92cafad2a7ea89f723dfde3)
(cherry picked from commit 45ee5e3b04b01350df7524f48afce3a1cc1fa592)

* nuget-hash-extractor: Add msbuild extensions nuget version from

.. xplat-master msbuild branch.

	Microsoft.NET.Build.Extensions          : 2.1.600-preview-63821-02

Version from:
https://github.com/dotnet/cli/blob/4b9d6502f8061db4a56b730d3d4e65262c72ad5c/build/DependencyVersions.props

None of the assemblies were newer, so none of the lists have any
changes.

(cherry picked from commit 6ce599387ef3ecd9b5954d9282a275fbeacc7aaf)
(cherry picked from commit 32de708d9dd11b6fedb2f9ef38e78b6dab166683)

* Bump bockbuild to pick up a fix for msbuild update.

* [msbuild] Bump to pick an update for NuGetSdkResolver
2019-04-24 09:51:50 +02:00
Thays Grazia 48c61e1f48 [2018-10] Protecting boxing a null value (#14130)
When a static method is called the obj is not used, so it can be null and it doesn't need to be boxed.

Adding an assert in the method to prevent other crash in this method if a NULL is received.
Fixes #13969

Backport of #14018.

/cc @lambdageek @thaystg
2019-04-22 11:05:41 -03:00
Alexander Köplinger 6892c97d6d [System] Fix monotouch_runtime repl assemblies (#14077)
They were missing some exclude files that caused unnecessary p/invokes to be retained.

Fixes https://github.com/mono/mono/issues/13526
2019-04-16 16:30:54 +02:00
Ankit Jain 8bcc316cbc [nuget] Bump to nuget 5.0.0 2019-04-12 08:31:15 +02:00
monojenkins e4df5ef680 [2018-10] [jit] Avoid an assert when gsharedvt enums are boxed. (#13997)
Fixes https://github.com/mono/mono/issues/13297.

Backport of #13301.
2019-04-11 20:32:28 +02:00
Mikhail Filippov c884c0ebf2 Use LoadFrom instead LoadFile for load logger type. LoadFile lost assembly load-context. If the logger assembly has any dependencies placed in same folder logger can't load it. Main.cs using LoadFrom to load assembly but assembly already loaded in the cache after GetLoggerTypeName. 2019-04-11 11:44:48 +02:00
Radek Doulik d63faca00b [2018-10] [profiler] Add duration=NUM parameter to AOT profiler (#13688) (#13968)
* [profiler] Do not print that many new lines (#13060)

The `mono_profiler_printf` already adds `\n` char, so we don't need to
add them in most cases.

Before the fix the output of aot profiler with verbose enabled looked
like:

    02-19 10:50:02.877 22795 22815 I mono-prof: System.OutOfMemoryException:.ctor (string) 2
    02-19 10:50:02.877 22795 22815 I mono-prof:
    02-19 10:50:02.877 22795 22815 I mono-prof: System.SystemException:.ctor (string) 4
    02-19 10:50:02.877 22795 22815 I mono-prof:
    02-19 10:50:02.877 22795 22815 I mono-prof: System.Exception:.ctor (string) 6
    02-19 10:50:02.877 22795 22815 I mono-prof:
    02-19 10:50:02.877 22795 22815 I mono-prof: System.Exception:.cctor () 7
    02-19 10:50:02.877 22795 22815 I mono-prof:
    ...

The `usage ()`'s output should now look similar to other profilers
usage output.

* [profiler] Add duration=NUM parameter to AOT profiler (#13688)

* [profiler] Add duration=NUM parameter to AOT profiler

It instructs the AOT profiler to write the data after NUM seconds
measured from runtime initialization.

* [profilers] Added aot:duration=NUM parameter description
2019-04-11 09:13:45 +02:00
monojenkins 886c490174 [debugger-agent] Ignore thread_end event if thread is detached (#13939)
The thread_stopped profiler event can be raised by the thread_info_key_dtor tls
key destructor when the thread is already doesn't have a domain set.  In that
case, don't call process_profiler_event since it cannot handle a thread with
null TLS values.

Addresses https://github.com/xamarin/xamarin-android/issues/2920
with the following stack trace

```
* thread #20, name = 'Filter', stop reason = signal SIGSEGV: invalid address (fault address: 0xbc)
  * frame #0: libmonosgen-2.0.so`mono_class_vtable_checked(domain=0x0000000000000000, klass=0x0000007200230648, error=0x00000071e92f9178) at object.c:1890
    frame #1: libmonosgen-2.0.so`get_current_thread_ptr_for_domain(domain=0x0000000000000000, thread=0x00000071ebfec508) at threads.c:595
    frame #2: libmonosgen-2.0.so`mono_thread_current at threads.c:1939
    frame #3: libmonosgen-2.0.so`process_event(event=<unavailable>, arg=<unavailable>, il_offset=<unavailable>, ctx=<unavailable>, events=<unavailable>, suspend_policy=<unavailable>) at debugger-agent.c:3715
    frame #4: libmonosgen-2.0.so`thread_end [inlined] process_profiler_event(event=EVENT_KIND_THREAD_DEATH, arg=0x00000071ebfec508) at debugger-agent.c:3875
    frame #5: libmonosgen-2.0.so`thread_end(prof=<unavailable>, tid=<unavailable>) at debugger-agent.c:3991
    frame #6: libmonosgen-2.0.so`mono_profiler_raise_thread_stopped(tid=<unavailable>) at profiler-events.h:105
    frame #7: libmonosgen-2.0.so`mono_thread_detach_internal(thread=<unavailable>) at threads.c:979
    frame #8: libmonosgen-2.0.so`thread_detach(info=0x00000071e949a000) at threads.c:3215
    frame #9: libmonosgen-2.0.so`unregister_thread(arg=<unavailable>) at mono-threads.c:544
    frame #10: libmonosgen-2.0.so`thread_info_key_dtor(arg=0x00000071e949a000) at mono-threads.c:774
    frame #11: 0x00000072899c58e8 libc.so`pthread_key_clean_all() + 124
    frame #12: 0x00000072899c5374 libc.so`pthread_exit + 76
    frame #13: 0x00000072899c5264 libc.so`__pthread_start(void*) + 44
    frame #14: 0x000000728996617c libc.so`__start_thread + 72
```
2019-04-09 10:39:24 -04:00
monojenkins bd6801d402 [merp] Restore non-assertion behavior in debugger-engine.c (#13880) 2019-04-08 22:24:05 -04:00
Alexander Köplinger 323e32d96b [System.Data] Remove unnecessary file from xunit tests (#13935)
It contained DllImports to some Windows APIs which causes issues on xamarin-macios which expects all pinvokes to exist.

Turns out we don't even need that file.

(cherry picked from commit 3903a50e43)
2019-04-08 23:52:17 +02:00
Alexander Köplinger 85d1920b01 Bump bockbuild to get GTK fix (#13912)
https://github.com/mono/bockbuild/pull/93
2019-04-08 15:50:42 +02:00
Jo Shields 2458d2d477 Merge pull request #13867 from monojenkins/backport-pr-13866-to-2018-10
[2018-10] [mono-dl] Don't do thread state transitions in mono_dl_fallback_register
2019-04-05 15:51:21 -04:00
Alexander Kyte da5c20953f [2018-10] [merp] Fix image size reported (#13884)
Fixes https://github.com/mono/mono/issues/13834

Backport of #13847.
2019-04-05 21:27:37 +02:00
Aleksey Kliger 0e9b8f7c93 [mono-dl] Don't do thread state transitions in mono_dl_fallback_register
1. it doesn't touch the managed runtime

2. it may be called (arguably it ought to be called only) before the runtime is
initialized (and in particular before the current thread is attached).
2019-04-04 23:23:57 +00:00
Alexander Köplinger 9144241961 [MacSDK] Bump bockbuild for fix to #13804 2019-04-04 00:16:53 +02:00
monojenkins fc775d0b9f [2018-10] Fix transition offset logic (#13800)
* Fix transition offset logic

* Update time zone info logic in case of no transitions (windows)
2019-04-03 10:24:54 +02:00
Jo Shields 15d050a792 Merge pull request #13764 from monojenkins/backport-pr-11014-to-2018-10
[2018-10] [llvm] Fix the loaded llvm build.
2019-04-01 11:40:22 -04:00
Zoltan Varga 4013ccbc3a [llvm] Fix the loaded llvm build. 2019-04-01 13:53:24 +00:00
Zoltan Varga 2264e1b30c [llvm] Fix the computation of size of gshared instances in another place.
Fixes https://github.com/mono/mono/issues/13610.
2019-03-29 13:40:32 +01:00
Aleksey Kliger 9bda4038a2 [2018-10][llvm] Bump LLVM submodule to 349752c464c5fc93b32e7d45825f2890c85c8b7d
Pick up https://github.com/mono/llvm/pull/19 to fix LLVM AOT crashes on
Windows.
2019-03-29 13:13:14 +01:00
Zoltan Varga 9e7fc6ccb0 [llvm] Fix the computation of size of gshared instances in emit_args_to_vtype ().
Fixes https://github.com/mono/mono/issues/13610.
2019-03-26 20:43:54 +01:00
Bernhard Urban 95911b799a [amd64] use 32bit variant of lea_membase for 32bit operations
Consider
```
 xor %r15, %r15       // %r15 = 0x0
 dec %r15d            // %r15 = 0xffff_ffff
 lea 0x1(%r15), %rdx  // %rdx = 0x1_0000_0000 but should be 0x0
```

instead `lea 0x1(%r15), %edx` should be generated.
2019-03-26 08:46:42 +01:00
Alexander Kyte 3a91530444 [merp] Fix anon allocation, use MAP_PRIVATE 2019-03-21 11:44:52 +01:00
monojenkins 24a71af6f3 [2018-10] [System.ServiceModel] Fix a race condition in HttpRequestChannel. (#13531)
Concurrent request completions could cause following exception:

    FATAL UNHANDLED EXCEPTION: System.ArgumentOutOfRangeException:
        Index was out of range. Must be non-negative and less than
        the size of the collection.
        Parameter name: index
       at System.Collections.Generic.List`1[T].RemoveAt (System.Int32 index) [0x00009] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Collections.Generic.List`1[T].Remove (T item) [0x0000c] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.ServiceModel.Channels.HttpRequestChannel+HttpChannelRequestAsyncResult.Cleanup () [0x00011] in <28c4695205ef47378f5370502b066592>:0
       at System.ServiceModel.Channels.HttpRequestChannel+HttpChannelRequestAsyncResult.set_IsCompleted (System.Boolean value) [0x00034] in <28c4695205ef47378f5370502b066592>:0
       at System.ServiceModel.Channels.HttpRequestChannel+HttpChannelRequestAsyncResult.Complete (System.Exception ex) [0x0001a] in <28c4695205ef47378f5370502b066592>:0
       at System.ServiceModel.Channels.HttpRequestChannel+<>c__DisplayClass7_1.<BeginProcessRequest>b__0 (System.IAsyncResult r) [0x000bd] in <28c4695205ef47378f5370502b066592>:0

    This stack was captured after some changes in AwaitTaskContinuation.RunOrScheduleAction.
    Unfortunately the current implementation of AwaitTaskContinuation.RunOrScheduleAction re-throws the above
    exception with a wrong stack:

       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction (System.Action action, System.Boolean allowInlining, System.Threading.Tasks.Task& currentTask) [0x00023] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task.FinishContinuations () [0x00052] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task.FinishStageThree () [0x0003c] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task.FinishStageTwo () [0x000a1] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task.Finish (System.Boolean bUserDelegateExecuted) [0x00003] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task.TrySetException (System.Object exceptionObject) [0x00023] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetException (System.Exception exception) [0x00029] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Net.HttpWebRequest+<RunWithTimeoutWorker>d__241`1[T].MoveNext () [0x000e0] in <3e9b3e26c4694baab3f689687ad40612>:0
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext (System.Object stateMachine) [0x00000] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run () [0x00024] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction (System.Action action, System.Boolean allowInlining, System.Threading.Tasks.Task& currentTask) [0x00023] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task.FinishContinuations () [0x00052] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task.FinishStageThree () [0x0003c] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Threading.Tasks.Task`1[TResult].TrySetResult (TResult result) [0x0004f] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetResult (TResult result) [0x0003d] in <4a8a0eaa024f41829d3435c07e5c7edb>:0
       at System.Net.ServicePointScheduler+<WaitAsync>d__45.MoveNext () [0x000f7] in <3e9b3e26c4694baab3f689687ad40612>:0
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext (System.Object stateMachine) [0x00000] in <4a8a0

    On an Android Xamarin installation this causes an app crash. Since no user code is active the exception cannot be caught.

Backport of #13304.
2019-03-19 20:34:53 +01:00
monojenkins 7e62f08570 [2018-10] [crash] Fallback to MAP_ANONYMOUS for allocator (#13504)
This is helpful by allowing the crash reporter to work even while unable to write to the working directory.

Backport of #13447.
2019-03-19 16:15:39 +01:00
Alexander Köplinger 903c4aab5c Bump bockbuild for GTK fix 2019-03-18 20:34:54 +01:00
Jo Shields 9326f9faf3 Append .1 to version number 2019-03-14 16:17:28 -04:00
Jo Shields f09e177295 Include libgdiplus 5.6.1
(cherry picked from commit 5888bf9acc)
2019-03-14 16:15:08 -04:00
monojenkins bfb9881410 Revert "[mini] Inline Selector.GetHandle for tvOS and watchOS assemblies as well. (#13246)" (#13419)
[2018-10] Revert "[mini] Inline Selector.GetHandle for tvOS and watchOS assemblies as well. (#13246)"

This reverts commit c99fe4b462.

It doesn't work when LLVM is enabled for tvOS: https://github.com/xamarin/xamarin-macios/pull/5742#issuecomment-471007078, it causes multiple compilation errors like this:

    Process exited with code 1, command:
    /Applications/Xcode101.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang  -isysroot /Applications/Xcode101.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk -Qunused-arguments -mtvos-version-min=12.1 -fembed-bitcode-marker -arch arm64 -c -o /private/var/folders/nh/n1y9qj2n40d7wpmx1mg9blg80000gn/T/mtouch.cache/arpl1vgs.js6/arm64/Xamarin.TVOS.dll-llvm.o -x assembler /private/var/folders/nh/n1y9qj2n40d7wpmx1mg9blg80000gn/T/mtouch.cache/arpl1vgs.js6/arm64/Xamarin.TVOS.dll-llvm.s
    /private/var/folders/nh/n1y9qj2n40d7wpmx1mg9blg80000gn/T/mtouch.cache/arpl1vgs.js6/arm64/Xamarin.TVOS.dll-llvm.s:4665:14: error: invalid variant 'OBJC_SELECTOR_REFERENCES_.2@PAGE'
            adrp    x8, l_@OBJC_SELECTOR_REFERENCES_.2@PAGE
                           ^
    /private/var/folders/nh/n1y9qj2n40d7wpmx1mg9blg80000gn/T/mtouch.cache/arpl1vgs.js6/arm64/Xamarin.TVOS.dll-llvm.s:4673:18: error: invalid variant 'OBJC_SELECTOR_REFERENCES_.2@PAGEOFF'
            ldr     x1, [x8, l_@OBJC_SELECTOR_REFERENCES_.2@PAGEOFF]




<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->

Backport of #13418.

/cc @lambdageek @rolfbjarne
2019-03-14 09:38:52 -04:00
Alexis Christoforides 92751e786f [MacSDK] Bump Nuget to 4.8.2 2019-03-12 22:38:00 +01:00
monojenkins 2142d47758 [2018-10] [debugger] Fixing two crashes while debugging an Android app. (#13403)
* [debugger] Fixing two crashes while debugging an Android app.

-> Doing stepping into in VSM in some situation the frame saved in TLS is not synchronised with what is really been executed in the main thread. This makes the debugger-agent crashes because it tries to get variable info in some memory that is not available anymore.
	-> To fix it I forced the update of stack when CMD_THREAD_GET_FRAME_INFO is called.

-> Doing step over in Visual Studio for Windows, if you have the threads debugger window enabled, VSW calls frame_commands for each thread that is showed, and if the thread is not really_suspended it tries to get variable info from a memory that is not available anymore because the thread is not suspended yet.
	-> To fix it I don't send variable info of a frame if the thread is not really_suspended and doesn't have an async_state valid.

#Fixes 12843
2019-03-11 22:53:31 -03:00
Alexander Köplinger a8ec3b0f2e Fix build on Alpine Linux (#13394)
- sys/sysctl.h isn't available on Alpine and not needed by the code,
  guard it using HAVE_SYS_SYSCTL_H like elsewhere. Added by https://github.com/mono/mono/pull/11855

(cherry picked from commit 0d7ce1f767)
2019-03-11 17:02:01 +01:00
Zoltan Varga 4987b261ad [llvm] Emit target layout/target triple into bitcode files.
Fixes https://github.com/mono/mono/issues/12307 for 2018-08.
2019-03-11 10:35:32 +01:00
Alexander Köplinger 204d95cec1 [2018-10][configure.ac] Fix configure checks for Mono.Native (#13351)
* [configure.ac] Fix configure checks for Mono.Native

When the configure checks were ported from configure.cmake in corefx
a couple of mistakes happened:

- Using AC_TRY_COMPILE instead of AC_TRY_LINK:
  CMake's check_c_source_compiles() function compiles *and* links while
  AC_TRY_COMPILE only does the former. This hides potential linking issues
  which should fail the configure check.
- Using CFLAGS="-Werror -W....":
  This works in CMake but autoconf always appends the previously defined
  CFLAGS and since we set e.g. `-Wno-undefined` some configure checks
  would fail due to an unrelated warning being treated as an error.
  We need to only promot specific warnings to errors instead.

While looking at this I also found that we were setting CFLAGS after
we already AC_SUBST() it, we need to do this very close to the end of configure.ac.
Moved some code into that last block.

Finally, Android has special cases for sendfile and arc4random_buf where
they're defined in the header but aren't actually there for certain API profiles.
For now we disable arc4random_buf on Android and add a special check for sendfile.

* Fix -Wreturn-type warning/error in sgen-grep-binprot.c

(cherry picked from commit 86bae56326)

* Fix sendfile with 6 parameters being misdetected

We need to make sure to actually prevent the implicit prototype since
in this case sendfile with different set of parameters actually exists
so the linker wouldn't fail.

Also fixed a few other cases of wrong configure checks due to missing headers.
2019-03-07 23:41:52 +01:00
Alexander Köplinger 5292793039 [corlib] Disable ThreadPoolTest.GetAvailableThreads () on machines with many cores
It doesn't work well on the new 64 core ARM machines we have in CI.

(cherry picked from commit d99af881c3)
2019-03-07 21:37:28 +01:00
monojenkins 229d6a0222 [crash] Detect when 0 attached threads, fix hang/double-fault. (#13337) 2019-03-07 13:59:41 -05:00
Alexander Köplinger c1cf332539 [2018-10] Bump bockbuild to get GTK fix
See https://github.com/mono/bockbuild/pull/90
2019-03-06 23:42:23 +01:00
monojenkins a76ca3c063 Bump API snapshot submodule 2019-03-05 15:15:46 -07:00
Martin Baulig cdad7378ae Make System.dll internals visible to Mono.Android. 2019-03-05 15:15:46 -07:00
Aaron Hill bf1b7f1951 Ensure that the module cctor is run before the entry point is executed (#13242)
* Ensure that the module cctor is run before the entry point is executed

We need to ensure that any module cctor for the 'main' image
is run *before* we invoke the entry point

This is required in order for tools like Costura
(https://github.com/Fody/Costura) to work properly. These tools inject
a module initializer which sets up event handlers (e.g. AssemblyResolve),
which allows the main method to run properly

For more information about module constructors,
see https://blogs.msdn.microsoft.com/junfeng/2005/11/19/module-initializer-a-k-a-module-constructor/

* Fix module-cctor-entrypoint.il
2019-03-05 13:20:08 +01:00
monojenkins 78e155f252 [2018-10] Fix mono conc hashtable lookup endless loop (#13293)
[2018-10] Fix mono conc hashtable lookup endless loop


<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->

The tombstone scrubbing fix applied in the past did not work in every case.

Since the key assignment to an element added via mono_conc_hashmap_insert() happens before the tombstone check, the tombstone count remains the same even if a tombstone was replaced. 

In this case the table size check can decide to rehash to the same table size because assuming free spots will become available from not copying over the tombstones. But if all tombstones have been replaced with new elements the fill rate of the hashmap will effectively stay the same, and in the long run rehashing with the same hashmapsize finally leads to a completely filled hashmap.

In the case of a completely filled hashmap looking up an element, not contained in the hashmap, will result in an endless loop because the termination condition for lookups is finding a null key.

We continuously run into this issue with our server application.

Please include this fix into the main repository


Backport of #12382.

/cc @lewurm @hecklatcipsoft
2019-03-04 12:56:06 -05:00
Marek Habersack af19147d0b [Android] Fix runtime loading of DSOs for 64-bit processes
Context: https://github.com/xamarin/xamarin-android/issues/2780

On Android the executable for the application is going to be
`/system/bin/app_process{32,64}` depending on the application's architecture.
However, libraries for the different architectures live in different
subdirectories of `/system`: `lib` for 32-bit apps and `lib64` for 64-bit ones.
Thus appending `/lib` below will fail to load the DSO for a 64-bit app, even if
it exists there, because it will have a different architecture. The quickest fix
is to use `lib64` explicitly for 64-bit Android apps.
2019-03-04 17:41:17 +01:00
Bernhard Urban e752907c5b [2018-10] [interp] mixed mode fixes for delegates (#13260)
Backport of https://github.com/mono/mono/pull/13215
2019-03-04 10:44:55 -05:00
monojenkins 68fb0e0c9c [mini] Inline Selector.GetHandle for tvOS and watchOS assemblies as well. (#13255) 2019-03-04 09:23:58 -05:00
Alexander Köplinger 1f81468bd5 Update csproj file for System.Drawing.Common facade
See 3151b5cea8
2019-03-04 14:11:55 +01:00
Alexander Köplinger 74cfbd2bb4 [sdks] Use throttle() instead of lock()
The former works in freestyle builds.

(cherry picked from commit 98e0f2697d)
2019-03-01 14:50:55 +01:00
Alexander Köplinger f08a9ab1d2 Revert "[sdks] Make sure to run only one build per type per node"
This reverts commit 5e9f06e9c1.

We actually want to only run one build per product on a node,
e.g. so that android-debug and android-release can't run on
the same node and stomp on each other's toolchain.
2019-03-01 13:53:24 +01:00
Alexander Köplinger 3151b5cea8 [Facades] Add System.Drawing.Common back to monotouch etc profiles
It was accidentally removed by 244c31c6be
2019-02-28 20:31:21 +01:00
monojenkins 91e8acb924 [2018-10] [interp] compute size of generic valuetype correctly (#13227)
[2018-10] [interp] compute size of generic valuetype correctly

Otherwise we smash the stack.


Contributes to https://github.com/xamarin/xamarin-macios/issues/5622

Backport of #13216.

/cc @lewurm
2019-02-28 14:25:41 -05:00
monojenkins 5849bb2f22 [aot] Resolve profile against compiled assembly (#13182)
When trying to use AOT profile in XA for assembly AOT compilation, the
methods from the profile were not compiled.

Context: https://github.com/xamarin/xamarin-android/issues/2504

The problem was, the profile data were not resolved, as there was no
assembly loaded in the domain.

With this fix, the compiled assembly is used to resolve the profile as
well.
2019-02-26 11:47:02 -05:00
monojenkins f16d2d5d44 [2018-10] [aot] abort lookup early when a method isn\u0027t available in AOT image (#13179)
[2018-10] [aot] abort lookup early when a method isn\u0027t available in AOT image

Mixed mode depends on that.  Usually, compile_method of mini takes care
to request only existing methods from the AOT image, but in some cases,
e.g. from a trampoline, AOT runtime is quiered directly.

Contributes to https://github.com/xamarin/xamarin-macios/issues/5618

Backport of #13138.

/cc @lewurm
2019-02-26 08:46:02 -05:00
Alexander Köplinger da38bdc0e4 [ci] Use dl.internalx.com when building on private Jenkins
(cherry picked from commit 9d4aa950aa)
2019-02-26 11:22:15 +01:00
Bernhard Urban ea3e93b191 [2018-10] AOT fixes for interp mixed mode (#13172)
[2018-10] AOT fixes for interp mixed mode

Backport of https://github.com/mono/mono/pull/13137 & https://github.com/mono/mono/pull/13139
2019-02-25 08:25:49 -05:00
Vincent Dondain b4b86276a4 [System] Bump SocketTest.TestSelect1 socket timeout to 1ms (#13152)
- Previous test with 100 micro second timeout would fail on iOS device when running **all the socket tests** about 3 times out of 5.
- With a 1 millisecond timeout, it didn't fail the 10 times I tried locally, hopefully this is enough to fix the flakiness.
- Fixes #8360: [System.Net.Sockets] flakey failures of SocketTest.TestSelect1 on Darwin systems
  (https://github.com/mono/mono/issues/8360)
- Also partial fix for maccore issue https://github.com/xamarin/maccore/issues/1069

(cherry picked from commit 0525583d1e)
2019-02-22 21:28:45 +01:00
Alexis Christoforides 5bd3f0b5b4 fixup: Point binary-reference-assemblies back to master 2019-02-21 15:59:25 -05:00
Alexis Christoforides 244c31c6be [2018-10] [monodroid] Fill-in reference stubs for System.Drawing types that are … (#12965)
* [monodroid] Use CoreFX to fill in reference stubs for System.Drawing types that are currently 'forked' from Mono into Mono.Android.dll

The list of localy implemented System.Drawing types: https://github.com/xamarin/xamarin-android/blob/e0da1f152de84c4cc39983f2fda775ec98c08250/src/Mono.Android/Mono.Android.csproj#L311-L325

* [netstandard] Update for Mono.Android change

* Bump reference assemblies to include Mono.Android update
* Use System.Drawing.Common to find moved types in monodroid case for netstandard facade

* Bump API snapshot submodule

* [csproj] Update project files
2019-02-21 15:17:32 -05:00
Alexander Köplinger 5e9f06e9c1 [sdks] Make sure to run only one build per type per node
They could conflict while provisioning android toolchains etc. otherwise.

(cherry picked from commit b740313aa5)
2019-02-21 17:35:58 +01:00
Alexander Köplinger d390bb6901 [Facades] Only provide the System.Drawing.Common stubs for monodroid 2019-02-21 16:07:54 +01:00
Maxim Lipnin 0065638f26 use for loop to access item values and avoid InvalidCastException which occurs because VirtualDirectoryMappingCollection enumerator returns key and it's not expected 2019-02-21 15:28:59 +01:00
Alexander Köplinger c35bd54639 Bump bockbuild for GTK fix
See https://github.com/mono/bockbuild/pull/84
2019-02-20 17:42:01 +01:00
monojenkins 2b6f395180 [2018-10] Cater for later glibc use of ucontext (#13052)
Later levels of glibc redefine struct ucontext to typedef struct ucontext_t. This PR will check the level of glibc and define MonoContext appropriately.

Backport of #12272.
2019-02-18 23:06:18 +01:00
Alexander Kyte 4c3f26a9de Merge pull request #13013 from alexanderkyte/managed_exc_reformat-2018-10
[2018-10]  Add more detailed reporting for exceptions
2019-02-15 11:14:04 -05:00
Alexander Kyte 4cad1b8af0 [crash] Fix exception stack walker to consider captured_traces
Previously we were missing these frames from the captured_traces fields
of MonoException and MonoStackTrace.
2019-02-14 13:06:06 -05:00
Alexander Kyte 68fbd3eca2 [crash] Add more detailed reporting for exceptions
This bumps the crash reporting file format to version 0.0.3.
2019-02-14 12:32:24 -05:00
monojenkins 0955247f91 [bitcode] round up value type size for slot calculation (#13009)
[2018-10] [bitcode] round up value type size for slot calculation

consider

```csharp
struct S3
{
    public ushort X;
    public ushort Y;
    public ushort Z;
}
```
this would be 3 * 2 = 6 bytes. Structs, however, are passed around as i32
arrays in LLVM IR between functions. Those, if such a struct is passed, are
split to `int32`s depending on the struct's size. The previous calulation was
wrongly reserving one such i32 slot instead of two for `S3` above.

Additionally increase slot size to i64 so that it aligns with a
slightly different ABI on arm64_32.


Fixes https://github.com/mono/mono/issues/8486

@rolfbjarne I've tested it on a arm64_32 device, please confirm that this fixes the issue on your armv7k device as well

Backport of #12992.

/cc @lewurm
2019-02-14 12:25:50 -05:00
monojenkins aa0b580e85 Fix issue where togglerefs might be incorrectly pinned. (#12933)
Due to current order, process togglerefs and then take current threads
stack could cause a problem where toogleref references might be left
in registers after native code process the list and those reference
would then be put into current thread context, incorrectly pinning the
toggleref, preventing it from being GC:ed. The problem was observed on
Windows (in debug build) running sgen-toggleref.exe runtime test since
the native compile of sgen_process_togglerefs used a register when
walking the list of togglerefs that was then not re-used until the
current threads stack was taken, causing incorrect pinning. This problem
could in theory happen on any platform depending on how sgen_process_togglerefs
would been compiled and what register will be used.

Fix is to take current threads context before walking the togglerefs to make
sure we are not getting managed references into registers as part of managing
the toggleref list in native code.
2019-02-14 10:29:37 -05:00
Thays Grazia a4b5c763a1 [2018-10] [debugger] Reverting part of https://github.com/mono/mono/pull/12114 (#12967)
Reverting part of this commit #12114, removing this part the test ShouldCorrectlyStepOverOnExitFromArgsAfterStepInMethodParameter continues working and solve the regressions of 12881.

Inserted a new test that reproduces the regression.
Fixes #12881

Backport of #12950.

/cc @thaystg
2019-02-12 22:11:46 -05:00
Alexander Köplinger 2f94cf00bb Mono.Native: Simplify checking for min-version
We don't need to do the replacement sed magic for the compat library,
it should just use whatever is passed in.
2019-02-13 03:16:28 +01:00
Alexander Köplinger 78f05bcfa3 [corlib] Fix CustomAttributeDataTest.MethodIncludesDllImportAttributeData() on watch/tv
Bitcode requires that the native symbol exists.
Changed the pinvoke to something that exists in libc.
2019-02-12 22:25:36 +01:00
monojenkins a5f5870b2a [2018-10] Bump cecil submodule (#12944)
* Bump cecil submodule

* Bump API snapshot submodule

* [csproj] Update project files
2019-02-12 11:59:06 +01:00
Alexis Christoforides 4a7563ff85 Disable other failing tests (they are tests that are newly added, not regressions) 2019-02-11 20:30:35 -05:00
Alexis Christoforides 0d241933d6 Look for mono_pal_init() directly in the System.Native library 2019-02-11 20:30:35 -05:00
Alexis Christoforides 6a9a2e961a [configure] Have libmono-native depend on libmono(-sgen) for the Android build
If this is not done, Android is not able to resolve mono symbols that are used in mono-native (e.g. mono_add_internal_call_with_flags), and will refuse to load the library with 'cannot locate symbol' errors
2019-02-11 20:30:35 -05:00
Alexander Köplinger 78bffebbd8 [ci] Bump bockbuild to get fontconfig download url fix 2019-02-11 16:52:47 +01:00
monojenkins 2e7daaa78d [interp] Fix ldelema (#12927)
The ldelema IL instruction provided the element class while the Address intrinsic provided the array class.

Fixes https://github.com/xamarin/xamarin-macios/issues/5363
2019-02-11 09:08:42 -05:00
monojenkins c43534cda4 [arm/bitcode] mark valuetype returns as such when dealing with pinvokes (#12910)
[2018-10] [arm/bitcode] mark valuetype returns as such when dealing with pinvokes

On armv7 our calling convention happens to be the same as the platform
one. However, when using a armv7 cross compiler to generate bitcode that
targets a different platform (e.g. arm64_32) the calling convention can
be different (e.g. on arm64_32, a return buffer must be passed via r8).
Thus, mark it properly for LLVM so it can generate correct code.



Backport of #12894.

/cc @luhenry @lewurm
2019-02-11 07:45:52 -05:00
monojenkins b48a13fd15 [2018-10] [interp] Add method to seq_points table after we finish registering it (#12905)
* [interp] Add method to seq_points table after we finish registering it

When adding a breakpoint (mono_de_set_breakpoint) we search in this table for seq_point information for the method. If we find the information we expect that the method is already compiled and has the metadata initialized when actually adding the breakpoint (set_bp_in_method). We were crashing if the jinfo field of the interp method was not yet initialized.

Fixes https://github.com/xamarin/xamarin-macios/issues/5381

* [interp] Move profiler callback when we are actually done

Just in case.
2019-02-11 10:32:58 +01:00
Alexander Köplinger 73a1f12571 [ci] Support building the OSX .pkg on private Jenkins
(cherry picked from commit 7f5125179d)
2019-02-09 20:21:33 +01:00
Ludovic Henry be6e0ebc77 Merge pull request #12857 from monojenkins/backport-pr-12856-to-2018-10
[2018-10] [Registry] Prevent crash due to background thread facing problems in the file system
2019-02-08 15:45:23 -05:00
monojenkins a13ca00bc8 [2018-10] [runtime] Fix mono_pe_file_map logging (#12898)
Since it's being used when the image is created, it actually doesn't need to be signal safe. This restores the previous behavior. 

Backport of #12588.
2019-02-08 19:06:25 +01:00
monojenkins fb48de64ce [arm64] encode offset within stack slot for r4 in gsharedvt descriptor (#12886)
[2018-10] [arm64] encode offset within stack slot for r4 in gsharedvt descriptor

Follow up fix for https://github.com/mono/mono/pull/11741

Fixes https://github.com/mono/mono/issues/12831


Backport of #12867.

/cc @lewurm
2019-02-08 06:25:41 -05:00
Aleksey Kliger cc39803728 [sre] Handle null values in MarshalAsAttribute CustomAttributeBuilder
Normally strings are encoded as length-then-utf8 in ECMA-335.  But a null
String is encoded as just the byte 0xFF.

When we make a CustomAttributeBuilder for a MarshalAsAttribute and attach it to
some parameter we first encode the CAB as a byte blob and then decode it in
CAB.get_umarshal into a UnmanagedMarshal attribute.  But the decoding didn't
account for the possibility of null strings.

Fixes https://github.com/mono/mono/issues/12747
2019-02-08 10:56:53 +01:00
Bernhard Urban 326fde705b [aot] interp flag on AOT images only on mscorlib required 2019-02-08 10:45:52 +01:00
Alexander Köplinger b2919b6ff1 [2018-10] [corlib] Disable four tests in TypeTest (#12868)
TypeTest.MakeGenericType_BadUserType
TypeTest.MakeGenericType_NestedUserDefinedType
TypeTest.MakeGenericType_UserDefinedType
TypeTest.TestMakeGenericType_UserDefinedType_DotNet20SP1

These tests pass when run with the interpreter on xamarin-macios.
They were disabled on master with https://github.com/mono/mono/commit/dc9bc9e0e6462739872117afc59e46fbc780d981
2019-02-08 00:22:05 +01:00
Alexander Kyte 9b3670f36a [2018-10] [runtime] Use temp folders for merp tests (#12866)
The 2018-10 lane seemed to be failing some tests because the merp-json-valid.exe test left behind the crash log file. I fixed that in this PR, but also move the tests into their separate folders so they can run at the same time safely.

Backport of #12830.
2019-02-07 23:20:20 +01:00
Miguel de Icaza c255eefb41 [Registry] Prevent crash due to background thread facing problems in the file system 2019-02-07 16:59:37 +00:00
monojenkins d3ebbdcde2 [ios] pass --enable-monotouch to cross compilers so icall defintions are visible to it (#12837)
This fixes a regression introduced by
https://github.com/mono/mono/commit/5187b0bdaaff56936d697b0753dad51e7498991d

The AOT compiler wasn't aware of the icalls since they are guarded by
`ENABLE_MONOTOUCH`. Passing `--enable-monotouch` to configure of the AOT
compiler enables that define, so it can properly resolve those icalls.
However, to avoid `zlib` dependency for the cross compilers, we stub
them out.
2019-02-06 23:08:33 +01:00
Alexander Köplinger bfe4e37521 [2018-10] [corlib] Remove reflection-based Mono.Native test (#12828)
The managed linker removes the type embedded inside mscorlib and we don't want to whitelist it in linker xml since then it'd be kept for everyone.

Instead move the type to the test assembly and remove the reflection-based tests.
2019-02-06 22:27:47 +01:00
monojenkins d6c979938c [2018-10] [runtime] Properly inflate cmods of (m)var. (#12802)
* [metadata] print just the assembly name when dumping the vtable.

* [metadata] Extract print_vtable_layout_result.

* [metadata] Improve --print-vtable.

* [metadata] Improve --print-vtable when dealing with broken types or abstract methods.

* [metadata] Make type dup used by inflate_generic_type be cmod aware. Fixes #10834

We didn't include cmods when inflating var/mvar cuz we'd mono_metadata_type_dup' the inflated type
and not the (m)var MonoType.

The solution is to add a variant of mono_metadata_type_dup that takes the source of cmods to use.

* [mini] Add regression test for #10834.
2019-02-06 11:35:08 +01:00
Alexander Köplinger fc8afab45c [spinlock] reduce interations in BCL test
Cherry-picked from f394d7cd8e.
2019-02-06 11:24:44 +01:00
Alexander Köplinger 1ca5ef6c30 Extend mono-native minimum version magic to CPPFLAGS/CXXFLAGS (#12801)
We were only doing the -mmacosx-min-version replacement magic on
CFLAGS and LDFLAGS for mono-native-compat and -unified,
but we need to do the same for CPPFLAGS/CXXFLAGS too.

Fixes an issue where the libraries were targeting the wrong minimum OSX
version when built from xamarin-macios since they pass the minimum version
in CPPFLAGS instead of CFLAGS for OSX.
2019-02-06 00:07:25 +01:00
Marek Safar 73f642d56b [corlib] Fix GetFrames_AsyncCalls test not to block 2019-02-05 19:14:37 +01:00
monojenkins 829480a1c3 [2018-10] [corlib] Do not clone SynchronizationContext in ExecutionContext.Capture (#12779)
Fixes https://github.com/mono/mono/issues/12421
When we switched to CoreFX/CoreRT sources (mostly CoreRT) for System.Threading we had to keep old reference-source based `ExecutionContext`, `CancellationToken` and `CancellationTokenSource`.  In the bug above the redundant `SynchronizationContext.Post` was triggered here:
https://github.com/mono/corert/blob/1b7d4a1e4bd79305905338827cc41eb8303364f0/src/System.Private.CoreLib/src/System/Threading/Tasks/TaskContinuation.cs#L404

it was expected to be "myCustomSyncContext == myCustomSyncContext" but instead it was "myCustomSyncContext == empty SynchronizationContext instance".
That empty instance was allocated in `CreateCopy` which I am trying to delete in this PR.
That `.CreateCopy()` always creates `SynchronizationContext` instance (see [here](https://github.com/mono/mono/blob/master/mcs/class/referencesource/mscorlib/system/threading/synchronizationcontext.cs#L363-L368), but it's expected) so `==` is `false` in our case => it goes to the "Post" path instead of "Execute synchronously". 
PS: .NET Core sources do not call `CreateCopy anywhere.

Backport of #12774.

/cc @marek-safar @EgorBo
2019-02-05 13:17:50 +01:00
Thays Grazia 9434d41512 [Tailcall] [arm] [jit] Fix moving tailcall parameters. (#12701) (#12763)
* When moving parameters for tailcall, first copy the parameters using ARMREG_IP and after that get destination in ARMREG_IP, then it's not necessary the PUSH and POP to SP nor the saved_ip_offset.
Fixes #11489
2019-02-04 10:27:22 -05:00
Alexis Christoforides f85db53c8b Update configure.ac
Define HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP in the cross-compilation case also (since we are "assuming yes")
2019-02-04 14:13:21 +01:00
ShonkyCH 42187d129f Fix cross compile issue introduced in 5.16
Fixes #9951
2019-02-04 14:13:21 +01:00
Bernhard Urban 548744cea9 Bump corert
Commit list for mono/corert:

* mono/corert@1b7d4a1e4 [Number] make double 0.0 cmp more portable (#30)
* mono/corert@c4ae51646 Update ISOWeek.cs
* mono/corert@7e8bf2382 fix ISOWeek for mcs
* mono/corert@0e5f123f6 [corlib] Import System.IO.Stream/BufferedStream from CoreFX (#26)

Diff: https://github.com/mono/corert/compare/b6a822b7424dab39eee81f0c08160f996c9e9e27...1b7d4a1e4bd79305905338827cc41eb8303364f0
2019-02-04 13:49:10 +01:00
Maxim Lipnin 8788708699 Avoid recursive extracting redundant frames from captured traces. 2019-02-04 13:40:36 +01:00
Aleksey Kliger (λgeek) 8d5fc8032a [2018-10][runtime] Switch to GC Unsafe in a few more external API functions (#12735)
* [runtime] Switch to GC Unsafe in mono_property_get_value

It's external only, so it should switch from GC Safe to GC Unsafe when called.

Addresses crash in https://github.com/mono/mono/issues/12724

* [runtime] Make mono_image_loaded external only

Also mono_image_loaded_full

Runtime should use mono_image_loaded_internal

* [runtime] Make mono_get_exception_argument_null external only
2019-02-02 18:01:04 -05:00
Lee Culver ad4efef139 Add back missing stack frames to mono MERP reports
Changeset https://github.com/mono/mono/commit/e1461ebc855977667f71d1804fd96eed2a155aff
introduced a regression where only the topmost frame of managed crashes are reported.

This change adds back the missing stack frames.
2019-02-02 15:17:07 +01:00
monojenkins fe613d1599 [2018-10] [bcl] Fix possible deadlock race in CSharpCodeGenerator (#12727)
`CSharpCodeGenerator` runs a compiler while redirecting its standard error and
standard output streams for further reporting. However, in doing that it fails
to read the standard output data completely and also fails to properly wait for
the standard error output to complete. Depending on environment it may lead to
the process using `CSharpCodeGenerator` hanging while the process has already
exited but there still is data to be read from standard output and standard
error.

This commit changes the code to an implementation of reading standard error and output
that makes sure all the data is read before the process is closed.

The hope is that it may fix some of the timeouts/hangs we see on the
Xamarin.Android build bots as a portion of them hangs in test that use the
code generator.


Backport of #12685.
2019-02-01 19:11:11 +01:00
monojenkins d3c9c60a8c [arm/ios] workaround for faulty vcmp.f64 insn (#12708)
[2018-10] [arm/ios] workaround for faulty vcmp.f64 insn

Fixes https://github.com/mono/mono/issues/11965



Backport of #12704.

/cc @marek-safar @lewurm
2019-02-01 07:15:44 -05:00
monojenkins 64aab490e4 [csproj] Update project files 2019-02-01 09:36:52 +01:00
monojenkins 39fd6b08b5 Bump API snapshot submodule 2019-02-01 09:36:52 +01:00
Egor Bogatov 003bf5dd60 Copy refs from CoreFX 2019-02-01 09:36:52 +01:00
Alexis Christoforides 15fb740a03 [android] Fix inaccurate detection of sendfile() 2019-01-31 18:05:41 -05:00
Alexander Köplinger e0b41dbf9b [bcl] Add Mono.CSharp back to xammac profile
It was removed in https://github.com/mono/mono/commit/96af472795496ad32768d113b1cb42a9d3cdcbcf but xammac does need it still.
2019-01-31 18:18:36 +01:00
Alexander Köplinger f2f5d27950 [System] Skip DefaultValueAttributeTest.Bug_12362() on xammac 4.5 too 2019-01-31 16:40:45 +01:00
Alexis Christoforides e632442e29 [Mono.Native] Build on Android 2019-01-28 20:25:54 -05:00
monojenkins f198c5dfa5 [2018-10] [runtime] Add opt-out for AOT file probing with MONO_AOT_MODE_NONE (#12507)
* [runtime] Don't probe for assemblies when MONO_AOT_MODE_NONE is set

* [runtime] Don't assert when MONO_AOT_MODE_NONE passed to setter

* [runtime] Fix aot mode double init check
2019-01-28 16:25:52 -05:00
Alexander Kyte 0255d3c60c [2018-10] Native Crash Stability Fix Batch (#12571)
* [crash] Support extra merp params

* [runtime] Make infrastructure for merp tests

* [runtime] Fix dumping when crash happens without sigctx

* [runtime] Disable crashy (886/1000 runs) stacktrace walker

* [crash] Remove usage of allocating build/os info functions

* [crash] Remove often-crashing g_free on native crash path

* [crash] Add crash_reporter checked build

We add a checked build mode that asserts when mono mallocs inside of
the crash reporter. It makes risky allocations into assertions. It's
useful for automated testing because the double-abort often represents
itself as an indefinite hang. If it happens before the thread dumping
supervisor process is started, or after it ends, the crash reporter
hangs.

* [crash] Remove reliance on nested SIGABRT/double-fault (broken on OSX)

* [crash] Fix top-level handling of double faults/assertions

* [runtime] Make fatal unwinding errors return into handled error paths

* [crash] Change dumper logging for better info

* [runtime] Fix handling of segfault on sgen thread

Threads without domains that get segfaults will end up in
this handler. It's not safe to call this function with a NULL domain.

See crash below:

```
* thread #1, name = 'tid_307', queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x10eff40f8)
  * frame #0: 0x000000010e1510d9 mono-sgen`mono_threads_summarize_execute(ctx=0x0000000000000000, out=0x0000001000000000, hashes=0x0000100000100000, silent=4096, mem="", provided_size=2199023296512) at threads.c:6414
    frame #1: 0x000000010e152092 mono-sgen`mono_threads_summarize(ctx=0x000000010effda00, out=0x000000010effdba0, hashes=0x000000010effdb90, silent=0, signal_handler_controller=1, mem=0x0000000000000000, provided_size=0) at threads.c:6508
    frame #2: 0x000000010df7c69f mono-sgen`dump_native_stacktrace(signal="SIGSEGV", ctx=0x000000010effef48) at mini-posix.c:1026
    frame #3: 0x000000010df7c37f mono-sgen`mono_dump_native_crash_info(signal="SIGSEGV", ctx=0x000000010effef48, info=0x000000010effeee0) at mini-posix.c:1147
    frame #4: 0x000000010de720a9 mono-sgen`mono_handle_native_crash(signal="SIGSEGV", ctx=0x000000010effef48, info=0x000000010effeee0) at mini-exceptions.c:3227
    frame #5: 0x000000010dd6ac0d mono-sgen`mono_sigsegv_signal_handler_debug(_dummy=11, _info=0x000000010effeee0, context=0x000000010effef48, debug_fault_addr=0xffffffffffffffff) at mini-runtime.c:3574
    frame #6: 0x000000010dd6a8d3 mono-sgen`mono_sigsegv_signal_handler(_dummy=11, _info=0x000000010effeee0, context=0x000000010effef48) at mini-runtime.c:3612
    frame #7: 0x00007fff73dbdf5a libsystem_platform.dylib`_sigtramp + 26
    frame #8: 0x0000000110bb81c1
    frame #9: 0x000000011085ffe1
    frame #10: 0x000000010dd6d4f3 mono-sgen`mono_jit_runtime_invoke(method=0x00007faae4f01fe8, obj=0x0000000000000000, params=0x00007ffee1eaa180, exc=0x00007ffee1ea9f08, error=0x00007ffee1eaa250) at mini-runtime.c:3215
    frame #11: 0x000000010e11509d mono-sgen`do_runtime_invoke(method=0x00007faae4f01fe8, obj=0x0000000000000000, params=0x00007ffee1eaa180, exc=0x0000000000000000, error=0x00007ffee1eaa250) at object.c:2977
    frame #12: 0x000000010e10d961 mono-sgen`mono_runtime_invoke_checked(method=0x00007faae4f01fe8, obj=0x0000000000000000, params=0x00007ffee1eaa180, error=0x00007ffee1eaa250) at object.c:3145
    frame #13: 0x000000010e11aa58 mono-sgen`do_exec_main_checked(method=0x00007faae4f01fe8, args=0x000000010f0003e8, error=0x00007ffee1eaa250) at object.c:5042
    frame #14: 0x000000010e118803 mono-sgen`mono_runtime_exec_main_checked(method=0x00007faae4f01fe8, args=0x000000010f0003e8, error=0x00007ffee1eaa250) at object.c:5138
    frame #15: 0x000000010e118856 mono-sgen`mono_runtime_run_main_checked(method=0x00007faae4f01fe8, argc=2, argv=0x00007ffee1eaa760, error=0x00007ffee1eaa250) at object.c:4599
    frame #16: 0x000000010de1db2f mono-sgen`mono_jit_exec_internal(domain=0x00007faae4f00860, assembly=0x00007faae4c02ab0, argc=2, argv=0x00007ffee1eaa760) at driver.c:1298
    frame #17: 0x000000010de1d95d mono-sgen`mono_jit_exec(domain=0x00007faae4f00860, assembly=0x00007faae4c02ab0, argc=2, argv=0x00007ffee1eaa760) at driver.c:1257
    frame #18: 0x000000010de2257f mono-sgen`main_thread_handler(user_data=0x00007ffee1eaa6a0) at driver.c:1375
    frame #19: 0x000000010de20852 mono-sgen`mono_main(argc=3, argv=0x00007ffee1eaa758) at driver.c:2551
    frame #20: 0x000000010dd56d7e mono-sgen`mono_main_with_options(argc=3, argv=0x00007ffee1eaa758) at main.c:50
    frame #21: 0x000000010dd5638d mono-sgen`main(argc=3, argv=0x00007ffee1eaa758) at main.c:406
    frame #22: 0x00007fff73aaf015 libdyld.dylib`start + 1
    frame #23: 0x00007fff73aaf015 libdyld.dylib`start + 1
  thread #2, name = 'SGen worker'
    frame #0: 0x000000010e2afd77 mono-sgen`mono_get_hazardous_pointer(pp=0x0000000000000178, hp=0x000000010ef87618, hazard_index=0) at hazard-pointer.c:208
    frame #1: 0x000000010e0b28e1 mono-sgen`mono_jit_info_table_find_internal(domain=0x0000000000000000, addr=0x00007fff73bffa16, try_aot=1, allow_trampolines=1) at jit-info.c:304
    frame #2: 0x000000010dd6aa5f mono-sgen`mono_sigsegv_signal_handler_debug(_dummy=11, _info=0x000070000fb81c58, context=0x000070000fb81cc0, debug_fault_addr=0x000000010e28fb20) at mini-runtime.c:3540
    frame #3: 0x000000010dd6a8d3 mono-sgen`mono_sigsegv_signal_handler(_dummy=11, _info=0x000070000fb81c58, context=0x000070000fb81cc0) at mini-runtime.c:3612
    frame #4: 0x00007fff73dbdf5a libsystem_platform.dylib`_sigtramp + 26
    frame #5: 0x00007fff73bffa17 libsystem_kernel.dylib`__psynch_cvwait + 11
    frame #6: 0x00007fff73dc8589 libsystem_pthread.dylib`_pthread_cond_wait + 732
    frame #7: 0x000000010e28d76d mono-sgen`mono_os_cond_wait(cond=0x000000010e44c9d8, mutex=0x000000010e44c998) at mono-os-mutex.h:168
    frame #8: 0x000000010e28df4f mono-sgen`get_work(worker_index=0, work_context=0x000070000fb81ee0, do_idle=0x000070000fb81ed4, job=0x000070000fb81ec8) at sgen-thread-pool.c:165
    frame #9: 0x000000010e28d2cb mono-sgen`thread_func(data=0x0000000000000000) at sgen-thread-pool.c:196
    frame #10: 0x00007fff73dc7661 libsystem_pthread.dylib`_pthread_body + 340
    frame #11: 0x00007fff73dc750d libsystem_pthread.dylib`_pthread_start + 377
    frame #12: 0x00007fff73dc6bf9 libsystem_pthread.dylib`thread_start + 13
  thread #3, name = 'Finalizer'
    frame #0: 0x00007fff73bf6246 libsystem_kernel.dylib`semaphore_wait_trap + 10
    frame #1: 0x000000010e1d9c0a mono-sgen`mono_os_sem_wait(sem=0x000000010e43e400, flags=MONO_SEM_FLAGS_ALERTABLE) at mono-os-semaphore.h:84
    frame #2: 0x000000010e1d832d mono-sgen`mono_coop_sem_wait(sem=0x000000010e43e400, flags=MONO_SEM_FLAGS_ALERTABLE) at mono-coop-semaphore.h:41
    frame #3: 0x000000010e1da787 mono-sgen`finalizer_thread(unused=0x0000000000000000) at gc.c:920
    frame #4: 0x000000010e152919 mono-sgen`start_wrapper_internal(start_info=0x0000000000000000, stack_ptr=0x000070000fd85000) at threads.c:1178
    frame #5: 0x000000010e1525b6 mono-sgen`start_wrapper(data=0x00007faae4f31bd0) at threads.c:1238
    frame #6: 0x00007fff73dc7661 libsystem_pthread.dylib`_pthread_body + 340
    frame #7: 0x00007fff73dc750d libsystem_pthread.dylib`_pthread_start + 377
    frame #8: 0x00007fff73dc6bf9 libsystem_pthread.dylib`thread_start + 13
  thread #4
    frame #0: 0x00007fff73c0028a libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x00007fff73dc7009 libsystem_pthread.dylib`_pthread_wqthread + 1035
    frame #2: 0x00007fff73dc6be9 libsystem_pthread.dylib`start_wqthread + 13
(lldb)
```

* [crash] Add signal-safe mmap/file "allocator"

* [crash] Remove use of static memory from dumper

* [runtime] Reduce print buffer size for lockless printer.

Each frame that prints ends up increased by the size of buff.
In practice, clang often fails to deduplicate some of these buffers,
leading to 30k-big stackframes.

It was noticed by a series of hard-to-diagnose segfaults on stacks that
looked otherwise fine during the crash reporting stress test.

This change fixes this, making stacks a 1/10th of the size. It doesn't
seem to break the crash reporter messages anywhere (may need to shrink
other "max name length" fields), and it's not mission-critical anywhere
else.

* [crash] Use async-safe file memory for dumper internals

* [crash] Add memory barriers around merp configuration

* [crash] Use signal-safe printers on all native crash paths

* [crash] Move gdb/lldb lookup to startup

* [runtime] Move MOSTLY_ASYNC_SAFE_FPRINTF to eglib

* [runtime] Fix all callsites of MOSTLY_ASYNC_SAFE_PRINTF

* [runtime] Fix all callsites of MOSTLY_ASYNC_SAFE_FPRINTF

* [crash] Switch to signal-safe exit function

* [crash] Make dumper enum in managed

* [runtime] Add more information to managed frame

* [crash] Make async_safe printers inlined

* [runtime] Move basic pe_file functionality into proclib

* [crash] Fix handling of thread attributes

* [crash] Place hashes into the json file for all threads

* [crash] Improve reporting on merp test

* [crash] Log the locations of written-to files, for better post-portems
2019-01-28 11:36:25 -05:00
monojenkins 2f2208282b [2018-10] [eglib]: Fix memory leak in g_find_program_in_path(). #11615. (#12598)
Backport of #12580.
2019-01-24 23:34:21 +01:00
Vlad Brezae 871038a64e [sgen] Don't trigger concurrent collections if we exceed soft heap limit
Concurrent gc (mark / sweep) allows the heap to grow further, which is not what we want if we already exceeded the limit.
2019-01-23 11:24:08 +01:00
Martin Baulig 716c8ea173 [SslStream]Flatten exceptions in sync SslStream APIs.
The sync APIs `SslStream.AuthenticateAsClient()` and `AuthenticateAsServer()`
should not throw `AggregateException`.

Fixes #9418.
2019-01-22 21:37:56 +01:00
Martin Baulig b8290b6f27 [System]Correctly dispose inner stream in WebResponseStream. #11928. 2019-01-22 10:08:47 +01:00
monojenkins b6de3867db [System]Fix race condition in SystemDependencyProvider.Initialize(). #12538. (#12544) 2019-01-22 09:15:09 +01:00
Maxim Lipnin 4dda38f2b3 [2018-10] Add TypeConverter fallback to DefaultValueAttribute (#12494)
Backport of https://github.com/mono/mono/pull/12412 to 2018-10 branch.

Requires https://github.com/mono/corefx/pull/239

Fixes https://github.com/mono/mono/issues/12362
2019-01-21 11:32:30 +01:00
monojenkins 1be343e3a9 [runtime] Don't try (slow) dlopen on android if it doesn't exist (#12513) 2019-01-21 11:23:33 +01:00
monojenkins c6a7260860 [2018-10] [ios] enable llvm for watch64_32 runtime (#12498) 2019-01-21 11:12:44 +01:00
Alexander Kyte 0582cf8ba6 [runtime] Don't probe aot cache on android 2019-01-18 08:42:26 +01:00
Marek Habersack 3d6efcb123 [2018-10 Android,AOT] Support dumping AOT offsets with Android NDK r17+ (#12454) (#12466)
Backport of: https://github.com/mono/mono/commit/eebe4b52857140ba9dea872c6249960273d222f2 from https://github.com/mono/mono/pull/12454

The latest Android NDK releases no longer ship with per-platform C headers.
Instead they ship with a set of unified headers and require the presence of the
`__ANDROID_API__` macro in order to select the target platform.
The AOT offset dumper doesn't support this new layout and this commit changes
that by adding support for the unified headers (without removing support for the
older NDKs) thus fixing the following error when trying to dump the offsets with
newer NDK:

    Processing triple: aarch64-v8a-linux-android
    Error parsing '[...]/mono/mono/metadata/metadata-cross-helpers.c'
    [...]/mono/mono/metadata/metadata-cross-helpers.c(5,10): fatal: 'stdio.h' file not found
    Error parsing '[...]/mono/mono/mini/mini-cross-helpers.c'
    [...]/mono/mono/mini/mini-cross-helpers.c(7,10): fatal: 'stdio.h' file not found
2019-01-17 13:32:27 +01:00
Kirill Osenkov 513707c15e Fix https://github.com/mono/mono/issues/12461.
After .NET 4.5 .NET Framework has changed the System.ComponentModel.Composition ReflectionModelServices.IsExportFactoryImportDefinition to not throw.

Updating this to match the .NET Framework behavior.
2019-01-17 12:05:29 +01:00
monojenkins aca7189869 [arm64_32] use emulate OPs so it works with bitcode compiled code for armv7k (#12455)
[2018-10] [arm64_32] use emulate OPs so it works with bitcode compiled code for armv7k



Backport of #12443.

/cc @lewurm
2019-01-16 17:45:39 -05:00
Bernhard Urban d2b92a4a77 [2018-10] [ios] arm64_32 build support (#12447)
[2018-10] [ios] arm64_32 build support

Backport of https://github.com/mono/mono/pull/11652, https://github.com/mono/mono/pull/12055 and https://github.com/mono/mono/pull/11691

Heads up: This will require changes to `xamarin-macios` regarding setting the XCODE location. I'll handle that for the XI 2018-10 integration branch when this is merged.
2019-01-16 12:55:44 -05:00
Thays Grazia 217af22eda [Debugger] Fix crash when there is a generic struct with a field that is an enumerator. (#12368)
* [Debugger]  Debugger crashes when inside a class, there is an internal struct, with a field that is an enumerator.
files.myBucket.GetEnumerator().get_Current().Key
Fixes #10735
2019-01-16 13:04:55 +01:00
Zoltan Varga 4f86bf7f44 [x86] Set the LLVM data layout. 2019-01-16 13:03:20 +01:00
Zoltan Varga 3b12df3beb [arm] Set the LLVM data layout, without it, opt seems to make incorrect optimizations.
Fixes https://github.com/mono/mono/issues/12307.
2019-01-16 13:03:20 +01:00
Aleksey Kliger 27a450b8b1 [threads] Use refcounts for coordinating finalization and detaching
Reverts a29ad08d00 (#9914)

The basic problem we want to solve is the following:
  1. All access to InternalThread:state must be protected by the
     InternalThread:synch_cs mutex
  2. We must destroy the mutex when we are done with the thread.
  3. We don't know which happens later - detaching the machine thread or
     finalizing its InternalThread managed object.

The solution is to replace InternalThread:synch_cs by InternalThread:longlived
which is a refcounted struct that holds the synch_cs.  The refcount starts out
at 2 when the thread is attached to the runtime and when we create the managed
InternalThread object that represents it.
Both detaching and finalizing the managed object will decrement the refounct,
and whichever one happens last will be responsible for destroying the mutex.

This addresses https://github.com/mono/mono/issues/11956 which was a race
condition due to the previous attempt to fix this lifetime problem.  The
previous attempt incorrectly used CAS in mono_thread_detach_internal while
continuing to use locking of synch_cs elsewhere. In particular
mono_thread_suspend_all_other_threads could race with
mono_thread_detach_internal: it expects to take the thread lock and test
thread->state and use the thread->suspended event, while detaching deletes
thread->suspended without taking a lock.

As a result we had a concurrency bug: in suspend_all_other_threads it's
possible to see both the old (non-Stopped) value of thread->state and the
new (NULL) value of thread->suspended.  Which leads to crashes.

---

Background - why we don't know if detaching or finalization happens first.

1. InternalThread normally outlives the machine thread. This can happen because
when one thread starts another it can hold a reference to the fresh thread's
Thread object which holds a reference to the InternalThread. So after the
machine thread is done, the older thread can query the state of the younger
Thread object. This is the normal situation.

2. During shutdown we can have the opposite situation: the InternalThread
objects are finalized first (this happens during root domain finalization), but
the machine threads are still running, and they may still return to
start_wrapper_internal and call detach_internal. So in this case we have an
InternalThread whose finalizer ran first and detach will run second.
2019-01-15 11:51:37 -05:00
Vlad Brezae 084c70bbca [2018-10] [interp] Fix interp eh backport (#12373)
[2018-10] [interp] Fix interp eh backport

Backport of https://github.com/mono/mono/pull/12092 + https://github.com/mono/mono/pull/12328
2019-01-15 08:25:37 -05:00
monojenkins 0343870bd1 Bump API snapshot submodule 2019-01-15 12:30:16 +01:00
Maxim Lipnin 8b1a5354ba Bump corefx 2019-01-15 12:30:16 +01:00
monojenkins 5998117b9e [runtime] Fix integer overflow when copying array (#12408)
[2018-10] [runtime] Fix integer overflow when copying array

Fixes https://github.com/mono/mono/issues/12344

Backport of #12407.

/cc @BrzVlad
2019-01-15 06:15:38 -05:00
Bernhard Urban e6f3003499 [2018-10] [interp] use interp_lmf wrapper for interp2native on platforms with wonky sigcontext (#12350)
[2018-10] [interp] use interp_lmf wrapper for interp2native on platforms with wonky sigcontext

Backport of #12293
2019-01-11 19:15:26 -05:00
Thays Grazia 71691716b7 [debugger] Fix test ShouldCorrectlyStepOverOnExitFromArgsAfterStepInMethodParameter (#12114) (#12340)
[2018-10] [debugger][backport] Fix test ShouldCorrectlyStepOverOnExitFromArgsAfterStepInMethodParameter (#12114)

Backport of #12114


The problem was in this line:
ss_nested_with_two_args(ss_nested_arg (), ss_nested_arg ());
The first step_into works correctly entering in the ss_nested_arg method, but the second one doesn't work.
The problem was because this flag MONO_SEQ_POINT_FLAG_NONEMPTY_STACK was set, so the debugger don't consider that it was a possible break.
The solution of the issue was create another flag to identify nested calls and ignore the  MONO_SEQ_POINT_FLAG_NONEMPTY_STACK.
2 new tests were added to test other nested calls.
2019-01-10 04:55:52 -05:00
Marek Safar 946e21a333 Bump CoreFX 2019-01-10 10:47:55 +01:00
Alexander Kyte dc59a6ff5b [2018-10] [merp] Batch of fixes (#12096)
* [crash] Early exit if callbacks not set

* [crash] Report which thread was crashing

* [runtime] Make sure lldb/gdb dump happens when MERP fails

* [crash] Create supervisor thread for crash dumper

* [runtime] Add waitpid to probed-for libc functions

* [crash] Add crash reporter logger

* [crash] Disable mono-merp when disabling crash reporting

* [crash] Switch merp dumper to no-allocate file writer

- Pass merp directory to backend (optional)
- Adds tests that needed the named change

* [crash] Make mono-state use non-allocating format strings

* [crash] Add json formatting validators to mono/tests

* [crash] Make crash-sending icalls use const strings

* [crash] Use fork+exec for merp

* [crash] Throw exception when unable to contact merp

* [crash] Disable merp-json-valid test on non-OSX

* [crash] Fix mono-state writer trailing comma

* [runtime] Remove duplicate merp invoke line

* [crash] Fix comma mismatch in json writer

* [crash] Fix C++ declaration of crash logger functions
2019-01-07 14:28:48 -02:00
Alexis Christoforides eb0779c34a [tests] Remove an invalid assertion on System.IO.DriveInfo
All fixed drives are not guaranteed to be ready
2019-01-07 08:22:31 -05:00
Marek Habersack 9fc606c983 [Android] Fix build with NDK r18 (#11016) (#12289)
Xamarin.Android is looking to switch to using the latest Android NDK, r18.
However, there are a few build issues in Mono and BTLS which need to be
addressed before that happens.

  * BTLS fails to build some ARM assembly sources with NDK r18's clang.
    https://github.com/mono/boringssl/pull/12 fixes this issue

  * BTLS uses obsolete Android cmake toolchain file.
    Add a configure option to set alternative toolchain file.

  * NDK r18 minimu supported API level is 16.
    This commit makes the API level configurable and sets the minimum platform
    to API 16

  * NDK r18 makes changes to declaration of `mmap` which break Mono build.
    Detect NDK version in `mono-compiler.h` and act accordingly (do not
    redeclare `mmap`)

  * NDK r18 doesn't have `cpp` and SDKs build assumes it's present.
    Detect whether `cpp` is present and, if not, use `compiler -E` instead.

  * NDK r18 uses unified headers exclusively and requires __ANDROID_API__ to be
    set in order to present the correct set of native APIs.
    SDKs now define the macro when the `ANDROID_NEW_NDK` Make variable is set to
    anything else than `no`.
2019-01-07 12:25:09 +01:00
monojenkins 4f185e4ce9 [2018-10] Display AM/PM for ko-KR culture (#12279)
Fixes https://github.com/mono/mono/issues/11317
(I guess I need to update culture-info-tables.h via make but it doesn't work on Windows, I have to switch to macOS).

Backport of #11327.

/cc @marek-safar @EgorBo
2019-01-07 10:20:09 +01:00
monojenkins 3dd90390a8 [2018-10] [Network] Fix CVE 2018-8292 on Mac OS X. (#12154)
[2018-10] [Network] Fix CVE 2018-8292 on Mac OS X.

This commit ensures that CVE 2018-8292 is fixed by not setting
auto-redirect in the first request done by CFNetwork. CFNetwork has the
same bug, but we can work around it by performing the first request,
checking the response and, if it is a rediret, follow it without the
Authorization headers.


PS: This fix should be ported to 2018-08, 2018-10 and 2018-12.

Backport of #12047.

/cc @mandel-macaque
2019-01-03 12:15:52 -05:00
Aleksey Kliger (λgeek) 1bb3aaa82f [coop] Make sure suspend_count is positive in suspend request states (#12245)
* Fix bug in pulse transition - the suspend count was lost and incorrectly
  swapped to 0.
* finish_async_suspend transition - add assertions that the suspend count is
  positive. Try to catch incorrect states sooner.

Fixes https://github.com/mono/mono/issues/12235
2019-01-03 11:51:59 -05:00
monojenkins 362b1a50e7 [exceptions] Verbose logging for cfa_reg assertion (#11915)
[2018-10] [exceptions] Verbose logging for cfa_reg assertion

Historically very common and hard to reproduce assertion, which, in some cases, could be fixed just from this logging. Log example :

```
Unset cfa_reg in method <0x40011220 - (null) trampoline>. Memory around ip (0x40011220):
0x40011210  41 89 07 4c 8b 3c 24 48 83 c4 08 c3 00 00 00 00  A..L.<$H........
0x40011220  48 83 c7 10 b8 00 12 01 40 ff e0 00 00 00 00 00  H.......@.......
0x40011230  00 00 00 00 e8 c7 ef fe ff 08 f8 34 e0 55 55 55  ...........4.UUU
0x40011240  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
* Assertion: should not be reached at unwind.c:664
```




Backport of #11888.

/cc @BrzVlad
2019-01-02 05:35:39 -05:00
Alexander Köplinger 60ca6d0fdb Bump bockbuild for VSTS #737323 fix to GtkNSView.
Backport of https://github.com/mono/mono/pull/11972
2018-12-21 16:29:02 +01:00
monojenkins 48791f832d [2018-10] System.Windows.Forms: Fix incorrect layout for table layout nested in flow layout (#12168)
Fixes issue #8922. The flow layout code specifies `int.MaxValue` as width in `GetPreferredSize` call, which the table layout didn't handle properly and tried to use all the available space.

Relevant WinForms open source code that implements the same behavior:

https://github.com/dotnet/winforms/blob/e5606060fa95bdb40af9ddeceb7bea81535de291/src/System.Windows.Forms/src/System/Windows/Forms/Layout/FlowLayout.cs#L183-L188

https://github.com/dotnet/winforms/blob/e5606060fa95bdb40af9ddeceb7bea81535de291/src/System.Windows.Forms/src/System/Windows/Forms/Layout/TableLayout.cs#L700-L702


Backport of #12161.

/cc @marek-safar @filipnavara
2018-12-21 15:09:52 +01:00
monojenkins 59572d0ad3 [2018-10] Bump msbuild to track xplat-master (#12111)
Backport of #12071.
2018-12-21 15:03:53 +01:00
monojenkins 75ada763c4 [2018-10] Bump to latest SQLite for Mac bundle (#12158)
Bump Mac bundle from SQLite 3.9.2 to 3.26.0

Backport of #12118.
2018-12-20 16:11:07 +01:00
Maxim Lipnin eea8213479 [2018-10] Fix IndexOutOfRangeException in MethodInfo.ReturnParameter.IsDefined(type) (#12106)
Fixes #12069

Backport of #12090.
2018-12-20 13:34:00 +01:00
Zoltan Varga a0db72bd48 [jit] Fix a buffer overflow in mini_get_gsharedvt_out_sig_wrapper_signature ().
Fixes https://github.com/mono/mono/issues/12130.
2018-12-19 21:54:49 +01:00
Ankit Jain 2a9100254d [MacSDK] Bump NuGet to 4.8.1 2018-12-19 14:02:59 +01:00
Ludovic Henry 4ad781f981 [bcl] Build all XUnit and NUnit tests for monodroid, monotouch, monotouch_tv, monotouch_watch and wasm BCL profiles (#12045) 2018-12-13 16:28:26 -05:00
monojenkins c6f6cff71e Fix #11898 (#11903) 2018-12-03 19:39:36 -05:00
monojenkins 6aa067b85c Fix race condition in XmlCharType.Instance (#11827) 2018-12-03 19:19:05 -05:00
Zoltan Varga f5d0808847 [aot] Emit runtime invoke wrappers for up to 40 parameters for bitcode, newly added tests depend on it.
Fixes https://github.com/mono/mono/issues/11874.
2018-12-03 14:50:35 +01:00
monojenkins c61d4b7a8c [crash] Add managed exception class name (#11820) 2018-11-30 13:27:58 -08:00
Egor Bogatov 56f1afd289 [2018-10] Fix Encoding serialization issue (#11842)
Manual backport of #11661
2018-11-29 21:20:46 +01:00
Bernhard Urban a0ac40a1a5 [interp] Don't include internal frames in stack trace (#11792)
For handled exceptions. On unhandled exceptions we leave them for debugging purposes.

Fixes exception18.cs
2018-11-27 14:32:38 -08:00
Aleksey Kliger 962f0c5248 [loader] ignore 'internalcall' impl attribute on 'abstract' methods
Otherwise we emit a noisy warning when doing a lookup of the method.

Fixes https://github.com/mono/mono/issues/11479
2018-11-26 17:34:14 -05:00
Alexander Köplinger 827ef28c8e [ci] Disable log compression in pipeline builds for now - second attempt
(cherry picked from commit 94d4055773)
2018-11-26 22:05:25 +01:00
monojenkins 53faf850c6 [mini] use AOT trampolines in interp mixed mode (#11782)
[2018-10] [mini] use AOT trampolines in interp mixed mode

Fixes this on mscorlib/mixed mode on Xamarin.iOS:
```
[FAIL] NonExceptional.Serialization_Deserialization : System.Runtime.Serialization.SerializationException : An error occurred while deserializing the object. The serialized data is corrupt. 
[FAIL] NonExceptional.Serialize_Deserialize_FixedDateRule : System.Runtime.Serialization.SerializationException : An error occurred while deserializing the object. The serialized data is corrupt. 
[FAIL] NonExceptional.Serialize_Deserialize_FloatingDateRule : System.Runtime.Serialization.SerializationException : An error occurred while deserializing the object. The serialized data is corrupt. 
[FAIL] SerializationTests.Serialization_Deserialization : System.Runtime.Serialization.SerializationException : An error occurred while deserializing the object. The serialized data is corrupt. 
[FAIL] TimeZoneTest.CurrentTimeZone_SerializationRoundtrip : System.Runtime.Serialization.SerializationException : An error occurred while deserializing the object. The serialized data is corrupt. 
```


Backport of #11767.

/cc @lewurm
2018-11-26 12:25:39 -05:00
Alexander Köplinger 009efbfc67 [ci] Disable log compression in pipeline builds for now
It is incompatible with JEP-210 at the moment.

(cherry picked from commit fb4b611636)
2018-11-26 17:48:51 +01:00
monojenkins 1e914f4b42 [arm64] Fix passing r4/r8 arguments on the stack in the gsharedvt trampoline. (#11742)
Fixes https://github.com/mono/mono/issues/11613.
2018-11-20 14:13:00 -05:00
Aleksey Kliger (λgeek) 47fd1d6236 [2018-10] [threading] Implement 'pulse' transition for two-phase STW (#11721)
* [threading] Add `pulse` transition and begin_pulse_resume_and_request_suspension operation.

A `pulse` atomically resumes a preemptively suspended GC Safe thread and
requests that it suspend again.

If the thread reaches a GC Safe -> GC Unsafe transition, it will self-suspend.
If it doesn't, another iteration of the 'mop up' STW phase will async suspend
it again.

* [threading] Use pulse_resume_and_request_suspension in STW

With non-hybrid suspend, a pulse is just a resume.

With hybrid suspend, a `pulse` is a combination of a resume of a preemptively
suspended GC Unsafe thread and a request that it suspend again - as if we
atomically resumed the thread and then applied the initial phase of two-phase
suspend again.  If the now-running thread comes to a GC Safe -> GC Unsafe
transition it will suspend.  If not, we will preemptively suspend it again
during the mop-up phase.

The important thing is that we don't want the thread to transition to GC Unsafe
again: if it does so, it may try to take a lock that some other
async-suspended thread is holding, and it will never reach a safepoint ---
exactly the situation that two-phase suspend is supposed to solve.

* [threads] Add mono_threads_is_multiphase_stw_enabled

Flip the logic in mono_thread_info_begin_pulse_resume_and_request_suspension
2018-11-16 16:40:42 -05:00
monojenkins 4453ed9862 [interp] attempt to intrinsify again after a method is resolved regarding generics (#11716) 2018-11-16 14:33:16 -05:00
monojenkins a2d589d2e7 [2018-10] [aot] image is usable without debug flag when interpreter is used (#11710)
Backport of #11705.
2018-11-16 12:09:32 +01:00
monojenkins 8a80b39fe4 [2018-10] [crash] Remove duplicated il_offset (#11701)
This code is duplicated completely from the code directly above it (github doesn't show in this diff)

Backport of #11700.
2018-11-15 23:23:18 +01:00
monojenkins 6db0148787 [runtime] Fix the size calculation in mono_debug_add_method (). (#11688)
Backport of #11672.
2018-11-15 16:09:40 +01:00
monojenkins 0539f15f77 [2018-10] Fix starting process with empty environment incorrectly inherits all variables (#11644)
This pull request fixes starting a process with an empty environment variable collection in `ProcessStartInfo`. As per the issue it fixes a regression that it used to work but currently an empty environment variable collection works like it was never touched.

I also made a minor fix to remove the `StringBuilder` because a simple `string.Concat` does the job without the `StringBuilder` allocation and overhead.

I've included unit tests. Please let me know if you'd like any changes.

Fixes #8766

Backport of #11630.
2018-11-15 16:04:56 +01:00
monojenkins 65187a7917 [ios] cosmetic fix for WatchOS Makefile (#11669)
It's not really used, and the directory `[...]/SDKs/WatchOS.sdk` always
exists.
2018-11-14 16:40:30 -05:00
Ludovic Henry 64c566d8da [sdks] Compile support/{zlib-helper,nl}.c so XI/XM/XA does not have to cherry-pick them (#11676)
* [sdks] Compile support/{zlib-helper,nl}.c so XA doesn't have to cherry-pick it.

* [sdks] Fix ios and android compilation and use of tests

The tests are already built as part of the archive, so there is no need to recompile them. We just need to pick them from the right folder.
2018-11-14 11:49:06 +01:00
Alexander Köplinger d51ed697a0 [ci] Clean acceptance-tests/external before build
Otherwise it might have left-over files from previous builds since it
uses our custom submodule system which isn't catched by Jenkins cleaning.

(cherry picked from commit 49a5af74f7)
(cherry picked from commit b429e290e8)
2018-11-14 11:37:26 +01:00
Martin Baulig 4d29428741 [2018-10][System.Data]: GSS is not available on tvOS and watchOS. (#11677)
* [System.Data]: GSS is not available on tvOS and watchOS.

* [csproj] Update project files
2018-11-14 11:09:16 +01:00
monojenkins f285f82c8d Bumping reference assemblies generated with latest GenAPI (#11633) 2018-11-09 18:13:58 +01:00
Bernhard Urban 5e1b11535d [llvm] bump for armhf callingconv fix (#11608)
Commit list for mono/llvm:

* mono/llvm@c97510286a [mono] respect hardfloat/softloat setting in ARM ABI (#16)
* mono/llvm@8415fd85ce Fix the mono calling convention on arm64+linux.

Diff: https://github.com/mono/llvm/compare/117a508c0ca65b754008e94e3eb97e77edfef04b...c97510286a58f9aaa116fcfdb8b693d5f61910d2


Backport of https://github.com/mono/mono/pull/11607
2018-11-08 13:38:11 -05:00
Zoltan Varga f28a0c04db [sdks] Exit with non-zero exit code if the simulator test fails on ios. (#11547)
(cherry picked from commit 7356b0914a)
2018-11-07 21:09:54 +01:00
Alexander Köplinger ae5ff1b4bc [android sdk] Package resource assemblies into app bundle (#11583)
.NET resource assemblies live in subdirectories named after the culture
of the resource. We need to package these assemblies too.

Follow up to https://github.com/mono/mono/pull/11575

(cherry picked from commit ab9c940dff)
2018-11-07 21:09:32 +01:00
Alexander Köplinger 0e6a3e0c85 [ios sdk] Package resource assemblies into app bundle (#11575)
.NET resource assemblies live in subdirectories named after the culture
of the resource. We need to package these assemblies too.

Addresses https://github.com/mono/mono/pull/11547#issuecomment-435688914

(cherry picked from commit 30e870b19e)
2018-11-07 21:09:26 +01:00
monojenkins 2d04a8f274 Bump API snapshot submodule 2018-11-07 14:52:08 +01:00
Marek Safar 2f9dcaf1fc [2018-10] Bump corefx 2018-11-07 14:52:08 +01:00
monojenkins 39ee7a08f9 [ios] remove DISABLE_POLICY_EVIDENCE (#11582)
[2018-10] [ios] remove DISABLE_POLICY_EVIDENCE

Originally it was introduced with db3591b
It seems like only the icall definitions were disabled for device
runtimes (which aren't shipped there anyway), however the icalls
themselves are _included_ in the device runtime. Not sure what the
rationale was behind this. Since the original change is very old, I
think it just happened to be like that today.  When running with the
interpreter we need the definitions at runtime too (via the optional
icall table that is linked in, so no additional cost for the fullAOT
runtime due to this change).

Backport of https://github.com/mono/mono/pull/11565

/cc @lewurm
2018-11-07 05:35:39 -05:00
Alex Earl 36cac59485 Bump roslyn-binaries submodule to pull in System.Xml.dll file name fix in vbc.rsp (#11573)
(cherry picked from commit 5d5d8fc7ea)
2018-11-06 21:41:38 +01:00
monojenkins f5e27e160c Added missing cts.Cancel() in HttpClient Dispose() method (#11539)
[2018-10] Added missing cts.Cancel() in HttpClient Dispose() method

Backport of #11442.

/cc @marek-safar @domino46

Description:
Fixes #11441
2018-11-06 09:56:15 -05:00
monojenkins 6d2ea1b004 [interp] transform delegate invoke in method body too (#11550)
[2018-10] [interp] transform delegate invoke in method body too

Backport of #11528.

/cc @lewurm 

Description:
2018-11-06 06:45:44 -05:00
Ludovic Henry 4023a6233e [2018-10] Fix ref return for structs in runtime invoke wrapper. (#11555)
[2018-10] Fix ref return for structs in runtime invoke wrapper.

Use mono_mb_emit_op for CEE_LDOBJ to ensure wrapper data is added for
indirect load of a ref return value as method-to-ir expects this for wrappers.

Backport https://github.com/mono/mono/pull/11514

/cc @joncham
2018-11-06 05:05:44 -05:00
Alexander Köplinger 78662419df [ci] Fix Windows .msi build
(cherry picked from commit c8d59d1d1d)
2018-11-06 10:40:49 +01:00
monojenkins 35d1ff89a0 Fix the issue when ParameterInfo.RawDefaultValue returns Missing.Value for non-null default values of DateTime?` and decimal? parameters (#11537)
[2018-10] Fixing ParameterInfo.RawDefaultValue for non-null default values of DateTime?` and decimal? 

Backport of #11330.

/cc @marek-safar @MaximLipnin

Description:
Adding checks for `DateTime?` and `decimal?` to `DefaultValue` property getter will allow to retrieve correct values instead of  System.Reflection.Missing

Fixes https://github.com/mono/mono/issues/11303
2018-11-05 23:15:40 -05:00
monojenkins 267470152a [bcl] avoid false pinning in GCTest (#11540)
[2018-10] [bcl] avoid false pinning in GCTest

Backport of #11521.

/cc @luhenry @lewurm

Description:
needed for mscorlibtests on Xamarin.iOS with interpreter
2018-11-05 22:05:36 -05:00
monojenkins aab7377d4f [interp] accept typed-by-ref as return type from a JIT call (#11535)
[2018-10] [interp] accept typed-by-ref as return type from a JIT call

Backport of #11522.

/cc @luhenry @lewurm

Description:
happens on fullAOT + interp on mscorlib tests
2018-11-05 16:55:29 -05:00
monojenkins bdf42f000e Make the test compile on mobile. (#11544) 2018-11-05 18:17:22 +01:00
Alexander Köplinger e45b97c68e [ci] Switch to new syntax of Azure Storage plugin
(cherry picked from commit de2cb5fdde)
2018-11-02 21:41:05 +01:00
monojenkins 24e7d7d5e8 [csproj] Update project files 2018-11-02 16:56:02 +01:00
monojenkins a65b7d8b44 [csproj] Update project files 2018-11-02 16:56:02 +01:00
Martin Baulig 6bbc707eb3 "Mono.Native - Halloween Edition"
In preparation of the upcoming FSW support, `Mono.Native` now supports icall registration
and has a test added for this.  This doesn't actually hook up FSW yet on iOS, but all the
preparations have been made as well as some tests for it.

* When using Bitcode (iOS only), we now link against the Mono runtime because we cannot have
  any undefined symbols.  Without Bitcode, the `mtouch` tool will do the linking for us.

* Add `-framework GSS` if needed.

* Removed `common/MonoNativeConfig.cs` - the test harness in `xamarin-macios/tests/xharness`
  now takes care of that.

* Include a few more `System.Native` files on IOS.

* `mono_native_initialize()`: New native method to initialize the module and register any
  necessary icalls.  We register a new `Mono.MonoNativePlatform::IncrementInternalCounter`
  icall for testing purposes.

* `mono_native_is_initialized()`: New native method for testing.

* `MonoNativePlatform.Initialize()`, `IsInitialized()`: Managed side of these.

* `MonoNativePlatform.IncrementInternalCounter()`: New icall, which is registered by
  `mono_native_initialize()` - this is used by the test suite to make sure the icall
  registration works.

* `NativePlatformTest`: Removed compat / unified check, see above.  Add tests to call
  the other managed APIs via reflection.
2018-11-02 16:56:02 +01:00
Marek Safar 114f88aaf1 [corlib] Remove incorrectly converted silverlight check
Fixes #11478
2018-11-02 12:23:03 +01:00
Marek Safar dc57395fd6 [2018-10] Add .NET 4.7.2 reference assemblies (#11391) (#11503) 2018-11-02 00:28:51 +01:00
Martin Baulig 86ba8ff964 [System]lock protect SystemCertificateProvider.EnsureInitialized(). 2018-11-01 23:05:11 +01:00
Alexander Kyte d02b6c0583 [crash] Fix async setting for crash reporter
We were previously only setting it from the icall. The icall was
therefore fine, while invocations associated with actual dumps
caused crashes like this:

```

thread #10, name = 'Thread Pool Worker'
    frame #0: 0x00007fff978dac22 libsystem_kernel.dylib`__psynch_mutexwait + 10
    frame #1: 0x00007fff979c5dfa libsystem_pthread.dylib`_pthread_mutex_lock_wait + 100
    frame #2: 0x00007fff979c3519 libsystem_pthread.dylib`_pthread_mutex_lock_slow + 285
    frame #3: 0x0000000108e0d4a9 mono`mono_loader_lock + 73
    frame #4: 0x0000000108dc9106 mono`mono_class_create_from_typedef + 182
    frame #5: 0x0000000108dc1f2c mono`mono_class_get_checked + 92
    frame #6: 0x0000000108e21da2 mono`mono_metadata_parse_type_internal + 1378
    frame #7: 0x0000000108e25e11 mono`mono_metadata_parse_mh_full + 1233
    frame #8: 0x0000000108ca4f79 mono`mono_debug_add_aot_method + 121
    frame #9: 0x0000000108cc6b1e mono`decode_exception_debug_info + 5918
    frame #10: 0x0000000108cc5047 mono`mono_aot_find_jit_info + 1367
    frame #11: 0x0000000108e082cc mono`mono_jit_info_table_find_internal + 204
    frame #12: 0x0000000108cdb035 mono`mini_jit_info_table_find_ext + 69
    frame #13: 0x0000000108cdad5c mono`mono_find_jit_info_ext + 124
    frame #14: 0x0000000108cdc3a5 mono`unwinder_unwind_frame + 229
    frame #15: 0x0000000108cdbade mono`mono_walk_stack_full + 798
    frame #16: 0x0000000108cda1a4 mono`mono_summarize_managed_stack + 100
    frame #17: 0x0000000108e6dc03 mono`mono_threads_summarize_execute + 1347
    frame #18: 0x0000000108e6df88 mono`mono_threads_summarize + 360

```
2018-11-01 18:46:41 +01:00
Bernhard Urban 3d170b9afe [tests] reduce recursion depth
so it doesn't trigger a stack overflow on Xamarin.iOS with interpreter on a debug build (`CFLAGS=-O0`).
2018-10-31 12:17:30 +01:00
monojenkins b52c3a73cf [crash] Fix merp invocation (#11469)
The change which made the handler return (rather than crashing the
runtime) did not consider this control flow path that causes the sigterm
signal handler to trigger the merp dumper if we return.

We now always return.

This was previously so that a random sigterm could be used to trigger a
dump. This isn't really used, and won't work right now anyways
(we don't register it until right before we dump). My fix is to remove
it, and to make the signal handler only work as part of the dumper
machinery.
2018-10-30 22:53:12 +01:00
monojenkins 23ec776507 [llvm] Fix passing vtypes received by value as arguments, they need to be copied. Fixes https://github.com/mono/mono/issues/11378. (#11428) 2018-10-30 15:47:50 -04:00
monojenkins ed8ea70ed4 [delegates] do not use CEE_CALLVIRT for non-virtual methods (#11452)
[2018-10] [delegates] do not use CEE_CALLVIRT for non-virtual methods

Backport of #11433.

/cc @lewurm 

Description:
2018-10-30 14:05:41 -04:00
monojenkins ecb182b6aa [2018-10] Bump msbuild to track xplat-master (#11446)
Backport of #11440.

/cc @marek-safar @radical

Description:
- pickup fix for #11214 .
2018-10-30 13:29:24 +01:00
Bernhard Urban 3e0ab3888f [2018-10] [aot] add unbox_arbitrary_trampoline for fullaot/interp mixed mode (#11364)
[2018-10] [aot] add unbox_arbitrary_trampoline for fullaot/interp mixed mode

Backport of https://github.com/mono/mono/pull/11321
2018-10-30 05:25:27 -04:00
monojenkins 3b70989861 x86 mono_arch_get_patch_offset: add support for 0xe9/jmp eip+32b. I don't know what the specific code is or what changed, etc. (#11432)
[2018-10] x86 mono_arch_get_patch_offset: add support for 0xe9/jmp eip+32b.

Backport of #11089.

/cc @lewurm @jaykrell

Description:
I don't know what the specific code is or what changed, etc.

This addresses Mac/x86:

https://jenkins.mono-project.com/job/test-mono-pull-request-i386-osx/15364/parsed_console/log.html

```Unable to compile method 'int Tests:calli_sig_check_2 ()' due to: 'Invalid IL code in Tests:calli_sig_check_2 (): IL_000b: calli     0x11000044```

which then fails an assert and fails overall.

CI goes deep into bash w/o echoing commands but a repro is:

 cd mono/mini
 MONO_PATH=./../../mcs/class/lib/net_4_x lldb -- ./mono --aot iltests.exe

The code is meant to be invalid, and meant to raise an exception,
which is catchable/resumable (at least in the JIT case where
executing IL the first time, can raise an exception while caller is
running, vs. AOT where the codegen all happens offline -- leaving what?
A note made at AOT time that calling the code should raise an exception?).

It isn't meant to fail an assert in either case.
2018-10-29 17:55:25 -04:00
monojenkins 32762757fc [interp] throw overflow exception when {float,double}.NaN is converted to an int type (#11412)
A comparison with NaN is always `false`.
2018-10-28 18:04:53 -04:00
monojenkins f7712118c1 [2018-10] [interp] enable more BCL tests (#11400)
Backport of #11381.
2018-10-27 01:27:54 +02:00
Alexander Köplinger d219d3ddc1 [System.Runtime.Serialization] Fix possible race when creating the test response file
test_lib might not be set yet at this point since we're including library.make
later on, use LIBRARY instead which is set further above.

(cherry picked from commit 87493e96fb)
2018-10-26 14:55:05 +02:00
Marek Habersack d36384af41 [SDKS, LLVM] Disable detection and use of libxml2 (#11340)
Mono doesn't use libxml2 and neither do the LLVM bits used by Mono when building
the AOT cross-compilers. Presence of `-lxml2` on the command line breaks 32-bit
builds on 64-bit Linux hosts:

    libtool: link: cc -shared  -fPIC -DPIC  -Wl,--whole-archive ./.libs/libmini.a ./.libs/libmono-ee-interp.a ./.libs/libmono-dbg.a ../../mono/metadata/.libs/libmonoruntimesgen.a ../../mono/sgen/.libs/libmonosgen.a ../../mono/utils/.libs/libmonoutils.a ../../mono/eglib/.libs/libeglib.a -Wl,--no-whole-archive  -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMObject -lLLVMMCParser -lLLVMMC -lLLVMBitReader -lLLVMCore -lLLVMBinaryFormat -lLLVMSupport -lLLVMDemangle -L$HOME/xamarin-android/external/mono/sdks/out/llvm-llvm32/lib -lz -ltinfo -lxml2 -lstdc++ -lm -lrt -ldl -lpthread  -O0 -ggdb3 -m32 -g -mno-tls-direct-seg-refs -Wl,-export-dynamic   -Wl,-soname -Wl,libmonosgen-2.0.so.1 -o .libs/libmonosgen-2.0.so.1.0.0
    mv -f .deps/libmini_la-aot-runtime-wasm.Tpo .deps/libmini_la-aot-runtime-wasm.Plo
    /usr/bin/ld: skipping incompatible //usr/lib/x86_64-linux-gnu/libxml2.so when searching for -lxml2
    /usr/bin/ld: skipping incompatible //usr/lib/x86_64-linux-gnu/libxml2.a when searching for -lxml2
    /usr/bin/ld: cannot find -lxml2
    collect2: error: ld returned 1 exit status
    make[7]: *** [Makefile:1495: libmonosgen-2.0.la] Error 1

Installation of `libxml2-dev` (on Ubuntu/Debian + friends) for the x86
architecture (or x86_64 architecture on 32-bit host) would be possible but then
it would break the 64-bit build because the 64-bit version of the library would
be absent. It would be a problem if Mono+LLVM actually used xml2, but since it
doesn't we can just disable the feature completely.

(cherry picked from commit 0d68ffd1ce)
2018-10-25 23:59:40 +02:00
monojenkins 14c0694078 [csproj] Update project files 2018-10-25 20:03:08 +02:00
monojenkins a8aa312734 Bump API snapshot submodule 2018-10-25 20:03:08 +02:00
Marek Safar 98bdd89013 [corlib] Adds back accidentally removed legacy COM API to Binder 2018-10-25 20:03:08 +02:00
monojenkins 231b48f33b [2018-10] [System.Core]: Stub out Interop.Sys.GetEUid and SetEUid. (#11367)
* [System.Core]Stub out `Interop.Sys.GetEUid` and `SetEUid`.

This is a temporary fix; the native side still needs to be ported from c++
and tested.

* [csproj] Update project files
2018-10-25 15:08:57 +02:00
monojenkins d00d06ba97 [2018-10] [cxx] Do not define C++ keywords: bool, inline, final, it can break things. (#11356)
* [cxx] Do not define C++ keywords: bool, inline, final, it can break things.

https://jenkins.mono-project.com/job/d/421/parsed_console/log.html

  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xkeycheck.h(250): fatal error C1189: #error:  The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro. [d:\j\workspace\d\msvc\libmonoruntime.vcxproj]

* PR: Leave profiler defining C++ keywords (define bool char).

* PR: Restore libgc.
2018-10-25 01:31:57 +02:00
Bernhard Urban e1c4ddc480 [tests] lower recursion depth of PerformNoPinAction
so it doesn't overflow the stack when running on macOS with `clang -O0`.
2018-10-24 14:02:25 +02:00
Alexander Köplinger 73ce88dcaf Bump corefx submodule (#11286)
MemberInfoTests.cs and TypeInfoTests moved from System.Runtime -> System.Reflection
Also some tests were added to ParameterInfoTests.cs that fail on 2018-10
2018-10-24 12:46:03 +02:00
Jay Krell b645d5b68b [2018-10] Replace mono_object_get_class with mono_object_class to avoid gc transitions. (#11339)
Replacement for #11105.
Backport of #11077.
2018-10-24 03:55:55 -04:00
monojenkins ba8520225c [wasm] Add missing include (#11336)
Fixup for
https://github.com/mono/mono/commit/5e961c6deb27c6bfc46cdba99274bbe02f8f0562
2018-10-24 02:11:58 -04:00
Bernhard Urban 7d14593291 [interp] use unsigned conversion for nuint
Fixes `MutableDataTest.Constructor` on Xamarin.iOS with interpreter.
2018-10-22 18:44:13 +02:00
Vlad Brezae f7a6b32910 [aot] Reenable recursion checking when initing shared got entries 2018-10-22 18:32:35 +02:00
Jay Krell b4593fd0e5 mono_class_is_assignable_from to mono_class_is_assignable_from_internal to skip GC mode machinery FIXME mono_class_is_assignable_from_checked 2018-10-22 18:28:48 +02:00
Jay Krell fd1c0a4784 mono_class_enum_basetype to mono_class_enum_basetype_internal to skip GC mode machinery. 2018-10-22 18:27:15 +02:00
Aleksey Kliger (λgeek) 7367fae549 [runtime] Don't init classes in ves_icall_RuntimeTypeHandle_is_subclass_of
We must not get a TLE if referenced types are in an assembly that can't be
loaded.

Backported fix of https://github.com/mono/mono/issues/11123
2018-10-22 18:24:41 +02:00
Aleksey Kliger (λgeek) bbcc3ebc21 [2018-10][marshal] Emit GC Safe transitions around foreign internal calls (#11184)
* [threads] Make mono_add_internal_call external only

The runtime should use mono_add_internal_call_internal or
mono_add_internal_call_with_flags.

The thread suspend mechanism needs to know if an icall is added via the legacy
mono_add_internal_call API (which is not coop-aware, and so the registered
icalls must run in GC Safe mode), or if it is added by the runtime or by a
cooperative client (currently either the profiler or the System.Native PAL)
which knows to add GC transitions and safepoints and not to block indefinitely.

* [marshal] Factor out GCSafeTransitionBuilder

Make a local builder for creating the GC Safe transition calls for a method wraper.

* [sgen] Add coop GC transitions in mono_gc_toggleref_add

Also mark it external only. It's not used inside the runtime.

* [marshal] Emit GC Safe transitions around foreign icalls.

A foreign icall is added using mono_add_internal_call and that is not coop GC
aware.  (The runtime uses mono_add_internal_call_with_flags or
mono_add_internal_call_internal)

Under hybrid suspend, foreign icalls will run in GC Safe mode and transition to
GC Unsafe only when the call back into the runtime or invoke managed code.

Fixes https://github.com/mono/mono/issues/11138

* [cxx] function type overloads for mono_add_internal_call_internal

and mono_add_internal_call_with_flags

* [runtime] Add new API call mono_dangerous_add_raw_internal_call

Under hybrid suspend, this adds an icall that is assumed to run in GC Unsafe
mode.  As such it has additional requirements for correct operation: it must
not run loops without periodically polling the runtime, and it must not perform
blocking operations such as blocking I/O or taking locks without manually
switching to GC Safe mode.
2018-10-22 18:22:40 +02:00
Alexander Köplinger 90fe086c23 Bump api-snapshot 2018-10-21 02:13:25 +02:00
Alexander Köplinger a75ce17e4b [Microsoft.Build.Engine] Fix race condition in TestTasks.dll compilation and embedding (#11275)
Since we've started embedding test resources inside of the test assembly
we've sometimes seen a strange error on Jenkins during the test run:

```
Msg: Error initializing task StringTestTask: Could not load file or assembly 'Microsoft.Build.Utilities.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
Msg: Error initializing task StringTestTask: System.TypeLoadException: Could not load file or assembly 'Microsoft.Build.Utilities.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
  at (wrapper managed-to-native) System.RuntimeType.GetConstructors_native(System.RuntimeType,System.Reflection.BindingFlags)
...
```

However this was from an xbuild_12 run so how come it tried to load xbuild 14 stuff?

The reason is there's a race condition between when TestTasks.dll gets
built and when it's embedded inside of the test assembly.

If we're building the xbuild_12 and xbuild_14 profile at the same time
we could end up embedding the xbuild_14 version of TestTasks.dll instead
of the correct one since we're copying it to the same file name.

The fix is to remove the unnecessary copying logic since we can just tell
the compiler to embed the file under the correct name.

(cherry picked from commit 6a8a2059bb)
2018-10-21 02:10:36 +02:00
monojenkins e2f7b95826 [2018-10] [arm64] Remove the limitation on the number of nullable arguments for dyncalls. (#11240)
* [arm64] Remove the limitation on the number of nullable arguments for dyncalls.

Fixes https://github.com/xamarin/xamarin-macios/issues/4984.

* [amd64] Remove the limitation on the number of nullable arguments for dyncalls.

* [jit] Add tests for dyncalls with lots of nullable arguments.

* fix merge conflict
2018-10-19 23:51:21 +02:00
Alexander Köplinger bb4a96f164 [Mono.Debugger.Soft] Remove sourcelink.json, it doesn't exist in 2018-10 2018-10-19 23:42:41 +02:00
Alexander Köplinger d578344b06 [Mono.Debugger.Soft] Simplify building dtest-app.exe for monodroid profile (#11229)
We only build it if we're explicitly building the monodroid profile and for the
monodroid_tools profile we only build the test assembly but not dtest-app.exe

(cherry picked from commit d07ddffffe)
(cherry picked from commit 8d1dd6aa65)
2018-10-19 20:06:59 +02:00
Alexander Köplinger f6efa3e82b [mcs] Fix test compilation to use common target
Add proper dependencies to the test support files where they were missing.
Compile test files using the standard "make test" target.

(cherry picked from commit f782e36a80)
2018-10-19 19:59:03 +02:00
Alexander Köplinger d0f6cc42bd [mono-symbolicate] Refactor so test assets can be precompiled
(cherry picked from commit a7d4c2a8b9)
2018-10-19 19:58:35 +02:00
monojenkins 68bac5c1d8 [WinForms] Propagate the flags from DrawTextInternal to MeasureTextInternal (#11260)
Flags to DrawText never reached MeasureText therefore strings with '&' were measured incorrect when drawn with flag TextFormatFlags.NoPrefix.
Fixes #6352
2018-10-19 18:09:24 +02:00
monojenkins f743d4250c [2018-10] Use Mono.Android as a reference for netstandard facade (#10974)
* bump external/binary-reference-assemblies

* use Mono.Android for netstandard

* use API_BIN_REFS

* move ifeq monodroid upper

* use Mono.Android in System.Drawing.Primitives instead of ns

* fix typo

* Add Mono.Android back to ns as API_BIN_REFS

* Bump API snapshot submodule

* [csproj] Update project files

* Bump api-snapshot
2018-10-19 14:04:36 +02:00
monojenkins dc9771601a [sdks] Package what's missing for XA (#11254)
They require the additional files:
 - mono/eglib/eglib-config.h: that's to build `libmonodroid`
 - mcs/build/Consts.cs: that's to build `Mono.Posix` and `Mono.Data.Sqlite`
2018-10-19 06:57:46 -04:00
monojenkins 3986341b65 [tests] Embed Mono.Data.Sqlite test resource (#11245) 2018-10-18 18:31:04 -04:00
monojenkins 0a919874d1 [pipeline] Ensure only 1 build per-product is executed per-node (#11248) 2018-10-18 22:09:32 +02:00
monojenkins 4577597ce1 [aot] Ensure shared got entries are initialized before loading methods (#11224)
Executing aot code that uses them would crash. Fixes random csc crashes.
2018-10-18 15:49:02 -04:00
Alexander Kyte 59b1d81525 [2018-10] Crash Reporter V2 (#11160)
* [crash] More gentle error handling around stack walking

* [crash] Make self-summarizier not need managed thread state

* [crash] Remove reliance on sgen/gchandles

* [crash] Refactor dumper mechanism

* [crash] Make threads not die during thread dump

* [crash] Add support for registering/dumping native libraries

* [crash] Add silent option to dumper

* [crash] Print error when unable to dump thread

* [crash] Add icalls to directly trigger telemetry-style walks

* [crash] Increase maximum frame depth

* [crash] Add managed method names when privacy disabled

* [crash] Add tests for concurrent dumping

* [crash] Add support for concurrent global dump requests

* [crash] Switch from CAS+Sleep to semaphore for dumper

Locks and GC-Safe regions are both unsafe in a signal handler
context. CAS primitives and the sleep syscall was used before.
Semaphores appear to be safe, enabling the following cleanup.

* [runtime] Make find_method use stack memory for dumper-facing entry point

* [crash] Enable install_state_summarizer on all platforms

* [crash] Dump managed stacks from controlling thread

* [crash] Don't use allocating method name formatter

* [crash] Copy safer strings with crash privacy disabled

* [crash] Fix string races with DumpTotal icall

* [crash] Fix space in crash file name

* [crash] Fix lifetime and size checks on mono-state memory

* [crash] Fix icall declarations for new style

* [runtime] Make sequence point lookup lockless

* [crash] Fix managed exception dumper icall format

* [crash] Print half-completed dump when space runs out

* [crash] Bump static memory for crash string to 500k

Note:
- This memory isn't accessed until we're crashing
- On any modern machine, unused static memory is lazily allocated. When
we access it, the fault will trigger the MMU to map memory for us.
- This is guaranteed to be reentrant and safe. mmap (the alternative) is
surely fairly stable on many systems, but this is not guaranteed. The
documentation pages for mmap specifically claim it as not safe in these async
contexts.

* [crash] Make whitelist lookup lockless

* [crash] Split unmanaged ptrs into method ip + offset

* [crash] Copy safer strings with crash privacy disabled
2018-10-18 18:28:53 +02:00
Alexander Köplinger 980aef41b9 [ci] Move OSX .pkg build to a separate bot pool
Allows us to better utilize the bockbuild cache.

(cherry picked from commit 229a4673d4)
2018-10-18 16:42:31 +02:00
monojenkins 429bb0bae0 [corlib] Ensure that Console Streams are thread-safe (#11230)
The Console class wraps the standard system stream reader/writers on construction so as to expose them as thread-safe. However, the Set-Out/In/Err methods in referencesource do not do the same when they replace default targets.

CoreFX code does: https://github.com/mono/corefx/blob/1748f6492e8b96842f76e1a9e7b5d7e8ccfca480/src/System.Console/src/System/Console.cs\#L412-L444

Possible fix for https://github.com/mono/mono/issues/11146
2018-10-17 21:02:44 -04:00
Maxim Lipnin c0212dac5f Remove overflow exception catch from #MOBILE 2018-10-17 15:37:06 -07:00
Maxim Lipnin 4f700983df [Reflection] Handle overflow exception on constructor invocation 2018-10-17 15:37:06 -07:00
monojenkins 790f412275 [pkg] Add preinstall which removes existing Mono of the same version (#11207)
Fixes #https://github.com/mono/mono/issues/11202
2018-10-17 22:37:35 +02:00
monojenkins 3b5cacc15c [2018-10] [System]: Reenable native Apple Certificate support on WatchOS. (#11198)
* [System]Reenable native Apple Certificate support on WatchOS.

During the code refactoring this summer, support for native apple certificates
has been dropped on watchOS.

* add `apple-certificates.sources` and move all certificate-related code from
  `appletls.sources`.

* move non-network related code from `MacProxy` into a new `AppleTypes`.

* add the `MONO_FEATURE_APPLE_X509` magic to `System/Makefile`, where it was
  missing from.

* [csproj] Update project files

* [csproj] Update project files
2018-10-17 21:15:10 +02:00
Ludovic Henry b261706d88 [sdks] Fix Archive Jenkins job (#11218) 2018-10-17 14:42:31 -04:00
monojenkins 8890b0c6c4 Take fast path only for delegate types not Delegate/MulticastDelegate. (#11195) 2018-10-17 08:11:25 -04:00
monojenkins dcaef0b2ca Bump to llvm/release_60/117a508c (#11120) 2018-10-16 15:47:03 -04:00
Vlad Brezae 9ff6d8f918 [interp] Implement interpreter entry trampolines on amd64 (#10978) (#11163)
* [interp] Avoid unnecessary allocations when pinvoke void functions

* [amd64] Refactor interp pinvoke context computation

* [amd64] Interp trampoline for interpreter entry

* [aot] Don't include interp_in_wrapper when we use entry trampoline

These wrappers take a lot of space in the image.
2018-10-16 15:29:00 -04:00
Ludovic Henry e708752f14 [sdks] Add Groovy script to build the SDKs archives for the products (#11191) 2018-10-16 12:30:14 -04:00
monojenkins 2a052ba0c9 [sdks] futimens and futimes symbols are missing on anything earlier than 10.13 (#11177)
This breaks when LLVM is built on 10.13+ and the runtimes are built on 10.12.
2018-10-15 23:02:30 -04:00
monojenkins 76be3b3bc8 Initial Mono.Native Support. (#10941)
Backport of #10596.

/cc @baulig @baulig

Description of #10596:
`Mono.Native` is the new name for both `System.Native` and `System.Security.Cryptography.Apple`.
It is built as a stand-alone shared library and not bundled with the runtime because we
may need to build two different versions of it.

Starting with macOS 10.12+ and iOS 10+, Apple introduced a new Unified API for some of the
crypto primitives that we're using as part of System.Security.Cryptography.Apple.

On Desktop, we can check at runtime whether the OS version is recent enough and switch
implementation accordingly.  We build a single `libmono_native` shared library.

However, on Mobile we cannot have any undefined symbols as this would break Bitcode.

During the mobile build, we are called with `CC` containing an explicit minium version flag,
which is eiter `-mmacosx-version-min=`, `-mios-simulator-version-min=` or `-miphoneos-version-min=`
depending on platform.

We build two versions of the shared library:
- `libmono_native_compat` is built with whichever minimum version is passed to us via `CC`.
- `libmono_native_unifed` is built with the minimum version set to macOS 10.12+ / iOS 10+.

For testing purpuses, there is a function called `mono_native_get_platform_type ()`
(see mono/native/mono-native-platform.c), which returns a `MonoNativePlatformType` enum value.
There is also `Mono.MonoNativePlatform.GetPlatformType ()` (see mcs/class/corlib/Mono/MonoNativePlatform.cs).

This can be called by automated tests both to ensure that the library has been correctly installed and also
to verify that it's the correct version of it.

* `configure.ac`: add new configure checks for Mono.Native.

* `mono/native/`: new directory - this replaces the `System.Native` code that was previously in `mono/metadata`.

* `mcs/class/corlib/Mono`: New internal `MonoNativePlatformType` and `MonoNativePlatform` classes.
2018-10-15 17:40:17 +02:00
Ludovic Henry 7e7efe488f [2018-10] [sdks] Build tests for BCL targets (#11140)
* [sdks] Build BCL profiles without configure flags

* [sdks] Add BclTemplate to build BCL profiles

This is to avoid building all the profiles in a single `sdks/out/bcl` directory which will be shared between android, ios and wasm.

* [sdks] Simplify call to BclTemplate

* [mcs] Make directory dependency as order-only

We would otherwise always rebuild the target since the directory is updated whenever something is added to the directory. This is a common Makefile technique.

* [sdks] Build tests for BCL targets
2018-10-15 10:52:26 -04:00
Martin Baulig 72a81cc6d2 Use passwordless import in the X509Certificate(byte[]) constructor.
The `X509Certificate(byte[])` constructor should call `CertificateProvider.Import(byte[])`
to use the native apple implementation if possible.

Add temporary hack to `X509Certificate2(byte[])` to ensure that we always get an
`X509Certificate2Impl`.
2018-10-12 18:27:03 -07:00
Ludovic Henry f00fa49bb9 [sdks] Add cmake toolchain file for LLVM MXE builds (#11054)
We couldn't compile llvmwin{32,64} on Linux because we would try to use {i686,x86_64}-w64-mingw-cmake but it wouldn't exist.
2018-10-12 10:55:24 -04:00
monojenkins fc9fc38926 [2018-08] Bump msbuild (#11097) 2018-10-11 17:35:56 -04:00
Aleksey Kliger d33c213354 Always use InvariantCulture calendars in X509Certificate on Mobile
Allow the linker to remove UmAlQuraCalendar and HijriCalendar on mobile devices

Match the CoreFX X509Certificate changes: https://github.com/mono/corefx/commit/4eb1fc2abd2ffa70e402d22415d0209b21725a10

Fixes https://github.com/mono/mono/issues/10448
2018-10-11 11:10:27 -07:00
Alexander Köplinger 8c7aca3316 [2018-10] Bump xunit (#11084)
* [2018-10] Bump xunit

* Bump API snapshot submodule
2018-10-11 12:32:33 -04:00
monojenkins 923afca889 [2018-10] Bump cecil (#11022)
* Bump cecil

* [build] Fixes Mono.Cecil boostrap dependency

* Bump API snapshot submodule
2018-10-08 11:30:13 -04:00
Ankit Jain 3dd1602a1a Bump msbuild to track xplat-master 2018-10-05 21:18:45 -04:00
Bernhard Urban edc6fc4e82 [2018-10] [interp] fixes for native type (#10999)
* [interp] fix op_implicit/op_explicit conversions for native types

Conversion operators have been mostly broken in the interpreter, for
example conversion from nint to float didn't work. While some
conversions are easy to intrinsify (like nint -> I8), there are harder
cases like nint -> decimal. The JIT actually falls back to the managed
implementation, so let's do this in the interpreter as well.

However the managed implementation expects a pointer to the value type,
i.e. the container type System.nfloat instead of float/double primitives.
In such cases the value is going to be stored in a local and then the
address of its storage is pushed on the stack before invoking the
managed implementation of the conversion.

Added test cases for scenarios observed in Xamarin.iOS.

* [interp] support ntype.CompareTo ()

* [interp] support ntype.Equals ()

* [interp] support nfloat.*Infinity

* [interp] support ntype.ToString ()

* [interp] introduce float R4 stack type
2018-10-05 11:28:10 -04:00
Maxim Lipnin 98b85ceaec Bump corert 2018-10-05 09:54:08 +02:00
Maxim Lipnin 7d4ca00db4 Bump corert 2018-10-05 09:54:08 +02:00
Maxim Lipnin 810ced6d0b Extract case for verifying several object array parameters to separate test method. 2018-10-05 09:54:08 +02:00
Maxim Lipnin 98c33e716d Add unit tests to verify custom attribute ctor with object array as parameter 2018-10-05 09:54:08 +02:00
Alexander Köplinger a5016f7898 [ci] Always pass sha1 from Mac to Windows packaging build
Before we only did this for PR builds but it turns out it's needed for
normal master/branch builds too.

In situations where there are two Mac builds at roughly the same time
the downstream Windows builds would otherwise both refer to the same/latest
commit since they just checkout the latest ref on the branch.

Now we reset the Windows build to the sha1 which is passed to it.

(cherry picked from commit b13145bb12)
2018-10-05 00:28:07 +02:00
Alexander Köplinger 6deb114ce5 [corlib] Simplify confusing "SSPI" error message and align with corefx (#10976)
Right now if anything goes wrong in the security stack you get a message like this:

```
System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> Mono.Btls.MonoBtlsException: Ssl error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED
```

This is confusing since SSPI is a Windows-only thing and is not used on Mono.
We inherited this error message string from referencesource.

Change the string to something more generic which also aligns us with CoreFX:
https://github.com/dotnet/corefx/blob/a10890f4ffe0fadf090c922578ba0e606ebdd16c/src/System.Net.Security/src/Resources/Strings.resx#L210-L212

(cherry picked from commit 42e347ee47)
2018-10-05 00:21:50 +02:00
monojenkins ec0ae343f0 [sdks/ios] Build libMonoPosixHelper for device architectures, so that zlib-helper.o is created. (#10959)
xamarin-macios currently builds zlib-helper.o using mono's source code.

It would be preferrable to use a version built by mono, and since
zlib-helper.o is a byproduct of building libMonoPosixHelper, we need to build
libMonoPosixHelper (we already build it for simulator architectures), even
though we don't need/use libMonoPosixHelper itself.
2018-10-04 11:23:14 -04:00
Alexander Köplinger 921642ea72 Put xunit tests in mcs/class/lib/PROFILE/tests too
So they are next to their NUnit counterparts.

Move xunit remote executor app to tests dir too and compile it when
compiling the test assembly instead of doing it before running the test.

We need to use an absolute path for the xunit remote executor and it
needs to be in Windows format on Windows since we pass it as an env var
to the xunit tests.
2018-10-04 09:52:54 +02:00
monojenkins 5e6ea6c806 Merge pull request #10909 from monojenkins/backport-pr-10899-to-2018-10
[2018-10] [runtime] Disable stack guard for main thread on osx

Backport of #10899.

/cc @luhenry @BrzVlad

Description of #10899:
On macOS Mojave, it seems that changing the mapping of stack pages for main thread can lead to corruption bugs.

https://github.com/mono/mono/issues/10802



<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->
2018-10-03 19:05:26 +02:00
monojenkins aa3762656b [sdks] Ensure LLVM is cloned before trying to download (#10933) 2018-10-03 10:45:21 -04:00
Marek Safar 7f3b574ca7 Bump linker 2018-10-03 10:15:52 +02:00
Vlad Brezae 31b7ce52ad [runtime] Fix undefined pthread_main_np (#10930)
It is exported only when _DARWIN_C_SOURCE is defined.
2018-10-03 10:38:00 +03:00
Maxim Lipnin be44769e17 [Reflection] Fix issue with finding types in module using an asterisk as filter criteria 2018-10-03 08:45:33 +02:00
monojenkins 1bcf14ab41 [w32handle] Add coop state transitions in mono_w32handle_lock_handles (#10911)
If another thread locked at least one of the other handles, and there is a
cooperative GC STW happening, this function will loop forever.

Add GC Safe transitions around the call to sleep to give this thread a chance
to suspend.

Fixes https://github.com/mono/mono/issues/10863
2018-10-03 00:04:12 +02:00
monojenkins a1c34dea01 [2018-10] [sdks] Create archive targets for pre-building on CI (#10908)
* [sdks] Remove redundant --enable-cxx

* [sdks] Shorten `-m32`/`-m64` parameters detection for runtimes

* [sdks] Build BCL profiles without configure flags

* [sdks] Create archive targets for pre-building on CI

* [sdks] Add BclTemplate to build BCL profiles

This is to avoid building all the profiles in a single `sdks/out/bcl` directory which will be shared between android, ios and wasm.

* [sdks] Use archive-{android,ios,wasm} on CI

* [sdks] Run archive-llvm-llvm{,win}{32,64} on CI
2018-10-02 10:36:07 -04:00
Alexander Köplinger dac2f1724e [ci] Remove workaround for libtiff issue
We recently updated libtiff, let's see if this is still required

(cherry picked from commit e9de4af4d4)
2018-10-02 13:31:41 +02:00
Alexander Köplinger 66da2b621d [packaging] Remove installation of openssl via brew on macOS (#10874)
We're now using an msbuild version which uses .NET Core 2.x which no longer needs openssl.

(cherry picked from commit 634e726bdf)
2018-10-02 13:13:02 +02:00
Vlad Brezae f362bfe257 [runtime] Disable stack guard for main thread on osx
On macOS Mojave, it seems that changing the mapping of stack pages for main thread can lead to corruption bugs.

https://github.com/mono/mono/issues/10802
2018-10-01 21:45:29 +00:00
Jo Shields 50051dacdb Merge pull request #10897 from directhex/2018-10
Bump version to 5.20.0
2018-10-01 12:05:11 -04:00
Jo Shields 503a4c402d Bump version to 5.20.0 2018-10-01 09:57:05 -04:00
444 changed files with 17067 additions and 5985 deletions

No files matched your search

+7
View File
@@ -42,6 +42,13 @@ dist-hook:
test -d $(distdir)/mcs || mkdir $(distdir)/mcs
d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive
rm -rf `find $(top_distdir)/external -path '*\.git'`
rm -rf `find $(top_distdir)/external -path '*\.libs'`
rm -rf `find $(top_distdir)/external -path '*\.deps'`
rm -f `find $(top_distdir)/external -path '*\.o'`
rm -f `find $(top_distdir)/external -path '*\.so'`
rm -f `find $(top_distdir)/external -path '*\.lo'`
rm -f `find $(top_distdir)/external -path '*\.Plo'`
rm -f `find $(top_distdir)/external -name '\.dirstamp'`
rm -f `find $(top_distdir)/external -path '*\.exe' -not -path '*/roslyn-binaries/*'`
rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/*' -not -path '*/roslyn-binaries/*'`
rm -rf "$(top_distdir)/external/linker/linker/Tests"
+4 -2
View File
@@ -3366,8 +3366,10 @@ Global
{817CE046-07E8-409D-84BF-A6EA4F2879DE}.Release|wasm.ActiveCfg = Release|net_4_x
{817CE046-07E8-409D-84BF-A6EA4F2879DE}.Debug|winaot.ActiveCfg = Debug|net_4_x
{817CE046-07E8-409D-84BF-A6EA4F2879DE}.Release|winaot.ActiveCfg = Release|net_4_x
{817CE046-07E8-409D-84BF-A6EA4F2879DE}.Debug|xammac.ActiveCfg = Debug|net_4_x
{817CE046-07E8-409D-84BF-A6EA4F2879DE}.Release|xammac.ActiveCfg = Release|net_4_x
{817CE046-07E8-409D-84BF-A6EA4F2879DE}.Debug|xammac.ActiveCfg = Debug|xammac
{817CE046-07E8-409D-84BF-A6EA4F2879DE}.Debug|xammac.Build.0 = Debug|xammac
{817CE046-07E8-409D-84BF-A6EA4F2879DE}.Release|xammac.ActiveCfg = Release|xammac
{817CE046-07E8-409D-84BF-A6EA4F2879DE}.Release|xammac.Build.0 = Release|xammac
{8787A3B7-8A19-4586-8DCF-6F5914FD48D5}.Debug|net_4_x.ActiveCfg = Debug|net_4_x
{8787A3B7-8A19-4586-8DCF-6F5914FD48D5}.Debug|net_4_x.Build.0 = Debug|net_4_x
{8787A3B7-8A19-4586-8DCF-6F5914FD48D5}.Release|net_4_x.ActiveCfg = Release|net_4_x
+408 -83
View File
@@ -1,7 +1,7 @@
# Process this file with autoconf to produce a configure script.
#AC_PREREQ([2.62])
AC_INIT(mono, [5.19.0],
AC_INIT(mono, [5.20.1],
[https://github.com/mono/mono/issues/new])
AC_CONFIG_SRCDIR([README.md])
@@ -46,7 +46,7 @@ MONO_VERSION_BUILD=`echo $VERSION | cut -d . -f 3`
# There is no ordering of corlib versions, no old or new,
# the runtime expects an exact match.
#
MONO_CORLIB_VERSION=BEAF66F4-BA36-44C5-974E-83C6F627DF8C
MONO_CORLIB_VERSION=B886E13F-6276-4BE5-85F8-C6BF5EDBD200
#
# Put a quoted #define in config.h.
@@ -522,6 +522,8 @@ AC_PROG_LD_GNU
AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h sys/utime.h semaphore.h sys/un.h linux/rtc.h sys/syscall.h sys/mkdev.h sys/uio.h sys/param.h sys/sysctl.h libproc.h sys/prctl.h copyfile.h)
AC_CHECK_HEADERS(sys/param.h sys/socket.h sys/ipc.h sys/utsname.h alloca.h ucontext.h pwd.h sys/select.h netinet/tcp.h netinet/in.h unistd.h sys/types.h link.h asm/sigcontext.h sys/inotify.h arpa/inet.h complex.h unwind.h)
AC_CHECK_HEADER(unistd.h, [HAVE_UNISTD_H=1], [HAVE_UNISTD_H=0])
AC_SUBST(HAVE_UNISTD_H)
AC_CHECK_HEADERS([linux/netlink.h linux/rtnetlink.h],
[], [], [#include <stddef.h>
#include <sys/socket.h>
@@ -578,6 +580,7 @@ AC_CHECK_HEADERS(linux/magic.h)
if test x$platform_android = xyes; then
AC_CHECK_HEADERS(machine/endian.h sys/endian.h)
AC_CHECK_HEADERS(android/legacy_signal_inlines.h, [have_android_signal_inlines=yes], [have_android_signal_inlines=no])
AC_CHECK_HEADERS(android/ndk-version.h)
# Make sure SIGRT{MIN,MAX} work - they will fail to work with unified headers if building for
# API level < 21 *and* android/legacy_signal_inlines.h doesn't declare (and define) the required
@@ -587,7 +590,8 @@ if test x$platform_android = xyes; then
if test x$have_android_signal_inlines = xyes; then
AC_MSG_CHECKING([Whether Android SIGRTMIN/SGRTMAX macros are valid])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([#include <android/legacy_signal_inlines.h>],[
AC_LANG_PROGRAM([#include <signal.h>
#include <android/legacy_signal_inlines.h>],[
int i;
for (i = SIGRTMIN + 1; i < SIGRTMAX; ++i) {
}
@@ -1801,6 +1805,9 @@ AC_TRY_COMPILE([
AM_CONDITIONAL(ENABLE_GSS, test x$enable_gss = xyes)
# `target_ios=yes` does not detect watch devices and fails when cross-compiling
AC_MONO_APPLE_TARGET(TARGET_OS_IPHONE, [mono_native_platform_ios=yes])
if test x$host_win32 = xno; then
dnl *************************************
dnl *** Checks for time capabilities ***
@@ -2423,7 +2430,7 @@ if test x$host_win32 = xno; then
AC_CHECK_HEADERS(pthread.h)
AC_CHECK_HEADERS(pthread_np.h)
AC_CHECK_FUNCS(pthread_mutex_timedlock)
AC_CHECK_FUNCS(pthread_getattr_np pthread_attr_get_np pthread_setname_np pthread_cond_timedwait_relative_np)
AC_CHECK_FUNCS(pthread_getattr_np pthread_attr_get_np pthread_getname_np pthread_setname_np pthread_cond_timedwait_relative_np)
AC_CHECK_FUNCS(pthread_kill)
AC_MSG_CHECKING(for PTHREAD_MUTEX_RECURSIVE)
AC_TRY_COMPILE([ #include <pthread.h>], [
@@ -2454,6 +2461,7 @@ if test x$host_win32 = xno; then
#error "__thread does not currently work with clang on Mac OS X"
#endif
#include <unistd.h>
#include <pthread.h>
__thread int i;
static int res1, res2;
@@ -2742,6 +2750,9 @@ if test x$host_win32 = xno; then
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#ifdef HAVE_NET_IF_H
#include <net/if.h>
#endif
#include <ifaddrs.h>
], [
getifaddrs(NULL);
@@ -2847,6 +2858,7 @@ if test x$host_win32 = xno; then
AC_CHECK_FUNCS(setpgid)
AC_CHECK_FUNCS(system)
AC_CHECK_FUNCS(fork execv execve)
AC_CHECK_FUNCS(waitpid)
AC_CHECK_FUNCS(accept4)
AC_CHECK_FUNCS(localtime_r)
AC_CHECK_FUNCS(mkdtemp)
@@ -2962,7 +2974,7 @@ if test x$host_win32 = xno; then
fi
dnl *********************************
dnl *** Checks for System.Native ***
dnl *** Checks for Mono.Native ***
dnl *********************************
AC_MSG_CHECKING(for linux/in.h)
@@ -3015,11 +3027,16 @@ if test x$host_win32 = xno; then
AC_CHECK_TYPES([struct flock64], [AC_DEFINE(HAVE_FLOCK64, 1, struct flock64)], , [#include <fcntl.h>])
fi
if test x$mono_native_platform_ios = xno; then
# On iOS, `stat64()` is deprecated and there is no `struct stat64` and `stat()`
# is either 32-bit or 64-bit based on the device / simulator that you're running on.
AC_CHECK_FUNC(stat64, [AC_DEFINE(HAVE_STAT64, 1, [stat64])])
fi
AC_CHECK_FUNC(lseek64, [AC_DEFINE(HAVE_LSEEK64, 1, [lseek64])])
AC_CHECK_FUNC(mmap64, [AC_DEFINE(HAVE_MMAP64, 1, [mmap64])])
AC_CHECK_FUNC(ftruncate64, [AC_DEFINE(HAVE_FTRUNCATE64, 1, [ftruncate64])])
AC_CHECK_FUNC(posix_fadvise64, [AC_DEFINE(HAVE_POSIX_FADVISE64, 1, [posix_fadvise64])])
AC_CHECK_FUNC(stat64, [AC_DEFINE(HAVE_STAT64, 1, [stat64])])
AC_CHECK_DECL(pipe2, [AC_DEFINE(HAVE_PIPE2, 1, [pipe2])])
AC_CHECK_FUNC(getmntinfo, [AC_DEFINE(HAVE_GETMNTINFO, 1, [getmntinfo])], [], [[#include <unistd.h>]])
AC_CHECK_FUNC(strcpy_s, [AC_DEFINE(HAVE_STRCPY_S, 1, [strcpy_s])])
@@ -3028,10 +3045,14 @@ if test x$host_win32 = xno; then
AC_CHECK_FUNC(ioctl, [AC_DEFINE(HAVE_IOCTL, 1, [ioctl])])
AC_CHECK_FUNC(sched_getaffinity, [AC_DEFINE(HAVE_SCHED_GETAFFINITY, 1, [sched_getaffinity])])
AC_CHECK_FUNC(sched_setaffinity, [AC_DEFINE(HAVE_SCHED_SETAFFINITY, 1, [sched_setaffinity])])
if test "x$platform_android" != "xyes"; then
AC_CHECK_FUNC(arc4random_buf, [AC_DEFINE(HAVE_ARC4RANDOM_BUF, 1, [arc4random_buf])])
fi
AC_CHECK_DECL(TIOCGWINSZ, [AC_DEFINE(HAVE_TIOCGWINSZ, 1, [TIOCGWINSZ])], [], [[#include <sys/ioctl.h>]])
AC_CHECK_FUNC(tcgetattr, [AC_DEFINE(HAVE_TCGETATTR, 1, [tcgetattr])])
AC_CHECK_FUNC(tcsetattr, [AC_DEFINE(HAVE_TCSETATTR, 1, [tcsetattr])])
AC_CHECK_FUNC(arc4random, [AC_DEFINE(HAVE_ARC4RANDOM, 1, [arc4random])])
AC_CHECK_DECL(ECHO, [AC_DEFINE(HAVE_ECHO, 1, [ECHO])], [], [[#include <termios.h>]])
AC_CHECK_DECL(ICANON, [AC_DEFINE(HAVE_ICANON, 1, [ICANON])], [], [[#include <termios.h>]])
AC_CHECK_DECL(TCSANOW, [AC_DEFINE(HAVE_TCSANOW, 1, [TCSANOW])], [], [[#include <termios.h>]])
@@ -3068,7 +3089,7 @@ if test x$host_win32 = xno; then
fi
AC_MSG_CHECKING(for readdir_r)
AC_TRY_COMPILE([
AC_TRY_LINK([
#include <dirent.h>
], [
DIR* dir;
@@ -3083,7 +3104,7 @@ if test x$host_win32 = xno; then
])
AC_MSG_CHECKING(for kevent with void *data)
AC_TRY_COMPILE([
AC_TRY_LINK([
#include <sys/types.h>
#include <sys/event.h>
], [
@@ -3101,9 +3122,17 @@ if test x$host_win32 = xno; then
AC_CHECK_MEMBER(struct fd_set.__fds_bits, [AC_DEFINE(HAVE_PRIVATE_FDS_BITS, 1, [struct fd_set.__fds_bits])], [], [[#include <sys/select.h>]])
AC_MSG_CHECKING(for sendfile with 4 arguments)
AC_TRY_COMPILE([
AC_TRY_LINK([
#include <sys/sendfile.h>
], [
#if defined(TARGET_ANDROID)
#if !defined(__ANDROID_API__)
#error No definition for __ANDROID_API__ even though we're targeting TARGET_ANDROID
#elif __ANDROID_API__ < 21
#error sendfile is not supported on this Android API level
#endif
#endif
int result = sendfile(0, 0, 0, 0);
],[
AC_MSG_RESULT(yes)
@@ -3112,6 +3141,9 @@ if test x$host_win32 = xno; then
AC_MSG_RESULT(no)
])
ORIG_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror-implicit-function-declaration"
AC_MSG_CHECKING(for sendfile with 6 arguments)
AC_TRY_LINK([
#include <stdlib.h>
@@ -3127,16 +3159,18 @@ if test x$host_win32 = xno; then
AC_MSG_RESULT(no)
])
CFLAGS="$ORIG_CFLAGS"
AC_CHECK_FUNC(fcopyfile, [AC_DEFINE(HAVE_FCOPYFILE, 1, [fcopyfile])])
AC_CHECK_FUNC(epoll_create1, [AC_DEFINE(HAVE_EPOLL, 1, [epoll_create1])])
AC_CHECK_FUNC(accept4, [AC_DEFINE(HAVE_ACCEPT4, 1, [accept4])])
AC_CHECK_FUNC(kqueue, [AC_DEFINE(HAVE_KQUEUE, 1, [kqueue])])
ORIG_CFLAGS="$CFLAGS"
CFLAGS="-Werror -Wsign-conversion"
CFLAGS="$CFLAGS -Werror=sign-conversion"
AC_MSG_CHECKING(for getnameinfo with signed flags)
AC_TRY_COMPILE([
AC_TRY_LINK([
#include <sys/types.h>
#include <netdb.h>
], [
@@ -3164,10 +3198,10 @@ if test x$host_win32 = xno; then
fi
ORIG_CFLAGS="$CFLAGS"
CFLAGS="-Werror -Wsign-conversion"
CFLAGS="$CFLAGS -Werror=sign-conversion"
AC_MSG_CHECKING(for bind with unsigned addrlen)
AC_TRY_COMPILE([
AC_TRY_LINK([
#include <sys/socket.h>
], [
int fd;
@@ -3182,7 +3216,7 @@ if test x$host_win32 = xno; then
])
AC_MSG_CHECKING(for struct ipv6_mreq with unsigned ipv6mr_interface)
AC_TRY_COMPILE([
AC_TRY_LINK([
#include <netinet/in.h>
#include <netinet/tcp.h>
], [
@@ -3197,7 +3231,7 @@ if test x$host_win32 = xno; then
])
AC_MSG_CHECKING(for inotify_rm_watch with unsigned wd)
AC_TRY_COMPILE([
AC_TRY_LINK([
#include <sys/inotify.h>
], [
intptr_t fd;
@@ -3215,6 +3249,9 @@ if test x$host_win32 = xno; then
AC_MSG_CHECKING(for shm_open that works well enough with mmap)
if test "x$ac_cv_func_shm_open" = "xno" -o "x$ac_cv_func_shm_open_working_with_mmap" = "xno" ; then
AC_MSG_RESULT(no)
elif test "x$cross_compiling" = "xyes"; then
AC_MSG_RESULT(cross compiling, assuming yes)
AC_DEFINE(HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP, 1, [shm_open that works well enough with mmap])
else
AC_TRY_RUN([
#include <sys/mman.h>
@@ -3246,7 +3283,7 @@ if test x$host_win32 = xno; then
fi
AC_MSG_CHECKING(for getpriority with int who)
AC_TRY_COMPILE([
AC_TRY_LINK([
#include <sys/resource.h>
], [
int which;
@@ -3260,7 +3297,7 @@ if test x$host_win32 = xno; then
])
AC_MSG_CHECKING(for kevent with int parameters)
AC_TRY_COMPILE([
AC_TRY_LINK([
#include <sys/types.h>
#include <sys/event.h>
], [
@@ -3278,34 +3315,15 @@ if test x$host_win32 = xno; then
AC_MSG_RESULT(no)
])
ORIG_CFLAGS="$CFLAGS"
CFLAGS="-Werror -Wimplicit-function-declaration"
AC_CHECK_FUNCS(mkstemps)
# AC_CHECK_FUNCS(mkstemp) # already done above
AC_MSG_CHECKING(for mkstemps)
AC_TRY_COMPILE([
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
], [
char *template;
int suffixlen;
int result = mkstemps(template, suffixlen);
],[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_MKSTEMPS, 1, [mkstemps])
have_mkstemps=yes
], [
AC_MSG_RESULT(no)
])
CFLAGS="$ORIG_CFLAGS"
if test "x$have_mkstemps" != "xyes" -a "x$ac_cv_func_mkstemp" != "xyes"; then
if test "x$ac_cv_func_mkstemps" != "xyes" -a "x$ac_cv_func_mkstemp" != "xyes"; then
AC_MSG_ERROR([Cannot find mkstemps or mkstemp on this platform])
fi
AC_MSG_CHECKING(for tcp/var.h)
AC_TRY_COMPILE([
AC_TRY_LINK([
#include <sys/types.h>
#include <sys/socketvar.h>
#include <netinet/ip.h>
@@ -3322,7 +3340,7 @@ if test x$host_win32 = xno; then
AC_CHECK_HEADERS([sys/cdefs.h])
AC_MSG_CHECKING(for TCPSTATE enum in netinet/tcp.h)
AC_TRY_COMPILE([
AC_TRY_LINK([
#ifdef HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
@@ -3355,14 +3373,14 @@ if test x$host_win32 = xno; then
AC_CHECK_HEADERS([linux/rtnetlink.h])
AC_CHECK_FUNC(getpeereid, [AC_DEFINE(HAVE_GETPEEREID, 1, [getpeereid])])
AC_CHECK_FUNC(getdomainname, [AC_DEFINE(HAVE_GETDOMAINNAME, 1, [getdomainname])])
#AC_CHECK_FUNC(getdomainname, [AC_DEFINE(HAVE_GETDOMAINNAME, 1, [getdomainname])]) # already done above
AC_CHECK_FUNC(uname, [AC_DEFINE(HAVE_UNAME, 1, [uname])])
ORIG_CFLAGS="$CFLAGS"
CFLAGS="-Werror -Weverything"
CFLAGS="$CFLAGS -Werror=shorten-64-to-32"
AC_MSG_CHECKING(for getdomainname with size_t namelen)
AC_TRY_COMPILE([
AC_TRY_LINK([
#include <unistd.h>
], [
size_t namelen = 20;
@@ -3390,7 +3408,7 @@ if test x$host_win32 = xno; then
AC_CHECK_HEADERS([crt_externs.h])
AC_MSG_CHECKING(for _NSGetEnviron)
AC_TRY_COMPILE([
AC_TRY_LINK([
#include <crt_externs.h>
], [
char **result = *(_NSGetEnviron());
@@ -3402,6 +3420,7 @@ if test x$host_win32 = xno; then
])
AC_CHECK_DECL(IN_EXCL_UNLINK, [AC_DEFINE(HAVE_IN_EXCL_UNLINK, 1, [IN_EXCL_UNLINK])], [], [[#include <sys/inotify.h>]])
AC_CHECK_DECL(TCP_KEEPALIVE, [AC_DEFINE(HAVE_TCP_H_TCP_KEEPALIVE, 1, [TCP_KEEPALIVE])], [], [[#include <netinet/tcp.h>]])
else
dnl *********************************
@@ -3928,7 +3947,7 @@ case "$host" in
TARGET=AMD64;
arch_target=amd64;
if test "x$ac_cv_sizeof_void_p" = "x4"; then
AC_DEFINE(__mono_ilp32__, 1, [64 bit mode with 4 byte longs and pointers])
AC_DEFINE(MONO_ARCH_ILP32, 1, [64 bit mode with 4 byte longs and pointers])
sizeof_register=8
fi
case $host_os in
@@ -4046,6 +4065,14 @@ case "$host" in
ACCESS_UNALIGNED="no"
CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
;;
aarch64-*darwin*ilp32)
TARGET=ARM64;
arch_target=arm64
AC_DEFINE(MONO_ARCH_ILP32, 1, [64 bit mode with 4 byte longs and pointers])
sizeof_register=8
# assuming no other target other than watchOS is using aarch64*darwin triple
TARGET_SYS=WATCHOS
;;
aarch64-*)
# https://lkml.org/lkml/2012/7/15/133
TARGET=ARM64
@@ -4100,7 +4127,7 @@ if test "x$host" != "x$target"; then
# It would be better to just use TARGET_POWERPC64, but lots of code already
# uses this define
AC_DEFINE(__mono_ppc64__, 1, [...])
AC_DEFINE(__mono_ilp32__, 1, [64 bit mode with 4 byte longs and pointers])
AC_DEFINE(MONO_ARCH_ILP32, 1, [64 bit mode with 4 byte longs and pointers])
sizeof_register=8
target_byte_order=G_BIG_ENDIAN
;;
@@ -4311,6 +4338,7 @@ if test "x$target_mach" = "xyes"; then
CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DTARGET_IOS"
CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DTARGET_IOS"
BTLS_SUPPORTED=no
target_ios=yes
else
AC_TRY_COMPILE([#include "TargetConditionals.h"],[
#if TARGET_IPHONE_SIMULATOR == 1 || TARGET_OS_IPHONE == 1
@@ -4511,7 +4539,6 @@ i*86-*-darwin*)
esac
AC_SUBST(ORDER)
AC_SUBST(CFLAGS)
AC_SUBST(PATHSEP)
AC_SUBST(SEARCHSEP)
AC_SUBST(OS)
@@ -4524,6 +4551,7 @@ AC_DEFINE(HAVE_UWP_WINAPI_SUPPORT, 0, [Don't use UWP Windows API support])
AC_CHECK_FUNCS(strlcpy stpcpy strtok_r rewinddir vasprintf)
AC_CHECK_FUNCS(getrlimit)
AC_CHECK_FUNCS(fork execv execve)
AC_CHECK_FUNCS(waitpid)
AC_ARG_WITH([overridable-allocators], [ --with-overridable-allocators allow g_*alloc/g_free to call custom allocators set via g_mem_set_vtable])
@@ -4547,8 +4575,6 @@ elif test x$target_ios = xno; then
AC_CHECK_FUNCS(strndup getpwuid_r)
fi
AM_CONDITIONAL(NEED_VASPRINTF, test x$ac_cv_func_vasprintf = xno || test x$with_overridable_allocators = xyes)
AC_SEARCH_LIBS(sqrtf, m)
# nanosleep may not be part of libc, also search it in other libraries
@@ -5047,7 +5073,7 @@ dnl **********************
dnl *** checked builds ***
dnl **********************
AC_ARG_ENABLE(checked_build, [ --enable-checked-build=LIST To enable checked build (expensive asserts), configure with a comma-separated LIST of checked build modules and then include that same list in the environment variable MONO_CHECK_MODE at runtime. Recognized checked build modules: all, gc, metadata, thread, private_types],[
AC_ARG_ENABLE(checked_build, [ --enable-checked-build=LIST To enable checked build (expensive asserts), configure with a comma-separated LIST of checked build modules and then include that same list in the environment variable MONO_CHECK_MODE at runtime. Recognized checked build modules: all, gc, metadata, thread, private_types, crash_reporting],[
if test x$enable_checked_build != x ; then
AC_DEFINE(ENABLE_CHECKED_BUILD,1,[Enable checked build])
@@ -5061,6 +5087,7 @@ AC_ARG_ENABLE(checked_build, [ --enable-checked-build=LIST To enable check
eval "mono_checked_build_test_enable_metadata='yes'"
eval "mono_checked_build_test_enable_thread='yes'"
eval "mono_checked_build_test_enable_private_types='yes'"
eval "mono_checked_build_test_enable_crash_reporting='yes'"
fi
if test "x$mono_checked_build_test_enable_gc" = "xyes"; then
@@ -5078,22 +5105,24 @@ AC_ARG_ENABLE(checked_build, [ --enable-checked-build=LIST To enable check
if test "x$mono_checked_build_test_enable_private_types" = "xyes"; then
AC_DEFINE(ENABLE_CHECKED_BUILD_PRIVATE_TYPES, 1, [Enable private types checked build])
fi
if test "x$mono_checked_build_test_enable_crash_reporting" = "xyes"; then
# Required
with_overridable_allocators=yes
AC_DEFINE(ENABLE_OVERRIDABLE_ALLOCATORS,1,[Overridable allocator support enabled])
AC_DEFINE(ENABLE_CHECKED_BUILD_CRASH_REPORTING, 1, [Enable private types checked build])
fi
], [])
dnl End of checked builds
AM_CONDITIONAL(NEED_VASPRINTF, test x$ac_cv_func_vasprintf = xno || test x$with_overridable_allocators = xyes)
AC_CHECK_HEADER([malloc.h],
[AC_DEFINE([HAVE_USR_INCLUDE_MALLOC_H], [1],
[Define to 1 if you have /usr/include/malloc.h.])],,)
if test x"$GCC" = xyes; then
# Implicit function declarations are not 64 bit safe
# Do this late, since this causes lots of configure tests to fail
CFLAGS="$CFLAGS -Werror-implicit-function-declaration"
# jay has a lot of implicit declarations
JAY_CFLAGS="-Wno-implicit-function-declaration"
fi
# When --disable-shared is used, libtool transforms libmono-2.0.la into libmono-2.0.so
# instead of libmono-static.a
if test "x$enable_shared" = "xno" -a "x$enable_executables" = "xyes"; then
@@ -5114,6 +5143,26 @@ dnl **************
AC_ARG_ENABLE(btls, [ --disable-btls Disable the BoringTls provider], enable_btls=$enableval, enable_btls=$BTLS_SUPPORTED)
AC_ARG_ENABLE(btls-lib, [ --disable-btls-lib Disable building the BTLS native library], enable_btls_lib=$enableval, enable_btls_lib=$BTLS_SUPPORTED)
AC_ARG_WITH(btls_android_ndk, [ --with-btls-android-ndk Android NDK for BoringTls])
AC_ARG_WITH(btls_android_api, [ --with-btls-android-api Android NDK API level for BTLS build])
AC_ARG_WITH(btls_android_cmake_toolchain, [ --with-btls-android-cmake-toolchain Path to the cmake toolchain file for Android])
AC_ARG_WITH(btls_android_ndk_asm_workaround, [ --with-btls-android-ndk-asm-workaround Work around a problem with NDK r18+ clang compiler when compiling some AES assembly for ARM])
if test "x$with_btls_android_api" = "x" ; then
case "$BTLS_PLATFORM" in
android-armv5)
with_btls_android_api=16" ;;
android-armv6)
with_btls_android_api=16" ;;
android-armv7)
with_btls_android_api=16 ;;
android-v8a)
with_btls_android_api=21 ;;
android-x86)
with_btls_android_api=16 ;;
android-x64)
with_btls_android_api=21 ;;
esac
fi
if test "x$enable_btls" = "xno"; then
enable_btls_lib=no
@@ -5171,30 +5220,38 @@ if test "x$enable_btls" = "xyes"; then
esac
;;
android-armv5)
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi\" -DANDROID_NATIVE_API_LEVEL=14"
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api"
;;
android-armv6)
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi\" -DANDROID_NATIVE_API_LEVEL=14"
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api"
;;
android-armv7)
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi-v7a\" -DANDROID_NATIVE_API_LEVEL=14"
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi-v7a\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api"
;;
android-v8a)
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"arm64-v8a\" -DANDROID_NATIVE_API_LEVEL=21"
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"arm64-v8a\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api"
;;
android-x86)
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"x86\" -DANDROID_NATIVE_API_LEVEL=14"
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"x86\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api"
;;
android-x64)
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"x86_64\" -DANDROID_NATIVE_API_LEVEL=21"
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"x86_64\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api"
;;
*)
AC_MSG_ERROR(Invalid BTLS platform)
esac
if test "x$platform_android" = "xyes"; then
if test "x$with_btls_android_cmake_toolchain" = "x"; then
with_btls_android_cmake_toolchain="$BTLS_ROOT/util/android-cmake/android.toolchain.cmake"
fi
if test "x$with_btls_android_ndk_asm_workaround" != "x"; then
BTLS_CMAKE_ARGS="$BTLS_CMAKE_ARGS -DENABLE_NDK_ARM_WORKAROUND=ON"
fi
btls_android=yes
BTLS_CMAKE_ARGS="$BTLS_CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=$BTLS_ROOT/util/android-cmake/android.toolchain.cmake"
BTLS_CMAKE_ARGS="$BTLS_CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=$with_btls_android_cmake_toolchain"
if test "x$with_btls_android_ndk" != "x"; then
BTLS_CMAKE_ARGS="$BTLS_CMAKE_ARGS -DANDROID_NDK=\"$with_btls_android_ndk\""
else
@@ -5263,9 +5320,6 @@ AC_SUBST(GTKX11)
AC_SUBST(XINERAMA)
AC_DEFINE_UNQUOTED(MONO_ARCHITECTURE,"$arch_target",[The architecture this is running on])
AC_SUBST(arch_target)
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
#This must always be defined when building the runtime
AC_DEFINE(MONO_INSIDE_RUNTIME,1, [Disable banned functions from being used by the runtime])
@@ -5465,24 +5519,275 @@ AC_CONFIG_COMMANDS([quiet-libtool], [sed -e 's/echo "copying selected/# "copying
AC_CONFIG_COMMANDS([nolock-libtool], [sed -e 's/lock_old_archive_extraction=yes/lock_old_archive_extraction=no/g' < libtool > libtool.tmp && mv libtool.tmp libtool && chmod a+x libtool])
AC_CONFIG_COMMANDS([clean-llvm], [rm -f llvm/llvm_config.mk])
#
# Mono.Native Support
# -------------------
# Mono.Native is the new name for both System.Native and System.Security.Cryptography.Apple.
# It is built as a stand-alone shared library and not bundled with the runtime because we
# may need to build two different versions of it.
#
# Starting with macOS 10.12+ and iOS 10+, Apple introduced a new Unified API for some of the
# crypto primitives that we're using as part of System.Security.Cryptography.Apple.
#
# On Desktop, we can check at runtime whether the OS version is recent enough and switch
# implementation accordingly. We build a single `libmono-native` shared library.
#
# However, on Mobile we cannot have any undefined symbols as this would break Bitcode.
#
# During the mobile build, we are called with `CFLAGS` containing an explicit minium version flag,
# which is eiter `-mmacosx-version-min=`, `-mios-simulator-version-min=` or `-miphoneos-version-min=`
# depending on platform.
#
# We build two versions of the shared library:
# - `libmono-native-compat` is built with whichever minimum version is passed to us via `CFLAGS`.
# - `libmono-native-unifed` is built with the minimum version set to macOS 10.12+ / iOS 10+.
#
# For testing purpuses, there is a function called `mono_native_get_platform_type ()`
# (see mono/native/mono-native-platform.c), which returns a `MonoNativePlatformType` enum value.
# There is also `Mono.MonoNativePlatform.GetPlatformType ()` (see mcs/class/corlib/Test/Mono/MonoNativePlatform.cs).
#
# This can be called by automated tests both to ensure that the library has been correctly installed and also
# to verify that it's the correct version of it.
#
AC_MSG_CHECKING([Mono.Native support])
sed_version_pattern='[[0-9]]\{1,2\}\(\.[[0-9]]\{1,2\}\)'
if test x$target_osx = xyes; then
MONO_NATIVE_CC=$CC
MONO_NATIVE_CXX=$CXX
MONO_NATIVE_CCASFLAGS=$CCASFLAGS
MONO_NATIVE_CPPFLAGS=$CPPFLAGS
MONO_NATIVE_CXXFLAGS=$CXXFLAGS
MONO_NATIVE_CFLAGS=$CFLAGS
MONO_NATIVE_LDFLAGS=$LDFLAGS
mono_native=yes
MONO_NATIVE_PLATFORM=macos
MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_MACOS"
AC_MONO_APPLE_AVAILABLE(mono_native_compat, [whether we need the compatibility layer],
[!(MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12)])
if test x$mono_native_compat = xyes; then
mono_native_compat=yes
mono_native_text="Mac OSX (compat + unified v10.12)"
MONO_NATIVE_COMPAT_CCASFLAGS=$MONO_NATIVE_CCASFLAGS
MONO_NATIVE_COMPAT_CPPFLAGS=$MONO_NATIVE_CPPFLAGS
MONO_NATIVE_COMPAT_CXXFLAGS=$MONO_NATIVE_CXXFLAGS
MONO_NATIVE_COMPAT_CFLAGS=$MONO_NATIVE_CFLAGS
MONO_NATIVE_COMPAT_LDFLAGS=$MONO_NATIVE_LDFLAGS
sed_remove_mac_version_pattern="s/-mmacosx-version-min=$sed_version_pattern//g"
MONO_NATIVE_UNIFIED_CCASFLAGS="`echo $CCASFLAGS | sed -e $sed_remove_mac_version_pattern` -mmacosx-version-min=10.12"
MONO_NATIVE_UNIFIED_CPPFLAGS="`echo $CPPFLAGS | sed -e $sed_remove_mac_version_pattern` -mmacosx-version-min=10.12"
MONO_NATIVE_UNIFIED_CXXFLAGS="`echo $CXXFLAGS | sed -e $sed_remove_mac_version_pattern` -mmacosx-version-min=10.12"
MONO_NATIVE_UNIFIED_CFLAGS="`echo $CFLAGS | sed -e $sed_remove_mac_version_pattern` -mmacosx-version-min=10.12"
MONO_NATIVE_UNIFIED_LDFLAGS="`echo $LDFLAGS | sed -e $sed_remove_mac_version_pattern` -mmacosx-version-min=10.12"
else
mono_native_compat=no
mono_native_text="Mac OSX"
fi
elif test x$mono_native_platform_ios = xyes; then
AC_MONO_APPLE_TARGET(TARGET_OS_SIMULATOR, [mono_native_ios_sim=yes], [mono_native_ios_sim=no])
AC_MONO_APPLE_TARGET(TARGET_OS_IOS, [
if test x$mono_native_ios_sim = xyes; then
mono_native_ios_target=ios-simulator
mono_native_text="iOS Simulator"
MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_IOS | MONO_NATIVE_PLATFORM_TYPE_IPHONE | MONO_NATIVE_PLATFORM_TYPE_SIMULATOR"
else
mono_native_ios_target=iphoneos
mono_native_text="iOS Device"
MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_IOS | MONO_NATIVE_PLATFORM_TYPE_IPHONE | MONO_NATIVE_PLATFORM_TYPE_DEVICE"
fi
mono_native_unified_version="10.0"
mono_native_compat_check="__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_10_0"
], [
AC_MONO_APPLE_TARGET(TARGET_OS_TV, [
if test x$mono_native_ios_sim = xyes; then
mono_native_ios_target=tvos-simulator
mono_native_text="AppleTV Simulator"
MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_IOS | MONO_NATIVE_PLATFORM_TYPE_TV | MONO_NATIVE_PLATFORM_TYPE_SIMULATOR"
else
mono_native_ios_target=tvos
mono_native_text="AppleTV Device"
MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_IOS | MONO_NATIVE_PLATFORM_TYPE_TV | MONO_NATIVE_PLATFORM_TYPE_DEVICE"
fi
mono_native_unified_version="10.0"
mono_native_compat_check="__TV_OS_VERSION_MIN_REQUIRED >= __TVOS_10_0"
], [
AC_MONO_APPLE_TARGET(TARGET_OS_WATCH, [
if test x$mono_native_ios_sim = xyes; then
mono_native_ios_target=watchos-simulator
mono_native_text="Apple Watch Simulator"
MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_IOS | MONO_NATIVE_PLATFORM_TYPE_WATCH | MONO_NATIVE_PLATFORM_TYPE_SIMULATOR"
else
mono_native_ios_target=watchos
mono_native_text="Apple Watch Device"
MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_IOS | MONO_NATIVE_PLATFORM_TYPE_WATCH | MONO_NATIVE_PLATFORM_TYPE_DEVICE"
fi
mono_native_unified_version="5.0"
mono_native_compat_check="__WATCH_OS_VERSION_MIN_REQUIRED >= __WATCHOS_5_0"
], [
AC_MSG_ERROR([Unknown iOS Target])
])
])
])
AC_MONO_APPLE_AVAILABLE(mono_native_compat, [whether we need the compatibility layer], [!($mono_native_compat_check)])
if test x$with_bitcode = xyes; then
mono_native_ldflags="-framework CoreFoundation -framework Foundation -no-undefined -fatal_warnings"
MONO_NATIVE_LIBADD="../mini/$LIBMONO_LA"
else
mono_native_ldflags="-framework CoreFoundation -framework Foundation -fatal_warnings"
fi
if test x$enable_gss = xyes; then
mono_native_ldflags="$mono_native_ldflags -framework GSS"
fi
MONO_NATIVE_CC=$CC
MONO_NATIVE_CXX=$CXX
MONO_NATIVE_CCASFLAGS=$CCASFLAGS
MONO_NATIVE_CPPFLAGS=$CPPFLAGS
MONO_NATIVE_CXXFLAGS=$CXXFLAGS
MONO_NATIVE_CFLAGS=$CFLAGS
MONO_NATIVE_LDFLAGS="$LDFLAGS $mono_native_ldflags"
if test x$mono_native_compat = xyes; then
mono_native_text="$mono_native_text (compat + unified v$mono_native_unified_version)"
MONO_NATIVE_COMPAT_CCASFLAGS=$MONO_NATIVE_CCASFLAGS
MONO_NATIVE_COMPAT_CPPFLAGS=$MONO_NATIVE_CPPFLAGS
MONO_NATIVE_COMPAT_CXXFLAGS=$MONO_NATIVE_CXXFLAGS
MONO_NATIVE_COMPAT_CFLAGS=$MONO_NATIVE_CFLAGS
MONO_NATIVE_COMPAT_LDFLAGS=$MONO_NATIVE_LDFLAGS
sed_remove_ios_version_pattern="s/-m\(.*\)-version-min=$sed_version_pattern//g"
MONO_NATIVE_UNIFIED_CCASFLAGS="`echo $CCASFLAGS | sed -e $sed_remove_ios_version_pattern` -m$mono_native_ios_target-version-min=$mono_native_unified_version"
MONO_NATIVE_UNIFIED_CPPFLAGS="`echo $CPPFLAGS | sed -e $sed_remove_ios_version_pattern` -m$mono_native_ios_target-version-min=$mono_native_unified_version"
MONO_NATIVE_UNIFIED_CXXFLAGS="`echo $CXXFLAGS | sed -e $sed_remove_ios_version_pattern` -m$mono_native_ios_target-version-min=$mono_native_unified_version"
MONO_NATIVE_UNIFIED_CFLAGS="`echo $CFLAGS | sed -e $sed_remove_ios_version_pattern` -m$mono_native_ios_target-version-min=$mono_native_unified_version"
MONO_NATIVE_UNIFIED_LDFLAGS="`echo $LDFLAGS $mono_native_ldflags | sed -e $sed_remove_ios_version_pattern` -m$mono_native_ios_target-version-min=$mono_native_unified_version"
fi
mono_native=yes
MONO_NATIVE_PLATFORM=ios
elif test x$host_linux = xyes; then
mono_native_text="Linux"
MONO_NATIVE_CC=$CC
MONO_NATIVE_CXX=$CXX
MONO_NATIVE_CCASFLAGS=$CCASFLAGS
MONO_NATIVE_CPPFLAGS=$CPPFLAGS
MONO_NATIVE_CXXFLAGS=$CXXFLAGS
MONO_NATIVE_CFLAGS=$CFLAGS
MONO_NATIVE_LDFLAGS=$LDFLAGS
mono_native=yes
mono_native_compat=no
MONO_NATIVE_PLATFORM=linux
MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_LINUX"
elif test x$platform_android = xyes; then
mono_native_text="Android"
MONO_NATIVE_CC=$CC
MONO_NATIVE_CXX=$CXX
MONO_NATIVE_CCASFLAGS=$CCASFLAGS
MONO_NATIVE_CPPFLAGS=$CPPFLAGS
MONO_NATIVE_CXXFLAGS=$CXXFLAGS
MONO_NATIVE_CFLAGS=$CFLAGS
MONO_NATIVE_LDFLAGS=$LDFLAGS
MONO_NATIVE_LIBADD="../mini/$LIBMONO_LA"
mono_native=yes
mono_native_compat=no
MONO_NATIVE_PLATFORM=android
MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_ANDROID"
else
mono_native=no
mono_native_text="no"
fi
AC_MSG_RESULT($mono_native_text)
if test x$mono_native_compat = xyes; then
MONO_NATIVE_LIBRARY_NAME=libmono-native-compat
else
MONO_NATIVE_LIBRARY_NAME=libmono-native
fi
AC_SUBST(MONO_NATIVE_PLATFORM)
AC_SUBST(MONO_NATIVE_CC)
AC_SUBST(MONO_NATIVE_CXX)
AC_SUBST(MONO_NATIVE_CCASFLAGS)
AC_SUBST(MONO_NATIVE_COMPAT_CCASFLAGS)
AC_SUBST(MONO_NATIVE_UNIFIED_CCASFLAGS)
AC_SUBST(MONO_NATIVE_CPPFLAGS)
AC_SUBST(MONO_NATIVE_COMPAT_CPPFLAGS)
AC_SUBST(MONO_NATIVE_UNIFIED_CPPFLAGS)
AC_SUBST(MONO_NATIVE_CXXFLAGS)
AC_SUBST(MONO_NATIVE_COMPAT_CXXFLAGS)
AC_SUBST(MONO_NATIVE_UNIFIED_CXXFLAGS)
AC_SUBST(MONO_NATIVE_CFLAGS)
AC_SUBST(MONO_NATIVE_COMPAT_CFLAGS)
AC_SUBST(MONO_NATIVE_UNIFIED_CFLAGS)
AC_SUBST(MONO_NATIVE_LDFLAGS)
AC_SUBST(MONO_NATIVE_COMPAT_LDFLAGS)
AC_SUBST(MONO_NATIVE_UNIFIED_LDFLAGS)
AC_SUBST(MONO_NATIVE_LIBRARY_NAME)
AC_SUBST(MONO_NATIVE_LIBADD)
AM_CONDITIONAL(MONO_NATIVE, test x$mono_native = xyes)
AM_CONDITIONAL(MONO_NATIVE_COMPAT, test x$mono_native_compat = xyes)
AM_CONDITIONAL(MONO_NATIVE_PLATFORM_MACOS, test x$MONO_NATIVE_PLATFORM = xmacos)
AM_CONDITIONAL(MONO_NATIVE_PLATFORM_IOS, test x$MONO_NATIVE_PLATFORM = xios)
AM_CONDITIONAL(MONO_NATIVE_PLATFORM_LINUX, test x$MONO_NATIVE_PLATFORM = xlinux)
AM_CONDITIONAL(MONO_NATIVE_PLATFORM_AIX, test x$MONO_NATIVE_PLATFORM = xaix)
AM_CONDITIONAL(MONO_NATIVE_PLATFORM_ANDROID, test x$MONO_NATIVE_PLATFORM = xandroid)
MONO_NATIVE_PLATFORM_TYPE_COMPAT="$MONO_NATIVE_PLATFORM_TYPE | MONO_NATIVE_PLATFORM_TYPE_COMPAT"
MONO_NATIVE_PLATFORM_TYPE_UNIFIED="$MONO_NATIVE_PLATFORM_TYPE | MONO_NATIVE_PLATFORM_TYPE_UNIFIED"
AC_SUBST(MONO_NATIVE_PLATFORM_TYPE)
AC_SUBST(MONO_NATIVE_PLATFORM_TYPE_COMPAT)
AC_SUBST(MONO_NATIVE_PLATFORM_TYPE_UNIFIED)
### Set -Werror options
#
# Anything involving -Werror must be done late because autoconf depends on compiling with warnings to be success.
#
if test x"$GCC" = xyes; then
# incompatible-pointer-types requires gcc circa 5.x
if test "x$with_jemalloc" != "xyes"; then
ORIG_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Wincompatible-pointer-types -Werror"
AC_MSG_CHECKING(for -Wincompatible-pointer-types option to gcc)
AC_TRY_COMPILE([],[
], [
AC_MSG_RESULT(yes)
CFLAGS="$ORIG_CFLAGS -Werror=incompatible-pointer-types"
], [
AC_MSG_RESULT(no)
CFLAGS=$ORIG_CFLAGS
])
# incompatible-pointer-types requires gcc circa 5.x
ORIG_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Wincompatible-pointer-types -Werror"
AC_MSG_CHECKING(for -Wincompatible-pointer-types option to gcc)
AC_TRY_COMPILE([],[
], [
AC_MSG_RESULT(yes)
CFLAGS="$ORIG_CFLAGS -Werror=incompatible-pointer-types"
], [
AC_MSG_RESULT(no)
CFLAGS=$ORIG_CFLAGS
])
CFLAGS="$CFLAGS -Werror=return-type"
fi
# Implicit function declarations are not 64 bit safe
# Do this late, since this causes lots of configure tests to fail
CFLAGS="$CFLAGS -Werror-implicit-function-declaration"
# jay has a lot of implicit declarations
JAY_CFLAGS="-Wno-implicit-function-declaration"
fi
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
# Update all submodules recursively to ensure everything is checked out
(cd $srcdir && scripts/update_submodules.sh)
@@ -5496,6 +5801,7 @@ scripts/mono-find-requires
mk/Makefile
mono/Makefile
mono/btls/Makefile
mono/native/Makefile
mono/utils/Makefile
mono/utils/jemalloc/Makefile
mono/metadata/Makefile
@@ -5511,6 +5817,9 @@ mono/arch/arm/Makefile
mono/arch/arm64/Makefile
mono/arch/mips/Makefile
mono/sgen/Makefile
mono/native/platform-type.c
mono/native/platform-type-compat.c
mono/native/platform-type-unified.c
mono/tests/Makefile
mono/tests/assembly-load-reference/Makefile
mono/tests/tests-config
@@ -5692,6 +6001,21 @@ fi
echo "HAVE_BTLS=1" >> $srcdir/$mcsdir/build/config.make
fi
if test "x$mono_native" = "xyes"; then
echo "MONO_NATIVE_SUPPORTED=true" >> $srcdir/$mcsdir/build/config.make
else
echo "MONO_NATIVE_SUPPORTED=false" >> $srcdir/$mcsdir/build/config.make
fi
if test x$mono_native_compat = xyes; then
echo "MONO_NATIVE_USING_COMPAT=true" >> $srcdir/$mcsdir/build/config.make
else
echo "MONO_NATIVE_USING_COMPAT=false" >> $srcdir/$mcsdir/build/config.make
fi
echo "MONO_NATIVE_PLATFORM_TYPE=$MONO_NATIVE_PLATFORM_TYPE" >> $srcdir/$mcsdir/build/config.make
echo "MONO_NATIVE_PLATFORM=$MONO_NATIVE_PLATFORM" >> $srcdir/$mcsdir/build/config.make
fi
)
@@ -5734,6 +6058,7 @@ echo "
DTrace: $enable_dtrace
LLVM Back End: $enable_llvm (dynamically loaded: $enable_loadedllvm, built in-tree: $internal_llvm, assertions: $enable_llvm_asserts)
Spectre: $spectre_mitigation_status
Mono.Native: $mono_native_text
Libraries:
.NET 4.x: $with_profile4_x
@@ -5752,7 +6077,7 @@ echo "
zlib: $zlib_msg
BTLS: $enable_btls$btls_platform_string
jemalloc: $with_jemalloc (always use: $with_jemalloc_always)
crash reporting: $crash_reporting
crash reporting: $crash_reporting (private crashes: $with_crash_privacy)
$disabled
"
if test x$with_static_mono = xno -a "x$host_win32" != "xyes"; then
+3 -2
View File
@@ -11,8 +11,9 @@
<dllmap dll="oci" target="libclntsh@libsuffix@" os="!windows"/>
<dllmap dll="db2cli" target="libdb2_36@libsuffix@" os="!windows"/>
<dllmap dll="MonoPosixHelper" target="$mono_libdir/libMonoPosixHelper@libsuffix@" os="!windows" />
<dllmap dll="System.Native" target="$mono_libdir/libmono-system-native@libsuffix@" os="!windows" />
<dllmap dll="System.Net.Security.Native" target="$mono_libdir/libmono-system-net-security-native@libsuffix@" os="!windows" />
<dllmap dll="System.Native" target="$mono_libdir/@MONO_NATIVE_LIBRARY_NAME@@libsuffix@" os="!windows" />
<dllmap dll="System.Net.Security.Native" target="$mono_libdir/@MONO_NATIVE_LIBRARY_NAME@@libsuffix@" os="!windows" />
<dllmap dll="System.Security.Cryptography.Native.Apple" target="$mono_libdir/@MONO_NATIVE_LIBRARY_NAME@@libsuffix@" os="osx" />
<dllmap dll="libmono-btls-shared" target="$mono_libdir/libmono-btls-shared@libsuffix@" os="!windows" />
<dllmap dll="i:msvcrt" target="@LIBC@" os="!windows"/>
<dllmap dll="i:msvcrt.dll" target="@LIBC@" os="!windows"/>
+1 -1
+1 -1
+1 -1
+1 -1
+1 -1
View File
@@ -2,7 +2,7 @@
{
"name": "llvm",
"url": "git://github.com/mono/llvm.git",
"rev": "81376d161cb6c2230834b2dc096ccbdae8d93020",
"rev": "349752c464c5fc93b32e7d45825f2890c85c8b7d",
"remote-branch": "origin/release_60",
"branch": "release_60",
"directory": "llvm"
+3
View File
@@ -47,6 +47,7 @@ $(LLVM_PATH)/CMakeLists.txt: | $(LLVM_PATH)
EXTRA_LLVM_ARGS = $(if $(filter $(LLVM_TARGET),wasm32), -DLLVM_BUILD_32_BITS=On -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="WebAssembly",)
# -DLLVM_ENABLE_LIBXML2=Off is needed because xml2 is not used and it breaks 32-bit builds on 64-bit Linux hosts
$(LLVM_BUILD)/$(if $(NINJA),build.ninja,Makefile): $(LLVM_PATH)/CMakeLists.txt | $(LLVM_BUILD)
cd $(LLVM_BUILD) && $(CMAKE) \
$(if $(NINJA),-G Ninja) \
@@ -60,6 +61,8 @@ $(LLVM_BUILD)/$(if $(NINJA),build.ninja,Makefile): $(LLVM_PATH)/CMakeLists.txt |
-DLLVM_TARGETS_TO_BUILD="X86;ARM;AArch64" \
$(EXTRA_LLVM_ARGS) \
-DLLVM_ENABLE_ASSERTIONS=$(if $(INTERNAL_LLVM_ASSERTS),On,Off) \
-DLLVM_ENABLE_LIBXML2=Off \
-DHAVE_FUTIMENS=0 \
$(LLVM_CMAKE_ARGS) \
$(dir $<)
+40
View File
@@ -0,0 +1,40 @@
# Usage:
# AC_MONO_APPLE_TARGET(target-name, action-if-found, action-if-not-found)
#
# Checks whether `target-name` is defined in "TargetConditionals.h"
#
AC_DEFUN([AC_MONO_APPLE_TARGET], [
AC_MONO_APPLE_AVAILABLE([$1], [for $1], [$1 == 1], $2, $3)
])
# Usage:
# AC_MONO_APPLE_AVAILABLE(name, message, conditional, action-if-found, action-if-not-found)
#
# Checks for `conditional` using "TargetConditionals.h" and "AvailabilityMacros.h"
#
AC_DEFUN([AC_MONO_APPLE_AVAILABLE], [
# cache the compilation check
AC_CACHE_CHECK([$2], [ac_cv_apple_available_[]$1], [
AC_TRY_COMPILE([
#include "TargetConditionals.h"
#include "AvailabilityMacros.h"
],[
#if !($3)
#error failed
#endif
], [
ac_cv_apple_available_[]$1=yes
], [
ac_cv_apple_available_[]$1=no
])
])
# keep the actions out of the cache check because they need to be always executed.
if test x$ac_cv_apple_available_[]$1 = xyes; then
$1=yes
[$4]
else
$1=no
[$5]
fi
])
+3
View File
@@ -335,6 +335,9 @@ format.
.SS Options
The AOT profiler supports the following options:
.TP
\fBduration\fR=\fInum\fR
Profile only NUM seconds of runtime and then write the data.
.TP
\fBhelp\fR
Print usage instructions.
.TP
-1
View File
@@ -15,7 +15,6 @@ apidiff/*
csprojdiff/*
errors/*.log
errors/dummy.xml
class/Mono.Data.Sqlite/test.db
class/RabbitMQ.Client/docs/specs/autogenerated-api-0-8.cs
class/RabbitMQ.Client/docs/specs/autogenerated-api-0-9.cs
class/RabbitMQ.Client/docs/specs/autogenerated-api-qpid-0-8.cs
+5 -2
View File
@@ -2,7 +2,7 @@ thisdir = build
SUBDIRS =
include ../build/rules.make
BUILT_FILES = common/Consts.cs
BUILT_FILES = common/Consts.cs $(topdir)/class/lib/$(PROFILE_DIRECTORY)/Consts.cs
all-local install-local test-local run-test-local csproj-local run-test-ondotnet-local uninstall-local doc-update-local: $(BUILT_FILES)
@:
@@ -10,7 +10,10 @@ all-local install-local test-local run-test-local csproj-local run-test-ondotnet
clean-local:
-rm -f $(BUILT_FILES) deps/*
common/Consts.cs: common/Consts.cs.in $(wildcard config.make)
$(topdir)/class/lib/$(PROFILE_DIRECTORY):
mkdir -p $@
common/Consts.cs $(topdir)/class/lib/$(PROFILE_DIRECTORY)/Consts.cs: common/Consts.cs.in $(wildcard config.make) | $(topdir)/class/lib/$(PROFILE_DIRECTORY)
test -n '$(MONO_VERSION)'
test -n '$(MONO_CORLIB_VERSION)'
sed -e 's,@''MONO_VERSION@,$(MONO_VERSION),' -e 's,@''MONO_CORLIB_VERSION@,$(MONO_CORLIB_VERSION),' $< > $@
+3 -3
View File
@@ -32,10 +32,10 @@ mono_libdir = $(exec_prefix)/lib
sysconfdir = $(prefix)/etc
#RUNTIME = mono
RUNTIME = false
MONO_PATH_TOP = $(topdir)/class/lib/$(PROFILE_DIRECTORY)/
MONO_PATH_TOP = $(topdir)/class/lib/$(PROFILE_DIRECTORY)
MONO_PATH_TESTS = $(MONO_PATH_TOP)/tests
TEST_MONO_PATH = $(MONO_PATH_TOP)$(PLATFORM_PATH_SEPARATOR)$(MONO_PATH_TESTS)
TEST_RUNTIME = MONO_PATH="$(TEST_MONO_PATH)$(PLATFORM_PATH_SEPARATOR).$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) --debug
TEST_MONO_PATH = $(MONO_PATH_TOP)$(PLATFORM_PATH_SEPARATOR)$(MONO_PATH_TESTS)$(PLATFORM_PATH_SEPARATOR).
TEST_RUNTIME = MONO_PATH="$(TEST_MONO_PATH)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) --debug
# In case you want to add MCS_FLAGS, this lets you not have to
# keep track of the default value
+2
View File
@@ -7,3 +7,5 @@ NO_THREAD_ABORT=1
NO_THREAD_SUSPEND_RESUME=1
NO_MULTIPLE_APPDOMAINS=1
NO_PROCESS_START=1
NO_GSS=1
NO_VTS_TEST=1
@@ -8,3 +8,5 @@ NO_THREAD_SUSPEND_RESUME=1
# The binding generator (btv) still needs to execute processes,
# so we need a System.dll that can do that.
#NO_PROCESS_START=1
NO_GSS=1
+2
View File
@@ -9,6 +9,8 @@ NO_THREAD_SUSPEND_RESUME=1
NO_MULTIPLE_APPDOMAINS=1
NO_PROCESS_START=1
NO_MONO_SECURITY=1
NO_GSS=1
MONO_FEATURE_APPLETLS=
ONLY_APPLETLS=
MONO_FEATURE_APPLE_X509=1
NO_VTS_TEST=1
@@ -6,6 +6,7 @@ PROFILE_MCS_FLAGS += \
NO_THREAD_ABORT=1
NO_THREAD_SUSPEND_RESUME=1
NO_GSS=1
# The binding generator (bwatch) still needs to execute processes,
# so we need a System.dll that can do that.
#NO_PROCESS_START=1
+1 -1
View File
@@ -54,7 +54,7 @@ INTERNAL_CSC_LOCATION = $(CSC_LOCATION)
INTERNAL_CSC = CSC_SDK_PATH_DISABLED= $(RUNTIME) $(RUNTIME_FLAGS) $(CSC_RUNTIME_FLAGS) $(INTERNAL_CSC_LOCATION)
RESGEN = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/resgen.exe
STRING_REPLACER = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/cil-stringreplacer.exe
STRING_REPLACER = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/tmp/cil-stringreplacer.exe
ILASM = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/ilasm.exe
GENSOURCES_LIBDIR = $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)
GENSOURCES_CS = $(topdir)/build/gensources.cs
+34 -20
View File
@@ -19,13 +19,22 @@ TEST_RUNTIME_WRAPPERS_PATH = $(shell dirname $(RUNTIME))/_tmpinst/bin
## Unit test support
ifndef NO_TEST
test_lib_dir = $(topdir)/class/lib/$(PROFILE)/tests
test_nunit_lib = nunitlite.dll
xunit_core := xunit.core xunit.execution.dotnet xunit.abstractions xunit.assert Xunit.NetCore.Extensions
xunit_deps := netstandard System.Runtime
xunit_deps := System.Runtime
xunit_src := $(patsubst %,$(topdir)/../external/xunit-binaries/%,BenchmarkAttribute.cs BenchmarkDiscover.cs) $(topdir)/../mcs/class/test-helpers/PlatformDetection.cs
ifeq ($(USE_XTEST_REMOTE_EXECUTOR), YES)
XTEST_REMOTE_EXECUTOR = $(topdir)/class/lib/$(PROFILE)/RemoteExecutorConsoleApp.exe
XTEST_REMOTE_EXECUTOR = $(test_lib_dir)/RemoteExecutorConsoleApp.exe
ifeq ($(BUILD_PLATFORM), win32)
XTEST_REMOTE_EXECUTOR_ABSPATH = $(shell cygpath -w $(abspath $(XTEST_REMOTE_EXECUTOR)))
else
XTEST_REMOTE_EXECUTOR_ABSPATH = $(abspath $(XTEST_REMOTE_EXECUTOR))
endif
xunit_src += $(topdir)/../mcs/class/test-helpers/AdminHelper.cs \
$(topdir)/../external/corefx/src/CoreFx.Private.TestUtilities/src/System/IO/FileCleanupTestBase.cs \
$(topdir)/../external/corefx/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs \
@@ -35,8 +44,15 @@ $(topdir)/../external/corefx/src/Common/src/System/PasteArguments.Unix.cs
ifeq ($(PROFILE),monodroid)
xunit_src += $(topdir)/../mcs/class/test-helpers/RemoteExecutorTestBase.Mobile.cs
else
xunit_src += $(topdir)/../mcs/class/test-helpers/RemoteExecutorTestBase.Mono.cs \
$(topdir)/../external/corefx/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.Process.cs
ifeq ($(PROFILE),monotouch_tv)
xunit_src += $(topdir)/../mcs/class/test-helpers/RemoteExecutorTestBase.Mobile.cs
else
ifeq ($(PROFILE),monotouch_watch)
xunit_src += $(topdir)/../mcs/class/test-helpers/RemoteExecutorTestBase.Mobile.cs
else
xunit_src += $(topdir)/../mcs/class/test-helpers/RemoteExecutorTestBase.Mono.cs $(topdir)/../external/corefx/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.Process.cs
endif
endif
endif
endif
@@ -62,6 +78,7 @@ test_sourcefile = $(ASSEMBLY:$(ASSEMBLY_EXT)=_test.dll.sources)
endif
test_lib = $(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_test.dll)
test_lib_output = $(test_lib_dir)/$(test_lib)
test_sourcefile_excludes = $(test_lib).exclude.sources
@@ -73,12 +90,13 @@ ifndef NO_BUILD
test_flags += -r:$(the_assembly)
test_assembly_dep = $(the_assembly)
endif
tests_CLEAN_FILES += $(ASSEMBLY:$(ASSEMBLY_EXT)=_test*.dll) $(ASSEMBLY:$(ASSEMBLY_EXT)=_test*.pdb) $(test_response) $(test_makefrag)
tests_CLEAN_FILES += $(test_lib_output) $(test_lib_output:$(ASSEMBLY_EXT)=.pdb) $(test_response) $(test_makefrag)
xtest_sourcefile = $(PROFILE_PLATFORM)_$(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_xtest.dll.sources)
xtest_sourcefile_excludes = $(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_xtest.dll.exclude.sources)
xunit_test_lib = $(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_xunit-test.dll)
xtest_lib_output = $(test_lib_dir)/$(xunit_test_lib)
xtest_response = $(depsdir)/$(xunit_test_lib).response
xtest_makefrag = $(depsdir)/$(xunit_test_lib).makefrag
@@ -86,7 +104,7 @@ xtest_flags = -r:$(the_assembly) $(xunit_libs_ref) $(XTEST_MCS_FLAGS) $(XTEST_LI
ifeq ($(wildcard $(xtest_sourcefile)),)
xtest_sourcefile = $(ASSEMBLY:$(ASSEMBLY_EXT)=_xtest.dll.sources)
tests_CLEAN_FILES += $(xunit_test_lib) $(xtest_response) $(xtest_makefrag)
tests_CLEAN_FILES += $(xtest_lib_output) $(xtest_response) $(xtest_makefrag)
endif
ifndef HAVE_CS_TESTS
@@ -113,10 +131,6 @@ endif
test_assemblies :=
test_lib_dir = $(topdir)/class/lib/$(PROFILE)/tests
test_lib_output = $(topdir)/class/lib/$(PROFILE)/tests/$(test_lib)
ifdef HAVE_CS_TESTS
test_assemblies += $(test_lib_output)
@@ -162,7 +176,7 @@ endif
NUNITLITE_CONFIG_FILE=$(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)nunit-lite-console.exe.config
$(test_lib_output).nunitlite.config: $(topdir)/tools/nunit-lite/nunit-lite-console/nunit-lite-console.exe.config.tmpl $(TEST_NUNITLITE_APP_CONFIG_GLOBAL) $(TEST_NUNITLITE_APP_CONFIG_RUNTIME) $(TEST_NUNITLITE_APP_CONFIG_SUPPLEMENTAL)
$(test_lib_output).nunitlite.config: $(topdir)/tools/nunit-lite/nunit-lite-console/nunit-lite-console.exe.config.tmpl $(TEST_NUNITLITE_APP_CONFIG_GLOBAL) $(TEST_NUNITLITE_APP_CONFIG_RUNTIME) $(TEST_NUNITLITE_APP_CONFIG_SUPPLEMENTAL) | $(test_lib_dir)
cp -f $(topdir)/tools/nunit-lite/nunit-lite-console/nunit-lite-console.exe.config.tmpl $(test_lib_output).nunitlite.config
ifdef TEST_NUNITLITE_APP_CONFIG_GLOBAL
sed -i -e "/__INSERT_CUSTOM_APP_CONFIG_GLOBAL__/r $(TEST_NUNITLITE_APP_CONFIG_GLOBAL)" $(test_lib_output).nunitlite.config
@@ -248,7 +262,7 @@ ifdef HAVE_CS_TESTS
$(test_lib_dir):
mkdir -p $@
$(test_lib_output): $(test_assembly_dep) $(test_response) $(test_nunit_dep) $(test_lib_dir) $(test_lib_output).nunitlite.config
$(test_lib_output): $(test_assembly_dep) $(test_response) $(test_nunit_dep) $(test_lib_output).nunitlite.config | $(test_lib_dir)
$(TEST_COMPILE) $(LIBRARY_FLAGS) -target:library -out:$@ $(test_flags) $(LOCAL_TEST_COMPILER_ONDOTNET_FLAGS) @$(test_response)
test_response_preprocessed = $(test_response)_preprocessed
@@ -311,23 +325,23 @@ XTEST_COVERAGE_FLAGS = -O=-aot --profile=coverage:output=$(topdir)/class/lib/$(P
endif
check: run-xunit-test-local
xunit-test-local: $(xunit_test_lib)
xunit-test-local: $(xtest_lib_output)
run-xunit-test-local: run-xunit-test-lib
# cp -rf is a HACK for xunit runner to require xunit.execution.dOTNET.dll file in local folder on .net only
run-xunit-test-lib: xunit-test-local $(XTEST_REMOTE_EXECUTOR)
@cp -rf $(XTEST_HARNESS_PATH)/xunit.execution.dotnet.dll xunit.execution.dotnet.dll
run-xunit-test-lib: xunit-test-local
@cp -rf $(XTEST_HARNESS_PATH)/xunit.execution.dotnet.dll $(test_lib_dir)/xunit.execution.dotnet.dll
ok=:; \
PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" REMOTE_EXECUTOR=$(XTEST_REMOTE_EXECUTOR) $(TEST_RUNTIME) $(TEST_RUNTIME_FLAGS) $(XTEST_COVERAGE_FLAGS) $(AOT_RUN_FLAGS) $(XTEST_HARNESS) $(xunit_test_lib) $(XTEST_HARNESS_FLAGS) $(XTEST_TRAIT) $(XTEST_TRAIT_PLATFORM) || ok=false; \
PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" REMOTE_EXECUTOR="$(XTEST_REMOTE_EXECUTOR_ABSPATH)" $(TEST_RUNTIME) $(TEST_RUNTIME_FLAGS) $(XTEST_COVERAGE_FLAGS) $(AOT_RUN_FLAGS) $(XTEST_HARNESS) $(xtest_lib_output) $(XTEST_HARNESS_FLAGS) $(XTEST_TRAIT) $(XTEST_TRAIT_PLATFORM) || ok=false; \
if [ -n "$$MONO_BABYSITTER_NUNIT_XML_LIST_FILE" ]; then echo "$(abspath $(XTEST_RESULT_FILE))" >> "$$MONO_BABYSITTER_NUNIT_XML_LIST_FILE"; fi; \
$$ok
@rm -f xunit.execution.dotnet.dll
@rm -f $(test_lib_dir)/xunit.execution.dotnet.dll
# Some xunit tests want to be executed in a separate process (see RemoteExecutorTestBase)
$(XTEST_REMOTE_EXECUTOR): $(topdir)/../external/corefx/src/Common/tests/System/Diagnostics/RemoteExecutorConsoleApp/RemoteExecutorConsoleApp.cs
$(XTEST_REMOTE_EXECUTOR): $(topdir)/../external/corefx/src/Common/tests/System/Diagnostics/RemoteExecutorConsoleApp/RemoteExecutorConsoleApp.cs | $(test_lib_dir)
$(TEST_COMPILE) -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll $< -out:$@
$(xunit_test_lib): $(the_assembly) $(xtest_response) $(xunit_libs_dep) $(xunit_src)
$(xtest_lib_output): $(the_assembly) $(xtest_response) $(xunit_libs_dep) $(xunit_src) $(XTEST_REMOTE_EXECUTOR) | $(test_lib_dir)
$(TEST_COMPILE) $(LIBRARY_FLAGS) $(XTEST_LIB_FLAGS) -target:library -out:$@ $(xtest_flags) @$(xtest_response) $(xunit_src)
xtest_response_preprocessed = $(xtest_response)_preprocessed
@@ -339,7 +353,7 @@ $(xtest_response): $(xtest_sourcefile) $(wildcard *xtest.dll.sources) $(wildcard
$(xtest_makefrag): $(xtest_response)
@echo Creating $@ ...
@sed 's,^,$(xunit_test_lib): ,' $< >$@
@sed 's,^,$(xtest_lib_output): ,' $< >$@
-include $(xtest_makefrag)
@@ -31,51 +31,106 @@
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;MOBILE_DYNAMIC;MONODROID;ANDROID</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'monodroid' ">
<OutputPath>./../../../class/lib/monodroid/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;MOBILE_DYNAMIC;MONODROID;ANDROID;NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;MOBILE_DYNAMIC;MONODROID;ANDROID</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'monodroid' ">
<OutputPath>./../../../class/lib/monodroid/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;MOBILE_DYNAMIC;MONODROID;ANDROID;NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;MOBILE_DYNAMIC;MONODROID;ANDROID;NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;MOBILE_DYNAMIC;MONODROID;ANDROID</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'monotouch' ">
<OutputPath>./../../../class/lib/monotouch/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'monotouch' ">
<OutputPath>./../../../class/lib/monotouch/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME;NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'monotouch_watch' ">
<OutputPath>./../../../class/lib/monotouch_watch/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME;FEATURE_NO_BSD_SOCKETS;MONOTOUCH_WATCH</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'monotouch_watch' ">
<OutputPath>./../../../class/lib/monotouch_watch/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME;FEATURE_NO_BSD_SOCKETS;MONOTOUCH_WATCH;NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME;FEATURE_NO_BSD_SOCKETS;MONOTOUCH_WATCH</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'monotouch_tv' ">
<OutputPath>./../../../class/lib/monotouch_tv/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME;MONOTOUCH_TV</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'monotouch_tv' ">
<OutputPath>./../../../class/lib/monotouch_tv/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME;MONOTOUCH_TV;NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME;MONOTOUCH_TV</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'testing_aot_full' ">
<OutputPath>./../../../class/lib/testing_aot_full/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;DISABLE_REMOTING;DISABLE_COM</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'testing_aot_full' ">
<OutputPath>./../../../class/lib/testing_aot_full/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;DISABLE_REMOTING;DISABLE_COM;NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;DISABLE_REMOTING;DISABLE_COM</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'winaot' ">
<OutputPath>./../../../class/lib/winaot/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;DISABLE_REMOTING;DISABLE_COM;WIN_PLATFORM</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'winaot' ">
<OutputPath>./../../../class/lib/winaot/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;DISABLE_REMOTING;DISABLE_COM;WIN_PLATFORM;NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;DISABLE_REMOTING;DISABLE_COM;WIN_PLATFORM</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'xammac' ">
<OutputPath>./../../../class/lib/xammac/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_DYNAMIC;XAMMAC;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;XAMARIN_MODERN</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'xammac' ">
<OutputPath>./../../../class/lib/xammac/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_DYNAMIC;XAMMAC;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;XAMARIN_MODERN;NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_DYNAMIC;XAMMAC;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;XAMARIN_MODERN</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'orbis' ">
<OutputPath>./../../../class/lib/orbis/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;ORBIS;DISABLE_REMOTING;DISABLE_COM</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'orbis' ">
<OutputPath>./../../../class/lib/orbis/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;ORBIS;DISABLE_REMOTING;DISABLE_COM;NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;ORBIS;DISABLE_REMOTING;DISABLE_COM</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'unreal' ">
<OutputPath>./../../../class/lib/unreal/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;MOBILE;MOBILE_DYNAMIC;NET_3_5;NET_4_0;NET_4_5;MONO</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'unreal' ">
<OutputPath>./../../../class/lib/unreal/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;MOBILE;MOBILE_DYNAMIC;NET_3_5;NET_4_0;NET_4_5;MONO;NET_1_1;NET_2_0;NET_2_1;MOBILE;MOBILE_DYNAMIC;NET_3_5;NET_4_0;NET_4_5;MONO</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'wasm' ">
<OutputPath>./../../../class/lib/wasm/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;WASM;DISABLE_REMOTING;DISABLE_COM;FEATURE_NO_BSD_SOCKETS</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'wasm' ">
<OutputPath>./../../../class/lib/wasm/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;WASM;DISABLE_REMOTING;DISABLE_COM;FEATURE_NO_BSD_SOCKETS;NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;WASM;DISABLE_REMOTING;DISABLE_COM;FEATURE_NO_BSD_SOCKETS</DefineConstants>
</PropertyGroup>
<!-- @ALL_PROFILE_PROPERTIES@ -->
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols>
@@ -96,8 +151,60 @@
<Compile Include="TypeForwarders.cs" />
</ItemGroup>
<!--End of common files-->
<!--Per-profile files-->
<Choose>
<When Condition="'$(Platform)' == 'xammac'">
<ItemGroup />
</When>
<When Condition="'$(Platform)' == 'winaot'">
<ItemGroup />
</When>
<When Condition="'$(Platform)' == 'wasm'">
<ItemGroup />
</When>
<When Condition="'$(Platform)' == 'unreal'">
<ItemGroup />
</When>
<When Condition="'$(Platform)' == 'orbis'">
<ItemGroup />
</When>
<When Condition="'$(Platform)' == 'net_4_x'">
<ItemGroup />
</When>
<When Condition="'$(Platform)' == 'monotouch_watch'">
<ItemGroup />
</When>
<When Condition="'$(Platform)' == 'monotouch_tv'">
<ItemGroup />
</When>
<When Condition="'$(Platform)' == 'monotouch'">
<ItemGroup />
</When>
<When Condition="'$(Platform)' == 'monodroid'">
<ItemGroup>
<Compile Include="..\..\..\..\external\corefx\src\Common\src\System\Drawing\ColorTable.cs" />
<Compile Include="..\..\..\..\external\corefx\src\Common\src\System\Drawing\ColorUtil.netcoreapp21.cs" />
<Compile Include="..\..\..\..\external\corefx\src\Common\src\System\Drawing\KnownColor.cs" />
<Compile Include="..\..\..\..\external\corefx\src\Common\src\System\Drawing\KnownColorTable.cs" />
<Compile Include="..\..\..\..\external\corefx\src\Common\src\System\Numerics\Hashing\HashHelpers.cs" />
<Compile Include="..\..\..\..\external\corefx\src\System.Drawing.Common\src\System\Drawing\ColorConverter.cs" />
<Compile Include="..\..\..\..\external\corefx\src\System.Drawing.Common\src\System\Drawing\SystemColors.cs" />
<Compile Include="..\..\..\..\external\corefx\src\System.Drawing.Primitives\src\System\Drawing\Color.cs" />
<Compile Include="..\..\..\..\external\corefx\src\System.Drawing.Primitives\src\System\Drawing\Point.cs" />
<Compile Include="..\..\..\..\external\corefx\src\System.Drawing.Primitives\src\System\Drawing\PointF.cs" />
<Compile Include="..\..\..\..\external\corefx\src\System.Drawing.Primitives\src\System\Drawing\Rectangle.cs" />
<Compile Include="..\..\..\..\external\corefx\src\System.Drawing.Primitives\src\System\Drawing\RectangleF.cs" />
<Compile Include="..\..\..\..\external\corefx\src\System.Drawing.Primitives\src\System\Drawing\Size.cs" />
<Compile Include="..\..\..\..\external\corefx\src\System.Drawing.Primitives\src\System\Drawing\SizeF.cs" />
<Compile Include="..\..\..\build\common\SR.cs" />
<Compile Include="SR.cs" />
</ItemGroup>
</When>
</Choose>
<!--End of per-profile files-->
<!-- @ALL_SOURCES@ -->
<ItemGroup>
<ProjectReference Include="../../System/System.csproj" />
<ProjectReference Include="../../corlib/corlib.csproj" />
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'testing_aot_full' ">
@@ -106,6 +213,12 @@
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'testing_aot_full' ">
<Reference Include="nunitlite">
<HintPath>..\lib\testing_aot_full\nunitlite.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<!-- @ALL_REFERENCES@ -->
<!-- @ALL_RESOURCES@ -->
<PropertyGroup>
@@ -12,7 +12,7 @@ LIBRARY = System.Drawing.Common.dll
KEYFILE = ../../Open.snk
LIBRARY_SNK = $(KEYFILE)
SIGN_FLAGS = /delaysign /nowarn:1616,1699
LIB_REFS =
LIB_REFS = System
LIB_MCS_FLAGS = $(SIGN_FLAGS) $(EXTRA_LIB_MCS_FLAGS)
ifdef false # we'll enable this at a later point
@@ -0,0 +1,6 @@
partial class SR
{
public const string InvalidColor = "Color '{0}' is not valid.";
public const string InvalidEx2BoundArgument = "Value of '{1}' is not valid for '{0}'. '{0}' should be greater than or equal to {2} and less than or equal to {3}.";
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,17 @@
#include System.Drawing.Common.dll.sources
../../../../external/corefx/src/System.Drawing.Primitives/src/System/Drawing/Color.cs
../../../../external/corefx/src/Common/src/System/Drawing/KnownColor.cs
../../../../external/corefx/src/System.Drawing.Primitives/src/System/Drawing/Point.cs
../../../../external/corefx/src/System.Drawing.Primitives/src/System/Drawing/PointF.cs
../../../../external/corefx/src/System.Drawing.Primitives/src/System/Drawing/Rectangle.cs
../../../../external/corefx/src/System.Drawing.Primitives/src/System/Drawing/RectangleF.cs
../../../../external/corefx/src/System.Drawing.Primitives/src/System/Drawing/Size.cs
../../../../external/corefx/src/System.Drawing.Primitives/src/System/Drawing/SizeF.cs
../../../../external/corefx/src/Common/src/System/Numerics/Hashing/HashHelpers.cs
../../../../external/corefx/src/Common/src/System/Drawing/KnownColorTable.cs
../../../../external/corefx/src/Common/src/System/Drawing/ColorTable.cs
../../../../external/corefx/src/Common/src/System/Drawing/ColorUtil.netcoreapp21.cs
../../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/SystemColors.cs
../../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/ColorConverter.cs
../../../build/common/SR.cs
SR.cs
@@ -36,6 +36,11 @@
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;MOBILE_DYNAMIC;MONODROID;ANDROID</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'monodroid' ">
<OutputPath>./../../../class/lib/monodroid/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;MOBILE_DYNAMIC;MONODROID;ANDROID;NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;MOBILE_DYNAMIC;MONODROID;ANDROID</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'monotouch' ">
<OutputPath>./../../../class/lib/monotouch/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
@@ -149,11 +154,20 @@
<ProjectReference Include="../../System.Drawing/System.Drawing.csproj" />
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'monodroid' ">
<Reference Include="$(EXTERNAL_FACADE_DRAWING_REFERENCE)">
<Reference Include="./../../../../external/binary-reference-assemblies/build/monodroid/Mono.Android.dll">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(EXTERNAL_FACADE_DRAWING_REFERENCE)</HintPath>
<HintPath>./../../../../external/binary-reference-assemblies/build/monodroid/Mono.Android.dll</HintPath>
<Private>False</Private>
</Reference>
<ProjectReference Include="../System.Drawing.Common/Facades_System.Drawing.Common.csproj" />
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'monodroid' ">
<Reference Include="./../../../../external/binary-reference-assemblies/build/monodroid/Mono.Android.dll">
<SpecificVersion>False</SpecificVersion>
<HintPath>./../../../../external/binary-reference-assemblies/build/monodroid/Mono.Android.dll</HintPath>
<Private>False</Private>
</Reference>
<ProjectReference Include="../System.Drawing.Common/Facades_System.Drawing.Common.csproj" />
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'monotouch' ">
<Reference Include="$(EXTERNAL_FACADE_DRAWING_REFERENCE)">
@@ -20,6 +20,12 @@ LIB_MCS_FLAGS = $(SIGN_FLAGS) $(EXTRA_LIB_MCS_FLAGS)
# TODO: find a better solution.
EMBEDDED_DRAWING_DEP := $(filter xammac_net_4_5 testing_aot_full testing_aot_hybrid, $(PROFILE))
ifeq ($(PROFILE),monodroid)
# XA implements System.Drawing API inside Mono.Android
API_BIN_REFS := Mono.Android
LIB_REFS += Facades/System.Drawing.Common
else
ifndef EMBEDDED_DRAWING_DEP
# profiles which build a System.Drawing.dll in the repo
@@ -29,12 +35,12 @@ ifdef REPO_DRAWING_DEP
LIB_REFS += System.Drawing
else
# When System.Drawing.dll is not built in the Mono repo but in
# the product repo like in the XI/XA case we need to pass in a reference
# the product repo like in the XI case we need to pass in a reference
# to the assembly containing drawing types like Rectangle etc. from there.
# This needs to be passed in via EXTERNAL_FACADE_DRAWING_REFERENCE.
LIB_MCS_FLAGS += /r:$(EXTERNAL_FACADE_DRAWING_REFERENCE)
endif
endif
endif
PLATFORM_DEBUG_FLAGS =
@@ -36,6 +36,11 @@
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;MOBILE_DYNAMIC;MONODROID;ANDROID</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'monodroid' ">
<OutputPath>./../../../class/lib/monodroid/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;MOBILE_DYNAMIC;MONODROID;ANDROID;NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;MOBILE_DYNAMIC;MONODROID;ANDROID</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'monotouch' ">
<OutputPath>./../../../class/lib/monotouch/Facades</OutputPath>
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
@@ -128,12 +133,22 @@
<ProjectReference Include="../../System.Drawing/System.Drawing.csproj" />
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'monodroid' ">
<Reference Include="$(EXTERNAL_FACADE_DRAWING_REFERENCE)">
<Reference Include="./../../../../external/binary-reference-assemblies/build/monodroid/Mono.Android.dll">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(EXTERNAL_FACADE_DRAWING_REFERENCE)</HintPath>
<HintPath>./../../../../external/binary-reference-assemblies/build/monodroid/Mono.Android.dll</HintPath>
<Private>False</Private>
</Reference>
<ProjectReference Include="../../System.Web.Services/System.Web.Services.csproj" />
<ProjectReference Include="../System.Drawing.Common/Facades_System.Drawing.Common.csproj" />
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'monodroid' ">
<Reference Include="./../../../../external/binary-reference-assemblies/build/monodroid/Mono.Android.dll">
<SpecificVersion>False</SpecificVersion>
<HintPath>./../../../../external/binary-reference-assemblies/build/monodroid/Mono.Android.dll</HintPath>
<Private>False</Private>
</Reference>
<ProjectReference Include="../../System.Web.Services/System.Web.Services.csproj" />
<ProjectReference Include="../System.Drawing.Common/Facades_System.Drawing.Common.csproj" />
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'monotouch' ">
<Reference Include="$(EXTERNAL_FACADE_DRAWING_REFERENCE)">
+7 -1
View File
@@ -25,6 +25,12 @@ else
LIB_REFS += System.Web
endif
ifeq ($(PROFILE),monodroid)
# XA implements System.Drawing API inside Mono.Android
API_BIN_REFS := Mono.Android
LIB_REFS += Facades/System.Drawing.Common
else
# profiles which build a System.Drawing.dll in the repo
REPO_DRAWING_DEP := $(filter net_4_x orbis winaot unreal wasm, $(PROFILE))
@@ -48,7 +54,7 @@ else
# This needs to be passed in via EXTERNAL_FACADE_DRAWING_REFERENCE.
LIB_MCS_FLAGS += /r:$(EXTERNAL_FACADE_DRAWING_REFERENCE)
endif
endif
endif
PLATFORM_DEBUG_FLAGS =
+11 -11
View File
@@ -36,10 +36,13 @@ System.Security.Cryptography.X509Certificates System.Runtime.Serialization.Primi
# common_SUBDIRS dependencies
common_DEPS_SUBDIRS :=
netstandard_drawing_SUBDIRS = System.Drawing.Primitives netstandard
netstandard_drawing_SUBDIRS = System.Drawing.Common System.Drawing.Primitives netstandard
monotouch_SUBDIRS = $(common_DEPS_SUBDIRS) $(mobile_only_DEPS_SUBDIRS)
monotouch_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS)
monotouch_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS) System.Drawing.Common
monodroid_SUBDIRS = $(monotouch_SUBDIRS) $(netstandard_drawing_SUBDIRS)
monodroid_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
# We don't build netstandard/System.Drawing.Primitives on monotouch etc. profiles by default,
# except when EXTERNAL_FACADE_DRAWING_REFERENCE is defined which allows us to build it in Mono CI
@@ -51,7 +54,7 @@ endif
testing_aot_full_SUBDIRS = $(monotouch_SUBDIRS)
testing_aot_full_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
net_4_x_SUBDIRS = $(common_DEPS_SUBDIRS) $(netstandard_drawing_SUBDIRS)
net_4_x_SUBDIRS = $(common_DEPS_SUBDIRS) System.Drawing.Primitives netstandard
net_4_x_PARALLEL_SUBDIRS = $(common_SUBDIRS) System.Net.Http.Rtc
basic_PARALLEL_SUBDIRS = System.Runtime System.Reflection System.Collections System.Resources.ResourceManager System.Globalization \
@@ -64,9 +67,6 @@ System.Text.Encoding.CodePages
build_PARALLEL_SUBDIRS = $(basic_PARALLEL_SUBDIRS) System.Text.RegularExpressions System.Diagnostics.Contracts
monodroid_SUBDIRS = $(monotouch_SUBDIRS)
monodroid_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
xammac_SUBDIRS = $(monotouch_SUBDIRS)
xammac_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
@@ -80,19 +80,19 @@ monotouch_tv_SUBDIRS = $(monotouch_SUBDIRS)
monotouch_tv_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
winaot_SUBDIRS = $(common_DEPS_SUBDIRS) $(netstandard_drawing_SUBDIRS)
winaot_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS)
winaot_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS) System.Drawing.Common
orbis_SUBDIRS = $(common_DEPS_SUBDIRS) $(netstandard_drawing_SUBDIRS)
orbis_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS)
orbis_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS) System.Drawing.Common
unreal_SUBDIRS = $(common_DEPS_SUBDIRS) $(netstandard_drawing_SUBDIRS)
unreal_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS)
unreal_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS) System.Drawing.Common
wasm_SUBDIRS = $(common_DEPS_SUBDIRS) $(netstandard_drawing_SUBDIRS)
wasm_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS)
wasm_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS) System.Drawing.Common
mobile_only_SUBDIRS = System.Security.Cryptography.Pkcs System.Security.Cryptography.OpenSsl System.Threading.Tasks.Extensions \
System.Security.Cryptography.Cng System.Runtime.Loader System.Xml.XPath.XmlDocument System.Reflection.DispatchProxy System.Memory \
System.Drawing.Common System.Buffers
System.Buffers
PROFILE_PARALLEL_SUBDIRS = $(net_4_x_PARALLEL_SUBDIRS)
+7 -2
View File
@@ -31,6 +31,9 @@ basic_SUBDIRS := \
../ilasm \
corlib/il
# Tooling dependencies of mscorlib, we build them to /tmp folder for MONO_PATH to work
# reliably for clean and update builds. All deps are built against stable API to run with
# range of boostrap versions and .NET at the same time
build_SUBDIRS = \
Mono.Cecil \
$(MCS_MODE_dirs) \
@@ -114,7 +117,8 @@ testing_aot_hybrid_dirs_parallel := $(testing_aot_full_dirs_parallel)
xammac_dirs_parallel := \
$(mobile_common_dirs_parallel) \
Mono.CompilerServices.SymbolWriter
Mono.CompilerServices.SymbolWriter \
Mono.CSharp
monodroid_dirs_parallel := \
$(mobile_common_dirs_parallel) \
@@ -131,7 +135,8 @@ monodroid_tools_dirs_parallel := \
monotouch_dirs_parallel := \
$(mobile_common_dirs_parallel) \
Mono.Simd \
Mono.CSharp
Mono.CSharp \
Mono.Runtime.Tests
monotouch_watch_dirs_parallel := $(filter-out Mono.Security Mono.Data.Tds,$(monotouch_dirs_parallel))
+5 -10
View File
@@ -12,12 +12,7 @@ KEYFILE = ../msfinal.pub
LIB_MCS_FLAGS =
TEST_RESOURCE_FILES = \
$(wildcard Test/resources/*.csproj) \
Test/resources/TestTasks.dll
ifndef MCS_MODE
TEST_RESOURCE_FILES += Test/resources/TestTasks.pdb
endif
$(wildcard Test/resources/*.csproj)
TEST_MCS_FLAGS = $(foreach r, $(TEST_RESOURCE_FILES), -resource:$(r),$(r))
TEST_LIB_REFS = $(XBUILD_FRAMEWORK) $(XBUILD_UTILITIES) $(PARENT_PROFILE)System.Xml
@@ -32,13 +27,13 @@ CLEAN_FILES = Test/resources/TestTasks-$(PROFILE).dll Test/resources/TestTasks-$
Test/resources/TestTasks-$(PROFILE).dll: Test/resources/TestTasks.cs
$(CSCOMPILE) /out:$@ Test/resources/TestTasks.cs /r:$(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)/mscorlib.dll /r:$(topdir)/class/lib/$(PROFILE)/$(XBUILD_FRAMEWORK).dll /r:$(topdir)/class/lib/$(PROFILE)/$(XBUILD_UTILITIES).dll /target:library
test-local: compile-resources
TEST_MCS_FLAGS += -resource:Test/resources/TestTasks-$(PROFILE).dll,Test/resources/TestTasks.dll
compile-resources: Test/resources/TestTasks-$(PROFILE).dll
cp Test/resources/TestTasks-$(PROFILE).dll Test/resources/TestTasks.dll
ifndef MCS_MODE
cp Test/resources/TestTasks-$(PROFILE).pdb Test/resources/TestTasks.pdb
TEST_MCS_FLAGS += -resource:Test/resources/TestTasks-$(PROFILE).pdb,Test/resources/TestTasks.pdb
endif
test-local: Test/resources/TestTasks-$(PROFILE).dll
include $(XBUILD_DIR)/xbuild_test.make
include ../../build/library.make
@@ -0,0 +1 @@
../../../external/corefx/src/Microsoft.CSharp/tests/AccessTests.netcoreapp.cs
@@ -0,0 +1 @@
#include monotouch_Microsoft.CSharp_xtest.dll.exclude.sources
@@ -0,0 +1 @@
#include monotouch_Microsoft.CSharp_xtest.dll.exclude.sources
@@ -0,0 +1 @@
../../../external/corefx/src/Microsoft.CSharp/tests/AccessTests.netcoreapp.cs
+8
View File
@@ -75,6 +75,11 @@
<IntermediateOutputPath>./../../class/obj/$(AssemblyName)-testing_aot_full</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;DISABLE_REMOTING;DISABLE_COM;IOS_REFLECTION;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_PROCESS_START</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'xammac' ">
<OutputPath>./../../class/lib/xammac</OutputPath>
<IntermediateOutputPath>./../../class/obj/$(AssemblyName)-xammac</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_DYNAMIC;XAMMAC;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;XAMARIN_MODERN;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_PROCESS_START</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'xammac_net_4_5' ">
<OutputPath>./../../class/lib/xammac_net_4_5</OutputPath>
<IntermediateOutputPath>./../../class/obj/$(AssemblyName)-xammac_net_4_5</IntermediateOutputPath>
@@ -123,6 +128,9 @@
<ItemGroup Condition=" '$(Platform)' == 'testing_aot_full' ">
<Compile Include="testing_aot_full-parser.cs" />
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'xammac' ">
<Compile Include="xammac-parser.cs" />
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'xammac_net_4_5' ">
<Compile Include="xammac_net_4_5-parser.cs" />
</ItemGroup>
+1
View File
@@ -10,6 +10,7 @@ API_BUILD := $(filter basic build, $(PROFILE))
ifdef API_BUILD
DEFAULT_REFERENCES =
API_BIN_REFS = System mscorlib
LIBRARY_USE_INTERMEDIATE_FILE = 1
else
LIB_REFS = System
endif
+1
View File
@@ -10,6 +10,7 @@ API_BUILD := $(filter basic build, $(PROFILE))
ifdef API_BUILD
DEFAULT_REFERENCES =
API_BIN_REFS = System.Core System mscorlib
LIBRARY_USE_INTERMEDIATE_FILE = 1
else
LIB_REFS = System.Core System
endif
+1
View File
@@ -180,6 +180,7 @@
<Compile Include="..\..\..\external\cecil\Mono.Security.Cryptography\CryptoService.cs" />
<Compile Include="..\..\..\external\cecil\Mono\Disposable.cs" />
<Compile Include="..\..\..\external\cecil\Mono\Empty.cs" />
<Compile Include="..\..\..\external\cecil\Mono\MergeSort.cs" />
<Compile Include="..\..\..\external\cecil\Mono\Type.cs" />
<Compile Include="..\..\..\external\cecil\ProjectInfo.cs" />
<Compile Include="Consts.cs" />
+6 -5
View File
@@ -15,10 +15,13 @@ KEYFILE = ../mono.pub
LIB_MCS_FLAGS = /unsafe \
$(RESOURCES:%=-resource:%) -d:SQLITE_STANDARD
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) /nowarn:618
TEST_RESOURCE_FILES = Test/test.db
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) /nowarn:618 $(foreach r, $(TEST_RESOURCE_FILES), -resource:$(r),$(r))
EXTRA_DISTFILES = Test/SqliteTest.cs \
Test/test.sql \
$(TEST_RESOURCE_FILES) \
resources/SR.resx \
resources/DataTypes.xml \
resources/MetaDataCollections.xml \
@@ -29,11 +32,9 @@ CLEAN_FILES += $(RESX_RESOURCES)
CLEAN_FILES = $(RESX_RESOURCES)
test-local: test.db
test.db: Test/test.sql
Test/test.db: Test/test.sql
rm -f $@
sqlite3 $@ < $< || :
sqlite3 $@ < $<
include ../../build/library.make
@@ -1,3 +1,4 @@
../../test-helpers/TestResourceHelper.cs
SqliteCommandUnitTests.cs
SqliteConnectionTest.cs
SqliteDataAdapterUnitTests.cs
@@ -37,12 +37,14 @@ using Mono.Data.Sqlite;
using NUnit.Framework;
using MonoTests.Helpers;
namespace MonoTests.Mono.Data.Sqlite
{
[TestFixture]
public class SqliteDataReaderTest
{
readonly static string _uri = "./test.db";
readonly static string _uri = TestResourceHelper.GetFullPathOfResource("Test/test.db");
readonly static string _connectionString = "URI=file://" + _uri + ", version=3";
SqliteConnection _conn = new SqliteConnection ();
Binary file not shown.
@@ -1 +0,0 @@
#include Mono.Data.Sqlite_test.dll.sources
@@ -0,0 +1,3 @@
Bug27864.cs
SqliteDataReaderTest.cs
SqliteTests.cs
@@ -0,0 +1 @@
#include monotouch_Mono.Data.Sqlite_test.dll.exclude.sources
@@ -0,0 +1 @@
#include monotouch_Mono.Data.Sqlite_test.dll.exclude.sources
+17 -13
View File
@@ -8,18 +8,13 @@ LIB_REFS = System Mono.Cecil System.Core
LIB_MCS_FLAGS = /unsafe -D:MONO_DATACONVERTER_STATIC_METHODS /publicsign
KEYFILE = $(LIBRARY_SNK)
TEST_MCS_FLAGS =
TEST_LIB_REFS = Mono.Cecil System System.Core
VALID_TEST_PROFILE := $(filter net_4_x, $(PROFILE))
# The test exe is not profile specific, and compiling a 2.0 will make the 4.5 tests fail
ifdef VALID_TEST_PROFILE
test-local: dtest-app.exe dtest-excfilter.exe
dtest-excfilter.exe: Test/dtest-excfilter.il
$(ILASM) -out:$@ /exe /debug Test/dtest-excfilter.il
test-local: build-dtest
else
@@ -28,20 +23,29 @@ check:
endif
test_output_dir=$(topdir)/class/lib/$(PROFILE)/tests
$(test_output_dir):
mkdir -p $@
build-dtest: $(test_output_dir)/dtest-app.exe $(test_output_dir)/dtest-excfilter.exe
$(test_output_dir)/dtest-excfilter.exe: Test/dtest-excfilter.il | $(test_output_dir)
$(ILASM) -out:$@ /exe /debug Test/dtest-excfilter.il
$(test_output_dir)/dtest-app.exe: Test/dtest-app.cs $(TEST_HELPERS_SOURCES) | $(test_output_dir)
$(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll -r:$(topdir)/class/lib/$(PROFILE)/System.Core.dll -r:$(topdir)/class/lib/$(PROFILE)/System.dll -out:$@ -unsafe $(PLATFORM_DEBUG_FLAGS) -optimize- Test/dtest-app.cs $(TEST_HELPERS_SOURCES)
TEST_HELPERS_SOURCES = \
../test-helpers/NetworkHelpers.cs \
Test/TypeLoadClass.cs
dtest-app.exe: Test/dtest-app.cs $(TEST_HELPERS_SOURCES)
$(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll -r:$(topdir)/class/lib/$(PROFILE)/System.Core.dll -r:$(topdir)/class/lib/$(PROFILE)/System.dll -out:$@ -unsafe $(PLATFORM_DEBUG_FLAGS) -optimize- Test/dtest-app.cs $(TEST_HELPERS_SOURCES)
CLEAN_FILES = dtest-app.exe dtest-app.exe.mdb dtest-app.pdb dtest-excfilter.exe dtest-excfilter.exe.mdb dtest-excfilter.pdb
EXTRA_DISTFILES = \
Test/dtest-app.cs \
Test/dtest.cs \
Test/dtest-excfilter.il
Test/dtest-excfilter.il \
$(TEST_HELPERS_SOURCES)
#NO_TEST = yes
CLEAN_FILES = $(addprefix $(test_output_dir)/, dtest-app.exe dtest-app.exe.mdb dtest-app.pdb dtest-excfilter.exe dtest-excfilter.exe.mdb dtest-excfilter.pdb)
include ../../build/library.make
@@ -85,6 +85,31 @@ public class Tests2 {
}
}
public struct TestEnumeratorInsideGenericStruct<TKey, TValue>
{
private KeyValuePair<TKey, TValue> _bucket;
private Position _currentPosition;
internal TestEnumeratorInsideGenericStruct(KeyValuePair<TKey, TValue> bucket)
{
_bucket = bucket;
_currentPosition = Position.BeforeFirst;
}
public KeyValuePair<TKey, TValue> Current
{
get
{
if (_currentPosition == Position.BeforeFirst)
return _bucket;
return _bucket;
}
}
private enum Position
{
BeforeFirst
}
}
public struct AStruct : ITest2 {
public int i;
public string s;
@@ -385,9 +410,26 @@ public class Tests : TestsBase, ITest2
new Tests ().invoke_abort ();
new Tests ().evaluate_method ();
Bug59649 ();
inspect_enumerator_in_generic_struct();
if_property_stepping();
return 3;
}
private class TestClass {
private string oneLineProperty = "";
public string OneLineProperty {
get { return oneLineProperty; }
set { oneLineProperty = value; }
}
}
public static void if_property_stepping() {
var test = new TestClass();
if (test.OneLineProperty == "someInvalidValue6049e709-7271-41a1-bc0a-f1f1b80d4125")
return;
Console.Write("");
}
public static void local_reflect () {
//Breakpoint line below, and reflect someField via ObjectMirror;
LocalReflectClass.RunMe ();
@@ -466,6 +508,8 @@ public class Tests : TestsBase, ITest2
ss_fp_clobber ();
ss_no_frames ();
ss_await ();
ss_nested_with_three_args_wrapper();
ss_nested_twice_with_two_args_wrapper();
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
@@ -577,16 +621,53 @@ public class Tests : TestsBase, ITest2
ss_nested_with_two_args(ss_nested_arg (), ss_nested_arg ());
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void ss_nested_with_three_args_wrapper () {
ss_nested_with_three_args(ss_nested_arg1 (), ss_nested_arg2 (), ss_nested_arg3 ());
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void ss_nested_twice_with_two_args_wrapper () {
ss_nested_with_two_args(ss_nested_arg1 (), ss_nested_with_two_args(ss_nested_arg2 (), ss_nested_arg3 ()));
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void inspect_enumerator_in_generic_struct() {
TestEnumeratorInsideGenericStruct<String, String> generic_struct = new TestEnumeratorInsideGenericStruct<String, String>(new KeyValuePair<string, string>("0", "f1"));
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static int ss_nested_with_two_args (int a1, int a2) {
return a1 + a2;
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static int ss_nested_with_three_args (int a1, int a2, int a3) {
return a1 + a2 + a3;
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static int ss_nested_arg () {
return 0;
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static int ss_nested_arg1 () {
return 0;
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static int ss_nested_arg2 () {
return 0;
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static int ss_nested_arg3 () {
return 0;
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void ss_nested_1 (int i) {
}
@@ -1813,6 +1894,12 @@ public class Tests : TestsBase, ITest2
public static ref string get_ref_string() {
return ref ref_return_string;
}
static BlittableStruct ref_return_struct = new BlittableStruct () { i = 1, d = 2.0 };
public static ref BlittableStruct get_ref_struct() {
return ref ref_return_struct;
}
}
public class SentinelClass : MarshalByRefObject {
+153 -22
View File
@@ -47,6 +47,15 @@ public class DebuggerTests
public static string runtime = Environment.GetEnvironmentVariable ("DBG_RUNTIME");
public static string runtime_args = Environment.GetEnvironmentVariable ("DBG_RUNTIME_ARGS");
public static string agent_args = Environment.GetEnvironmentVariable ("DBG_AGENT_ARGS");
#if MONODROID_TEST
// AssemblyInfo.Location doesn't work on Android, we expect test .exe's to be in the working dir
public static string this_assembly_path = "";
#else
// expect test .exe's to be next to this assembly
public static string this_assembly_path = Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location);
#endif
public static string dtest_app_path = Path.Combine (this_assembly_path, "dtest-app.exe");
// Not currently used, but can be useful when debugging individual tests.
void StackTraceDump (Event e)
@@ -74,16 +83,16 @@ public class DebuggerTests
if (runtime != null) {
pi.FileName = runtime;
} else if (Path.DirectorySeparatorChar == '\\') {
} else {
string processExe = Diag.Process.GetCurrentProcess ().MainModule.FileName;
if (processExe != null) {
string fileName = Path.GetFileName (processExe);
if (fileName.StartsWith ("mono") && fileName.EndsWith (".exe"))
if (fileName.StartsWith ("mono"))
pi.FileName = processExe;
}
}
if (string.IsNullOrEmpty (pi.FileName))
pi.FileName = "mono";
throw new ArgumentException ("Couldn't find mono runtime.");
pi.Arguments = String.Join (" ", args);
if (runtime_args != null)
pi.Arguments = runtime_args + " " + pi.Arguments;
@@ -362,7 +371,7 @@ public class DebuggerTests
[SetUp]
public void SetUp () {
ThreadMirror.NativeTransitions = false;
Start (new string [] { "dtest-app.exe" });
Start (new string [] { dtest_app_path });
}
[TearDown]
@@ -494,7 +503,7 @@ public class DebuggerTests
public void IsDynamicAssembly () {
vm.Detach ();
Start (new string[] {"dtest-app.exe", "ref-emit-test"});
Start (new string[] { dtest_app_path, "ref-emit-test"});
run_until ("ref_emit_call");
var assemblyMirrors = entry_point.DeclaringType.Assembly.Domain.GetAssemblies ();
@@ -672,7 +681,7 @@ public class DebuggerTests
public void ClassLocalReflection () {
vm.Detach ();
Start (new string [] { "dtest-app.exe", "local-reflect" });
Start (new string [] { dtest_app_path, "local-reflect" });
MethodMirror m = entry_point.DeclaringType.Assembly.GetType ("LocalReflectClass").GetMethod ("RunMe");
@@ -2573,7 +2582,7 @@ public class DebuggerTests
public void Suspend () {
vm.Detach ();
Start (new string [] { "dtest-app.exe", "suspend-test" });
Start (new string [] { dtest_app_path, "suspend-test" });
Event e = run_until ("suspend");
@@ -3052,7 +3061,7 @@ public class DebuggerTests
public void InvokeSingleThreaded () {
vm.Detach ();
Start (new string [] { "dtest-app.exe", "invoke-single-threaded" });
Start (new string [] { dtest_app_path, "invoke-single-threaded" });
Event e = run_until ("invoke_single_threaded_2");
@@ -3133,7 +3142,7 @@ public class DebuggerTests
public void InvokeAbort () {
vm.Detach ();
Start (new string [] { "dtest-app.exe", "invoke-abort" });
Start (new string [] { dtest_app_path, "invoke-abort" });
Event e = run_until ("invoke_abort");
@@ -3466,7 +3475,7 @@ public class DebuggerTests
public void ExceptionFilter2 () {
vm.Detach ();
Start (new string [] { "dtest-excfilter.exe" });
Start (new string [] { Path.Combine (this_assembly_path, "dtest-excfilter.exe") });
MethodMirror filter_method = entry_point.DeclaringType.GetMethod ("Filter");
Assert.IsNotNull (filter_method);
@@ -3566,7 +3575,7 @@ public class DebuggerTests
public void MemberInOtherDomain () {
vm.Detach ();
Start (new string [] { "dtest-app.exe", "domain-test" });
Start (new string [] { dtest_app_path, "domain-test" });
vm.EnableEvents (EventType.AppDomainCreate, EventType.AppDomainUnload, EventType.AssemblyUnload);
@@ -3582,7 +3591,7 @@ public class DebuggerTests
public void Domains () {
vm.Detach ();
Start (new string [] { "dtest-app.exe", "domain-test" });
Start (new string [] { dtest_app_path, "domain-test" });
vm.EnableEvents (EventType.AppDomainCreate, EventType.AppDomainUnload, EventType.AssemblyUnload);
@@ -3705,7 +3714,7 @@ public class DebuggerTests
public void RefEmit () {
vm.Detach ();
Start (new string [] { "dtest-app.exe", "ref-emit-test" });
Start (new string [] { dtest_app_path, "ref-emit-test" });
Event e = run_until ("ref_emit_call");
@@ -3741,7 +3750,7 @@ public class DebuggerTests
// Check that stack traces can be produced for threads in native code
vm.Detach ();
Start (new string [] { "dtest-app.exe", "frames-in-native" });
Start (new string [] { dtest_app_path, "frames-in-native" });
var e = run_until ("frames_in_native");
@@ -4115,7 +4124,7 @@ public class DebuggerTests
public void UnhandledException () {
vm.Exit (0);
Start (new string [] { "dtest-app.exe", "unhandled-exception" });
Start (new string [] { dtest_app_path, "unhandled-exception" });
var req = vm.CreateExceptionRequest (null, false, true);
req.Enable ();
@@ -4134,7 +4143,7 @@ public class DebuggerTests
public void UnhandledException_2 () {
vm.Exit (0);
Start (new string [] { "dtest-app.exe", "unhandled-exception-endinvoke" });
Start (new string [] { dtest_app_path, "unhandled-exception-endinvoke" });
var req = vm.CreateExceptionRequest (null, false, true);
req.Enable ();
@@ -4158,7 +4167,7 @@ public class DebuggerTests
vm.Detach ();
// Exceptions caught in non-user code are treated as unhandled
Start (new string [] { "dtest-app.exe", "unhandled-exception-user" });
Start (new string [] { dtest_app_path, "unhandled-exception-user" });
var req = vm.CreateExceptionRequest (null, false, true);
req.AssemblyFilter = new List<AssemblyMirror> () { entry_point.DeclaringType.Assembly };
@@ -4229,7 +4238,7 @@ public class DebuggerTests
[Test]
public void InspectThreadSuspenedOnWaitOne () {
TearDown ();
Start (true, "dtest-app.exe", "wait-one" );
Start (true, dtest_app_path, "wait-one" );
ThreadMirror.NativeTransitions = true;
@@ -4401,7 +4410,7 @@ public class DebuggerTests
[Test]
public void ThreadpoolIOsinglestep () {
TearDown ();
Start ("dtest-app.exe", "threadpool-io");
Start (dtest_app_path, "threadpool-io");
// This is a regression test for #42625. It tests the
// interaction (particularly in coop GC) of the
// threadpool I/O mechanism and the soft debugger.
@@ -4418,7 +4427,7 @@ public class DebuggerTests
[Category("NotWorking")] // flaky, see https://github.com/mono/mono/issues/6997
public void StepOutAsync () {
vm.Detach ();
Start (new string [] { "dtest-app.exe", "step-out-void-async" });
Start (new string [] { dtest_app_path, "step-out-void-async" });
var e = run_until ("step_out_void_async_2");
create_step (e);
var e2 = step_out ();
@@ -4435,7 +4444,83 @@ public class DebuggerTests
}
[Test]
[Category("NotWorking")]
public void StepOverOnExitFromArgsAfterStepInMethodParameter2() {
Event e = run_until ("ss_nested_with_three_args_wrapper");
var req = create_step(e);
req.Enable();
e = step_once();
assert_location(e, "ss_nested_with_three_args_wrapper");
e = step_into();
assert_location(e, "ss_nested_arg1");
e = step_over();
assert_location(e, "ss_nested_arg1");
e = step_over();
assert_location(e, "ss_nested_arg1");
e = step_over();
assert_location(e, "ss_nested_with_three_args_wrapper");
e = step_into();
assert_location(e, "ss_nested_arg2");
e = step_over();
assert_location(e, "ss_nested_arg2");
e = step_over();
assert_location(e, "ss_nested_arg2");
e = step_over();
assert_location(e, "ss_nested_with_three_args_wrapper");
e = step_into();
assert_location(e, "ss_nested_arg3");
}
[Test]
public void StepOverOnExitFromArgsAfterStepInMethodParameter3() {
Event e = run_until ("ss_nested_twice_with_two_args_wrapper");
var req = create_step(e);
req.Enable();
e = step_once();
assert_location(e, "ss_nested_twice_with_two_args_wrapper");
e = step_into();
assert_location(e, "ss_nested_arg1");
e = step_over();
assert_location(e, "ss_nested_arg1");
e = step_over();
assert_location(e, "ss_nested_arg1");
e = step_over();
assert_location(e, "ss_nested_twice_with_two_args_wrapper");
e = step_into();
assert_location(e, "ss_nested_arg2");
e = step_over();
assert_location(e, "ss_nested_arg2");
e = step_over();
assert_location(e, "ss_nested_arg2");
e = step_over();
assert_location(e, "ss_nested_twice_with_two_args_wrapper");
e = step_into();
assert_location(e, "ss_nested_arg3");
}
[Test]
public void ShouldCorrectlyStepOverOnExitFromArgsAfterStepInMethodParameter() {
Event e = run_until ("ss_nested_with_two_args_wrapper");
@@ -4461,6 +4546,25 @@ public class DebuggerTests
assert_location(e, "ss_nested_arg");
}
[Test]
public void InspectEnumeratorInGenericStruct() {
//files.myBucket.GetEnumerator().get_Current().Key watching this generates an exception in Debugger
Event e = run_until("inspect_enumerator_in_generic_struct");
var req = create_step(e);
req.Enable();
e = step_once();
e = step_over();
StackFrame frame = e.Thread.GetFrames () [0];
var ginst = frame.Method.GetLocal ("generic_struct");
Value variable = frame.GetValue (ginst);
StructMirror thisObj = (StructMirror)variable;
TypeMirror thisType = thisObj.Type;
variable = thisObj.InvokeMethod(e.Thread, thisType.GetMethod("get_Current"), null);
thisObj = (StructMirror)variable;
thisType = thisObj.Type;
AssertValue ("f1", thisObj["value"]);
}
[Test]
// Uses a fixed port
[Category("NotWorking")]
@@ -4468,7 +4572,7 @@ public class DebuggerTests
vm.Exit (0);
// Launch the app using server=y,suspend=n
var pi = CreateStartInfo (new string[] { "--debugger-agent=transport=dt_socket,address=127.0.0.1:10000,server=y,suspend=n", "dtest-app.exe", "attach" });
var pi = CreateStartInfo (new string[] { "--debugger-agent=transport=dt_socket,address=127.0.0.1:10000,server=y,suspend=n", dtest_app_path, "attach" });
var process = Diag.Process.Start (pi);
// Wait for the app to reach the Sleep () in attach ().
@@ -4621,6 +4725,33 @@ public class DebuggerTests
m = t.GetMethod ("get_ref_string");
v = t.InvokeMethod (e.Thread, m, null);
AssertValue ("byref", v);
m = t.GetMethod ("get_ref_struct");
v = t.InvokeMethod (e.Thread, m, null);
Assert.IsTrue(v is StructMirror);
var mirror = (StructMirror)v;
AssertValue (1, mirror["i"]);
AssertValue (2.0, mirror["d"]);
}
[Test]
public void IfPropertyStepping () {
Event e = run_until ("if_property_stepping");
var req = create_step (e);
req.Enable ();
e = step_once ();
e = step_over ();
e = step_into ();
e = step_into ();
e = step_into ();
e = step_into ();
e = step_into ();
e = step_into ();
e = step_into ();
e = step_into ();
e = step_into ();
Assert.IsTrue ((e as StepEvent).Method.Name == "op_Equality" || (e as StepEvent).Method.Name == "if_property_stepping");
}
} // class DebuggerTests
} // namespace
+6 -5
View File
@@ -11,17 +11,18 @@ LIB_MCS_FLAGS = /unsafe /publicsign /nowarn:0618
XTEST_LIB_REFS = System System.Core Facades/System.Threading.Tasks
xunit-test-local: log-profiler-test.exe
xunit-test-local: $(topdir)/class/lib/$(PROFILE_DIRECTORY)/tests/log-profiler-test.exe
log-profiler-test.exe: Test/log-profiler-test.cs
$(topdir)/class/lib/$(PROFILE_DIRECTORY)/tests/log-profiler-test.exe: Test/log-profiler-test.cs
mkdir -p $(dir $@)
$(CSCOMPILE) $(PLATFORM_DEBUG_FLAGS) /unsafe $(if $(MCS_MODE),,/warnaserror) /r:$(build_libdir)/mscorlib.dll /r:$(build_lib) /out:$@ $<
EXTRA_DISTFILES = \
Test/log-profiler-test.cs
CLEAN_FILES = \
log-profiler-test.exe \
log-profiler-test.exe.mdb \
log-profiler-test.pdb
$(topdir)/class/lib/$(PROFILE_DIRECTORY)/tests/log-profiler-test.exe \
$(topdir)/class/lib/$(PROFILE_DIRECTORY)/tests/log-profiler-test.exe.mdb \
$(topdir)/class/lib/$(PROFILE_DIRECTORY)/tests/log-profiler-test.pdb
include ../../build/library.make
@@ -37,8 +37,13 @@ namespace MonoTests.Mono.Profiler.Log {
static volatile int _id;
static string _testAssemblyPath;
static Process _currentProcess;
public ProfilerTestRun (string name, string options)
{
_testAssemblyPath = Path.Combine (Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly ().Location), "log-profiler-test.exe");
_currentProcess = Process.GetCurrentProcess();
Name = name;
Options = options;
_output = $"test-{_id++}.mlpd";
@@ -57,8 +62,8 @@ namespace MonoTests.Mono.Profiler.Log {
using (var proc = new Process ()) {
proc.StartInfo = new ProcessStartInfo {
UseShellExecute = false,
FileName = Path.GetFullPath (Path.Combine ("..", "..", "..", "runtime", "mono-wrapper")),
Arguments = $"--debug --profile=log:nodefaults,output={_output},{Options} log-profiler-test.exe {Name}",
FileName = _currentProcess.MainModule.FileName,
Arguments = $"--debug --profile=log:nodefaults,output=\"{_output}\",{Options} {_testAssemblyPath} {Name}",
};
proc.Start ();
@@ -0,0 +1,11 @@
../../../external/corefx/src/System.ComponentModel.Composition/tests/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AttributedModel/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Diagnostics/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Factories/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Primitives/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ReflectionModel/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/Integration/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/UnitTesting/*.cs
@@ -0,0 +1,9 @@
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AttributedModel/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Diagnostics/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Factories/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Primitives/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ReflectionModel/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/Integration/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/UnitTesting/*.cs
@@ -0,0 +1 @@
#include monotouch_System.ComponentModel.Composition_xtest.dll.exclude.sources
@@ -0,0 +1 @@
#include monotouch_System.ComponentModel.Composition_xtest.dll.exclude.sources
@@ -110,14 +110,6 @@ namespace System.ComponentModel.Composition.ReflectionModel
{
Requires.NotNull(importDefinition, "importDefinition");
ReflectionImportDefinition reflectionImportDefinition = importDefinition as ReflectionImportDefinition;
if (reflectionImportDefinition == null)
{
throw new ArgumentException(
string.Format(CultureInfo.CurrentCulture, Strings.ReflectionModel_InvalidImportDefinition, importDefinition.GetType()),
"importDefinition");
}
return (importDefinition is IPartCreatorImportDefinition);
}
@@ -0,0 +1,9 @@
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AttributedModel/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Diagnostics/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Factories/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Primitives/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ReflectionModel/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/Integration/*.cs
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/UnitTesting/*.cs
+3 -6
View File
@@ -916,7 +916,6 @@
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.Fcntl.Pipe.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.Fcntl.SetCloseOnExec.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.GetDomainSocketSizes.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.GetEUid.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.GetHostName.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.GetPeerID.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.GetPeerUserName.cs" />
@@ -927,7 +926,6 @@
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.Pipe.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.Poll.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.Read.Pipe.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.SetEUid.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.Stat.Pipe.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.Stat.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.Unlink.cs" />
@@ -982,6 +980,7 @@
<Compile Include="System.Security.Cryptography\SHA256Cng.cs" />
<Compile Include="System.Security.Cryptography\SHA384Cng.cs" />
<Compile Include="System.Security.Cryptography\SHA512Cng.cs" />
<Compile Include="corefx\Interop.cs" />
</ItemGroup>
</When>
<When Condition="'$(HostPlatform)' == 'macos'">
@@ -994,7 +993,6 @@
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.Fcntl.Pipe.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.Fcntl.SetCloseOnExec.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.GetDomainSocketSizes.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.GetEUid.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.GetHostName.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.GetPeerID.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.GetPeerUserName.cs" />
@@ -1005,7 +1003,6 @@
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.Pipe.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.Poll.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.Read.Pipe.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.SetEUid.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.Stat.Pipe.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.Stat.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.Unlink.cs" />
@@ -1060,6 +1057,7 @@
<Compile Include="System.Security.Cryptography\SHA256Cng.cs" />
<Compile Include="System.Security.Cryptography\SHA384Cng.cs" />
<Compile Include="System.Security.Cryptography\SHA512Cng.cs" />
<Compile Include="corefx\Interop.cs" />
</ItemGroup>
</When>
<When Condition="'$(HostPlatform)' == 'linux'">
@@ -1072,7 +1070,6 @@
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.Fcntl.Pipe.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.Fcntl.SetCloseOnExec.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.GetDomainSocketSizes.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.GetEUid.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.GetHostName.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.GetPeerID.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.GetPeerUserName.cs" />
@@ -1083,7 +1080,6 @@
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.Pipe.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.Poll.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.Read.Pipe.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.SetEUid.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.Stat.Pipe.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.Stat.cs" />
<Compile Include="..\..\..\external\corefx\src\Common\src\Interop\Unix\System.Native\Interop.Unlink.cs" />
@@ -1138,6 +1134,7 @@
<Compile Include="System.Security.Cryptography\SHA256Cng.cs" />
<Compile Include="System.Security.Cryptography\SHA384Cng.cs" />
<Compile Include="System.Security.Cryptography\SHA512Cng.cs" />
<Compile Include="corefx\Interop.cs" />
</ItemGroup>
</When>
</Choose>
@@ -393,7 +393,7 @@ namespace MonoTests.System.IO.MemoryMappedFiles {
[Test]
public void CreateViewStreamAlignToPageSize ()
{
#if __WATCHOS__
#if MONOTOUCH_WATCH
int pageSize = 4096;
#elif MONOTOUCH
// iOS bugs on ARM64 - bnc #27667 - apple #
+18
View File
@@ -0,0 +1,18 @@
using System;
internal static partial class Interop
{
internal static partial class Sys
{
internal static uint GetEUid ()
{
throw new PlatformNotSupportedException ();
}
internal static int SetEUid (uint euid)
{
throw new PlatformNotSupportedException ();
}
}
}
@@ -0,0 +1 @@
../../../external/corefx/src/System.Linq.Expressions/tests/Dynamic/InvokeMemberBindingTests.cs
@@ -0,0 +1 @@
#include monotouch_System.Core_xtest.dll.exclude.sources
@@ -0,0 +1 @@
#include monotouch_System.Core_xtest.dll.exclude.sources
@@ -35,5 +35,8 @@ System.IO.Pipes/AnonymousPipeServerStream.Unix.cs
../../../external/corefx/src/Common/src/Interop/Unix/System.Native/Interop.Stat.cs
../../../external/corefx/src/Common/src/Interop/Unix/System.Native/Interop.Stat.Pipe.cs
../../../external/corefx/src/Common/src/Interop/Unix/System.Native/Interop.GetPeerID.cs
../../../external/corefx/src/Common/src/Interop/Unix/System.Native/Interop.GetEUid.cs
../../../external/corefx/src/Common/src/Interop/Unix/System.Native/Interop.SetEUid.cs
# FIXME: the native side is not there yet.
# ../../../external/corefx/src/Common/src/Interop/Unix/System.Native/Interop.GetEUid.cs
# ../../../external/corefx/src/Common/src/Interop/Unix/System.Native/Interop.SetEUid.cs
corefx/Interop.cs
@@ -0,0 +1 @@
../../../external/corefx/src/System.Linq.Expressions/tests/Dynamic/InvokeMemberBindingTests.cs
+2
View File
@@ -26,8 +26,10 @@ LIB_MCS_FLAGS += -d:MONO_FEATURE_APPLETLS
endif
ifdef ENABLE_GSS
ifndef NO_GSS
LIB_MCS_FLAGS += -d:ENABLE_GSS
endif
endif
ifndef PROFILE_DISABLE_BTLS
ifdef HAVE_BTLS
+2 -2
View File
@@ -44,12 +44,12 @@
<PropertyGroup Condition=" '$(Platform)' == 'monotouch_watch' ">
<OutputPath>./../../class/lib/monotouch_watch</OutputPath>
<IntermediateOutputPath>./../../class/obj/$(AssemblyName)-monotouch_watch</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME;FEATURE_NO_BSD_SOCKETS;MONOTOUCH_WATCH;COREFX;PLATFORM_UNIX;USEOFFSET;MONO_PARTIAL_DATA_IMPORT;NO_CODEDOM;NO_OLEDB;NO_ODBC;NO_CONFIGURATION;ENABLE_GSS</DefineConstants>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME;FEATURE_NO_BSD_SOCKETS;MONOTOUCH_WATCH;COREFX;PLATFORM_UNIX;USEOFFSET;MONO_PARTIAL_DATA_IMPORT;NO_CODEDOM;NO_OLEDB;NO_ODBC;NO_CONFIGURATION</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'monotouch_tv' ">
<OutputPath>./../../class/lib/monotouch_tv</OutputPath>
<IntermediateOutputPath>./../../class/obj/$(AssemblyName)-monotouch_tv</IntermediateOutputPath>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME;MONOTOUCH_TV;COREFX;PLATFORM_UNIX;USEOFFSET;MONO_PARTIAL_DATA_IMPORT;NO_CODEDOM;NO_OLEDB;NO_ODBC;NO_CONFIGURATION;MONO_FEATURE_APPLETLS;ENABLE_GSS</DefineConstants>
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME;MONOTOUCH_TV;COREFX;PLATFORM_UNIX;USEOFFSET;MONO_PARTIAL_DATA_IMPORT;NO_CODEDOM;NO_OLEDB;NO_ODBC;NO_CONFIGURATION;MONO_FEATURE_APPLETLS</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'testing_aot_hybrid' ">
<OutputPath>./../../class/lib/testing_aot_hybrid</OutputPath>
@@ -119,7 +119,6 @@
../../../external/corefx/src/System.Data.SqlClient/tests/Tools/TDS/TDS.EndPoint/SSPI/SecResult.cs
../../../external/corefx/src/System.Data.SqlClient/tests/Tools/TDS/TDS.EndPoint/SSPI/SecurityHandle.cs
../../../external/corefx/src/System.Data.SqlClient/tests/Tools/TDS/TDS.EndPoint/SSPI/SecurityInteger.cs
../../../external/corefx/src/System.Data.SqlClient/tests/Tools/TDS/TDS.EndPoint/SSPI/SecurityWrapper.cs
../../../external/corefx/src/System.Data.SqlClient/tests/Tools/TDS/TDS.EndPoint/SSPI/SSPIContext.Unix.cs
../../../external/corefx/src/System.Data.SqlClient/tests/Tools/TDS/TDS.EndPoint/SSPI/SSPIResponse.cs
+5 -1
View File
@@ -17,7 +17,11 @@ ifndef MOBILE_PROFILE
LIB_MCS_FLAGS += -d:FEATURE_TYPECONVERTER,SUPPORTS_WINDOWS_COLORS
endif
TEST_LIB_REFS = System.Drawing System.Runtime.Serialization.Formatters.Soap System.Xml
TEST_LIB_REFS = System.Drawing System.Xml
ifneq ($(PROFILE),wasm)
TEST_LIB_REFS += System.Runtime.Serialization.Formatters.Soap
endif
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -define:TEST -resource:Test/resources/indexed.png,indexed.png \
-nowarn:0618 -nowarn:219 -nowarn:169
@@ -0,0 +1,8 @@
System.Drawing/GDIPlusTest.cs
System.Drawing/TestBitmap.cs
System.Drawing/TestGraphics.cs
System.Drawing/TestIcon.cs
System.Drawing/TestIconConverter.cs
System.Drawing/TestImage.cs
System.Drawing/TestImageConverter.cs
System.Drawing/TestBitmap.cs
+54 -4
View File
@@ -57,13 +57,35 @@ namespace System.Net.Http
public HttpRequestMessage Request;
public CancellationTokenRegistration CancellationTokenRegistration;
public CFContentStream ContentStream;
public bool StreamCanBeDisposed;
public void Close ()
{
CancellationTokenRegistration.Dispose ();
if (ContentStream != null) {
ContentStream.Close ();
}
if (ContentStream != null) {
// The Close method of the CFContentStream blocks as you can see:
// public void Close ()
// {
// data_read_event.WaitOne (); // make sure there's no pending data
//
// data_mutex.WaitOne ();
// data = null;
// this.http_stream.ErrorEvent -= HandleErrorEvent;
// data_mutex.ReleaseMutex ();
//
// data_event.Set ();
// }
// This means. that when we want to ignore the data of the content, which happens
// in the first request of a redirect, if we want to close, ignoring the content
// we will have a deadlock.
// Dispose will clean all the data, without waiting for the read, which by design in the
// CFContentStream, blocks the thread. This happens ONLY after the first request that gets
// a redirect status code. All other cases should call close.
if (StreamCanBeDisposed)
ContentStream.Dispose ();
else
ContentStream.Close ();
}
}
}
@@ -173,6 +195,11 @@ namespace System.Net.Http
}
protected internal override async Task<HttpResponseMessage> SendAsync (HttpRequestMessage request, CancellationToken cancellationToken)
{
return await SendAsync (request, cancellationToken, true).ConfigureAwait (false);
}
internal async Task<HttpResponseMessage> SendAsync (HttpRequestMessage request, CancellationToken cancellationToken, bool isFirstRequest)
{
sentRequest = true;
@@ -194,7 +221,8 @@ namespace System.Net.Http
}
}
stream.ShouldAutoredirect = allowAutoRedirect;
if (!isFirstRequest && allowAutoRedirect)
stream.ShouldAutoredirect = allowAutoRedirect;
stream.HasBytesAvailableEvent += HandleHasBytesAvailableEvent;
stream.ErrorEvent += HandleErrorEvent;
stream.ClosedEvent += HandleClosedEvent;
@@ -234,9 +262,31 @@ namespace System.Net.Http
CloseStream (stream);
});
if (isFirstRequest) {
var initialRequest = await response.Task;
var status = initialRequest.StatusCode;
if (IsRedirect (status) && allowAutoRedirect) {
bucket.StreamCanBeDisposed = true;
// remove headers in a redirect for Authentication.
request.Headers.Authorization = null;
return await SendAsync (request, cancellationToken, false).ConfigureAwait (false);
}
return initialRequest;
}
return await response.Task;
}
// Decide if we redirect or not, similar to what is done in the managed handler
// https://github.com/mono/mono/blob/eca15996c7163f331c9f2cd0a17b63e8f92b1d55/mcs/class/referencesource/System/net/System/Net/HttpWebRequest.cs#L5681
static bool IsRedirect (HttpStatusCode status)
{
return status == HttpStatusCode.Ambiguous || // 300
status == HttpStatusCode.Moved || // 301
status == HttpStatusCode.Redirect || // 302
status == HttpStatusCode.RedirectMethod || // 303
status == HttpStatusCode.RedirectKeepVerb; // 307
}
void HandleErrorEvent (object sender, CFStream.StreamEventArgs e)
{
var stream = (CFHTTPStream)sender;
@@ -115,6 +115,8 @@ namespace System.Net.Http
if (disposing && !disposed) {
disposed = true;
//We don't use CancelPendingRequests() because we don't want to create new CancellationTokenSource
cts.Cancel ();
cts.Dispose ();
}
@@ -13,7 +13,17 @@ LIB_MCS_FLAGS = \
$(RESOURCE_FILES:%=/resource:%)
TXT_RESOURCE_STRINGS = ../referencesource/System.Runtime.Serialization/System.Runtime.Serialization.txt
XTEST_LIB_REFS = System System.Core System.Xml System.Xml.Linq System.Drawing Facades/System.Threading.Tasks
XTEST_LIB_REFS = System System.Core System.Xml System.Xml.Linq Facades/System.Threading.Tasks
ifneq ($(PROFILE),monodroid)
ifneq ($(PROFILE),monotouch)
ifneq ($(PROFILE),monotouch_tv)
ifneq ($(PROFILE),monotouch_watch)
XTEST_LIB_REFS += System.Drawing
endif
endif
endif
endif
ifneq (2.1, $(FRAMEWORK_VERSION))
LIB_REFS += System.Data System.Configuration SMDiagnostics
@@ -35,9 +45,10 @@ TEST_RESOURCE_FILES = \
# we need to write the test resource args into a response file to avoid
# hitting "argument list too long" errors because of too many files
TEST_RESOURCES_RESPONSE_FILE = $(depsdir)/$(test_lib).resources.response
TEST_RESOURCES_RESPONSE_FILE = $(depsdir)/$(LIBRARY)_test.resources.response
$(TEST_RESOURCES_RESPONSE_FILE): $(TEST_RESOURCE_FILES)
@echo Creating $@ ...
@echo $(foreach r, $(TEST_RESOURCE_FILES), -resource:$(r),$(r)) > $(TEST_RESOURCES_RESPONSE_FILE)
test-local: $(TEST_RESOURCES_RESPONSE_FILE)
@@ -0,0 +1 @@
../../../external/corefx/src/System.Runtime.Serialization.Xml/tests/SerializationTypes.RuntimeOnly.cs
@@ -0,0 +1 @@
../../../external/corefx/src/System.Runtime.Serialization.Xml/tests/SerializationTypes.RuntimeOnly.cs
@@ -0,0 +1 @@
#include monotouch_System.Runtime.Serialization_xtest.dll.exclude.sources
@@ -0,0 +1 @@
#include monotouch_System.Runtime.Serialization_xtest.dll.exclude.sources
@@ -0,0 +1 @@
../../../external/corefx/src/System.Runtime.Serialization.Xml/tests/SerializationTypes.RuntimeOnly.cs
@@ -0,0 +1 @@
#include monotouch_System.Security_test.dll.exclude.sources
@@ -0,0 +1 @@
#include monotouch_System.Security_test.dll.exclude.sources
@@ -0,0 +1 @@
System.Security.Permissions/DataProtectionPermissionAttributeTest.cs
@@ -41,7 +41,8 @@ namespace System.ServiceModel.Channels
{
HttpChannelFactory<IRequestChannel> source;
List<WebRequest> web_requests = new List<WebRequest> ();
object locker = new object();
List<WebRequest> web_requests = new List<WebRequest> (); //synced by locker
// Constructor
@@ -86,7 +87,12 @@ namespace System.ServiceModel.Channels
}
var web_request = (HttpWebRequest) HttpWebRequest.Create (destination);
web_requests.Add (web_request);
lock (locker)
{
web_requests.Add (web_request);
}
result.WebRequest = web_request;
web_request.Method = "POST";
web_request.ContentType = Encoder.ContentType;
@@ -350,9 +356,20 @@ namespace System.ServiceModel.Channels
protected override void OnAbort ()
{
foreach (var web_request in web_requests.ToArray ())
WebRequest[] current_web_requests;
lock (locker)
{
current_web_requests = web_requests.ToArray();
}
foreach (var web_request in current_web_requests)
web_request.Abort ();
web_requests.Clear ();
lock(locker)
{
web_requests.Clear ();
}
}
// Close
@@ -497,7 +514,10 @@ namespace System.ServiceModel.Channels
void Cleanup ()
{
owner.web_requests.Remove (WebRequest);
lock (owner.locker)
{
owner.web_requests.Remove (WebRequest);
}
}
}
}
@@ -0,0 +1,7 @@
System.Web.Services.Configuration/DiagnosticsElementTest.cs
System.Web.Services.Configuration/ProtocolElementTest.cs
System.Web.Services.Configuration/SoapEnvelopeProcessingElementTest.cs
System.Web.Services.Configuration/SoapExtensionTypeElementTest.cs
System.Web.Services.Configuration/TypeElementTest.cs
System.Web.Services.Configuration/WsdlHelpGeneratorElementTest.cs
System.Web.Services.Configuration/WsiProfilesElementTest.cs
@@ -0,0 +1 @@
#include monotouch_System.Web.Services_test.dll.exclude.sources
@@ -0,0 +1 @@
#include monotouch_System.Web.Services_test.dll.exclude.sources
@@ -0,0 +1,7 @@
System.Web.Services.Configuration/DiagnosticsElementTest.cs
System.Web.Services.Configuration/ProtocolElementTest.cs
System.Web.Services.Configuration/SoapEnvelopeProcessingElementTest.cs
System.Web.Services.Configuration/SoapExtensionTypeElementTest.cs
System.Web.Services.Configuration/TypeElementTest.cs
System.Web.Services.Configuration/WsdlHelpGeneratorElementTest.cs
System.Web.Services.Configuration/WsiProfilesElementTest.cs
@@ -272,7 +272,8 @@ namespace System.Web.Configuration
{
string path = NormalizeVirtualPath (virtualPath);
foreach (VirtualDirectoryMapping mapping in map.VirtualDirectories) {
for (int j = 0; j < map.VirtualDirectories.Count; j++) {
VirtualDirectoryMapping mapping = map.VirtualDirectories.Get(j);
if (path.StartsWith (mapping.VirtualDirectory)) {
int i = mapping.VirtualDirectory.Length;
if (path.Length == i) {
@@ -483,7 +483,7 @@ namespace System.Windows.Forms.Layout
CalculateColumnWidths (settings, actual_positions, max_colspan, settings.ColumnStyles, auto_size, column_widths, false);
// Calculate available width
int available_width = size.Width - (border_width * (columns + 1));
int available_width = size.Width < Int16.MaxValue ? size.Width - (border_width * (columns + 1)) : 0;
foreach (int width in column_widths)
available_width -= width;
@@ -516,7 +516,7 @@ namespace System.Windows.Forms.Layout
CalculateRowHeights (settings, actual_positions, max_rowspan, settings.RowStyles, auto_size, column_widths, row_heights);
// Calculate available height
int available_height = size.Height - (border_width * (rows + 1));
int available_height = size.Height < Int16.MaxValue ? size.Height - (border_width * (rows + 1)) : 0;
foreach (int height in row_heights)
available_height -= height;
@@ -318,10 +318,15 @@ namespace System.Windows.Forms
internal static void DrawTextInternal (IDeviceContext dc, string text, Font font, Point pt, Color foreColor, Color backColor, TextFormatFlags flags, bool useDrawString)
{
Size sz = MeasureTextInternal (dc, text, font, useDrawString);
Size sz = MeasureTextInternal (dc, text, font, flags, useDrawString);
DrawTextInternal (dc, text, font, new Rectangle (pt, sz), foreColor, backColor, flags, useDrawString);
}
internal static Size MeasureTextInternal (IDeviceContext dc, string text, Font font, TextFormatFlags flags, bool useMeasureString)
{
return MeasureTextInternal (dc, text, font, Size.Empty, flags, useMeasureString);
}
internal static Size MeasureTextInternal (IDeviceContext dc, string text, Font font, bool useMeasureString)
{
return MeasureTextInternal (dc, text, font, Size.Empty, TextFormatFlags.Default, useMeasureString);
+11 -1
View File
@@ -18,7 +18,17 @@ endif
TEST_LIB_REFS = System.Data System.Core
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
XTEST_LIB_REFS = System System.Core System.Xml System.Xml.Linq System.Drawing Facades/System.Threading.Tasks System.Runtime.Serialization Facades/System.Text.Encoding.CodePages
XTEST_LIB_REFS = System System.Core System.Xml System.Xml.Linq Facades/System.Threading.Tasks System.Runtime.Serialization Facades/System.Text.Encoding.CodePages
ifneq ($(PROFILE),monodroid)
ifneq ($(PROFILE),monotouch)
ifneq ($(PROFILE),monotouch_tv)
ifneq ($(PROFILE),monotouch_watch)
XTEST_LIB_REFS += System.Drawing
endif
endif
endif
endif
LIBRARY_WARN_AS_ERROR = yes
Loaded 100 of 444 files, more files were not shown because too many files have changed in this diff. Show more