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

61 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge bbbe881747 Fix how we build frameworks. Fixes #53813. (#1952)
Previously we copied any equivalent .dylib and ran install_name_tool on the
library to change the library id to make it a framework.

Unfortunately this does not work when the library contains bitcode, because
bitcode embeds linker flags (-install_name for instance), and
install_name_tool does not change those linker flags.

This means that we need to create frameworks by linking with the proper
arguments, since it's much more difficult to fixup the embedded bitcode linker
flags as well.

So change how be build Mono.framework, Xamarin.framework, and any frameworks
built from assemblies to:

* Always link instead of fixup a dylib. For Mono.framework this means
  extracting all the object files from libmonosgen-2.0.a and linking those,
  for Xamarin.framework this means linking the object files we've already
  built.

* Make sure the library is correctly named when linked (once again: bitcode
  contains embedded linker flags, so renaming the executable later breaks
  stuff as well).

I've also extracted the logic that creates Mono.framework from
libmonosgen-2.0.a to a separate shell script, to deduplicate this logic.

This required a minor change in the mono builds: we need the Mono.framework
when building the `all` target, so make sure that happens.

https://bugzilla.xamarin.com/show_bug.cgi?id=53813
2017-04-03 11:52:29 +02:00
Rolf Bjarne Kvinge b568b2541e [builds] Improve mono/llvm dependencies. (#1948)
* [builds] Improve mono/llvm dependencies.

* Create a list of all the files in the mono and llvm repositories, and save
  these lists as a Make variable (in a generated Makefile - .deps.*.mk). We
  don't list _all_ the files in each repository, because there are quite a few
  (55k for mono), and Make measurably takes a while to check all of them, so
  try to limit it to a sane subset, without risking missing changes to files
  that actually matters.

* Always create stamp files when we're done with mono builds.

* Modify the mono/llvm builds to depend on all the files in their
  repositories.

* Explicitly list the corresponding .stamp-build-* files as dependencies for
  various files that are produced by the mono builds, so that make knows how
  to build these files.

* Rewrite the *-facade-check targets to depend on the corresponding
  *_BCL_TARGETS, so that we can avoid running a submake to the same Makefile
  to execute the facade checks.

  It now takes a little while (less than a second on my machine, which is
  fine) for make to list all dependencies and get their timestamps, but if
  executing multiple submakes this adds up to a multi-second timewaste.

  So avoid the timewaste by not doing submakes, but instead use dependencies
  to enforce the required target execution ordering.

* Don't depend on nicely named intermediate targets, since won't prevent
  rebuilds:

      build-cross64: setup-cross64

  Since the `setup-cross64` file doesn't exist, `build-cross64` will always
  execute. Instead depend on the stamp file:

      build-cross64: .stamp-configure-cross64

  And now `build-cross64` will only rebuild if needed.

* Don't try to list all intermediate files as .SECONDARY dependencies, instead
  list none at all, which works as if all files were listed as dependencies.

* Some targets had to move later in the file, since variables used in dependencies:

       foo: $(VARIABLE)

  must be defined before that point in the file, as opposed to variables used in recipes:

       foo:
           $(MAKE) $(VARIABLE)

  can be defined anywhere in the Makefile.

* Simplify the targets that sign assemblies significantly.

There are a few end results:

* It's now possible to do `make install`, without doing `make all` first. This
  might seem weird, but that also ensures the more common `make all install`
  works properly.

* Remakes (without any mono/llvm changes) in build/ are much faster, because
  we now won't recurse into every mono build:

      $ time make all -C builds/ -j8
      [...]
      real  0m1.873s

  This even means that we might be able to make it a habit to remake in the
  root directory, which doesn't take forever now:

      $ time make all -j8
      [...]
      real  0m4.521s

  Unfortunately adding `make install` to the mix still does some useless
  stuff, and it ends up taking ~30 seconds to complete a full build:

      $ time make all install -j8
      [...]
      real  0m32.542s

* [msbuild] Don't verify the xml syntax of targets files unless the files change.

* [build] Don't depend on installed files.

Don't depend on installed files, because that causes a rebuild when installing
to a different directory (i.e. package creation).

* Bump maccore to get build improvements.

Rebuilds are now very fast:

    $ make all install -j8
    $ time make all install -j8
    real	0m5.735s

Less than 6s to figure out that nothing needs to be done.

And strangely flushing the disk cache doesn't make it much slower:

    $ sudo purge
    $ time make all install -j8
    real	0m7.309s

Which probably means that Make mostly reads file metadata, and not actual file
contents (which is good).
2017-03-31 20:23:38 +02:00
Marek Safar 105ee26509 Merge remote-tracking branch 'origin/master' into mono-2017-02 2017-03-23 23:13:43 +01:00
Marek Safar 6906d8948e Remove mdbrebase which is no longer needed (compiler does it now) 2017-03-14 11:51:08 +01:00
Marek Safar 16ba9f1452 [build] Update debug symbols to pdb 2017-03-14 11:47:06 +01:00
Marek Safar 398935db61 Bump mono 2017-03-14 11:47:06 +01:00
Marek Safar 1e77e19aa1 Remove 4.x profile dependency 2017-03-14 11:47:06 +01:00
Marek Safar 1f606b58b3 Replace mdbrebase tool with pathmap and fix broken debug symbols mapping in public builds 2017-03-14 11:47:06 +01:00
Marek Safar 6a20abca76 [build] Profiles cleanup 2017-03-14 11:47:06 +01:00
Rolf Bjarne Kvinge b7794b0eb7 [builds] Don't install mono binaries for the generator if we're using the IKVM-based generator. 2017-03-09 12:47:57 +01:00
Rolf Bjarne Kvinge 743a45456d [builds] Fix mdb permissions. Fixes #52113. (#1605) 2017-02-01 10:47:46 +01:00
Manuel de la Pena d7a9bd462a [Debugger] Ensure that we use the correct paths in the mono mdb files (#1554)
* [Debugger] Ensure that we use the correct paths in the mono mdb files to be able to step into the mono code.

Fixes bug 51530.

* Make the mdb paths to be correct in other platforms.

* Ensure mdb paths are also correct in XM.
2017-01-25 13:17:02 +01:00
Rolf Bjarne Kvinge 3dac0bae81 Use @rpath instead of @executable_path in dylibs. (#1552)
Use @rpath instead of @executable_path in dylibs, since it allows us to be
more flexible when placing dylibs in the app.

In particular with this change it's trivial to put libmonosgen-2.0.dylib in
the container app, and reference it from extensions.
2017-01-24 20:24:32 +01:00
Rolf Bjarne Kvinge 0a07b6ba8e Remove unnecessary bitcode from dylibs. Fixes #51352 (#1469)
This is a series of fixes to the dynamic libraries we build / create to remove
any unnecessary bloat (unused architectures, bitcode).

A brand new watchOS app with no changes goes from 35MB to 11MB with these
fixes (with incremental builds disabled, the app size is 10MB).

--------------------------------------------------------------------------------

* [runtime] Split list of architectures into simulator and device-specific lists.

* [runtime] Build separate dylibs for device and simulator.

Build separate dylibs for device and simulator, since we already install these
into different locations.

This makes both the simulator and device builds slightly faster (since the
respective dylibs are smaller, and less data to copy around).

For watchOS apps, this saves ~430kb.

* [runtime] Strip bitcode from dylibs. Fixes #51352.

We know that dylibs will never be shipped to the App Store, so we'll never
need them to have bitcode.

So just strip the bitcode from all our dylibs, since this makes apps with
fastdev significantly smaller (and thus much faster to upload to watch
devices).

For watchOS apps this is a very significant improvement: a branch new watchOS
app without any changes goes from 35MB to 17MB.

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

* [mtouch] Fix dylib compilation to not embed full bitcode.

Facts
=====

a. The output from the AOT compiler is an assembly (.s) file.
b. Clang's assembler does not support -fembed-bitcode-marker (only -fembed-
   bitcode), so when we ask clang to -fembed-bitcode-marker, the assembler
   receives a -fembed-bitcode argument.
c. This means that the assembled object file does not contain the
   __LLVM/__bitcode and __LLVM/__cmdline sections (it does however contain an
   __LLVM/__asm section).
d. The native linker will create a bitcode assembly section if none of the
   object files passed to the linker contain a __LLVM/__bitcode section and
   there's an __LLVM/__asm section present.
e. The end result is that when we build to a dylib, we end up (unexpectedly,
   because we ask Clang to -fembed-bitcode-marker) including both armv7k and
   bitcode in the dylib, thus bloating the dylib size significantly.

Solution
========

We manually add the __LLVM/__bitcode and __LLVM/__cmdline sections to the .s
file Mono's AOT compiler generated. This way the .o file will have the magic
sections, and the linker will not include bitcode (only the bitcode marker) in
the final library.

An empty watchOS extension with incremental builds is now 6MB smaller (down
to 11MB from 17MB).
2017-01-16 12:32:06 +01:00
Chris Hamons ffe142d0b5 [XM] AOT support in Xamarin.Mac (#1340) 2017-01-11 14:10:39 -06:00
Rolf Bjarne Kvinge 3cf0eb89d1 [builds] Rely on the mono repo automatically cloning the binaries for the offset tool. (#1215) 2016-11-18 12:32:51 +01:00
João Matos ab5cf5cafd [cross] Bump Mono and update the AOT cross offsets generation paths. (#1176)
Following https://github.com/mono/mono/pull/3927 this needs to be updated to work with latest Mono revisions.
2016-11-11 14:24:47 -05:00
Sebastien Pouliot 742f85ff5a Ensure BoringTLS is not build (by default) in any configuration for XI and XM (no trace in logs) (#957) 2016-10-06 12:56:17 -04:00
Rolf Bjarne Kvinge c0255c2d49 Try to make the watch build parallel safe. (#949)
We need to build the watch profile in tools64 now, since we don't have
a separate watch-mono repository anymore.
2016-10-05 20:20:53 +02:00
Rolf Bjarne Kvinge 1d54c461b0 Remove the watch-mono repository, and use a single mono repository. (#941)
Still keeping some of the logic so that it's easy to switch back if we wish
to.
2016-10-05 16:21:01 +02:00
Chris Hamons 642173828e [XM] Disable blts on XM since we don't ship it (#946) 2016-10-04 21:31:56 -04:00
Rolf Bjarne Kvinge c4f4056b22 Bump [watch-]mono to get more API removal for watchOS. 2016-10-03 18:31:04 +02:00
Rolf Bjarne Kvinge 46b9a5bfbf [builds] Apply magic to make us build on Sierra. (#911)
* Pass -Wl,-no_weak_imports to the linker so that   we don't accidentally use
  symbols weakly. This would   cause problems on older OSes where the symbol
  isn't there, because our code is not prepared to deal with weakly linked
  symbols.

* Manually disable fstatat and readlinkat (introduced with Xcode 7 in iOS 8 /
  macOS 10.10), found by the above.

* Manually disable __thread support for a few targets, since mono's configure
  script doesn't properly detect it's not supported.

* Manually disable clock_nanosleep, since mono's configure script doesn't
  properly detect it's not supported.
2016-09-28 20:27:10 -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
Zoltan Varga 6d174b4fc1 [builds] Pass --with-llvm to the cross compile build's configure instead of adding llvm's bin directory to the PATH. (#862) 2016-09-20 20:34:05 -04:00
Chris Hamons e3863afb30 [XM] Enable System.Numerics.Vector assembly (#850)
- Bump mono to get 377041fd6e
2016-09-19 16:43:58 -04:00
Rolf Bjarne Kvinge fd47ae889f [builds] Don't install symlinks to iOS/Classic assemblies in the iOS/Unified profile. (#844)
* [builds] Don't install symlinks to iOS/Classic assemblies in the iOS/Unified profile.
* [fsharp] Don't install symlinks to iOS/Classic assemblies in the iOS/Unified profile.

The symlinks won't quite work once we remove the iOS/Classic assemblies.
2016-09-16 20:02:25 +02:00
Sebastien Pouliot 38148c718a Merge branch 'xcode8' 2016-09-09 15:29:37 -04:00
Rolf Bjarne Kvinge e5bdbdd1ac Allow profiling + incremental builds on bitcode-capable targets again. (#706)
Mono bug [#41428](https://bugzilla.xamarin.com/show_bug.cgi?id=41428) has been fixed now,
which means we have profiler dylibs again, so we can enable profiling + incremental builds again.
2016-08-30 11:39:29 +02:00
Chris Hamons b401d4eadb Build System.Security for XM Mobile (#450)
- Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=42692
2016-08-18 09:47:15 -05:00
Alexander Köplinger 59125e6f9c [C8] Bump to latest Mono 4.6.0 commit (#602)
* [C8] Bump to latest Mono 4.6.0 commit

Brings in the netstandard updates from https://github.com/mono/mono/pull/3394
We also had to add a new assembly System.IdentityModel.dll to the mobile profiles while doing that work.

* Add System.IdentityModel to Sdk assemblies

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 15:09:59 -04:00
Alexander Köplinger 834b46a5f6 Bump to latest Mono 4.6.0 commit (and master for watch) (#601)
Brings in the netstandard updates from https://github.com/mono/mono/pull/3394
We also had to add a new assembly System.IdentityModel.dll to the mobile profiles while doing that work.
2016-08-12 14:50:10 -04:00
Alexander Köplinger ba278764e6 Only use files ending in .dll for Facades check (#559)
Since eaf2ceb532 there can be .dll.mdb files
for Facades as well which broke the Facades check.

The fix is to only include files ending in .dll and ignore the others.
2016-08-05 20:14:57 +02:00
Zoltan Varga 2f0c5d0b40 [builds] Add a 'install-device' target to match the other 'device' targets. 2016-08-02 20:34:12 -04:00
Marek Safar 68c21e3174 [build] Update facades script to include correct names 2016-07-22 11:48:38 -04:00
Aleksey Kliger 23f5280276 Revert "Revert "Merge pull request #416 from marek-safar/cycle8-new-assemblies""
This reverts commit 8305bca6bd.
2016-07-21 17:27:55 -04:00
Chris Hamons 900d13c13f Build System.Security for XM Mobile (#451)
- Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=42692
2016-07-21 09:05:57 -05:00
Alexander Köplinger c50322f4dc [build] Update list of installed assemblies (#430)
(cherry picked from commit 1edab27b38)
2016-07-19 18:53:32 +02:00
Rolf Bjarne Kvinge fed6b450e4 [builds] Fix symlinks from Unified facades to Classic facades. (#424)
Instead of having a symlink of the entire Facades directory for
Unified, we must now create a real directory and symlink each Facade
assembly, because there's one Facade assembly that can't be shared
between Unified and Classic (System.Drawing.Primitives.dll) because
it references monotouch.dll/Xamarin.iOS.dll.
2016-07-19 11:12:00 +02:00
Sebastien Pouliot 8305bca6bd Revert "Merge pull request #416 from marek-safar/cycle8-new-assemblies"
This reverts commit 950a4badfd, reversing
changes made to 4ba36fc88d.

Incomplete port that breaks the build.
2016-07-18 21:14:38 -04:00
Marek Safar 1edab27b38 [build] Update list of installed assemblies 2016-07-18 07:21:36 -07:00
Marek Safar a48b3001ab [build] Update facades script to include correct names 2016-07-14 14:54:23 +02:00
Rolf Bjarne Kvinge 834c0a9fd7 Build with path to the exact SDK version. Fixes #41597. (#244)
If no sdk version (-sdk_version) is passed to the native
linker, it tries to infer the SDK version from the
path to the -syslibroot argument.

In our case we use a versioned path to Xcode, but a general
symlink without the SDK version:

/Applications/Xcode73.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk

which means ld picked up the Xcode version as the SDK version,
since that's the first number part of the path [1], so we'd
end up with libraries whose SDK version was 73.

So instead use an SDK path with the SDK version, so that ld
finds the SDK version instead of the Xcode version.

[1] 266f4401b9/src/ld/Options.cpp (L4005-L4020)

https://bugzilla.xamarin.com/show_bug.cgi?id=41597
2016-06-21 07:24:16 -07:00
Zoltan Varga 46dccaf7bc [builds] Don't pass --disable-shared-handles to mono's configure, its the default. Avoid some duplicate configure options. 2016-06-07 01:37:51 -04:00
Zoltan Varga d2300a17b2 [builds] Don't pass --enable-gsharedvt and --enable-native-types to mono's configure, they are enabled by default. 2016-06-07 01:35:58 -04:00
Zoltan Varga e3b219bc71 [builds] Disable the building of libmono-profiler-log.dylib on tvos as well. 2016-05-30 19:50:41 -04:00
Rolf Bjarne Kvinge 27402f8142 [builds] Avoid looking for libmono-profiler-log.dylib when bitcode is enabled, its not built anymore on mono master. (#95) 2016-05-27 17:46:06 +02:00
Rolf Bjarne Kvinge 16824dd40f [builds] Enable checked builds for watchOS for now, to make it easier to track down failures. 2016-05-26 17:47:10 +02:00
Rolf Bjarne Kvinge d48d7c2e11 [configure] Add option to disable device-related parts of the build. (#67)
And use it when building on jenkins.
2016-05-19 14:33:35 +02:00
Rolf Bjarne Kvinge 65c50daf22 [builds] Use the mono from watch-mono repo for bwatch-mono. (#64)
* [mk] Add watch-mono to the check-versions and reset-versions targets.

* [builds] Use the mono from watch-mono repo for bwatch-mono.
2016-05-18 19:33:04 +02:00