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

45 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge f9e3cbdf57 [mtouch] Incremental builds (--fastdev) is the same as compiling all assemblies to dynamic libraries. 2017-02-10 14:46:29 +01:00
Rolf Bjarne Kvinge e620caefe2 [mtouch] Implement support for creating frameworks from assemblies.
Implement support for linking the output from AOT compilation to frameworks,
and then bundling those frameworks.
2017-02-10 14:46:28 +01:00
Rolf Bjarne Kvinge a590612751 [mtouch] Add an --assembly-build-target option. 2017-02-10 14:29:11 +01:00
Rolf Bjarne Kvinge 5fb09b1b84 [linker] Remove static state, and put the state inside DerivedLinkContext instead. (#1657)
Remove the usage of static variables in the linker so that one day we can run
the linker in parallel over multiple assembly sets.
2017-02-10 07:45:42 +01:00
Rolf Bjarne Kvinge 30082029cb [mtouch] Fix compiler warning in generated main code. (#1550) 2017-01-24 13:43:38 +01:00
Rolf Bjarne Kvinge a42419ab2d [mtouch] Remove dead code. (#1549) 2017-01-24 13:43:01 +01:00
Rolf Bjarne Kvinge 29dbb38ad4 [mtouch] It's no longer necessary to set MONO_GC_PARAMS during AOT-compilation. (#1548)
According to Vlad it's not necessary to set MONO_GC_PARAMS during AOT-
compilation, since all MONO_GC_PARAMS options can be changed at runtime:

Rolf Kvinge [16:35] @vlad.brezae is this true for all the different options MONO_GC_PARAMS take: https://github.com/xamarin/xamarin-macios/pull/1546#discussion_r97318092?
Rolf Kvinge [16:36] I remember this: https://bugzilla.xamarin.com/show_bug.cgi?id=35414#c14
Rofl Kvinge [16:36] which apparently you changed here, so that it can be changed at runtime: https://bugzilla.xamarin.com/show_bug.cgi?id=35414#c27
Rolf Kvinge [16:36] but I don't know if this is true for all the options you can pass using MONO_GC_PARAMS
Vlad Brezae [16:41] yes, it should be true for all of them, that was a bug
Rolf Kvinge [16:41] ok, that's great news 😄
2017-01-24 10:07:42 +01:00
Rolf Bjarne Kvinge 1a7a4ab463 [mtouch] Add support for specifying how to optimize LLVM output. (#1532)
Performance tests
-----------------

This is for a new watchOS extension project, built for release.

* The default (currently -O2) optimizations:      41s (  baseline )  30.027.060 bytes (     baseline    )
* All optimizations disabled (`--llvm-opt=all=`): 17s (-24s = -59%)  32.978.312 bytes (+2.951.252 = +10%)
* Optimized for size (`--llvm-opt=all=-Os`):      36s ( -5s = -12%)  28.617.408 bytes (-1.409.652 =  -5%)
* Optimized for more size (`--llvm-opt=all=-Oz`): 35s ( -6s = -15%)  28.601.016 bytes (-1.426.044 =  -5%)
* Optimized slightly (`--llvm-opt=all=-O1`):      35s ( -6s = -15%)  28.666.556 bytes (-1.360.504 =  -5%)
* Optimized a lot (`--llvm-opt=all=-O3`):         41s (  0s =   0%)  30.403.996 bytes (+  376.936 =  +1%)

Conclusions
-----------

* The fastest build by far (less than twice as fast) is if optimizations are
  disabled, but this adds a 10% size penalty (~3 MB in this test case),
  compared to the baseline, and 15% size penalty (4.3 MB) compared to -Oz.
* -Oz seems to have the best overall results: at least as fast as any other
  optimized build, and the smallest app as well.

Caveats
-------

Some optimizations might not work the AOT compiled code. The resulting
binaries have not been tested.
2017-01-20 16:11:48 +01:00
Rolf Bjarne Kvinge 786ae13f80 [mtouch] Fix an unnecessary re-link when the linker copies assemblies without processing them. (#1534)
Event sequence:

* mtouch is executed with the linker disabled.
* The linker pipeline copies all input assemblies (since the linker is
  disabled the assemblies don't change) into the PreBuild directory. This will
  keep the original timestamps of the input assemblies.
* mtouch is executed again, when none of the input assemblies changed.
* The linker pipeline will re-execute, because it will see that at least one
  of the input assemblies (at least the .exe) is newer than at least one of
  the assemblies in the PreBuild directory (usually a framework assembly,
  because those have the original timestamp from their install location).

Fix:

Touch all the assemblies in the PreBuild directory after the linker pipeline
executes the first time. This way the second time mtouch is executed, it will
find that all assemblies in the PreBuild directory have timestamps later than
all the input assemblies, so it will load the cached linked assemblies,
instead of re-executing the linker pipeline.
2017-01-20 10:45:08 +01:00
Rolf Bjarne Kvinge dae1d79aed [mtouch] Quote symbols passed to the native linker.
Also quote any arguments with a '$' character.
2017-01-18 10:48:11 +01:00
Rolf Bjarne Kvinge 5aaea3ee49 [mtouch] Build extensions and the container app in the same mtouch process.
Build extensions and the container app in the same mtouch process, by storing
all the mtouch arguments when called to build extensions in a text file, and
then reloading those arguments when called to build the main app.

This is required if we want to share code between extensions and the
container.
2017-01-16 13:52:37 +01:00
Rolf Bjarne Kvinge 53fc697aad [mtouch] Refactor command-line parsing to be reusable.
Also add a few tests to verify how we treat the root assembly (or lack
thereof).
2017-01-16 13:52:37 +01:00
Rolf Bjarne Kvinge d2498370d9 [mtouch] Make the 'action' a local variable instead of a global one.
Make the 'action' a local variable instead of a global one so that argument
parsing can be done multiple times.
2017-01-16 12:45:03 +01:00
Rolf Bjarne Kvinge 052c2e9753 [mtouch] Refactor input validation a bit.
Move some input validation from the Main method to the App instance,
since it depends on the App instance.
2017-01-16 12:42:46 +01:00
Chris Hamons ffe142d0b5 [XM] AOT support in Xamarin.Mac (#1340) 2017-01-11 14:10:39 -06:00
Rolf Bjarne Kvinge d7ecfc3a14 [mtouch/mmp] Make Cache a non-static class. (#1425)
So that there can be multiple caches in the same process (which we'll have
once mtouch can compile extensions and the container app in the same process).
2017-01-03 15:14:47 +01:00
Rolf Bjarne Kvinge ab2548a115 [mtouch] Automatically create the output directory if it doesn't exist. (#1414) 2016-12-24 10:57:08 -05: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
Rolf Bjarne Kvinge 3ec3f39089 [mtouch] Always require a SDK version when building. (#1407)
* [mtouch] Always require a SDK version when building.

Technically it was required before too, but the error messages were non-optimal:
it could for instance complain that the user is using an iOS framework that
was introduced in iOS 2.0.

* [mtouch tests] Rewrite MT0060 and MT0061 tests to use MTouchTool.

This makes sure we pass --sdk to mtouch (which MTouchTool does by default), so
that we don't run into MT0025 before the errors we're testing for.
2016-12-23 17:09:39 +01:00
Rolf Bjarne Kvinge ee5b450174 [mtouch] Remove deprecated comment. (#1402) 2016-12-23 07:35:36 +01:00
Rolf Bjarne Kvinge 7dad48a59c [mtouch] Remove dead code. (#1397)
The (ugly) manual exit logic was only needed when interacting with the
simulator, which mtouch doesn't do anymore.
2016-12-22 17:39:10 +01:00
Rolf Bjarne Kvinge 7842a0b506 [mtouch] Remove deprecated Classic commmand-line arguments. (#1319)
* [mtouch] Remove deprecated Classic commmand-line arguments.

* [mtouch docs] Document MT0022's death.
2016-12-08 18:59:04 +01:00
Rolf Bjarne Kvinge 30bac18e10 [mtouch] Fix BundleId. (#1315)
The BundleId property is used by the code that generates the mSYM directory,
but its value was always the default value 'com.yourcompany.sample' instead of
looked up in the app's Info.plist.

So fix the BundleId property to do the expected.

Also fix the mSYM test (SymbolicationData) to actually test mSYM stuff (it was
partially disabled when we disabled automatic mSYM generation for C8, and
never re-enabled), and port it to the new and better test syntax, and add a
few more asserts to check the manifest.xml generation.
2016-12-08 16:05:47 +01:00
Rolf Bjarne Kvinge e563d96083 [mtouch] Fix parsing --mono argument. (#1145) 2016-11-09 16:16:00 +01:00
Rolf Bjarne Kvinge ac98469ddd [mtouch] Run the partial static registrar separately for 32-bit and 64-bit. (#1078)
Run the partial static registrar separately for 32-bit and 64-bit, since this
is required with the upcoming changes to embed metadata tokens inside the
generated output, because the metadata tokens are different between the 32-bit
and 64-bit versions of Xamarin.iOS.dll.

Also make sure to properly resolve the 32-bit and 64-bit assemblies correctly
(by setting the ArchDirectory on the assembly resolver), so that we don't pick
up the reference assembly (which does not have the right metadata tokens).

Additionally stop running the partial static registrar for MonoTouch.Dialog-1,
since with the upcoming changes to use metadata tokens in the generated
output, we won't support registering anything more than once. This shouldn't
make much of an impact, because MonoTouch.Dialog-1 is fairly small, and
doesn't take long to register in the dynamic registrar. For device builds (or
when the static registrar is selected) this has no effect, since in that case
we're registering everythinga anyway.
2016-11-01 16:41:41 +01:00
Rolf Bjarne Kvinge 0c43ddc615 Disable managed exception marshaling when the debugger is attached. Fixes #45116. (#1055)
Managed exception marshaling interferes with the debugger, because it adds
exception handlers to executing code, which makes the Mono runtime think an
exception is handled when logically it's not (although technically it is).

The consequence is that the IDEs will only be notified when we re-throw the
exception after catching it, making it impossible for the IDEs to stop when
the exception is thrown (they will instead stop when we re-throw the
exception).

So disable managed exception marshaling (unless the user changed the default
behavior) when a debugger is attached.

This is the same behavior as Xamarin.Android.

https://bugzilla.xamarin.com/show_bug.cgi?id=45116
2016-10-28 19:07:01 +02:00
Rolf Bjarne Kvinge 71a578ee38 [runtime] Remove deprecated and ignored mono option. (#1019)
Setting this option prints this to stdout:

> Mono Warning: option gen-compact-seq-points is deprecated.

and it's ignored, so just don't set this option.
2016-10-27 16:04:19 -04:00
Rolf Bjarne Kvinge c533db66bf [mtouch] Always use ordinal string comparisons. (#995) 2016-10-14 12:34:35 +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 4d06d05cc0 [mtouch] Add workaround for file descriptor leak in System.Diagnostics.Process. (#917) 2016-09-29 17:45:23 +02:00
Rolf Bjarne Kvinge 0db1fe1ff2 [mtouch] Add support for -j X to specify concurrency. (#876) 2016-09-22 09:21:20 -04:00
Manuel de la Pena 46e6f06919 [mtouch] MVID for symblication ought to be lower case and with no `-` (#749) 2016-09-02 16:25:12 -04:00
Manuel de la Pena 30ae7cf5a3 [Fix] Ensure that symbolication contains the aotid subdirs that will contain the msym files. 2016-07-18 16:42:00 +02:00
Rolf Bjarne Kvinge b6189e9165 [mtouch] Make sure to reference mono_profiler_startup_log so that the native linker doesn't remove the symbol. Fixes #41666. (#340)
https://bugzilla.xamarin.com/show_bug.cgi?id=41666
2016-07-04 13:25:34 -04:00
Rolf Bjarne Kvinge 2d28e24837 [runtime] Handle any exceptions whenever we return from managed code. 2016-06-08 20:05:54 +02:00
Rolf Bjarne Kvinge 62cbe7e1f6 [mtouch] Fix logic to detect if simlauncher can be used. 2016-05-17 11:24:04 +02:00
Rolf Bjarne Kvinge 86c73f8fc0 Refactor static registrar to produce both a header and a source file.
This way we can re-use the header in other files.
2016-05-17 11:23:47 +02:00
Rolf Bjarne Kvinge 9b4f7532ab Add runtime variable to specify the exception marshalling modes, and mmp/mtouch options to select it. 2016-05-17 11:20:26 +02:00
Rolf Bjarne Kvinge b8abf3db01 Add runtime variable to specify if the Coop GC should be used, and a mmp/mtouch option to select it.
The mmp/mtouch option is hidden for now, since it's not actually possible
to select the Coop GC yet.
2016-05-17 11:20:26 +02:00
Sebastien Pouliot 61b3006b84 [mtouch] Fix --sdkroot not to report a default to /Developer/. Fixes part of #41083
Also bump maccore so `mlaunch` behave like `mtouch` wrt --sdkroot

https://bugzilla.xamarin.com/show_bug.cgi?id=41083
2016-05-14 11:11:40 -04:00
Sebastien Pouliot 448a3cf1d6 [mtouch] Look where XS 6.1+ has installed mlaunch. Fixes part of #41083
The initial location was incorrectly guessed (before XS added it).

$ mtouch --launchsim tests//monotouch-test/bin/iPhoneSimulator/Debug/monotouchtest.app --sdkroot /Applications/Xcode73.app/Contents/Developer/
error MT0092: Could not find 'mlaunch'.

https://bugzilla.xamarin.com/show_bug.cgi?id=41083
2016-05-13 16:29:41 -04:00
Rolf Bjarne Kvinge 0d376c521a [mtouch] Properly link with CoreAudioKit when not using simlauncher. (#49)
Also bump maccore to get new test.

commit xamarin/maccore@eb9c34d875
Author: Rolf Bjarne Kvinge <rolf@xamarin.com>
Date:   Fri May 13 12:46:04 2016 +0200

    [monotouch-test] Add test to ensure mtouch properly links with CoreAudioKit when not using simlauncher.
2016-05-13 08:23:49 -04:00
Rolf Bjarne Kvinge 00a855f2b1 [mtouch] Fix building the static registrar files. 2016-04-25 18:15:02 -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 50a8af84db Add mtouch to the build. 2016-04-24 14:47:27 -04:00