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

184 Коммитов

Автор SHA1 Сообщение Дата
Sebastien Pouliot bdd39b529e
[mtouch][mmp] Add a `--warn-on-type-ref=X` option (#8038)
Using this option it's possible to test for the presence of a type
reference in both pre-linked and post-linked assemblies.

This makes it possible to detect if
* a 3rd party assemblies are using some specific type you would like to avoid;
* a type reference has been removed during the build (e.g. linker)

Notes:
* Custom attributes are encoded differently and not included in the assembly type references metadata.
* Assembly that define a type `X` do not have a reference (but the definition) of the type (and won't be reported).

If either the pre or post-linked warnings are not useful then it's possible
 to add `-nowarn:150x` to exclude the results.

E.g.
* `-nowarn:1502` would not report references in pre-linked assemblies;
* `-nowarn:1503` would not report references in post-linked assemblies;

Finally `-warnaserror:150x` can be used to stop a build that would not
satisfy either the pre or post-linked condition.

* `-warnaserror:1502` would not report references in pre-linked assemblies;
* `-warnaserror:1503` would not report references in post-linked assemblies;

_side note_ this was first done on `d16-6` to ease backports as `master`
has multiple changes for localization. A similar PR will be done for
`master` once merged.
2020-03-04 17:28:39 -05:00
Rolf Bjarne Kvinge ab60a11f14
[mmp] Add deployment target to the -fobjc-runtime clang argument. Fixes #7204. (#7227) (#7231)
This is required when also passing the -fobjc-arc argument.

Fixes https://github.com/xamarin/xamarin-macios/issues/7204.

This is a backport of #7227.
2019-10-17 17:44:37 +02:00
Vincent Dondain a3076f29a3 Merge branch 'xcode11.1' into d16-4 2019-10-07 21:46:13 -04:00
Rolf Bjarne Kvinge 382083c992
[mmp] Don't ignore failures to execute pkg-config. (#7066)
Also bump system mono to a version whose pkg-config executable actually works
on Catalina.
2019-09-23 16:59:14 +02:00
Rolf Bjarne Kvinge 303aa0a649 Merge remote-tracking branch 'origin/xcode11' into master-xcode11 2019-09-13 18:35:18 +02:00
Rolf Bjarne Kvinge f6e0531197 Merge xcode11 into d16-3. 2019-09-12 08:29:02 +02:00
Jo Shields 926372c940 Bump to mono:2019-08 (#6723)
Included changes are:

* New Cecil API in 2019-08
* Permit new symbols from networkable AOT profiler in symbols test
* Bump Mono to include fix for zlib linking, and new Cecil API
* We need to link against zlib now, if using libmono.a
* [Tests] Ignore memory hungry tests in old devices. (#6913)
* Ignore certain tests that use too many resources in old devices.
* Add missing tests that use too much memory on 32b devices.
2019-09-09 09:44:03 -04:00
Rolf Bjarne Kvinge ec09193daf
Build native code with -std=c++14. (#6864)
* Build native code with -std=c++14.

Apple's headers now require -std=c++14 to compile their headers in C++ mode.

This fixes a compile error that would occur with the PhotosUI framework when
compiling code for C++.

* [mmp] Use -std=c++14 when compiling.

* Fix command line output.

* [mmp] Add all source files at the end, so they all get the -x clang argument applied.

* Limit when using c++14 in mtouch according to language.
2019-08-29 08:49:06 -07:00
Rolf Bjarne Kvinge 6075a9aa5b
[mmp] Remove support for 32-bit apps. Partial fix for #6300. (#6642)
Partial fix for https://github.com/xamarin/xamarin-macios/issues/6300.
2019-07-24 09:01:14 -07:00
Rolf Bjarne Kvinge a495077533
[xcode11] Stop building/shipping 32-bit Xamarin.Mac bits. Partial fix for #6300. (#6393)
This includes:

* 32-bit version of Xamarin.Mac.dll and OpenTK.dll
* XamMac.dll and XamMac.CFNetwork.dll
* 32-bit versions of the runtime libraries (libxammac.a and friends).
* 32-bit version of the partial static library for Xamarin.Mac.
* Classic support in the generator.

We still ship a few Classic files so that Visual Studio for Mac continue to detect that Xamarin.Mac is installed (otherwise VSfM won't open Classic projects, which makes it impossible to use the migration wizard).

This makes our build slightly faster.

Partial fix for #6300.
2019-07-15 10:19:24 -07:00
Alexander Köplinger 8627c4311a Merge remote-tracking branch 'upstream/master' into binary-artifacts 2019-05-24 20:27:09 +02:00
Sebastien Pouliot 224593b46d [mmp] Update (not copy-on-change) the output of lipo
We can't assume that the cached `lipo` output is part of the `.app`
since the directory for the later could be different.

E.g. we build two .csproj in out `mmptest` inside the same directory
and they share the same `obj` directory (used for caching) but have
different output directories

```
./obj/Release/mmp-cache/libmono-native.dylib
./bin/Release/UnifiedExample.app/Contents/MonoBundle/libmono-native.dylib
./bin/Release/XM45Example.app/Contents/MonoBundle/libmono-native.dylib
```

Without an update building the XM45 project would not include the
**required** `libmono-native.dylib` library and would crash when
executed.
2019-05-24 11:51:17 -04:00
Sebastien Pouliot fc5b9e24d4
[mmp] Ignore, by default, frameworks that cause rejection from App Store. Fix #6039 (#6107)
So far this only applies to `QTKit`...

XM will now, by default, avoid natively link with QTKit unless it's
instructed to so explicitly using `--link-prohibited-frameworks`

ref: https://github.com/xamarin/xamarin-macios/issues/6039
2019-05-23 15:59:40 -05:00
monojenkins 2d8396d0a0 [mtouch/mmp] Make the mono native mode a Target-specific variable. (#6037)
The arm64_32 slice for watchOS apps will always use the 'unified' mode, while
the armv7k can be both 'unified' and 'compat' depending on the deployment
target, so we need to keep track of this per Target.

This PR does not change anything related to arm64_32, that will come in a
later PR.
2019-05-10 15:40:17 +02:00
Rolf Bjarne Kvinge d657c723ee
[mtouch/mmp] Make the mono native mode a Target-specific variable. (#6028)
The arm64_32 slice for watchOS apps will always use the 'unified' mode, while
the armv7k can be both 'unified' and 'compat' depending on the deployment
target, so we need to keep track of this per Target.

This PR does not change anything related to arm64_32, that will come in a
later PR.
2019-05-09 21:36:42 +02:00
Sebastien Pouliot 922328becb
[mmp] Fix error for `mmp --version` (#5955)
Some code now need to be initialized a few lines earlier... otherwise we
end up with an error like:

```
/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/bin/mmp --version
error MM0000: Unexpected error - Please file a bug report at https://github.com/xamarin/xamarin-macios/issues/new
System.InvalidOperationException: Nullable object must have a value.
  at System.Nullable`1[T].get_Value () [0x0000d] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-02/external/bockbuild/builds/mono-x64/external/corefx/src/Common/src/CoreLib/System/Nullable.cs:48
  at Xamarin.Bundler.Driver.get_TargetFramework () [0x00001] in /Users/poupou/git/xamarin/xamarin-macios/tools/common/Driver.cs:198
  at Xamarin.Bundler.Application.get_Platform () [0x00001] in /Users/poupou/git/xamarin/xamarin-macios/tools/common/Application.cs:62
  at Xamarin.Bundler.RuntimeOptions.ParseHttpMessageHandler (Xamarin.Bundler.Application app, System.String value) [0x0002f] in /Users/poupou/git/xamarin/xamarin-macios/src/ObjCRuntime/RuntimeOptions.cs:43
  at Xamarin.Bundler.RuntimeOptions.Create (Xamarin.Bundler.Application app, System.String http_message_handler, System.String tls_provider) [0x00007] in /Users/poupou/git/xamarin/xamarin-macios/src/ObjCRuntime/RuntimeOptions.cs:34
  at Xamarin.Bundler.Driver.Main2 (System.String[] args) [0x00a78] in /Users/poupou/git/xamarin/xamarin-macios/tools/mmp/driver.cs:377
  at Xamarin.Bundler.Driver.Main (System.String[] args) [0x00015] in /Users/poupou/git/xamarin/xamarin-macios/tools/mmp/driver.cs:211
```
2019-04-27 10:11:47 -04:00
Alexander Köplinger 7f717f01ae
Merge pull request #5563 from xamarin/mono-2019-02
Bump to mono:2019-02
2019-04-25 19:24:35 +02:00
Rolf Bjarne Kvinge aa4eaf7c92
Make a copy of the static registrar and the runtime headers for Xamarin.Mac/Classic. (#5945)
* [registrar] Make a copy of the static registrar for Xamarin.Mac/Classic.

Make a copy of the static registrar for Xamarin.Mac/Classic, one which is
compatible with the binary artifacts we ship for Xamarin.Mac/Classic
(libxammac, XamMac.dll).

This way the static registrar can evolve in the future, without breaking
Xamarin.Mac/Classic.

* [runtime] Make a copy of the runtime headers too.

* Update comment.

* [mmp] Delay creating a Target instance until we know if we're a Classic or Unified app.

Otherwise the wrong static registrar might be created.
2019-04-25 18:08:10 +02:00
Alexander Köplinger e42e1e8fce Merge remote-tracking branch 'upstream/master' into mono-2019-02 2019-04-09 21:06:44 +02:00
Chris Hamons d98c22e39f
[mmp] Don't apply libintl hack when you explicitly ask for that file (#5855)
- A long while ago, this hack was added to mmp:

 	// Shutup the warning until we decide on bug: 36478
	if (shortendName.ToLowerInvariant () == "intl" && IsUnifiedFullXamMacFramework)

- This breaks use cases were we explicitly ask for that file, so let's
fix that for now until we can fix the root cause for real
2019-04-08 10:26:23 -05:00
Alexander Köplinger 067cbf0a28 Merge remote-tracking branch 'upstream/master' into mono-2019-02
# Conflicts:
#	tools/mmp/driver.cs
2019-04-05 11:19:11 +02:00
Vincent Dondain 86d1b42ad2 Merge branch 'xcode10.2' into master-merge-xcode10.2 2019-04-03 13:57:31 -04:00
Alexander Köplinger 032145f99b mmp: Require mono-native even for Classic mode
Many BCL APIs call into it now.
2019-03-25 16:37:37 +01:00
Alexander Köplinger f67ca65e95 mmp: Add -lc++ to clang arguments
We need to link with C++ now since Mono requires it on Desktop now.
2019-03-25 16:30:52 +01:00
Rolf Bjarne Kvinge 0f49b41513 Merge remote-tracking branch 'origin/master' into mono-2018-10 2019-02-13 13:51:37 +01:00
Rolf Bjarne Kvinge d02c9bc8e0
Add a Runtime.IsARM64CallingConvention property. (#5569)
* Add a Runtime.IsARM64CallingConvention property.

Determining whether we should use the ARM64 calling convention in P/Invokes
gets more complicated with ARM64_32 (which for our purposes is a 32-bit
architecture).

So add a property on the Runtime class to avoid code duplication, and teach
the linker to optimize any calls to this property to a constant value whenever
possible (and the method is marked as optimizable).

Also change our code to use this new property, and make the corresponding
methods optimizable.

Some shuffling in mmp was required, which meant a little bit more code is now
shared between mtouch and mmp.

* Coding style.

* Test tweaks.

* Improve comment.

* Document new optimization

* Move ILReader to shared linker test code location.

* Disable inlining on armv7k.

* Change IsARM64CallingConvention to a read-only field.

We can give the AOT compiler a constant value for a read-only field, so that
the AOT compiler optimizes away the call to the field by using the constant
value.

This commit does not implement this change for the AOT compiler, but using a
read-only field makes it easy to implement it in the future.
2019-02-11 17:29:13 +01:00
Rolf Bjarne Kvinge 019fcb6a83 [mmp/mtouch] Share some code. 2019-02-11 13:49:38 +01:00
Rolf Bjarne Kvinge 930d66ff63 [mtouch/mmp] Use 99 as the error code for internal errors. 2019-02-11 13:49:38 +01:00
Alexander Köplinger 213f23b829 Merge branch 'master' into mono-2018-10
# Conflicts:
#	tests/mtouch/mtouch.csproj
2019-02-07 23:12:42 +01:00
Rolf Bjarne Kvinge 135507957f
[linker] Remove non-bitcode compatible code, and show a warning. (#5551)
* [linker] Remove non-bitcode compatible code, and show a warning.

Remove code not currently compatible with bitcode and replace it with an
exception instead (otherwise we'll assert at runtime).

Also show a warning when we detect this.

This is quite helpful when looking at watch device test runs to filter out
failures we already know about.

This fixes point #2 in #4763.

* Improve documentation.

* Simplify linker code by using a substep.

* Fix whitespace issues.

* Improve reporting.

* Add support for reporting more than one MT2105 at the same time when making
  the errors instead of warnings.
* Only report MT2105 for methods that haven't been linked away.
* Format the error message nicer for properties.

* Tweak a bit for warning tests to pass.

* Use ExceptionalSubStep to provide better error information.

* Adjust where linker warnings/errors are reported from to avoid a NullReferenceException.
2019-02-07 07:57:01 +01:00
Alexander Köplinger d612d3ec27 bugzilla -> github 2019-02-01 19:47:55 +01:00
Alexander Köplinger 8081626eda Improve copying of libmono-native 2019-02-01 19:40:50 +01:00
Alexander Köplinger e25499395d Link with GSS framework in mmp when Mono.Native is used 2019-01-31 14:32:21 +01:00
Alexander Köplinger acc513aba5 Add System.Net.Security.Native to mmp 2019-01-31 14:32:00 +01:00
Alexander Köplinger 0dae3f27ad Fix building XamMac projects 2019-01-14 14:58:37 +01:00
Chris Hamons a4332c90aa
[mmp] Add support for mono 5.18 by pulling in libmono-system-native.a (#5328)
- https://github.com/xamarin/xamarin-macios/issues/5324
- Patch tweaked over multiple commits in master so applied directly instead of cherry-pick
2019-01-10 13:31:31 -06:00
Marek Safar aa6fefb1c9 Merge remote-tracking branch 'origin/master' into mono-2018-10 2018-12-17 15:28:08 +01:00
Chris Hamons d7c2a45ca9
Add 'NoBindingEmbedding' style binding project support (#5167)
- Existing binding projects embed the native libraries within the assembly as managed resource
- This does not scale well and has performance implications
- This PR creates a new property, NoBindingEmbedding which when true processes the building and consumption of binding projects differently.
- Existing binding projects are not affected, they will continue as is
- I've written a full XM test suite and ported a subset to iOS. Since iOS only supports checked in projects, and I didn't want to make the existing situation worse by adding more, I only wrote tests that could use the existing test projects.
    -When we complete some form of msbuild testing reform, we'll revisit these tests.
- Remove two files in MyiOSFrameworkBinding that are not used (we use copies elsewhere)
- Remove unnecessary sleep and fix broken touch command
- Output failing test log to console instead of test output
    - VSfM does not handle thousands of lines of test failure message well
- Add ability to generate binding projects with LinkWith
2018-12-12 09:55:57 -05:00
Chris Hamons c00e9af445
[mmp] Add rpath during compile and not after via install_name_tool (#5251)
- https://github.com/xamarin/xamarin-macios/issues/5243
- https://github.com/xamarin/xamarin-macios/issues/5248
- There were multiple issues where we'd run out of space and install_name_tool
would randomly fail. We can easily move these two to during initial
clang and avoid those cases.
2018-12-11 10:28:55 -05:00
Rolf Bjarne Kvinge 366d94d28a
[mmp] Show the right error code in error message. (#5245) 2018-12-10 15:14:18 +01:00
Rolf Bjarne Kvinge 1cdfc65b38 Merge remote-tracking branch 'origin/master' into mono-2018-10 2018-12-07 08:25:46 +01:00
Chris Hamons 2e72e1aee0
[mmp] Add rpath to MonoBundle folder if we copy any NativeLibraries in (#5214)
- https://github.com/xamarin/xamarin-macios/issues/4435
- A common enough breakage in our handling of native references is if you have
two native libraries with dependencies (with rpath) between them that get copied into MonoBundle
- We did not add rpath to this location so we would not resolve them
- This is a behavior change, as anything that touches library resolution in mmp, but should be safe enough
- Add 2 ignore line for common swift libraries
2018-12-06 14:16:10 -05:00
Bernhard Urban 3ddadfb852 [mmp] fix compilation error 2018-12-05 14:13:30 +01:00
Ludovic Henry 1c59076f82 Merge branch 'master' of github.com:xamarin/xamarin-macios into mono-2018-10 2018-11-14 14:20:02 -05:00
Martin Baulig 83de08eb78 [mmp]: Fix mono-native support. 2018-11-14 13:43:45 -05:00
Chris Hamons e91ba9f93a
[mmp] Fix typo (#5123)
- https://github.com/xamarin/xamarin-macios/issues/5121
2018-11-13 17:56:05 -05:00
Rolf Bjarne Kvinge ef8f1dcbfe
[mtouch/mmp] Unify Xcode lookup & verification code in mtouch and mmp. (#5077)
Share all the code to find and verify Xcode between mtouch and mmp.

Also print out the actual product version when logging which Xcode was used
(to make it easier to detect if a beta version is in use).
2018-11-05 08:16:29 +01:00
Chris Hamons 366281e8b7
[mmp] Remove duplicate libmono-system-native.a logic (#5073)
- https://github.com/xamarin/xamarin-macios/pull/4980 and the mono branch merge both added it
- However both copies were not the same, one was conditional and one added an extra -u option
- This collapses them into one check
2018-11-02 09:07:50 -05:00
Martin Baulig 673325206d Merge remote-tracking branch 'origin/mono-2018-08' into mono-2018-10 2018-10-26 02:24:28 -04:00
Martin Baulig 3f325dd3f0 Initial "Titanium Yellow" support. 2018-10-16 19:01:32 -04:00