xamarin-macios/tools/linker
Sebastien Pouliot 54f2dae935
[mtouch] Add `force-rejected-types-removal` optimization (#8009)
This optimization can be enabled when it's not possible to use the
managed linker (e.g. **Don't link**) or when the managed linker cannot
remove references to deprecated types that would cause an application
to be rejected by Apple.

References to the existing types will be renamed, e.g. `UIWebView` to
`DeprecatedWebView`, in every assemblies.

The type definition is also renamed (for validity) and all custom
attributes on the types and their members will be removed.
Code inside the members will be replaced with a
`throw new NotSupportedException ();`.

The msbuild test app `MyReleaseBuild` has been updated to test that the
optimization is working as expected (device builds are slow so reusing
this test has little impact in test time).

Basically the test ensure that `UIWebView` is used and cannot be removed
by the compiler (optimization) or the managed linker (since it's
referenced). Since the optimization is enabled then we can `grep` then
final `.app` directory to ensure there's no mention of `UIWebView` inside
any of the files that would be submitted.

The application can be run, by itself, and will turn green if OK, red if
`DeprecatedWebView` can't be found (skeleton replacement for `UIWebView`)
or orange if a `NotSupportedException` is thrown.

Finally introspection tests have been updated to skip over the deprecated
(and renamed) types. It should not be an issue right now, since this
optimization is not enabled by default, but it made testing easier.
2020-03-02 09:20:29 -05:00
..
MonoTouch.Tuner [mtouch] Add `force-rejected-types-removal` optimization (#8009) 2020-03-02 09:20:29 -05:00
ApplyPreserveAttribute.cs [linker] Remove static state, and put the state inside DerivedLinkContext instead. (#1657) 2017-02-10 07:45:42 +01:00
BaseProfile.cs Build mmp. 2016-04-24 14:47:26 -04:00
ChangeLog Build mmp. 2016-04-24 14:47:26 -04:00
CoreHttpMessageHandler.cs HttpClientHandler is still in System.Net.Http.dll and use short string for http handler in runtime-options.plist 2019-04-02 17:20:58 +02:00
CoreMarkStep.cs [linker] Always preserve INativeObject (interface) on types. Fixes #6711 (#6737) 2019-08-08 17:19:06 -04:00
CoreOptimizeGeneratedCode.cs [Localization] mtouch/mmp C# (#7710) 2020-01-31 15:02:52 -05:00
CorePreserveCode.cs Build mmp. 2016-04-24 14:47:26 -04:00
CoreRemoveAttributes.cs [mtouch/mmp] Register complete protocol information in the static registrar, and link away unneeded metadata/code. 2018-02-12 14:46:01 +01:00
CoreRemoveSecurity.cs Build mmp. 2016-04-24 14:47:26 -04:00
CoreSweepStep.cs [linker] Find linked away interfaces when resolving removed interfaces. Fixes #3513. (#3515) (#3524) 2018-02-19 15:24:40 +01:00
CoreTypeMapStep.cs [Localization] mtouch/mmp C# (#7710) 2020-01-31 15:02:52 -05:00
CustomSymbolWriter.cs [mtouch] Use a custom symbol writer to ensure only pdb file names are written to assemblies. 2019-02-13 14:59:34 +01:00
ExceptionalSubStep.cs [linker] Remove static state, and put the state inside DerivedLinkContext instead. (#1657) 2017-02-10 07:45:42 +01:00
MarkNSObjects.cs [linker] Do not mark NSObject subclasses from Xamarin.Forms.Platform.iOS.dll assembly (#7473) 2019-11-22 15:38:46 +01:00
MobileExtensions.cs [Localization] mtouch/mmp C# (#7710) 2020-01-31 15:02:52 -05:00
MobileMarkStep.cs [linker] Fix NRE when System.Linq.Queryable is used. Fix #6346 (#6805) 2019-08-20 20:17:57 -04:00
MobileProfile.cs Bump mono to 2019-08@528103728fc2aedb7b6062e11255d39a0ed3f31c to add missing NS2.1 APIs (#7147) 2019-10-02 07:59:39 -04:00
MobileRemoveAttributes.cs Build mmp. 2016-04-24 14:47:26 -04:00
MobileResolveMainAssemblyStep.cs Bump to mono:2017-12 (#3421) 2018-02-14 11:08:01 -05:00
MobileSweepStep.cs Bump to mono:2019-10 (#7192) 2019-12-04 15:10:32 -05:00
ObjCExtensions.cs [ImageCaptureCore] Add ImageCaptureCore Bindings (#5074) 2018-11-07 09:52:39 -05:00
README.linker Build mmp. 2016-04-24 14:47:26 -04:00
RemoveRejectedTypesStep.cs [mtouch] Add `force-rejected-types-removal` optimization (#8009) 2020-03-02 09:20:29 -05:00
RemoveSelectors.cs [macos][mmp] Fix RemoveSelectors when generics are used, Fix #55693 (#2104) 2017-05-18 08:45:23 -04:00
RemoveUserResourcesSubStep.cs [mtouch][mmp] Unify user resources removal as a link step (#1026) 2016-11-01 13:11:25 -04:00
ScanTypeReferenceStep.cs [mtouch][mmp] Add a `--warn-on-type-ref=X` option (#7949) 2020-02-20 22:25:23 -05:00

README.linker

README.linker

Q: Why some stuff is not linked out ?

A: In most case this is because:
	a) the BCL uses it internally
	b) the mono runtime depends on the type, methods, class layout


= mscorlib.dll =

System.Security.PermissionSet
	* Assembly has (3) fields of that type
	* mscorlib.xml preserve all fields from Assembly (object-internals.h)
	* code is "stubified" by the linker
System.Security.Policy.ApplicationTrust: 
	* Used as a field in AppDomainSetup;
	* Field also exists in unmanaged code (domain-internals.h);
	* mscorlib.xml preserve all fields from AppDomainSetup
	* only the default .ctor remains and is stubified by the linker
System.Security.Policy.Evidence
	* Used by AppDomain.Load[Assembly]
	* Used by Assembly.LoadWithPartialName overloads
	* code is "stubified" by the linker


= System.dll =

System.Text.RegularExpressions.*
	* Included because there is 2 regex in UriParser