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

432 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge f4ac99efc0
[dotnet] Build & publish MacCatalyst packs. (#10624)
* [dotnet] Build & publish MacCatalyst packs.

* Add runtime support.
2021-02-12 07:38:43 +01:00
Rolf Bjarne Kvinge 598dbc8ae3
Use pointer-sized GCHandles everywhere. (#10597)
* Convert the GCHandles interface from 32-bit ints to pointer size types

This involves:

* Stop using some bits of the GCHandle to store extra flags, instead add an extra
  field to store those flags.
* Define a INVALID_GCHANDLE constant and use it instead of 0/NULL. This is not
  strictly required, but it makes the code more self-documenting.
* Define a GCHandle type (typedef'ed to void*) and change all variables and parameters
  to use it instead of guint32.
* Use our own xamarin_gchandle_* methods (with pointer-sized types) that wraps
  the mono_gchandle_* embedding API (which uses 32-bit types) everywhere.
* Update managed code (registrars, runtime code, etc) accordingly.

* [runtime] Make debug code compile.

* Fix typo.

* Fix signature of xamarin_create_gchandle.

Co-authored-by: Aaron R Robinson <arobins@microsoft.com>
2021-02-11 08:18:38 +01:00
Rolf Bjarne Kvinge 90676df846 [src] Build Xamarin.MacCatalyst.dll 2020-12-03 10:43:19 +01:00
Rolf Bjarne Kvinge 30f8d217ea [runtime] Build our native runtime bits for catalyst. 2020-12-03 10:42:27 +01:00
Rolf Bjarne Kvinge 874df65210 [runtime] Split the make template to create native libraries in two templates
Split the make template 'PlatformTemplate' in two templates, now there's a 'FrameworkTemplate'
that's in charge of building Xamarin[-debug].framework, and the existing 'PlatformTemplate'
will be in charge of the rest of the native libraries.
2020-12-03 10:42:27 +01:00
Rolf Bjarne Kvinge 38eca9806a [runtime] Look for files in the Contents/MonoBundle directory for catalyst apps. 2020-12-03 10:42:26 +01:00
Rolf Bjarne Kvinge 9327af6960 [runtime] Put MonoTouchDebugConfiguration.txt in the app resources directory.
This is required for Catalyst apps, since no custom files can be in the root directory
for apps on macOS.
2020-12-03 10:42:25 +01:00
Rolf Bjarne Kvinge adb566e408
[runtime] Simplify code for custom mono bundle name a bit by using a default value for the 'xamarin_custom_bundle_name' variable. (#10130) 2020-11-23 08:30:08 +01:00
Alex Soto 72c7b1ffcc
[main][watchOS] Add x86_64 simulator support (#10059)
* [watchOS] Add x86_64 simulator support

* Build runtime/registrar x86_64 slices
* Produce a 64 bit version of Xamarin.WatchOS.dll
* Allow building x86_64 for watch simulators in mtouch
* Let xharness know about x86_64

* [tests] Add x86_64 arch to test-libraries

* Make dotnet package aware of x64

* [ObjCRuntime] Fix computing if we're calling a stret function or not in a 64-bit watchOS simulator.

* [xharness] Re-enable some watchOS tests.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-11-20 09:27:46 -05:00
Filip Navara d602cf76cf
[dotnet] Fix install name for libxamarin[-debug].dylib on macOS (#9821)
* [dotnet] Fix install name for libxamarin[-debug].dylib on macOS

* When using DYNAMIC_MONO_RUNTIME pass down the bundle directory in MONO_PATH to the relaunched process. Also fix support for custom bundle names in the surrounding code.

* Fix pattern matching
2020-10-09 14:55:00 +02:00
Filip Navara 59db084141
Respect xamarin_executable_name on macOS if specified (#9803) 2020-10-08 18:23:39 +02:00
Manuel de la Pena dcb0c93ab0 [Xcode12] Bring xcode 12 changes into main. 2020-09-23 16:05:22 -04:00
Manuel de la Pena eb9b690fe0 Merge xcode12 into d16-8. 2020-09-18 17:51:52 -04:00
Rolf Bjarne Kvinge 5a85c17e6d
[runtime] Give a better error message if we can't load ObjCRuntime.Runtime.Initialize () (#9514)
* [runtime] Give a better error message if we can't load ObjCRuntime.Runtime.Initialize ()

Otherwise we'll get a SIGSEGV due to dereferencing NULL.

* Rework strings a bit to have fewer unique strings.
2020-08-27 13:29:12 +02:00
Manuel de la Pena 5fae175cf6
[ARKit] Add support for Xcode 12 beta 1. (#9002)
PInvoke that is missing is due to a dependency with Visio which is not
yet updated.



Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-07-07 09:37:16 -04:00
Sebastien Pouliot f427b5e91d
[xcode12] Bump for beta 1 (#8935)
Known issues https://github.com/xamarin/xamarin-macios/issues/8943
2020-06-26 14:02:44 -04:00
Sebastien Pouliot 4a23951829
[runtime] Fix warning in launcher.m (#8891)
```
launcher.m:136:9: warning: unused variable 'size' [-Wunused-variable]
        size_t size;
               ^
1 warning generated.
```

missed in https://github.com/xamarin/xamarin-macios/pull/8853
2020-06-19 09:40:01 -04:00
Sebastien Pouliot 96eb54dcb2
[runtime] Use `strnlen` instead of `strlen` (#8893)
`strlen` is part of the list of C API banned by Microsoft.

Also rename a local variable in `Runtime.cs` so grepping the source
files won't show `strlen` outside the `tests` subdirectories.
2020-06-19 09:36:02 -04:00
Sebastien Pouliot 577af10467
[runtime] Remove strlen and memcpy usage from runtime/xamarin-support.m (#8879)
* NSString can give us the length of the string
* NSData can copy memory into a supplied buffer

The later is already covered by tests in `tests/linker/ios/link all/InternalsTest.cs`
2020-06-18 08:06:59 -04:00
Sebastien Pouliot 44d3e1b7ba
[runtime] Simplify string code inside launcher by using ObjC (#8859)
This avoids the use of `strcpy`, `memcpy` and `strlen` which can be
misused. We're already using ObjC code inside the file so we can
leverage higher-level API that makes review the code easier.
2020-06-17 10:03:35 -04:00
Sebastien Pouliot f9aa25cefa
[runtime] Replace custom string concatenation inside `mono-runtime.m.t4` (#8865)
by simpler, at least to review, ObjC code.
2020-06-16 13:26:58 -04:00
Sebastien Pouliot 0187a45359
[runtime] Have launcher use https-based URL if mono is missing (#8855) 2020-06-15 14:21:15 -04:00
Sebastien Pouliot 65901a6f29
[runtime] Update launcher to use `strndup` (#8853)
because now we can :)
2020-06-15 13:46:01 -04:00
Rolf Bjarne Kvinge 748612fbc2
[dotnet] Ship libxamarin.dylib and friends. (#8830)
* [dotnet] Ship libxamarin.dylib and friends.

Add libxamarin[-debug].[a|dylib] to the NuGets.

* [dotnet] Create a DOTNET_PLATFORMS variable in Make.config.

Create a DOTNET_PLATFORMS variable in Make.config and use it everywhere
instead of the PLATFORMS variable we were defining in multiple Makefiles.

Also move the creation of the DOTNET_<platform>_RUNTIME_IDENTIFIERS variables
from dotnet/Makefile to Make.config, it'll soon be needed elsewhere as well.

* [runtime] Conditionally include bits.

* Make the contents of the DOTNET_[PLATFORMS|RUNTIME_IDENTIFIERS] variables depend on the INCLUDE_[IOS|TVOS|WATCH] variables.
2020-06-15 17:47:18 +02:00
Sebastien Pouliot 37b62cbaae
[runtime] Only include debug over HTTP for watchOS devices (#8828)
We have better options for watchOS simulator and other platforms.

This only affects `lib*-debug.dylib` and `Xamarin-debug.framework`
as the non-debug binaries don't include debugging support.
2020-06-10 16:27:15 -04:00
monojenkins b492f5a33e
[runtime] Remove Classic code. (#8722)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-06-02 16:14:17 +02:00
Rolf Bjarne Kvinge 24ed1ddc66
[runtime] Remove Classic code. (#8720) 2020-06-02 08:18:24 +02:00
Rolf Bjarne Kvinge 2926083d20
[runtime/mmp] Put libxammac and xamarin headers for Xamarin.Mac in the same directory as the corresponding files for Xamarin.iOS. (#8542)
That's in /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/SDKs/Xamarin.macOS.sdk/[lib|include]

This allows for a bit more code share between mtouch and mmp.
2020-05-08 13:04:32 +02:00
Rolf Bjarne Kvinge ef8a5736a2 [src] Remove ObjectWrapper.
ObjectWrapper is not safe, and in any case incompatible with .NET 5.
2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge ab50886e47 Convert Runtime.GetNullableType to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge fc233a46ad Convert Registrar.WriteUnmanagedDescription to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge 872530dfe0 Convert Runtime.CreateDelegateProxy to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge b0974e8317 Convert Runtime.ConvertNSStringToSmartEnum and Runtime.ConvertSmartEnumToNSString to use GCHandle.
These methods were already partially using GCHandles, so convert the parameter
using ObjectWrapper to GCHandle, and port the rest of the existing logic to
use the new helper API.
2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge b360263f2c Convert Runtime.RegisterAssembly to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge dd7278c4ea Convert Runtime.RegisterEntryAssembly to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge 605a83215d Convert Runtime.GetHandleForINativeObject to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge aa875592c8 Convert Runtime.UnregisterNSObject to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge c0c35acd40 Convert Runtime.TryGetOrConstructNSObjectWrapped to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge 8ac784ccfe Convert Runtime.GetINativeObject_[Dynamic|Static] to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge e31b9db516 Convert Runtime.GetNSObjectWithType to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge 5e44aac2d8 Convert Runtime.IsParameter[Out|Transient] to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge cff3617dd2 Convert Runtime.Dispose to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge e2ee5a2710 Convert Runtime.GetSelector to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge ef92c04135 Convert Runtime.GetClass to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge c25403bb21 Convert Runtime.RegisterNSObject to take a GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge 632fd10328 Convert Runtime.GetBlockWrapperCreator, Runtime.CreateBlockProxy and Runtime.Get[Generic]MethodFromToken to use GCHandle.
The native methods xamarin_get_[generic_]method_from_token are a bit unusual
in that they return an actual GCHandle. This is for performance reasons, since
in some cases their return value is passed as parameters to other function
calls to managed code, in which case we need the GCHandle. This way we avoid
round-tripping a GCHandle multiple times.
2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge a7d68ddfbc Convert Runtime.GetMethodAndObjectForSelector to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge 1bf3ccfb45 Convert Runtime.TypeGetFullName to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge 6663d8d273 [runtime] Use a common cleanup logic in xamarin_get_delegate_for_block_parameter. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge 54bc2f1dfe [runtime] Add GCHandle pointer-sized API. 2020-05-04 11:31:19 +02:00