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

289 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 1ddc0b4b74
Get Mono.Cecil from NuGet everywhere. (#19535)
Also:

* Store the version in Directory.Build.props, which makes it much easier to update.
* Bump all versions to latest (0.11.5).
2023-12-04 20:15:03 +01:00
Rolf Bjarne Kvinge 8cd685d448
[InputMethodKit] Remove existing code for InputMethodKit. (#19462)
No InputMethodKit bindings are included in the build, so just remove the
bindings we have, since it's confusing to have code we don't build/use.

See also https://github.com/xamarin/xamarin-macios/issues/7487.
2023-11-20 07:55:13 +01:00
Manuel de la Pena 61f438656c
[MetalFX] Add the framework (which was added in Xcode 14) and add xcode 15 support. (#19107)
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2023-10-23 10:40:02 -04:00
Haritha Mohan 4f1cbbccaa
[SensitiveContentAnalysis] Add support for Xcode 15 (#19020)
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Alex Soto <alex@soto.dev>
2023-09-15 09:49:05 -07:00
Rolf Bjarne Kvinge 46214aee78
[net8.0-xcode15] Merge net8.0 into net8.0-xcode15. (#18798) 2023-08-29 08:23:35 +02:00
Manuel de la Pena 642889a11b
[Cinematic] Add support for Xcode 15 beta 6. (#18686)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2023-08-28 14:59:22 -04:00
Rolf Bjarne Kvinge 7d5e1a4e7e [net8.0-xcode15] Merge net8.0 into net8.0-xcode15. 2023-08-23 17:35:17 +02:00
Rolf Bjarne Kvinge 19b2b3744f
[NativeAOT] Add support for [Preserve] attributes (#18666)
Add partial support for the `[Preserve]` attribute for NativeAOT. This
is done by injecting an equivalent `[DynamicDependency]` attribute. The
partial support comes from the fact that there's no way to map a
conditional preserve attribute (`[Preserve (Conditional = true)]`) to a
`[DynamicDependency]` attribute, so we report a warning instead.

For non-conditional `[Preserve]` attributes, we'll now add a
`[DynamicDependency]` attribute to the assembly's module constructor for
the type/member in question, effectively rooting it.

This makes it possible to fully link all our test suites when NativeAOT
(otherwise NativeAOT would just link out all the tests, leaving the test
suites empty - and unfortunately green, so this was a rather accidental
discovery).
2023-08-18 16:49:47 +02:00
Rolf Bjarne Kvinge 8bb54d360f [net8.0-xcode15] Merge net8.0 into net8.0-xcode15. 2023-08-16 11:21:06 +02:00
Manuel de la Pena d5d14f6cd8
[Symbols] Add support for the new Xcode 15 Symbols framework. (#18642)
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>
2023-08-15 11:53:48 -04:00
Rolf Bjarne Kvinge ac90c511d1 [net8.0] Merge main into net8.0. 2023-08-14 15:36:54 +02:00
Rolf Bjarne Kvinge 24895406b2
[dotnet] Link Mono and Xamarin statically in Mac Catalyst by default. Fixes #14686. (#18619)
It's possible to create a provisioning profile for Mac Catalyst that
doesn't allow dylibs in the app. It seems a significant number of people run
into this problem when publishing their apps, so avoid it by linking Mono and
Xamarin statically by default instead.

The downside is that build time might increase a little bit.

An upside however is that the app size might decrease somewhat.

Fixes https://github.com/xamarin/xamarin-macios/issues/14686.
2023-08-11 15:08:27 +02:00
Manuel de la Pena 32e419b000 Merge branch 'main' into merge-main-net8 2023-07-11 10:25:23 -04:00
Manuel de la Pena 72865626fe
[Policheck] Fix all policheck issues that are not part of the apple APIs. (#18544) 2023-07-10 14:38:21 -04:00
Rolf Bjarne Kvinge ab73088c0b [net8.0] Merge main into net8.0. 2023-05-19 08:06:07 +02:00
Rolf Bjarne Kvinge 00a822818f [linker] Don't optimize calls to BlockLiteral.SetupBlock in BlockLiteral.CreateBlockForDelegate. 2023-05-11 13:10:31 +02:00
Git History Editor dc56054d2a [registrar] Add an HasCustomAttribute overload that returns the found attribute (if any) 2023-05-11 13:10:30 +02:00
Git History Editor 53d7bc523e [tools] Move code to compute block signatures to the static registrar.
This makes it easier to use this code from the managed static registrar.
2023-05-11 13:10:30 +02:00
Rolf Bjarne Kvinge b8c7dc7dc3 [net8.0] Merge main into net8.0. 2023-05-11 11:54:37 +02:00
Rolf Bjarne Kvinge 36af029204
Change all null checking expressions to use 'is' and 'is not'. (#18176)
Change all null checking expressions to use 'is null' and 'is not null'
instead of '== null' and '!= null'.

This was mostly done with sed, so code can probably be improved in many
other ways with manual inspection, but that will come over time.

Also add code to the autoformat script to automatically fix these issues in the future.
2023-05-05 17:52:19 +02:00
Rolf Bjarne Kvinge 791b98cac2
[dotnet-linker] Enable nullability in numerous files. (#18184)
This required some minor refactorings to simplify the changes, but no
behavior should change.
2023-05-04 07:50:32 +02:00
Rolf Bjarne Kvinge ce19b092c2 [net8.0] Merge main into net8.0. 2023-04-21 12:31:53 +02:00
Rolf Bjarne Kvinge 4dbd98b78f
[linker/trimmer] Add opt-in support for not marking NSObjects in user assemblies. Fixes #15723. (#17949)
We mark all types that derive from NSObject when we find them in user
assemblies, so that these types may be used in storyboards (where the linker
can't see them), without having to go through hoops to make sure the linker
doesn't remove these types (which would make the storyboard fail to load,
because it would reference types that were linked away).

However, not everybody uses storyboards, so in some cases it may make sense to
link away as much as possible, so make it opt-in to skip this custom marking.

This is an experimental feature, and will break at least some apps. It may
break most apps, but if someone wants to try it out, they're welcome!

It can be turned on by passing `--skip-marking-nsobjects-in-user-assemblies=true` to mtouch/mmp:

```xml
<PropertyGroup>
    <MtouchExtraArgs>--skip-marking-nsobjects-in-user-assemblies=true</MtouchExtraArgs>
</PropertyGroup>
```

Fixes #15723.
2023-04-13 16:38:04 +02:00
dotnet-maestro[bot] a7de036e62
[net8.0] Update dependencies from dotnet/installer (#17888)
This pull request updates the following dependencies

## Coherency Updates

The following updates ensure that dependencies with a *CoherentParentDependency*
attribute were produced in a build used as input to the parent dependency's build.
See [Dependency Description Format](https://github.com/dotnet/arcade/blob/master/Documentation/DependencyDescriptionFormat.md#dependency-description-overview)

- **Coherency Updates**:
  - **Microsoft.NET.ILLink.Tasks**: from 8.0.0-preview.3.23171.4 to 8.0.0-preview.4.23176.4 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.AspNetCore.App.Ref**: from 8.0.0-preview.4.23171.7 to 8.0.0-preview.4.23176.6 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.3.23171.4 to 8.0.0-preview.4.23176.4 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport**: from 8.0.0-preview.3.23167.1 to 8.0.0-preview.4.23170.1 (parent: Microsoft.NETCore.App.Ref)
  - **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.3.23171.4 to 8.0.0-preview.4.23176.4 (parent: Microsoft.Dotnet.Sdk.Internal)

## From https://github.com/dotnet/installer
- **Subscription**: 9a2944cb-7dee-4bf2-a65c-08dabd10ae64
- **Build**: 20230328.2
- **Date Produced**: March 28, 2023 10:27:20 AM UTC
- **Commit**: 69e28735b98581f2ee0825953de83a8581df7563
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.100-preview.4.23172.3 to 8.0.100-preview.4.23178.2][21]
  - **Microsoft.NET.ILLink.Tasks**: [from 8.0.0-preview.3.23171.4 to 8.0.0-preview.4.23176.4][22]
  - **Microsoft.AspNetCore.App.Ref**: [from 8.0.0-preview.4.23171.7 to 8.0.0-preview.4.23176.6][23]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.3.23171.4 to 8.0.0-preview.4.23176.4][22]
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport**: [from 8.0.0-preview.3.23167.1 to 8.0.0-preview.4.23170.1][24]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.3.23171.4 to 8.0.0-preview.4.23176.4][22]

[21]: 27622e3898...69e28735b9
[22]: edb161ab06...8d5f520838
[23]: 16907a1efa...c2350729d0
[24]: 25d9f7a5e3...a464820353
2023-04-12 09:38:36 +02:00
Rolf Bjarne Kvinge a54ab5c42a
[tools/tests] Fix bug in 'link all' test and the resulting regression that showed up in code. (#18016)
There's a 'link all' test that's verifying that the IntroducedAttribute is
linked away. It does so by verifying that the linked app doesn't have a
'IntroducedAttribute' type - but the test was constructing the fully qualified
type name to look for incorrectly:

    ObjCRuntime.IntroducedAttribute, , Microsoft.iOS

Note the double comma: that meant we wouldn't find the type, even if it wasn't linked away.

The fix is easy (use a single comma), with one caveat (don't use a constant
string, because the linker sees the reference to
"ObjCRuntime.IntroducedAttribute" and _helpfully_ preserves it, exactly what
we don't want), but it revealed that the tested behavior regressed: a fully
linked app wouldn't link away the IntroducedAttribute.

So a fix is also needed: properly remove TVAttribute, WatchAttribute and
MacCatalystAttribute, which are subclasses of IntroducedAttribute (and what
would make the linker keep IntroducedAttribute).

Interestingly this showed up because of a bug in the runtime, where parsing
the invalid assembly name would now throw an exception
(https://github.com/dotnet/runtime/issues/84118).
2023-04-11 20:12:35 +02:00
Rolf Bjarne Kvinge 425323a1c6
[net8.0] Merge main into net8.0. (#17711) 2023-03-07 07:41:18 +01:00
dotnet-maestro[bot] 727a29d8c9
[net8.0] Update dependencies from dotnet/installer (#17518)
This pull request updates the following dependencies

## From https://github.com/dotnet/installer
- **Subscription**: 9a2944cb-7dee-4bf2-a65c-08dabd10ae64
- **Build**: 20230306.1
- **Date Produced**: March 6, 2023 10:15:46 AM UTC
- **Commit**: 51e06f6931e859f56564556fa6ba519761fa7141
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.100-preview.2.23108.2 to 8.0.100-preview.3.23156.1][77]
  - **Microsoft.NET.ILLink.Tasks**: [from 8.0.0-preview.2.23107.1 to 8.0.0-preview.2.23127.4][78]
  - **Microsoft.AspNetCore.App.Ref**: [from 8.0.0-preview.2.23107.2 to 8.0.0-preview.3.23127.13][79]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.2.23107.1 to 8.0.0-preview.2.23127.4][78]
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100-preview.2**: [from 8.0.0-preview.2.23081.3 to 8.0.0-preview.2.23113.1][80]

[77]: 5a84050...51e06f6
[78]: e71a4fb...2bdc3cb
[79]: cec7fbf...3265dc6
[80]: 1d9df33...d7ff0aa

## Coherency Updates

The following updates ensure that dependencies with a *CoherentParentDependency*
attribute were produced in a build used as input to the parent dependency's build.
See [Dependency Description Format](https://github.com/dotnet/arcade/blob/master/Documentation/DependencyDescriptionFormat.md#dependency-description-overview)

- **Coherency Updates**:
  - **Microsoft.NET.ILLink.Tasks**: from 8.0.0-preview.2.23107.1 to 8.0.0-preview.2.23127.4 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.AspNetCore.App.Ref**: from 8.0.0-preview.2.23107.2 to 8.0.0-preview.3.23127.13 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.2.23107.1 to 8.0.0-preview.2.23127.4 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100-preview.2**: from 8.0.0-preview.2.23081.3 to 8.0.0-preview.2.23113.1 (parent: Microsoft.NETCore.App.Ref)
2023-03-07 07:11:52 +01:00
Rolf Bjarne Kvinge e013c10a30
Add support for function pointers to BlockLiteral. (#17672)
Add support for function pointers to BlockLiteral, and use it to update
almost all manually bound block code to use function pointers (in .NET).

Also add support to the linker for optimizing the new block API.

Contributes towards https://github.com/xamarin/xamarin-macios/issues/15783.
2023-03-06 10:26:08 +01:00
Rolf Bjarne Kvinge 8f8818dd72
[generator] Use the new Block API that makes BlockLiteral disposable. (#17612)
Contributes towards https://github.com/xamarin/xamarin-macios/issues/15783.
2023-03-01 07:23:21 +01:00
Rolf Bjarne Kvinge eec5f62054 Merge main into xcode14.1. 2022-10-13 13:36:23 +02:00
Rolf Bjarne Kvinge 2d9f9c3d1f
[autoformat] Add mtouch.csproj. (#16316)
This also required modifying mtouch.csproj, otherwise the wrong settings would
be applied.
2022-10-13 10:42:41 +02:00
Rolf Bjarne Kvinge ee7e95dd69
[autoformat] Add mmp.csproj. (#16313) 2022-10-11 22:36:58 +02:00
Rolf Bjarne Kvinge c7badeacf1 Merge main into xcode14.1. 2022-10-04 16:21:54 +02:00
Rolf Bjarne Kvinge 9d0687191d
[autoformat] Add dotnet-linker to the projects to autoformat. (#16178) 2022-09-30 09:32:42 +02:00
TJ Lambert de7dccd8b0
[AVKit and AVRouting] Updates for Xcode14 Beta3 (#15811)
This PR has the AVKit updates and introduces the AVRouting bindings that
are interconnected with AVKit

Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Co-authored-by: tj_devel709 <antlambe@microsoft.com>
2022-09-08 15:13:15 -05:00
TJ Lambert 7bd98383e1
[HealthKit] Update bindings for Xcode 14 beta 1-4 (#15612)
This one has been a toughy 😮‍💨
@mandel-macaque I am creating the draft PR and here is a gist with the MacModern failures that you mentioned you would take a closer look at: https://gist.github.com/tj-devel709/24f5c63d4b698a0e2387524a0d2666c6

There were also monotouch-test failures that seem to be related to enabling mac that I could use some help with as well.

Lastly, @chamons there was a failing Cecil test regarding ios in DidGenerateEvent method found here: https://gist.github.com/tj-devel709/2c8aee7325c0c2751e29269d3eb77fef. I did not touch this method so I am not sure why this would be a problem.
Here is the Cecil failure: https://gist.github.com/tj-devel709/cfb2576c75de2ee100a8f2b7ee6e3923

Thanks for the help!

Edit *: Issues mentioned in the code comments
https://github.com/xamarin/maccore/issues/2609
https://github.com/xamarin/maccore/issues/2610

Co-authored-by: tj_devel709 <antlambe@microsoft.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>
2022-09-01 10:24:35 -05:00
Rolf Bjarne Kvinge 77b8b61639
[tools] Make sure to finish the P/Invoke generator output before running the static registrar. Fixes #15190. (#15214)
Otherwise the P/Invoke generator leaves partial results in the static
registrar class, essentially saying things like "we've processed CoreMidi, no
need to add an #include for this framework", and then we'd generate the static
registrar code and that code would lack the #include for CoreMidi.

Finishing the P/Invoke generator output will clear out any state stored in the
static registrar.

Also fix a few other issues to make the generated P/Invoke wrapper code work,
and add a test.

Fixes https://github.com/xamarin/xamarin-macios/issues/15190.
2022-06-09 07:38:45 +02:00
Rolf Bjarne Kvinge 92eda7f353
[dotnet] Add support for selecting whether to create P/Invoke wrappers or not. Fixes #4940. (#14961)
* This is a potential mitigation for slower transition to native code when
  exception marshalling is enabled (#14812).
* A minor modification was required in the linker, to make sure any modified
  assemblies are saved.

Fixes https://github.com/xamarin/xamarin-macios/issues/4940.
2022-05-11 16:42:01 +02:00
Frank A. Krueger bd4fee0cdc
Add MetalPerformanceShadersGraph Bindings (#14303)
I'm very pleased to present full bindings to the MetalPerformanceShadersGraph framework!

I'm happy with how everything turned out with the exception of a few notes and questions below.

I re-implemented Apple's MNIST sample (from https://developer.apple.com/documentation/metalperformanceshadersgraph/training_a_neural_network_using_mps_graph) here:

https://gist.github.com/praeclarum/b8077771fb341a1f9c28240113e00425

It's also added as a unit test.

Fixes #14286

### Notes

* Although the API says it works on macOS 11, it has bugs and crashes with errors even with Apple’s Swift examples. It’s better on macOS 12. iOS 14 and on is fine.

* `MPSGraphSparseStorageType` has terrible names. They match Apple's but I wish they were better.

* I added convenience methods to `MPSNDArray` and `MPSGrapTensorData` and the `Variable` and `Constant` operations to decrease the amount of unsafe code users have to write. I currently do this for 32-bit floats, the most common data type.

Co-authored-by: Alex Soto <alex@alexsoto.me>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-05-10 10:52:22 +02:00
Alex Soto 28f905fd75
[CHIP] Remove CHIP framework from dotnet (#14309)
CHIP framework seems to not be stable yet from Apple's side
each xcode update it brings breaking changes and it is also
not documented anywhere so let's disable it for now and
we can re-enable it in the future once it is stable.
2022-03-04 11:59:49 -05:00
Rolf Bjarne Kvinge e0f5cede53
[tools] Remove XAMCORE_4_0 condition in linker source. (#14091)
Thinks are working fine as-is (with this XAMCORE_4_0 variable set to false),
and I see no particular reason in the code to change it, nor does the original
implementation explain much (b2bcad7a94).

So just remove this XAMCORE_4_0 condition as if it had never existed.
2022-02-08 10:38:49 +01:00
Rolf Bjarne Kvinge 6220b0fd11 [linker] Preserve the NativeHandle constructor now. 2021-11-26 14:25:21 +01:00
Rolf Bjarne Kvinge 4b81c5d143
[QTKit] Remove the QTKit framework from .NET. (#13224)
The QTKit framework does not exist on macOS anymore, so just remove our
bindings for it now that we can break compatibility.

Fixes a lot of errors like this when building with XAMCORE_4_0:

> build/dotnet/macos/generated-sources/Accessibility/AXCategoricalDataAxisDescriptor.g.cs(14,7): error CS0246: The type or namespace name 'QTKit' could not be found (are you missing a using directive or an assembly reference?)
> build/dotnet/macos/generated-sources/Accessibility/AXChart.g.cs(14,7): error CS0246: The type or namespace name 'QTKit' could not be found (are you missing a using directive or an assembly reference?)
> build/dotnet/macos/generated-sources/Accessibility/AXChartDescriptor.g.cs(14,7): error CS0246: The type or namespace name 'QTKit' could not be found (are you missing a using directive or an assembly reference?)
> build/dotnet/macos/generated-sources/Accessibility/AXChartDescriptorContentDirection.g.cs(14,7): error CS0246: The type or namespace name 'QTKit' could not be found (are you missing a using directive or an assembly reference?)
> build/dotnet/macos/generated-sources/Accessibility/AXCustomContent.g.cs(14,7): error CS0246: The type or namespace name 'QTKit' could not be found (are you missing a using directive or an assembly reference?)
> build/dotnet/macos/generated-sources/Accessibility/AXCustomContentImportance.g.cs(14,7): error CS0246: The type or namespace name 'QTKit' could not be found (are you missing a using directive or an assembly reference?)
> [...]
2021-11-03 08:48:34 +01:00
Rolf Bjarne Kvinge b87db48344
[mtouch] Make 'MonoTouch.Dialog-1' and 'MonoTouch.NUnitLite' SDK assemblies, not product assemblies. Fixes #12862. (#12919)
The "product assembly" is supposed to be Xamarin.iOS.dll, Xamarin.Mac.dll,
etc., not other assemblies, so fix the implementation to reflect this. The
original commit where MonoTouch.Dialog-1 and MonoTouch.NUnitLite were
introduced as platform assemblies is quite old [1], and doesn't explain much,
but I believe the intention was to make us treat these assemblies as *SDK*
assemblies and link them accordingly, so I made these assemblies SDK assemblies now.

Additionally remove "Xamarin.iOS" as a hardcoded platform assembly for Mac
Catalyst, because this particular code is exclusive to legacy Xamarin, and Mac
Catalyst support will only be included in our .NET release, which means this
code does not have any purpose here, and might even break something one day.

[1]: 0349f8d47f

Fixes https://github.com/xamarin/xamarin-macios/issues/12862.
2021-10-04 19:14:34 +02:00
Rolf Bjarne Kvinge 5a0a5cdab9
[dotnet-linker] Check if both static and dynamic libraries from the Mono runtime matches P/Invoke libraries. (#12791)
When checking if we need to manually preserve a native symbol, we need to
check if a P/Invoke matches both static and dynamic libraries from the Mono
runtime, not just dynamic libraries.
2021-09-22 07:32:51 +02:00
Manuel de la Pena 143a2216a6
[ThreadNetwork] Add new framework Xcode 13 beta 5. (#12533)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-08-26 18:15:31 -04:00
Rolf Bjarne Kvinge cd60fc7123
[tests] Add .NET version of link all for macOS. (#12436)
This also required changing some linker code to not have platform-specific conditional compilation,
because dotnet-linker is built only once for .NET (same binary for all platforms).
2021-08-17 16:39:43 +02:00
Rolf Bjarne Kvinge 2972e1b715
Fix some whitespace issues in various files. (#12399)
* Remove BOM
* Add EOL at end of file.
2021-08-11 10:06:46 +02:00
Sebastien Pouliot a20d417bf7
[dotnet][linker] Enable the sealer optimization (#12009)
when (by default)
* the interpreter is not enabled (since new code might subclass or override the members analyzed at build time)
* building for release

Reverts c56b893b68
Fix https://github.com/xamarin/xamarin-macios/issues/9573

Notes

* Even if possible (in metadata) there is no point in setting `final` on
a method if we remove `virtual`. This match ILLink version of the sealer
and makes the same test pass on both.

* Don't apply optimization on non-AOT builds, e.g. simulators, since some
features (like XML serialization) checks for
`RuntimeFeature.IsDynamicCodeSupported` and that requires some types
to be subclassed thru SRE
2021-08-10 16:01:30 -04:00
Rolf Bjarne Kvinge 6dda8a97dc
[tools] Link away Runtime.RegisterEntryAssembly if and only if we've optimized away the dynamic registrar. Fixes #12327. (#12330)
Previously we'd only call Runtime.RegisterEntryAssembly in the simulator if
the dynamic registrar was available, but now we may call it on device as well
(still only if the dynamic registrar is available). So modify the linker to
keep Runtime.RegisterEntryAssembly even if we're executing on device, as long
as the dynamic registrar is around.

This ensures we get the same behavior both in the simulator and on device (and
desktop for that matter).

Fixes https://github.com/xamarin/xamarin-macios/issues/12327.
2021-08-04 09:26:58 +02:00