Граф коммитов

30 Коммитов

Автор SHA1 Сообщение Дата
Chris Hamons cdf3915704 Fix EveryFrameworkSmokeTests test with MediaPlayerLibrary (#1418) 2016-12-28 08:46:46 -06:00
Rolf Bjarne Kvinge d1102c800e [mtouch] Remove most static state and put it on an instance. (#1398)
* [mtouch] Remove most static state and put it on an instance.

Remove most static state, and put it on an instance (of Application) instead.

Soon we'll build multiple apps (app extensions) in the same process, and we
need to make sure we're not inadvertedly (and incorrectly) sharing state
between apps, so remove as much static state as possible to avoid any
problems.

* [mtouch] Rename GetIsUsingClang -> IsUsingClang.
2016-12-23 18:50:35 +01:00
Sebastien Pouliot c92934eb6d [mtouch][mmp] Only allow `appletls` for the TLS provider (#1132)
The old `legacy` option will now be reported as a warning. 

That's by design an warning would require manually editing the .csproj
file (when the UI gets removed, as planned, from the IDE). 

This is part of
https://trello.com/c/SrgU38DN/647-only-ship-support-appletls

Note: The BCL changes will happen in later stages.
2016-11-08 14:42:40 -05:00
Sebastien Pouliot 7b38187479 [mtouch][mmp] Unify user resources removal as a link step (#1026)
Right now the logic exists in a few places, both in and outside the
linker. We recently began to use part of the linker pipeline in normal /
all builds so it's easier to share (and unify) the code now.

The real gain is to avoid copying assemblies, in particular large ones,
more than strictly needed while building.

E.g. a build including a very large 1.3GB assembly, with several
native libraries embedded, save a lot of time avoiding the rewrites

mtouch (before)
		Total time: 64202 ms

mtouch (after)
		Total time: 34840 ms

* Add XM support for RemoveUserResourcesSubStep

* Tests supplied by @chamons
2016-11-01 13:11:25 -04:00
Sebastien Pouliot f015a954ec [mtouch] Add missing HasParameters check inside linker and static registrar (#1010)
* [mtouch] Add missing HasParameters check inside linker and static registrar

Without the checks new, empty collections can be allocated and their
whole and only purpose will be to iterate up to 0 (nop).

The checks saves a small amount of memory (collections) and time.

* [registrar] Fix method comparison when they have no parameters
2016-10-31 22:31:07 -04:00
Rolf Bjarne Kvinge e9f125fbcb [mmp] Don't process SDK assemblies for external symbols unless we're embedding mono. Fixes #45902. (#1036)
SDK assemblies might contain P/Invokes to libmono, but unless we link with
mono (which we don't do if we're not embedding mono), the native linker will
complain if we ask it to keep those symbols (using `-u symbol`).

So don't look for __Internal P/Invokes in SDK assemblies in that case.

https://bugzilla.xamarin.com/show_bug.cgi?id=45902
2016-10-26 12:57:11 +02:00
Rolf Bjarne Kvinge 0863e412b4 Remove XI/Classic support (#926)
* [tests] Remove Classic SDK tests.

* Remove XI/Classic support.

This also means we can remove support for the legacy registrars.

* [monotouch-test] Remove legacy registrar tests.

* [tests/mtouch] Remove Classic tests (and legacy registrar logic).

* [tests/scripted] Fix tests to reference Xamarin.iOS.dll.
2016-09-30 15:02:17 -04:00
Rolf Bjarne Kvinge b58b36178b Update list of Facade assemblies. (#916)
These assemblies were added here: 919b89954a
2016-09-29 16:12:31 +02:00
Sebastien Pouliot 9fda816230 [mtouch][linker] Use correct error code for CoreOptimizeGeneratedCode (#915)
Previous PR [1] has the right documentation but the wrong source code.

[1] https://github.com/xamarin/xamarin-macios/pull/903
2016-09-28 23:16:03 -04:00
Sebastien Pouliot 5b80e7f85c [mtouch][linker] Provide a more specific error code when OptimizeGeneratedCodeSubStep fails (#903)
The MT2001 error is a general, something went bad, in the linker code
base. The stack trace is often enough to track down issues but in some
cases it would be easier to ask customers for a specific assembly
(rather than their complete project) to investigate an issue.

Example:

error MT2103: Binding Optimizer failed processing `System.Void GoogleConversionTracking.Unified.GoogleConversionPing::.ctor()`.
--- inner exception
System.NullReferenceException: Object reference not set to an instance of an object
  at MonoTouch.Tuner.OptimizeGeneratedCodeSubStep.ProcessIsDirectBinding (Mono.Cecil.MethodDefinition caller, Mono.Cecil.Cil.Instruction ins) [0x00026] in /Users/poupou/git/xamarin/xamarin-macios/tools/linker/MonoTouch.Tuner/OptimizeGeneratedCodeSubStep.cs:264
  at MonoTouch.Tuner.OptimizeGeneratedCodeSubStep.ProcessCalls (Mono.Cecil.MethodDefinition caller, Int32 i) [0x00337] in /Users/poupou/git/xamarin/xamarin-macios/tools/linker/MonoTouch.Tuner/OptimizeGeneratedCodeSubStep.cs:197
  at MonoTouch.Tuner.OptimizeGeneratedCodeSubStep.Process (Mono.Cecil.MethodDefinition method) [0x0007b] in /Users/poupou/git/xamarin/xamarin-macios/tools/linker/MonoTouch.Tuner/OptimizeGeneratedCodeSubStep.cs:81
  at Xamarin.Linker.StateSubStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x00004] in /Users/poupou/git/xamarin/xamarin-macios/tools/linker/CoreOptimizeGeneratedCode.cs:48
---
  at Xamarin.Linker.StateSubStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x00014] in /Users/poupou/git/xamarin/xamarin-macios/tools/linker/CoreOptimizeGeneratedCode.cs:50
  at Mono.Tuner.SubStepDispatcher.DispatchMethod (Mono.Cecil.MethodDefinition method) [0x0001d] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs:215
  at Mono.Tuner.SubStepDispatcher.BrowseMethods (ICollection methods) [0x0001c] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs:167
  at Mono.Tuner.SubStepDispatcher.BrowseTypes (ICollection types) [0x0006b] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs:145
  at Mono.Tuner.SubStepDispatcher.BrowseAssemblies (IEnumerable`1 assemblies) [0x00050] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs:123
  at Mono.Tuner.SubStepDispatcher.Process (Mono.Linker.LinkContext context) [0x0000f] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs:104
  at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00027] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/linker/Mono.Linker/Pipeline.cs:118
  at MonoTouch.Tuner.Linker.Process (MonoTouch.Tuner.LinkerOptions options, MonoTouch.Tuner.MonoTouchLinkContext& context, System.Collections.Generic.List`1& assemblies) [0x000ac] in /Users/poupou/git/xamarin/xamarin-macios/tools/mtouch/Tuning.cs:79

Right now the MT2001 would only include the inner exception, which does
not include any clue to which assembly caused the exception.

Note: The same pattern to be applied to other BaseSubStep subclasses in
separate commits.

Related to (but not the fix for) https://bugzilla.xamarin.com/show_bug.cgi?id=44701
2016-09-28 11:46:14 -04:00
Sebastien Pouliot da60263a0a [mtouch] Fix NRE when optimizing bindings. Fixes #44701 (#900)
Some binding assemblies contains extra, unneeded code, generated by the C# compiler, e.g.

IL_002f: stloc.0
IL_0030: ldloc.0

which the binding optimizer did not expect.

https://bugzilla.xamarin.com/show_bug.cgi?id=44701
2016-09-27 16:09:42 -04:00
Martin Baulig f3501d99af Remove Mono.Security.Providers.*.dll in preparation of their upcoming removal from the BCL. 2016-09-22 07:23:40 +02:00
Alexander Köplinger 5eba5f78ce Remove wrong System.Private.* facades from Sdk check (#745)
They are no longer shipped since c8c09310f9 and c75dcf579f.
2016-09-02 12:01:55 +02:00
Rolf Bjarne Kvinge 2eb6ba12c7 [mtouch/mmp] Fix build after breaking cecil update in mono.
Also use mono's cecil instead of our own cecil submodule for mtouch.
2016-09-01 18:28:35 +02:00
Rolf Bjarne Kvinge 80c88e9ce4 [linker] Add temporary workaround for bug #43658. (#697)
The real fix for bug #43658 is in mono master, but the current
version of mono master doesn't build for us, so implement this
workaround instead.

The problem is that the linker doesn't preserve fields of nested types marked
in xml descriptions unless the declaring type is marked. So the workaround
(until we can bump mono) is to mark the declaring type.

https://bugzilla.xamarin.com/show_bug.cgi?id=43658
2016-08-29 08:17:57 -04:00
Sebastien Pouliot 0bea77b781 [linker] Ensure we do not devirtualize methods that needs to be called from a base class to satisfy an interface. Fixes #34308 (#675)
Update unit tests to catch this case and be more precise in others.

reference:
https://bugzilla.xamarin.com/show_bug.cgi?id=43408
2016-08-26 09:24:51 +02:00
Rolf Bjarne Kvinge e291f1717d Revert "Bump [watch-]mono to master to get fix for #43658." (#665) 2016-08-25 14:44:53 +02:00
Rolf Bjarne Kvinge f6b1ccd748 Bump [watch-]mono to master to get fix for #43658. (#653)
* Bump [watch-]mono to master to get fix for #43658.

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

* [mtouch/mmp] Fix build after breaking cecil update in mono.

Also use mono's cecil instead of our own cecil submodule for mtouch.

* Bump [watch-]mono to get compilation fixes after cecil bump in mono.

* Remove cecil submodule, we only use the one in mono now.
2016-08-25 13:10:14 +02:00
Aleksey Kliger (λgeek) e5132633e5 [linker] Update mscorlib.xml to include Mono.RuntimeStructs (#616) 2016-08-16 17:08:11 -04:00
Alexander Köplinger e04f2abb19 Add System.IdentityModel to Sdk assemblies (#612)
Fixes the following mtouch test failure:

```
Xamarin.Linker.SdkTest.iOS_Classic :   BCL
  Expected:
  But was:  < "System.IdentityModel" >

at NUnit.Framework.CollectionAssert.IsEmpty (IEnumerable collection, System.String message, System.Object[] args) <0x47bec88 + 0x00047> in :0
at NUnit.Framework.CollectionAssert.IsEmpty (IEnumerable collection, System.String message) <0x47bec58 + 0x0001f> in :0
at Xamarin.Linker.SdkTest.BCL (System.String path) <0x47bccf0 + 0x003f3> in :0
at Xamarin.Linker.SdkTest.iOS_Classic () <0x47bcc50 + 0x0001b> in :0
```
2016-08-16 11:41:51 -04:00
Rolf Bjarne Kvinge 1003b14a8e Add multiple new assemblies to the list of known SDK assemblies. (#476)
Fixes the Sdk test:

    Errors and Failures:
    1) Test Failure : Xamarin.Linker.SdkTest.iOS_Classic
         BCL
      Expected: <empty>
      But was:  < "System.Net.Http.WinHttpHandler", "System.Numerics.Vectors", "System.Reflection.Context", "System.Reflection.DispatchProxy", "System.Runtime.InteropServices.RuntimeInformation", "System.Security", "System.Xml.XPath.XmlDocument" >

    at NUnit.Framework.CollectionAssert.IsEmpty (IEnumerable collection, System.String message, System.Object[] args) <0x39ec5e0 + 0x00047> in <filename unknown>:0
    at NUnit.Framework.CollectionAssert.IsEmpty (IEnumerable collection, System.String message) <0x39ec5b0 + 0x0001f> in <filename unknown>:0
    at Xamarin.Linker.SdkTest.BCL (System.String path) <0x39ea8a8 + 0x003f3> in <filename unknown>:0
    at Xamarin.Linker.SdkTest.iOS_Classic () <0x39ea808 + 0x0001b> in <filename unknown>:0

    2) Test Failure : Xamarin.Linker.SdkTest.iOS_Unified
         BCL
      Expected: <empty>
      But was:  < "System.Net.Http.WinHttpHandler", "System.Numerics.Vectors", "System.Reflection.Context", "System.Reflection.DispatchProxy", "System.Runtime.InteropServices.RuntimeInformation", "System.Security", "System.Xml.XPath.XmlDocument" >

    at NUnit.Framework.CollectionAssert.IsEmpty (IEnumerable collection, System.String message, System.Object[] args) <0x39ec5e0 + 0x00047> in <filename unknown>:0
    at NUnit.Framework.CollectionAssert.IsEmpty (IEnumerable collection, System.String message) <0x39ec5b0 + 0x0001f> in <filename unknown>:0
    at Xamarin.Linker.SdkTest.BCL (System.String path) <0x39ea8a8 + 0x003f3> in <filename unknown>:0
    at Xamarin.Linker.SdkTest.iOS_Unified () <0x39ede58 + 0x0001b> in <filename unknown>:0

    3) Test Failure : Xamarin.Linker.SdkTest.tvOS
         BCL
      Expected: <empty>
      But was:  < "System.Net.Http.WinHttpHandler", "System.Numerics.Vectors", "System.Reflection.Context", "System.Reflection.DispatchProxy", "System.Runtime.InteropServices.RuntimeInformation", "System.Security", "System.Xml.XPath.XmlDocument" >

    at NUnit.Framework.CollectionAssert.IsEmpty (IEnumerable collection, System.String message, System.Object[] args) <0x39ec5e0 + 0x00047> in <filename unknown>:0
    at NUnit.Framework.CollectionAssert.IsEmpty (IEnumerable collection, System.String message) <0x39ec5b0 + 0x0001f> in <filename unknown>:0
    at Xamarin.Linker.SdkTest.BCL (System.String path) <0x39ea8a8 + 0x003f3> in <filename unknown>:0
    at Xamarin.Linker.SdkTest.tvOS () <0x39eded8 + 0x0001b> in <filename unknown>:0

    4) Test Failure : Xamarin.Linker.SdkTest.watchOS
         BCL
      Expected: <empty>
      But was:  < "System.Net.Http.WinHttpHandler", "System.Numerics.Vectors", "System.Reflection.Context", "System.Reflection.DispatchProxy", "System.Runtime.InteropServices.RuntimeInformation", "System.Security", "System.Xml.XPath.XmlDocument" >

    at NUnit.Framework.CollectionAssert.IsEmpty (IEnumerable collection, System.String message, System.Object[] args) <0x39ec5e0 + 0x00047> in <filename unknown>:0
    at NUnit.Framework.CollectionAssert.IsEmpty (IEnumerable collection, System.String message) <0x39ec5b0 + 0x0001f> in <filename unknown>:0
    at Xamarin.Linker.SdkTest.BCL (System.String path) <0x39ea8a8 + 0x003f3> in <filename unknown>:0
    at Xamarin.Linker.SdkTest.watchOS () <0x39edf58 + 0x0001b> in <filename unknown>:0
2016-07-25 14:50:33 +02:00
Chris Hamons 9530bdf608 [XM] Fix linker ability to deadstrip library loads from NSObject.mac.… (#448)
* [XM] Fix linker ability to deadstrip library loads from NSObject.mac.cd for new libraries

- Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=42177 in Release / Mobile since we can rip out GameController if not used
2016-07-21 12:58:54 -05:00
Rolf Bjarne Kvinge c13e733b8a Add System.Security.Cryptography.[Algorithms|Primitives] to the list of known SDK assemblies. (#445)
Fixes the Sdk test:

    Errors and Failures:
    1) Test Failure : Xamarin.Linker.SdkTest.iOS_Classic
         System.Security.Cryptography.Algorithms
      Expected: True
      But was:  False

    at Xamarin.Linker.SdkTest.Facades (System.String path) <0x30d4640 + 0x0006f> in <filename unknown>:0
    at Xamarin.Linker.SdkTest.iOS_Classic () <0x30d2808 + 0x0004b> in <filename unknown>:0

    2) Test Failure : Xamarin.Linker.SdkTest.iOS_Unified
         System.Security.Cryptography.Algorithms
      Expected: True
      But was:  False

    at Xamarin.Linker.SdkTest.Facades (System.String path) <0x30d4640 + 0x0006f> in <filename unknown>:0
    at Xamarin.Linker.SdkTest.iOS_Unified () <0x30d5558 + 0x0004b> in <filename unknown>:0

    3) Test Failure : Xamarin.Linker.SdkTest.tvOS
         System.Security.Cryptography.Algorithms
      Expected: True
      But was:  False

    at Xamarin.Linker.SdkTest.Facades (System.String path) <0x30d4640 + 0x0006f> in <filename unknown>:0
    at Xamarin.Linker.SdkTest.tvOS () <0x30d55d8 + 0x0004b> in <filename unknown>:0

    4) Test Failure : Xamarin.Linker.SdkTest.watchOS
         System.Security.Cryptography.Algorithms
      Expected: True
      But was:  False

    at Xamarin.Linker.SdkTest.Facades (System.String path) <0x30d4640 + 0x0006f> in <filename unknown>:0
    at Xamarin.Linker.SdkTest.watchOS () <0x30d5658 + 0x0004b> in <filename unknown>:0
2016-07-20 12:12:47 +02:00
Aleksey Kliger (λgeek) a46d86948c [linker] Adjust RemoveCode.cs not to remove MonoMethodMessage (#226)
Fixes Bug5354 in linker-ios/dont link/AotBugs.cs when compiled with Mono master.
2016-06-17 15:51:19 -07:00
Aleksey Kliger (λgeek) 8474a21176 [runtime] Add MonoMethodMessage::InitMessage to linker descriptors (#172)
It's called from the runtime mono_message_init method since
 Mono commit 83f37161192b7735ffd04a4235253d790eefff99
2016-06-10 13:21:19 -04:00
Rolf Bjarne Kvinge 6a58755389 [linker] Add Mono.Security.Provider.NewTls as known SDK library. (#118) 2016-06-02 11:11:37 +02:00
Rolf Bjarne Kvinge 1f1f6991a3 Implement support for exception marshalling. 2016-05-17 11:23:48 +02:00
Sebastien Pouliot 2edb2ae4f5 [linker] Fix debugging of watchOS apps when link all is used. Fixes #40641 (#3)
Watch apps are inside .dll (not .exe) and needs to be processed
differently (e.g. to register their content). The issue was that the
debugging symbols were not loaded by that code so it was not part of
the .appex for debugging.

https://bugzilla.xamarin.com/show_bug.cgi?id=40641
2016-04-26 19:01:49 -04:00
Rolf Bjarne Kvinge 56308e7eb6 [mmp/mtouch] Don't mkbundle anymore.
mtouch only uses Xamarin.Mac to read plists, so change to use
our purely managed plist reader in Xamarin.MacDev instead.

That makes us able to change mtouch to be a normal command-line
executable (and project).

Which makes it logical to not mkbundle mtouch anymore,
it executes just fine with the system mono (and there's
no code to protect anymore either).

And since mmp and mtouch share some files, do the same
for mmp.
2016-04-25 18:14:56 -04:00
Rolf Bjarne Kvinge 82ab3fc106 Build mmp. 2016-04-24 14:47:26 -04:00