Merge pull request #2867 from alexrp/sgen-block-size-ppc
authormonojenkins <jo.shields+jenkins@xamarin.com>
Mon, 11 Apr 2016 16:15:24 +0000 (17:15 +0100)
committermonojenkins <jo.shields+jenkins@xamarin.com>
Mon, 11 Apr 2016 16:15:24 +0000 (17:15 +0100)
[sgen] Set ARCH_MIN_MS_BLOCK_SIZE to 64k on both ppc32 and ppc64.

This fixes a problem that was happening on Debian ppc32 build machines. Since
they are set up as a 32-bit userland on a 64-bit kernel, Mono would be compiled
with an ARCH_MIN_MS_BLOCK_SIZE value of 16k. However, at runtime, the system
page size would be 64k (due to the 64-bit kernel with PPC_64K_PAGES set).

Signed-off-by: `Alex Rønne Petersen <alexrp@xamarin.com>`
21 files changed:
configure.ac
mcs/mcs/ecore.cs
mcs/mcs/expression.cs
mcs/mcs/typemanager.cs
mcs/tests/gtest-optional-09.cs
mcs/tests/gtest-optional-36.cs [new file with mode: 0644]
mcs/tests/test-933.cs [new file with mode: 0644]
mcs/tests/test-debug-17-ref.xml
mcs/tests/ver-il-net_4_x.xml
mcs/tools/mkbundle/Makefile
mcs/tools/mkbundle/mkbundle.cs
mono/metadata/icall-def.h
mono/metadata/icall.c
mono/metadata/method-builder.c
mono/metadata/reflection.c
mono/mini/driver.c
mono/mini/main.c
mono/mini/mini.h
mono/mini/tramp-arm64.c
msvc/mono.def
msvc/monosgen.def

index 66174bea4e6ca48e97e79b77831ac17db5ad92b2..52bd77591086353b5a9030c95f425cfe9e90687b 100644 (file)
@@ -272,8 +272,6 @@ case "$host" in
                need_link_unlink=yes
                libmono_cflags="-D_REENTRANT"
                libgc_threads=pthreads
-               # This doesn't seem to work on solaris/x86, but the configure test runs
-               with_tls=pthread
                has_dtrace=yes
                use_sigposix=yes
                enable_solaris_tar_check=yes
index a581906d3e9b82d7ffd04ab74c4c1f8275e7efa5..145f222bdcd39d2f100c230845024b4881b99258 100644 (file)
@@ -4704,8 +4704,14 @@ namespace Mono.CSharp {
 
                                // for each argument, the conversion to 'ct' should be no worse than 
                                // the conversion to 'bt'.
-                               if (result == 2)
-                                       return false;
+                               if (result == 2) {
+                                       better_at_least_one = false;
+
+                                       ++j;
+                                       while (j < args_count && !args [j++].IsDefaultArgument) ;
+
+                                       break;
+                               }
 
                                // for at least one argument, the conversion to 'ct' should be better than 
                                // the conversion to 'bt'.
@@ -4717,15 +4723,26 @@ namespace Mono.CSharp {
                                return true;
 
                        //
-                       // Tie-breaking rules are applied only for equivalent parameter types
+                       // LAMESPEC: Tie-breaking rules for not equivalent parameter types
                        //
                        if (!are_equivalent) {
                                //
-                               // LAMESPEC: A candidate with less default parameters is still better when there
+                               // A candidate with no default parameters is still better when there
                                // is no better expression conversion
                                //
-                               if (candidate_pd.Count < best_pd.Count && !candidate_params && best_pd.FixedParameters [j].HasDefaultValue) {
-                                       return true;
+                               if (candidate_pd.Count < best_pd.Count) {
+                                       if (!candidate_params && !candidate_pd.FixedParameters [j - j].HasDefaultValue) {
+                                               return true;
+                                       }
+                               } else if (candidate_pd.Count == best_pd.Count) {
+                                       if (candidate_params)
+                                               return false;
+
+                                       if (!candidate_pd.FixedParameters [j - 1].HasDefaultValue && best_pd.FixedParameters [j - 1].HasDefaultValue)
+                                               return true;
+
+                                       if (candidate_pd.FixedParameters [j - 1].HasDefaultValue && best_pd.HasParams)
+                                               return true;
                                }
 
                                return false;
@@ -4746,7 +4763,7 @@ namespace Mono.CSharp {
                                var cand_param = candidate_pd.FixedParameters [j];
                                var best_param = best_pd.FixedParameters [j];
 
-                               if (cand_param.HasDefaultValue != best_param.HasDefaultValue)
+                               if (cand_param.HasDefaultValue != best_param.HasDefaultValue && (!candidate_pd.HasParams || !best_pd.HasParams))
                                        return cand_param.HasDefaultValue;
 
                                defaults_ambiguity = true;
index bfba44fbb8c656079254fc346737ea8a4af5fd3e..5f66d6a5f95d3ab585e661f3759305bbf13b942d 100644 (file)
@@ -8398,11 +8398,32 @@ namespace Mono.CSharp
 
                public override void Emit (EmitContext ec)
                {
+                       if (EmitOptimizedEmpty (ec))
+                               return;
+
                        var await_field = EmitToFieldSource (ec);
                        if (await_field != null)
                                await_field.Emit (ec);
                }
 
+               bool EmitOptimizedEmpty (EmitContext ec)
+               {
+                       if (arguments.Count != 1 || dimensions != 1)
+                               return false;
+
+                       var c = arguments [0] as Constant;
+                       if (c == null || !c.IsZeroInteger)
+                               return false;
+
+                       var m = ec.Module.PredefinedMembers.ArrayEmpty.Get ();
+                       if (m == null || ec.CurrentType.MemberDefinition.DeclaringAssembly == m.DeclaringType.MemberDefinition.DeclaringAssembly)
+                               return false;
+
+                       m = m.MakeGenericMethod (ec.MemberContext, array_element_type);
+                       ec.Emit (OpCodes.Call, m);
+                       return true;
+               }
+
                protected sealed override FieldExpr EmitToFieldSource (EmitContext ec)
                {
                        if (first_emit != null) {
index a5a9ad15607da053892c5073fee28ecfcdd25130..b53915f6eb1c030c749d98c239553e8a7c46c76d 100644 (file)
@@ -198,6 +198,8 @@ namespace Mono.CSharp
                public readonly PredefinedType SecurityAction;
                public readonly PredefinedType Dictionary;
                public readonly PredefinedType Hashtable;
+               public readonly PredefinedType Array;
+
                public readonly TypeSpec[] SwitchUserTypes;
 
                //
@@ -266,6 +268,7 @@ namespace Mono.CSharp
                        SecurityAction = new PredefinedType (module, MemberKind.Enum, "System.Security.Permissions", "SecurityAction");
                        Dictionary = new PredefinedType (module, MemberKind.Class, "System.Collections.Generic", "Dictionary", 2);
                        Hashtable = new PredefinedType (module, MemberKind.Class, "System.Collections", "Hashtable");
+                       Array = new PredefinedType (module, MemberKind.Class, "System", "Array");
 
                        Expression = new PredefinedType (module, MemberKind.Class, "System.Linq.Expressions", "Expression");
                        ExpressionGeneric = new PredefinedType (module, MemberKind.Class, "System.Linq.Expressions", "Expression", 1);
@@ -340,6 +343,7 @@ namespace Mono.CSharp
        class PredefinedMembers
        {
                public readonly PredefinedMember<MethodSpec> ActivatorCreateInstance;
+               public readonly PredefinedMember<MethodSpec> ArrayEmpty;
                public readonly PredefinedMember<MethodSpec> AsyncTaskMethodBuilderCreate;
                public readonly PredefinedMember<MethodSpec> AsyncTaskMethodBuilderStart;
                public readonly PredefinedMember<MethodSpec> AsyncTaskMethodBuilderSetResult;
@@ -411,6 +415,9 @@ namespace Mono.CSharp
                        ActivatorCreateInstance = new PredefinedMember<MethodSpec> (module, types.Activator,
                                MemberFilter.Method ("CreateInstance", 1, ParametersCompiled.EmptyReadOnlyParameters, null));
 
+                       ArrayEmpty = new PredefinedMember<MethodSpec> (module, types.Array,
+                               MemberFilter.Method ("Empty", 1, ParametersCompiled.EmptyReadOnlyParameters, null));
+
                        AsyncTaskMethodBuilderCreate = new PredefinedMember<MethodSpec> (module, types.AsyncTaskMethodBuilder,
                                MemberFilter.Method ("Create", 0, ParametersCompiled.EmptyReadOnlyParameters, types.AsyncTaskMethodBuilder.TypeSpec));
 
index 7117ab291e7ce6b4fed42288979c4a60936c1279..9ed101f55221f9dd6473518cee7ab70a0fe27795 100644 (file)
@@ -104,10 +104,10 @@ public class Program
                if (Test_5 () != 0)
                        return 5;
 
-               if (Test_6 () != 0)
+               if (Test_6 () != 1)
                        return 6;
 
-               if (Test_7 (false) != 0)
+               if (Test_7 (false) != 1)
                        return 7;
 
                if (Test_8 (typeof (bool)) != 0)
diff --git a/mcs/tests/gtest-optional-36.cs b/mcs/tests/gtest-optional-36.cs
new file mode 100644 (file)
index 0000000..bf9f7d1
--- /dev/null
@@ -0,0 +1,66 @@
+using System;
+
+public class Program
+{
+       static int Arg (uint a, long b)
+       {
+               return 2;
+       }
+
+       static int Arg (int a, ulong b, int c = 9)
+       {
+               return 3;
+       }
+
+       static int Arg_2 (uint a, long b, params int[] arg)
+       {
+               return 2;
+       }
+
+       static int Arg_2 (int a, ulong b, int c = 0)
+       {
+               return 3;
+       }
+
+       static int Arg_3 (int a, long b, params int[] arg)
+       {
+               return 2;
+       }
+
+       static int Arg_3 (uint a, ulong b, int c = 0, int d = 1, params int[] oo)
+       {
+               return 3;
+       }       
+
+       public static int Main ()
+       {
+               if (Arg (0, 0) != 2)
+                       return 1;
+
+               if (Arg (0, 0, 0) != 3)
+                       return 2;
+
+               if (Arg_2 (0, 0) != 3)
+                       return 3;
+
+               if (Arg_2 (0, 0, 0, 0) != 2)
+                       return 4;
+
+               if (Arg_3 (0, 0) != 2)
+                       return 5;
+
+               if (Arg_3 (0, 0, 0) != 2)
+                       return 6;
+
+               if (Arg_3 (0, 0, 0, 0) != 2)
+                       return 7;
+
+               if (Arg_3 (0, 0, 0, 0, 0) != 2)
+                       return 8;
+
+               if (Arg_3 (0, 0, 0, 0, 0) != 2)
+                       return 9;
+
+               return 0;
+       }
+}
diff --git a/mcs/tests/test-933.cs b/mcs/tests/test-933.cs
new file mode 100644 (file)
index 0000000..2f076eb
--- /dev/null
@@ -0,0 +1,22 @@
+using System;
+
+class X
+{
+       static int Foo (params X[] p)
+       {
+               return 1;
+       }
+
+       static int Foo (object p)
+       {
+               return 0;
+       }
+
+       static int Main ()
+       {
+               if (Foo ((X[]) null) != 1)
+                       return 1;
+
+               return 0;
+       }
+}
\ No newline at end of file
index 8c966ef91e8f63f76b24bf0f422a520846f0427b..9b087dd751dae78098aa36a6d2e2a9dd66680e7f 100644 (file)
@@ -38,9 +38,9 @@
         <entry il="0x0" row="20" col="2" file_ref="1" hidden="false" />
         <entry il="0x1" row="21" col="3" file_ref="1" hidden="false" />
         <entry il="0x11" row="21" col="59" file_ref="1" hidden="false" />
-        <entry il="0x1c" row="21" col="53" file_ref="1" hidden="false" />
-        <entry il="0x2c" row="21" col="47" file_ref="1" hidden="false" />
-        <entry il="0x32" row="22" col="2" file_ref="1" hidden="false" />
+        <entry il="0x1b" row="21" col="53" file_ref="1" hidden="false" />
+        <entry il="0x2a" row="21" col="47" file_ref="1" hidden="false" />
+        <entry il="0x30" row="22" col="2" file_ref="1" hidden="false" />
       </sequencepoints>
       <locals>
         <entry name="e" il_index="0" scope_ref="0" />
index b7054e4b28943dcc026469b86d3f13d8af453e54..98c397dc13a262de343b6566f7c14b0b05735a07 100644 (file)
@@ -85,7 +85,7 @@
   <test name="dtest-003.cs">
     <type name="AssertDynamicObject">
       <method name="System.Dynamic.DynamicMetaObject GetFakeMetaObject(System.Object)" attrs="129">
-        <size>130</size>
+        <size>129</size>
       </method>
       <method name="System.Dynamic.DynamicMetaObject BindBinaryOperation(System.Dynamic.BinaryOperationBinder, System.Dynamic.DynamicMetaObject)" attrs="198">
         <size>70</size>
     </type>
     <type name="Tester+&lt;GetIndex_3&gt;c__AnonStorey1">
       <method name="Void &lt;&gt;m__0(System.Dynamic.GetIndexBinder, System.Object[])" attrs="131">
-        <size>93</size>
+        <size>92</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
     </type>
     <type name="Tester+&lt;InvokeMember_2&gt;c__AnonStorey2">
       <method name="Void &lt;&gt;m__0(System.Dynamic.InvokeMemberBinder, System.Object[])" attrs="131">
-        <size>110</size>
+        <size>109</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
     </type>
     <type name="Tester+&lt;InvokeMember_6&gt;c__AnonStorey3">
       <method name="Void &lt;&gt;m__0(System.Dynamic.InvokeMemberBinder, System.Object[])" attrs="131">
-        <size>120</size>
+        <size>119</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
     </type>
     <type name="Tester+&lt;SetIndex_3&gt;c__AnonStorey4">
       <method name="Void &lt;&gt;m__0(System.Dynamic.SetIndexBinder, System.Object[], System.Object)" attrs="131">
-        <size>120</size>
+        <size>119</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
         <size>67</size>
       </method>
       <method name="Void &lt;GetIndex_1&gt;m__25(System.Dynamic.GetIndexBinder, System.Object[])" attrs="145">
-        <size>93</size>
+        <size>92</size>
       </method>
       <method name="Void &lt;GetIndex_2&gt;m__26(System.Dynamic.GetIndexBinder, System.Object[])" attrs="145">
-        <size>112</size>
+        <size>111</size>
       </method>
       <method name="System.Object &lt;GetMember_1&gt;m__27(System.Dynamic.GetMemberBinder)" attrs="145">
         <size>75</size>
       </method>
       <method name="Void &lt;Invoke_1&gt;m__28(System.Dynamic.InvokeBinder, System.Object[])" attrs="145">
-        <size>102</size>
+        <size>101</size>
       </method>
       <method name="Void &lt;Invoke_2&gt;m__29(System.Dynamic.InvokeBinder, System.Object[])" attrs="145">
-        <size>74</size>
+        <size>72</size>
       </method>
       <method name="Void &lt;Invoke_4&gt;m__2A(System.Dynamic.InvokeBinder, System.Object[])" attrs="145">
         <size>128</size>
       </method>
       <method name="Void &lt;Invoke_5&gt;m__2B(System.Dynamic.InvokeBinder, System.Object[])" attrs="145">
-        <size>92</size>
+        <size>91</size>
       </method>
       <method name="Void &lt;Invoke_5&gt;m__2C(System.Object)" attrs="145">
         <size>94</size>
       </method>
       <method name="Void &lt;Invoke_6&gt;m__2D(System.Dynamic.InvokeBinder, System.Object[])" attrs="145">
-        <size>93</size>
+        <size>92</size>
       </method>
       <method name="Void &lt;InvokeMember_1&gt;m__2E(System.Dynamic.InvokeMemberBinder, System.Object[])" attrs="145">
-        <size>111</size>
+        <size>110</size>
       </method>
       <method name="Void &lt;InvokeMember_3&gt;m__2F(System.Dynamic.InvokeMemberBinder, System.Object[])" attrs="145">
-        <size>112</size>
+        <size>111</size>
       </method>
       <method name="Void &lt;InvokeMember_4&gt;m__30(System.Dynamic.InvokeMemberBinder, System.Object[])" attrs="145">
-        <size>111</size>
+        <size>110</size>
       </method>
       <method name="Void &lt;InvokeMember_7&gt;m__31(System.Dynamic.InvokeMemberBinder, System.Object[])" attrs="145">
-        <size>91</size>
+        <size>89</size>
       </method>
       <method name="Void &lt;InvokeMember_8&gt;m__32(System.Dynamic.InvokeMemberBinder, System.Object[])" attrs="145">
-        <size>112</size>
+        <size>111</size>
       </method>
       <method name="Void &lt;SetIndex_1&gt;m__33(System.Dynamic.SetIndexBinder, System.Object[], System.Object)" attrs="145">
-        <size>125</size>
+        <size>124</size>
       </method>
       <method name="Void &lt;SetIndex_2&gt;m__34(System.Dynamic.SetIndexBinder, System.Object[], System.Object)" attrs="145">
-        <size>140</size>
+        <size>139</size>
       </method>
       <method name="Void &lt;SetMember_1&gt;m__35(System.Dynamic.SetMemberBinder, System.Object)" attrs="145">
         <size>102</size>
   <test name="dtest-044.cs">
     <type name="C">
       <method name="Int32 Main()" attrs="150">
-        <size>868</size>
+        <size>867</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
         <size>2</size>
       </method>
       <method name="Void Main()" attrs="150">
-        <size>383</size>
+        <size>381</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
         <size>23</size>
       </method>
       <method name="Int32 Main()" attrs="150">
-        <size>213</size>
+        <size>212</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
         <size>84</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
-        <size>20</size>
+        <size>19</size>
       </method>
       <method name="Void .ctor(E[])" attrs="6278">
         <size>15</size>
     </type>
     <type name="ExtensibleTester`1[U]">
       <method name="Void Direct()" attrs="134">
-        <size>25</size>
+        <size>24</size>
       </method>
       <method name="Void .ctor(U)" attrs="6278">
         <size>15</size>
     </type>
     <type name="Crash">
       <method name="Void Main()" attrs="150">
-        <size>15</size>
+        <size>14</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
     </type>
     <type name="Tests">
       <method name="Void Main()" attrs="150">
-        <size>22</size>
+        <size>21</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
     </type>
     <type name="Tests">
       <method name="Void Main()" attrs="150">
-        <size>39</size>
+        <size>38</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
   <test name="gtest-340.cs">
     <type name="Tests">
       <method name="T[] FindAll[T](T[], System.Predicate`1[T])" attrs="150">
-        <size>15</size>
+        <size>14</size>
       </method>
       <method name="Boolean ProtectedOnly(System.Reflection.MemberInfo)" attrs="129">
         <size>10</size>
         <size>16</size>
       </method>
       <method name="Int32 Main()" attrs="150">
-        <size>25</size>
+        <size>24</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
         <size>2</size>
       </method>
       <method name="Int32 Main()" attrs="150">
-        <size>189</size>
+        <size>187</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
     </type>
     <type name="TestIssue.Program">
       <method name="Int32 Main()" attrs="150">
-        <size>32</size>
+        <size>31</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
     </type>
     <type name="Base">
       <method name="System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()" attrs="481">
-        <size>20</size>
+        <size>19</size>
       </method>
     </type>
   </test>
         <size>10</size>
       </method>
       <method name="Int32 Main()" attrs="150">
-        <size>51</size>
+        <size>50</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
         <size>7</size>
       </method>
       <method name="Int32 Main()" attrs="150">
-        <size>37</size>
+        <size>36</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
         <size>25</size>
       </method>
       <method name="Int32 Main()" attrs="150">
-        <size>27</size>
+        <size>26</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
   <test name="gtest-495.cs">
     <type name="Repro">
       <method name="Void Main()" attrs="150">
-        <size>13</size>
+        <size>12</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
         <size>2</size>
       </method>
       <method name="Void Test()" attrs="134">
-        <size>38</size>
+        <size>37</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
     </type>
     <type name="C">
       <method name="Int32 Main()" attrs="150">
-        <size>80</size>
+        <size>78</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
         <size>2</size>
       </method>
       <method name="Void Main()" attrs="150">
-        <size>51</size>
+        <size>48</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
     </type>
     <type name="X2">
       <method name="Void Main()" attrs="150">
-        <size>24</size>
+        <size>22</size>
       </method>
       <method name="Void Foo[T1,T2](T2[])" attrs="145">
         <size>9</size>
         <size>42</size>
       </method>
       <method name="System.Linq.Expressions.Expression`1[System.Func`1[System.Func`1[System.Boolean]]] GetEvent()" attrs="134">
-        <size>41</size>
+        <size>40</size>
       </method>
       <method name="Void set_MyTypeProperty(MyType)" attrs="2182">
         <size>9</size>
         <size>244</size>
       </method>
       <method name="Void ArrayIndexTest_5()" attrs="129">
-        <size>109</size>
+        <size>108</size>
       </method>
       <method name="Void ArrayIndexTest_6()" attrs="129">
         <size>123</size>
       </method>
       <method name="Void ArrayIndexTest_7()" attrs="129">
-        <size>127</size>
+        <size>126</size>
       </method>
       <method name="Void ArrayLengthTest()" attrs="129">
-        <size>100</size>
+        <size>99</size>
       </method>
       <method name="Void ArrayLengthTest_2()" attrs="129">
         <size>92</size>
         <size>196</size>
       </method>
       <method name="Void CallTest_4()" attrs="129">
-        <size>110</size>
+        <size>108</size>
       </method>
       <method name="Void CallTest_5()" attrs="129">
         <size>100</size>
       </method>
       <method name="Void CallTest_6()" attrs="129">
-        <size>71</size>
+        <size>70</size>
       </method>
       <method name="Void CallTest_7()" attrs="129">
         <size>125</size>
         <size>184</size>
       </method>
       <method name="Void ConditionTest_5()" attrs="129">
-        <size>108</size>
+        <size>107</size>
       </method>
       <method name="Void ConstantTest()" attrs="129">
-        <size>60</size>
+        <size>59</size>
       </method>
       <method name="Void ConstantTest_2()" attrs="129">
-        <size>63</size>
+        <size>62</size>
       </method>
       <method name="Void ConstantTest_3()" attrs="129">
-        <size>55</size>
+        <size>54</size>
       </method>
       <method name="Void ConstantTest_4()" attrs="129">
-        <size>45</size>
+        <size>44</size>
       </method>
       <method name="Void ConstantTest_5()" attrs="129">
-        <size>60</size>
+        <size>59</size>
       </method>
       <method name="Void ConstantTest_6()" attrs="129">
-        <size>68</size>
+        <size>67</size>
       </method>
       <method name="Void ConstantTest_7()" attrs="129">
-        <size>63</size>
+        <size>62</size>
       </method>
       <method name="Void ConstantTest_8()" attrs="129">
-        <size>73</size>
+        <size>72</size>
       </method>
       <method name="Void ConstantTest_9()" attrs="129">
-        <size>73</size>
+        <size>72</size>
       </method>
       <method name="Void ConstantTest_10()" attrs="129">
-        <size>73</size>
+        <size>72</size>
       </method>
       <method name="Void ConstantTest_11()" attrs="129">
-        <size>60</size>
+        <size>59</size>
       </method>
       <method name="Void ConstantTest_13()" attrs="129">
-        <size>60</size>
+        <size>59</size>
       </method>
       <method name="Void ConstantTest_14()" attrs="129">
-        <size>73</size>
+        <size>72</size>
       </method>
       <method name="Void ConstantTest_15()" attrs="129">
-        <size>63</size>
+        <size>62</size>
       </method>
       <method name="Void ConvertTest()" attrs="129">
         <size>83</size>
         <size>119</size>
       </method>
       <method name="Void ConvertTest_9()" attrs="129">
-        <size>98</size>
+        <size>97</size>
       </method>
       <method name="Void ConvertTest_10()" attrs="129">
         <size>181</size>
         <size>102</size>
       </method>
       <method name="Void ConvertTest_12()" attrs="129">
-        <size>141</size>
+        <size>140</size>
       </method>
       <method name="Void ConvertTest_13()" attrs="129">
         <size>87</size>
         <size>170</size>
       </method>
       <method name="Void InvokeTest()" attrs="129">
-        <size>91</size>
+        <size>90</size>
       </method>
       <method name="Void InvokeTest_2()" attrs="129">
         <size>139</size>
       </method>
       <method name="Void LambdaTest()" attrs="129">
-        <size>90</size>
+        <size>89</size>
       </method>
       <method name="Void LeftShiftTest()" attrs="129">
         <size>156</size>
         <size>170</size>
       </method>
       <method name="Void ListInitTest()" attrs="129">
-        <size>405</size>
+        <size>404</size>
       </method>
       <method name="Void ListInitTest_2()" attrs="129">
         <size>293</size>
       </method>
       <method name="Void MemberAccessTest()" attrs="129">
-        <size>133</size>
+        <size>132</size>
       </method>
       <method name="Void MemberAccessTest_2()" attrs="129">
-        <size>64</size>
+        <size>63</size>
       </method>
       <method name="Void MemberAccessTest_3()" attrs="129">
-        <size>114</size>
+        <size>113</size>
       </method>
       <method name="Void MemberAccessTest_4()" attrs="129">
-        <size>92</size>
+        <size>91</size>
       </method>
       <method name="Void MemberAccessTest_5()" attrs="129">
         <size>40</size>
       </method>
       <method name="Void MemberAccessTest_6()" attrs="129">
-        <size>105</size>
+        <size>104</size>
       </method>
       <method name="Void MemberAccessTest_7()" attrs="129">
         <size>110</size>
       </method>
       <method name="Void MemberAccessTest_8()" attrs="129">
-        <size>64</size>
+        <size>63</size>
       </method>
       <method name="Void MemberAccessTest_9()" attrs="129">
-        <size>92</size>
+        <size>91</size>
       </method>
       <method name="Void MemberInitTest()" attrs="129">
-        <size>303</size>
+        <size>302</size>
       </method>
       <method name="Void MemberInitTest_2()" attrs="129">
-        <size>251</size>
+        <size>250</size>
       </method>
       <method name="Void MemberInitTest_3()" attrs="129">
         <size>125</size>
       </method>
       <method name="Void MemberInitTest_4()" attrs="129">
-        <size>67</size>
+        <size>65</size>
       </method>
       <method name="Void MemberInitTest_5()" attrs="129">
-        <size>119</size>
+        <size>117</size>
       </method>
       <method name="Void ModuloTest()" attrs="129">
         <size>101</size>
         <size>89</size>
       </method>
       <method name="Void NewArrayInitTest()" attrs="129">
-        <size>93</size>
+        <size>92</size>
       </method>
       <method name="Void NewArrayInitTest_2()" attrs="129">
-        <size>65</size>
+        <size>62</size>
       </method>
       <method name="Void NewArrayInitTest_3()" attrs="129">
         <size>137</size>
       </method>
       <method name="Void NewArrayInitTest_4()" attrs="129">
-        <size>121</size>
+        <size>120</size>
       </method>
       <method name="Void NewArrayInitTest_5()" attrs="129">
-        <size>159</size>
+        <size>158</size>
       </method>
       <method name="Void NewArrayInitTest_6()" attrs="129">
-        <size>104</size>
+        <size>103</size>
       </method>
       <method name="Void NewArrayBoundsTest()" attrs="129">
-        <size>124</size>
+        <size>123</size>
       </method>
       <method name="Void NewArrayBoundsTest_2()" attrs="129">
-        <size>124</size>
+        <size>123</size>
       </method>
       <method name="Void NewArrayBoundsTest_3()" attrs="129">
-        <size>86</size>
+        <size>85</size>
       </method>
       <method name="Void NewArrayBoundsTest_4()" attrs="129">
-        <size>83</size>
+        <size>82</size>
       </method>
       <method name="Void NewTest()" attrs="129">
-        <size>94</size>
+        <size>93</size>
       </method>
       <method name="Void NewTest_2()" attrs="129">
-        <size>62</size>
+        <size>61</size>
       </method>
       <method name="Void NewTest_3()" attrs="129">
-        <size>99</size>
+        <size>98</size>
       </method>
       <method name="Void NewTest_4()" attrs="129">
         <size>253</size>
       </method>
       <method name="Void NewTest_5()" attrs="129">
-        <size>376</size>
+        <size>375</size>
       </method>
       <method name="Void NewTest_6()" attrs="129">
-        <size>183</size>
+        <size>182</size>
       </method>
       <method name="Void NewTest_7()" attrs="129">
-        <size>54</size>
+        <size>53</size>
       </method>
       <method name="Void NotTest()" attrs="129">
         <size>71</size>
         <size>74</size>
       </method>
       <method name="Void ParameterTest_2()" attrs="129">
-        <size>76</size>
+        <size>74</size>
       </method>
       <method name="Void ParameterTest_3()" attrs="129">
         <size>74</size>
         <size>101</size>
       </method>
       <method name="Void QuoteTest()" attrs="129">
-        <size>86</size>
+        <size>84</size>
       </method>
       <method name="Void QuoteTest_2()" attrs="129">
-        <size>100</size>
+        <size>99</size>
       </method>
       <method name="Void RightShiftTest()" attrs="129">
         <size>153</size>
         <size>81</size>
       </method>
       <method name="Void TypeIsTest_5()" attrs="129">
-        <size>75</size>
+        <size>74</size>
       </method>
       <method name="Void TypeIsTest_6()" attrs="129">
         <size>112</size>
         <size>12</size>
       </method>
       <method name="Void NewTest_8()" attrs="129">
-        <size>64</size>
+        <size>63</size>
       </method>
       <method name="Void CallTest_10()" attrs="129">
-        <size>137</size>
+        <size>136</size>
       </method>
     </type>
   </test>
         <size>2</size>
       </method>
       <method name="System.String Param(System.String)" attrs="145">
-        <size>122</size>
+        <size>121</size>
       </method>
       <method name="Int32 Main()" attrs="150">
         <size>173</size>
     </type>
     <type name="C">
       <method name="Int32 Main()" attrs="150">
-        <size>495</size>
+        <size>490</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
         <size>48</size>
       </method>
       <method name="Int32 Main()" attrs="150">
-        <size>358</size>
+        <size>357</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
   <test name="gtest-etree-06.cs">
     <type name="Test">
       <method name="Int32 Main()" attrs="150">
-        <size>53</size>
+        <size>52</size>
       </method>
       <method name="Int32 Value()" attrs="145">
         <size>10</size>
         <size>2</size>
       </method>
       <method name="Int32 TestInstance()" attrs="129">
-        <size>337</size>
+        <size>336</size>
       </method>
       <method name="Int32 Main()" attrs="150">
-        <size>580</size>
+        <size>577</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
         <size>11</size>
       </method>
       <method name="Int32 Goo(Boolean)" attrs="134">
-        <size>231</size>
+        <size>228</size>
       </method>
       <method name="Int32 Main()" attrs="150">
         <size>22</size>
   <test name="gtest-etree-09.cs">
     <type name="Mono.C">
       <method name="Int32 Main()" attrs="150">
-        <size>296</size>
+        <size>294</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
     </type>
     <type name="Foo`1[T]">
       <method name="Boolean ContainsAll[U](System.Collections.Generic.IEnumerable`1[U])" attrs="134">
-        <size>200</size>
+        <size>199</size>
       </method>
     </type>
   </test>
     </type>
     <type name="Test">
       <method name="Void Invalid(Int32)" attrs="134">
-        <size>125</size>
+        <size>124</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
         <size>19</size>
       </method>
       <method name="Boolean MoveNext()" attrs="486">
-        <size>148</size>
+        <size>147</size>
       </method>
       <method name="Void Dispose()" attrs="486">
         <size>15</size>
         <size>33</size>
       </method>
       <method name="T Value[T]()" attrs="145">
-        <size>86</size>
+        <size>85</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
     </type>
     <type name="FieldInfoBug.GenericClass`1[T]">
       <method name="Void .ctor(String)" attrs="6278">
-        <size>59</size>
+        <size>58</size>
       </method>
     </type>
     <type name="FieldInfoBug.GenericClass`1+&lt;GenericClass&gt;c__AnonStorey0[T]">
     </type>
     <type name="NotifyingPropertyTest">
       <method name="Void CreateDependent_NotifierNull()" attrs="134">
-        <size>59</size>
+        <size>57</size>
       </method>
       <method name="Void CreateDependent_DependentsNull()" attrs="134">
-        <size>84</size>
+        <size>83</size>
       </method>
       <method name="Void Main()" attrs="150">
         <size>2</size>
     </type>
     <type name="A`1+B`1[TA,TB]">
       <method name="Void foo()" attrs="150">
-        <size>40</size>
+        <size>39</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
         <size>8</size>
       </method>
       <method name="Int32 Main()" attrs="150">
-        <size>1210</size>
+        <size>1204</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>19</size>
   <test name="gtest-etree-28.cs">
     <type name="Repro">
       <method name="Void UseField()" attrs="129">
-        <size>70</size>
+        <size>69</size>
       </method>
       <method name="Void TakeExpression(System.Linq.Expressions.Expression`1[System.Action])" attrs="129">
         <size>2</size>
   <test name="gtest-exmethod-20.cs">
     <type name="Outer.Inner.Test">
       <method name="Void M(I)" attrs="145">
-        <size>14</size>
+        <size>13</size>
       </method>
       <method name="Void Main()" attrs="150">
         <size>2</size>
   <test name="gtest-exmethod-27.cs">
     <type name="Bar.Program">
       <method name="Void Main()" attrs="150">
-        <size>18</size>
+        <size>17</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
     </type>
     <type name="A">
       <method name="Void Main()" attrs="150">
-        <size>13</size>
+        <size>12</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
         <size>23</size>
       </method>
       <method name="Int32 Main()" attrs="150">
-        <size>88</size>
+        <size>87</size>
       </method>
       <method name="Boolean Foo(Int32[])" attrs="145">
         <size>52</size>
   <test name="gtest-friend-14.cs">
     <type name="Test">
       <method name="Int32 Main()" attrs="150">
-        <size>21</size>
+        <size>20</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
     </type>
     <type name="C`1[T]">
       <method name="System.Collections.IEnumerator GetEnumerator()" attrs="134">
-        <size>20</size>
+        <size>19</size>
       </method>
     </type>
     <type name="C`1+&lt;Filter&gt;c__Iterator0[T]">
         <size>10</size>
       </method>
       <method name="Int32 Main()" attrs="150">
-        <size>53</size>
+        <size>52</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
   <test name="gtest-linq-01.cs">
     <type name="from.C">
       <method name="Void Main()" attrs="150">
-        <size>2181</size>
+        <size>2179</size>
       </method>
       <method name="Void Foo(Int32, Boolean)" attrs="129">
         <size>16</size>
     </type>
     <type name="NameCollisionTest.C">
       <method name="Void Main()" attrs="150">
-        <size>79</size>
+        <size>78</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
     </type>
     <type name="C">
       <method name="Void &lt;Main&gt;m__0()" attrs="145">
-        <size>162</size>
+        <size>159</size>
       </method>
       <method name="System.Collections.Generic.IEnumerable`1[B] &lt;Main&gt;m__1(A)" attrs="145">
-        <size>15</size>
+        <size>14</size>
       </method>
       <method name="&lt;&gt;__AnonType0`2[A,B] &lt;Main&gt;m__2(A, B)" attrs="145">
         <size>16</size>
         <size>10</size>
       </method>
       <method name="Int32 Main()" attrs="150">
-        <size>192</size>
+        <size>190</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
         <size>10</size>
       </method>
       <method name="Int32 Main()" attrs="145">
-        <size>42</size>
+        <size>41</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
       </method>
     </type>
   </test>
+  <test name="gtest-optional-36.cs">
+    <type name="Program">
+      <method name="Int32 Arg(UInt32, Int64)" attrs="145">
+        <size>10</size>
+      </method>
+      <method name="Int32 Arg(Int32, UInt64, Int32)" attrs="145">
+        <size>10</size>
+      </method>
+      <method name="Int32 Arg_2(UInt32, Int64, Int32[])" attrs="145">
+        <size>10</size>
+      </method>
+      <method name="Int32 Arg_2(Int32, UInt64, Int32)" attrs="145">
+        <size>10</size>
+      </method>
+      <method name="Int32 Arg_3(Int32, Int64, Int32[])" attrs="145">
+        <size>10</size>
+      </method>
+      <method name="Int32 Arg_3(UInt32, UInt64, Int32, Int32, Int32[])" attrs="145">
+        <size>10</size>
+      </method>
+      <method name="Int32 Main()" attrs="150">
+        <size>237</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="gtest-partial-01.cs">
     <type name="B`1[U]">
       <method name="Void .ctor()" attrs="6278">
   <test name="gtest-variance-13.cs">
     <type name="A">
       <method name="Void Test()" attrs="150">
-        <size>18</size>
+        <size>17</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
   <test name="gtest-variance-19.cs">
     <type name="Test">
       <method name="Void Bla[T,U]()" attrs="145">
-        <size>13</size>
+        <size>12</size>
       </method>
       <method name="Void Main()" attrs="150">
         <size>7</size>
         <size>9</size>
       </method>
       <method name="Int32 Main()" attrs="150">
-        <size>94</size>
+        <size>93</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
   <test name="test-232.cs">
     <type name="CtorInfoTest">
       <method name="Void Main(System.String[])" attrs="150">
-        <size>978</size>
+        <size>977</size>
       </method>
       <method name="Void Assert(System.Object, System.Object)" attrs="145">
         <size>43</size>
     </type>
     <type name="UnsupportedClassVersionError">
       <method name="Void .ctor(String)" attrs="6275">
-        <size>15</size>
+        <size>14</size>
       </method>
     </type>
   </test>
     </type>
     <type name="ChildClass">
       <method name="Void .ctor()" attrs="6278">
-        <size>13</size>
+        <size>12</size>
       </method>
     </type>
     <type name="M">
         <size>2</size>
       </method>
       <method name="Void Main()" attrs="150">
-        <size>243</size>
+        <size>242</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
     </type>
     <type name="SimpleAttribute">
       <method name="Int64[] get_ArrayValue()" attrs="2182">
-        <size>15</size>
+        <size>14</size>
       </method>
       <method name="Void set_ArrayValue(Int64[])" attrs="2182">
         <size>2</size>
     </type>
     <type name="X+Derived+Nested">
       <method name="Void G()" attrs="134">
-        <size>22</size>
+        <size>21</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
         <size>41</size>
       </method>
       <method name="Void Main(System.String[])" attrs="150">
-        <size>259</size>
+        <size>257</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
   <test name="test-555.cs">
     <type name="Test">
       <method name="Int32 Main()" attrs="150">
-        <size>361</size>
+        <size>360</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
         <size>60</size>
       </method>
       <method name="Int32 Main()" attrs="150">
-        <size>165</size>
+        <size>164</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
   <test name="test-772.cs">
     <type name="Test">
       <method name="Void Main()" attrs="150">
-        <size>15</size>
+        <size>14</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
         <size>7</size>
       </method>
       <method name="System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()" attrs="481">
-        <size>20</size>
+        <size>19</size>
       </method>
     </type>
   </test>
         <size>12</size>
       </method>
       <method name="Void TestCallOnly()" attrs="129">
-        <size>66</size>
+        <size>65</size>
       </method>
       <method name="Void SomeMethod()" attrs="486">
         <size>2</size>
   <test name="test-850.cs">
     <type name="C">
       <method name="Int32 Main()" attrs="150">
-        <size>39</size>
+        <size>38</size>
       </method>
       <method name="Int32 F(System.String, System.String[])" attrs="145">
         <size>10</size>
         <size>20</size>
       </method>
       <method name="Int32 Main()" attrs="150">
-        <size>71</size>
+        <size>70</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
         <size>2</size>
       </method>
       <method name="Int32 Main()" attrs="150">
-        <size>288</size>
+        <size>284</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
       </method>
     </type>
   </test>
+  <test name="test-933.cs">
+    <type name="X">
+      <method name="Int32 Foo(X[])" attrs="145">
+        <size>10</size>
+      </method>
+      <method name="Int32 Foo(System.Object)" attrs="145">
+        <size>10</size>
+      </method>
+      <method name="Int32 Main()" attrs="145">
+        <size>29</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="test-94.cs">
     <type name="Base">
       <method name="Int32 IVehicle.Start()" attrs="481">
         <size>10</size>
       </method>
       <method name="Int32 Main()" attrs="150">
-        <size>95</size>
+        <size>94</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
     </type>
     <type name="Foo`1+&lt;ContainsAll&gt;c__AnonStorey0`1[T,U]">
       <method name="Boolean &lt;&gt;m__0()" attrs="131">
-        <size>210</size>
+        <size>209</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
     </type>
     <type name="AwaitNS.MemberAccess">
       <method name="Void M()" attrs="145">
-        <size>13</size>
+        <size>12</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
     </type>
     <type name="O">
       <method name="Void Main()" attrs="150">
-        <size>23</size>
+        <size>22</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
         <size>76</size>
       </method>
       <method name="Void Test_2()" attrs="129">
-        <size>51</size>
+        <size>49</size>
       </method>
       <method name="Void .ctor()" attrs="6278">
         <size>7</size>
         <size>14</size>
       </method>
       <method name="Boolean MoveNext()" attrs="486">
-        <size>168</size>
+        <size>167</size>
       </method>
       <method name="Void Dispose()" attrs="486">
         <size>15</size>
         <size>477</size>
       </method>
       <method name="Int32 TestReferenceType()" attrs="145">
-        <size>229</size>
+        <size>227</size>
       </method>
       <method name="Int32 TestGeneric[T](T)" attrs="145">
         <size>118</size>
index 867c1d3e2df0fd3c833b427f1927b62103831449..05faf5e8c685e1ec0ce4d295e848619f974d28c8 100644 (file)
@@ -11,7 +11,7 @@ RESOURCE_FILES = $(OTHER_RES)
 LOCAL_MCS_FLAGS= $(OTHER_RES:%=-resource:%)
 
 LOCAL_MCS_FLAGS += -d:STATIC,NO_SYMBOL_WRITER,NO_AUTHENTICODE
-LIB_REFS = System.Xml System
+LIB_REFS = System.Xml System System.Core
 
 EXTRA_DISTFILES = $(RESOURCE_FILES)
 
index 57bae7e4c1d96d7e934ae63c25872c9e9dcfab5a..6395e90ff41b3499337d075e126a72376dd6f35e 100755 (executable)
@@ -7,6 +7,11 @@
 //   Miguel de Icaza
 //
 // (C) Novell, Inc 2004
+// (C) 2016 Xamarin Inc
+//
+// Missing features:
+// * Implement --cross, --local-targets, --list-targets, --no-auto-fetch
+// * concatenate target with package to form native binary
 //
 using System;
 using System.Diagnostics;
@@ -17,8 +22,8 @@ using System.IO.Compression;
 using System.Runtime.InteropServices;
 using System.Text;
 using IKVM.Reflection;
-
-
+using System.Linq;
+using System.Diagnostics;
 using System.Threading.Tasks;
 
 class MakeBundle {
@@ -41,6 +46,9 @@ class MakeBundle {
        static bool skip_scan;
        static string ctor_func;
        static bool quiet;
+       static bool custom_mode = true;
+       static string embedded_options = null;
+       static string runtime = null;
        
        static int Main (string [] args)
        {
@@ -56,6 +64,15 @@ class MakeBundle {
                                Help ();
                                return 1;
 
+                       case "--simple":
+                               custom_mode = false;
+                               autodeps = true;
+                               break;
+                               
+                       case "--custom":
+                               custom_mode = true;
+                               break;
+                               
                        case "-c":
                                compile_only = true;
                                break;
@@ -68,6 +85,20 @@ class MakeBundle {
                                output = args [++i];
                                break;
 
+                       case "--options":
+                               if (i+1 == top){
+                                       Help (); 
+                                       return 1;
+                               }
+                               embedded_options = args [++i];
+                               break;
+                       case "--runtime":
+                               if (i+1 == top){
+                                       Help (); 
+                                       return 1;
+                               }
+                               runtime = args [++i];
+                               break;
                        case "-oo":
                                if (i+1 == top){
                                        Help (); 
@@ -95,6 +126,7 @@ class MakeBundle {
                        case "--keeptemp":
                                keeptemp = true;
                                break;
+                               
                        case "--static":
                                static_link = true;
                                break;
@@ -197,9 +229,11 @@ class MakeBundle {
                foreach (string file in assemblies)
                        if (!QueueAssembly (files, file))
                                return 1;
-                       
-               GenerateBundles (files);
-               //GenerateJitWrapper ();
+
+               if (custom_mode)
+                       GenerateBundles (files);
+               else
+                       GeneratePackage (files);
                
                return 0;
        }
@@ -264,6 +298,138 @@ class MakeBundle {
 
                ts.WriteLine ();
        }
+
+       class PackageMaker {
+               Dictionary<string, Tuple<long,int>> locations = new Dictionary<string, Tuple<long,int>> ();
+               const int align = 4096;
+               Stream package;
+               
+               public PackageMaker (string output)
+               {
+                       package = File.Create (output, 128*1024);
+                       if (IsUnix){
+                               File.SetAttributes (output, unchecked ((FileAttributes) 0x80000000));
+                       }
+               }
+
+               public int AddFile (string fname)
+               {
+                       using (Stream fileStream = File.OpenRead (fname)){
+                               var ret = fileStream.Length;
+                               
+                               Console.WriteLine ("At {0:x} with input {1}", package.Position, fileStream.Length);
+                               fileStream.CopyTo (package);
+                               package.Position = package.Position + (align - (package.Position % align));
+
+                               return (int) ret;
+                       }
+               }
+               
+               public void Add (string entry, string fname)
+               {
+                       var p = package.Position;
+                       var size = AddFile (fname);
+                       
+                       locations [entry] = Tuple.Create(p, size);
+               }
+
+               public void AddString (string entry, string text)
+               {
+                       var bytes = Encoding.UTF8.GetBytes (text);
+                       locations [entry] = Tuple.Create (package.Position, bytes.Length);
+                       package.Write (bytes, 0, bytes.Length);
+                       package.Position = package.Position + (align - (package.Position % align));
+               }
+
+               public void Dump ()
+               {
+                       foreach (var floc in locations.Keys){
+                               Console.WriteLine ($"{floc} at {locations[floc]:x}");
+                       }
+               }
+
+               public void WriteIndex ()
+               {
+                       var indexStart = package.Position;
+                       var binary = new BinaryWriter (package);
+
+                       binary.Write (locations.Count);
+                       foreach (var entry in from entry in locations orderby entry.Value.Item1 ascending select entry){
+                               var bytes = Encoding.UTF8.GetBytes (entry.Key);
+                               binary.Write (bytes.Length+1);
+                               binary.Write (bytes);
+                               binary.Write ((byte) 0);
+                               binary.Write (entry.Value.Item1);
+                               binary.Write (entry.Value.Item2);
+                       }
+                       binary.Write (indexStart);
+                       binary.Write (Encoding.UTF8.GetBytes ("xmonkeysloveplay"));
+                       binary.Flush ();
+               }
+               
+               public void Close ()
+               {
+                       WriteIndex ();
+                       package.Close ();
+                       package = null;
+               }
+       }
+
+       static bool MaybeAddFile (PackageMaker maker, string code, string file)
+       {
+               if (file == null)
+                       return true;
+               
+               if (!File.Exists (file)){
+                       Console.Error.WriteLine ("The file {0} does not exist", file);
+                       return false;
+               }
+               maker.Add (code, file);
+               return true;
+       }
+       
+       static bool GeneratePackage (List<string> files)
+       {
+               if (runtime == null){
+                       if (IsUnix)
+                               runtime = Process.GetCurrentProcess().MainModule.FileName;
+                       else {
+                               Console.Error.WriteLine ("You must specify at least one runtime with --runtime or --cross");
+                               Environment.Exit (1);
+                       }
+               }
+               if (!File.Exists (runtime)){
+                       Console.Error.WriteLine ($"The specified runtime at {runtime} does not exist");
+                       Environment.Exit (1);
+               }
+               
+               if (ctor_func != null){
+                       Console.Error.WriteLine ("--static-ctor not supported with package bundling, you must use native compilation for this");
+                       return false;
+               }
+               
+               var maker = new PackageMaker (output);
+               maker.AddFile (runtime);
+               
+               foreach (var url in files){
+                       string fname = LocateFile (new Uri (url).LocalPath);
+                       string aname = Path.GetFileName (fname);
+
+                       maker.Add ("assembly:" + aname, fname);
+                       if (File.Exists (fname + ".config"))
+                               maker.Add ("config:" + aname, fname + ".config");
+               }
+               if (!MaybeAddFile (maker, "systemconfig:", config_file) || !MaybeAddFile (maker, "machineconfig:", machine_config_file))
+                       return false;
+
+               if (config_dir != null)
+                       maker.Add ("config_dir:", config_dir);
+               if (embedded_options != null)
+                       maker.AddString ("options:", embedded_options);
+               maker.Dump ();
+               maker.Close ();
+               return true;
+       }
        
        static void GenerateBundles (List<string> files)
        {
@@ -756,25 +922,35 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
        {
                Console.WriteLine ("Usage is: mkbundle [options] assembly1 [assembly2...]\n\n" +
                                   "Options:\n" +
-                                  "    -c                  Produce stub only, do not compile\n" +
+                                  "    --config F          Bundle system config file `F'\n" +
+                                  "    --config-dir D      Set MONO_CFG_DIR to `D'\n" +
+                                  "    --deps              Turns on automatic dependency embedding (default on simple)\n" +
+                                  "    -L path             Adds `path' to the search path for assemblies\n" +
+                                  "    --machine-config F  Use the given file as the machine.config for the application.\n" +
                                   "    -o out              Specifies output filename\n" +
+                                  "    --nodeps            Turns off automatic dependency embedding (default on custom)\n" +
+                                  "    --skip-scan         Skip scanning assemblies that could not be loaded (but still embed them).\n" +
+                                  "\n" + 
+                                  "--simple   Simple mode does not require a C toolchain and can cross compile\n" + 
+                                  "    --cross TARGET      Generates a binary for the given TARGET\n"+
+                                  "    --local-targets     Lists locally available targets\n" +
+                                  "    --list-targets [SERVER] Lists available targets on the remote server\n" +
+                                  "    --no-auto-fetch     Prevents the tool from auto-fetching a TARGET\n" +
+                                  "    --options OPTIONS   Embed the specified Mono command line options on target\n" +
+                                  "    --runtime RUNTIME   Manually specifies the Mono runtime to use\n" + 
+                                  "\n" +
+                                  "--custom   Builds a custom launcher, options for --custom\n" +
+                                  "    -c                  Produce stub only, do not compile\n" +
                                   "    -oo obj             Specifies output filename for helper object file\n" +
-                                  "    -L path             Adds `path' to the search path for assemblies\n" +
-                                  "    --nodeps            Turns off automatic dependency embedding (default)\n" +
-                                  "    --deps              Turns on automatic dependency embedding\n" +
                                   "    --dos2unix[=true|false]\n" +
                                   "                        When no value provided, or when `true` specified\n" +
                                   "                        `dos2unix` will be invoked to convert paths on Windows.\n" +
                                   "                        When `--dos2unix=false` used, dos2unix is NEVER used.\n" +
                                   "    --keeptemp          Keeps the temporary files\n" +
-                                  "    --config F          Bundle system config file `F'\n" +
-                                  "    --config-dir D      Set MONO_CFG_DIR to `D'\n" +
-                                  "    --machine-config F  Use the given file as the machine.config for the application.\n" +
                                   "    --static            Statically link to mono libs\n" +
                                   "    --nomain            Don't include a main() function, for libraries\n" +
-                                  "    --custom-main C         Link the specified compilation unit (.c or .obj) with entry point/init code\n" +
+                                  "    --custom-main C     Link the specified compilation unit (.c or .obj) with entry point/init code\n" +
                                   "    -z                  Compress the assemblies before embedding.\n" +
-                                  "    --skip-scan         Skip scanning assemblies that could not be loaded (but still embed them).\n" +
                                   "    --static-ctor ctor  Add a constructor call to the supplied function.\n" +
                                   "                        You need zlib development headers and libraries.\n");
        }
index dc00fd17b0d7e8773e3c1bad467208491301ba54..6a5dc193331b7e1ee3c8a3fe641a474f6b76e52d 100644 (file)
@@ -499,10 +499,10 @@ ICALL_TYPE(ASSEMB, "System.Reflection.Emit.AssemblyBuilder", ASSEMB_1)
 ICALL(ASSEMB_1, "InternalAddModule", ves_icall_System_Reflection_Emit_AssemblyBuilder_InternalAddModule)
 ICALL(ASSEMB_2, "basic_init", mono_image_basic_init)
 
+#ifndef DISABLE_REFLECTION_EMIT
 ICALL_TYPE(CATTRB, "System.Reflection.Emit.CustomAttributeBuilder", CATTRB_1)
 ICALL(CATTRB_1, "GetBlob", ves_icall_System_Reflection_Emit_CustomAttributeBuilder_GetBlob)
 
-#ifndef DISABLE_REFLECTION_EMIT
 ICALL_TYPE(DERIVEDTYPE, "System.Reflection.Emit.DerivedType", DERIVEDTYPE_1)
 ICALL(DERIVEDTYPE_1, "create_unmanaged_type", mono_reflection_create_unmanaged_type)
 #endif
index 29d3b7c9ce80d829bafcdc038a9713967ff92958..c342e592a4c21c6df409727bfff139047d0e0499 100644 (file)
@@ -1285,6 +1285,7 @@ ves_icall_System_Reflection_Emit_TypeBuilder_create_generic_class (MonoReflectio
        mono_error_set_pending_exception (&error);
 }
 
+#ifndef DISABLE_REFLECTION_EMIT
 ICALL_EXPORT MonoArray*
 ves_icall_System_Reflection_Emit_CustomAttributeBuilder_GetBlob (MonoReflectionAssembly *assembly, MonoObject *ctor, MonoArray *ctorArgs, MonoArray *properties, MonoArray *propValues, MonoArray *fields, MonoArray* fieldValues)
 {
@@ -1293,6 +1294,7 @@ ves_icall_System_Reflection_Emit_CustomAttributeBuilder_GetBlob (MonoReflectionA
        mono_error_set_pending_exception (&error);
        return result;
 }
+#endif
 
 static gboolean
 get_executing (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer data)
index 4f6eb93ba60da7444c0b6b873b002bb1f5dd9dab..09e6027f4a0d53b7f5c2d50eed49cc7c59b1479b 100644 (file)
@@ -185,9 +185,11 @@ mono_mb_create_method (MonoMethodBuilder *mb, MonoMethodSignature *signature, in
 #endif
        }
 
+#ifndef DISABLE_JIT
        /* Free the locals list so mono_mb_free () doesn't free the types twice */
        g_list_free (mb->locals_list);
        mb->locals_list = NULL;
+#endif
 
        method->signature = signature;
        if (!signature->hasthis)
index a52072f324f31eb485d421982095d2b62c6bd26e..61a8a597d407c0722d61299cc1f83d1980b0435c 100644 (file)
@@ -14298,8 +14298,9 @@ mono_reflection_create_dynamic_method (MonoReflectionDynamicMethod *mb)
 }
 
 gpointer
-mono_reflection_lookup_dynamic_token (MonoImage *image, guint32 token, gboolean valid_token, MonoClass **handle_class, MonoGenericContext *context)
+mono_reflection_lookup_dynamic_token (MonoImage *image, guint32 token, gboolean valid_token, MonoClass **handle_class, MonoGenericContext *context, MonoError *error)
 {
+       mono_error_init (error);
        return NULL;
 }
 
index f1c27d7dc404fe214ff5d13837dfd7677988ea65..e39a941023491c1b34581a32ef7f7e3db9789cd6 100644 (file)
@@ -2377,83 +2377,154 @@ mono_set_crash_chaining (gboolean chain_crashes)
        mono_do_crash_chaining = chain_crashes;
 }
 
-void
-mono_parse_env_options (int *ref_argc, char **ref_argv [])
+/**
+ * mono_parse_options_from:
+ * @options: string containing strings 
+ * @ref_argc: pointer to the argc variable that might be updated 
+ * @ref_argv: pointer to the argv string vector variable that might be updated
+ *
+ * This function parses the contents of the `MONO_ENV_OPTIONS`
+ * environment variable as if they were parsed by a command shell
+ * splitting the contents by spaces into different elements of the
+ * @argv vector.  This method supports quoting with both the " and '
+ * characters.  Inside quoting, spaces and tabs are significant,
+ * otherwise, they are considered argument separators.
+ *
+ * The \ character can be used to escape the next character which will
+ * be added to the current element verbatim.  Typically this is used
+ * inside quotes.   If the quotes are not balanced, this method 
+ *
+ * If the environment variable is empty, no changes are made
+ * to the values pointed by @ref_argc and @ref_argv.
+ *
+ * Otherwise the @ref_argv is modified to point to a new array that contains
+ * all the previous elements contained in the vector, plus the values parsed.
+ * The @argc is updated to match the new number of parameters.
+ *
+ * Returns: The value NULL is returned on success, otherwise a g_strdup allocated
+ * string is returned (this is an alias to malloc under normal circumstances) that
+ * contains the error message that happened during parsing.
+ */
+char *
+mono_parse_options_from (const char *options, int *ref_argc, char **ref_argv [])
 {
        int argc = *ref_argc;
        char **argv = *ref_argv;
-
-       const char *env_options = g_getenv ("MONO_ENV_OPTIONS");
-       if (env_options != NULL){
-               GPtrArray *array = g_ptr_array_new ();
-               GString *buffer = g_string_new ("");
-               const char *p;
-               unsigned i;
-               gboolean in_quotes = FALSE;
-               char quote_char = '\0';
-
-               for (p = env_options; *p; p++){
-                       switch (*p){
-                       case ' ': case '\t':
-                               if (!in_quotes) {
-                                       if (buffer->len != 0){
-                                               g_ptr_array_add (array, g_strdup (buffer->str));
-                                               g_string_truncate (buffer, 0);
-                                       }
-                               } else {
-                                       g_string_append_c (buffer, *p);
-                               }
-                               break;
-                       case '\\':
-                               if (p [1]){
-                                       g_string_append_c (buffer, p [1]);
-                                       p++;
-                               }
-                               break;
-                       case '\'':
-                       case '"':
-                               if (in_quotes) {
-                                       if (quote_char == *p)
-                                               in_quotes = FALSE;
-                                       else
-                                               g_string_append_c (buffer, *p);
-                               } else {
-                                       in_quotes = TRUE;
-                                       quote_char = *p;
+       GPtrArray *array = g_ptr_array_new ();
+       GString *buffer = g_string_new ("");
+       const char *p;
+       unsigned i;
+       gboolean in_quotes = FALSE;
+       char quote_char = '\0';
+
+       if (options == NULL)
+               return NULL;
+       
+       for (p = options; *p; p++){
+               switch (*p){
+               case ' ': case '\t':
+                       if (!in_quotes) {
+                               if (buffer->len != 0){
+                                       g_ptr_array_add (array, g_strdup (buffer->str));
+                                       g_string_truncate (buffer, 0);
                                }
-                               break;
-                       default:
+                       } else {
                                g_string_append_c (buffer, *p);
-                               break;
                        }
+                       break;
+               case '\\':
+                       if (p [1]){
+                               g_string_append_c (buffer, p [1]);
+                               p++;
+                       }
+                       break;
+               case '\'':
+               case '"':
+                       if (in_quotes) {
+                               if (quote_char == *p)
+                                       in_quotes = FALSE;
+                               else
+                                       g_string_append_c (buffer, *p);
+                       } else {
+                               in_quotes = TRUE;
+                               quote_char = *p;
+                       }
+                       break;
+               default:
+                       g_string_append_c (buffer, *p);
+                       break;
                }
-               if (in_quotes) {
-                       fprintf (stderr, "Unmatched quotes in value of MONO_ENV_OPTIONS: [%s]\n", env_options);
-                       exit (1);
-               }
-                       
-               if (buffer->len != 0)
-                       g_ptr_array_add (array, g_strdup (buffer->str));
-               g_string_free (buffer, TRUE);
+       }
+       if (in_quotes) 
+               return g_strdup_printf ("Unmatched quotes in value: [%s]\n", options);
+               
+       if (buffer->len != 0)
+               g_ptr_array_add (array, g_strdup (buffer->str));
+       g_string_free (buffer, TRUE);
 
-               if (array->len > 0){
-                       int new_argc = array->len + argc;
-                       char **new_argv = g_new (char *, new_argc + 1);
-                       int j;
+       if (array->len > 0){
+               int new_argc = array->len + argc;
+               char **new_argv = g_new (char *, new_argc + 1);
+               int j;
 
-                       new_argv [0] = argv [0];
-                       
-                       /* First the environment variable settings, to allow the command line options to override */
-                       for (i = 0; i < array->len; i++)
-                               new_argv [i+1] = (char *)g_ptr_array_index (array, i);
-                       i++;
-                       for (j = 1; j < argc; j++)
-                               new_argv [i++] = argv [j];
-                       new_argv [i] = NULL;
-
-                       *ref_argc = new_argc;
-                       *ref_argv = new_argv;
-               }
-               g_ptr_array_free (array, TRUE);
+               new_argv [0] = argv [0];
+               
+               /* First the environment variable settings, to allow the command line options to override */
+               for (i = 0; i < array->len; i++)
+                       new_argv [i+1] = (char *)g_ptr_array_index (array, i);
+               i++;
+               for (j = 1; j < argc; j++)
+                       new_argv [i++] = argv [j];
+               new_argv [i] = NULL;
+
+               *ref_argc = new_argc;
+               *ref_argv = new_argv;
        }
+       g_ptr_array_free (array, TRUE);
+       return NULL;
+}
+
+/**
+ * mono_parse_env_options:
+ * @ref_argc: pointer to the argc variable that might be updated 
+ * @ref_argv: pointer to the argv string vector variable that might be updated
+ *
+ * This function parses the contents of the `MONO_ENV_OPTIONS`
+ * environment variable as if they were parsed by a command shell
+ * splitting the contents by spaces into different elements of the
+ * @argv vector.  This method supports quoting with both the " and '
+ * characters.  Inside quoting, spaces and tabs are significant,
+ * otherwise, they are considered argument separators.
+ *
+ * The \ character can be used to escape the next character which will
+ * be added to the current element verbatim.  Typically this is used
+ * inside quotes.   If the quotes are not balanced, this method 
+ *
+ * If the environment variable is empty, no changes are made
+ * to the values pointed by @ref_argc and @ref_argv.
+ *
+ * Otherwise the @ref_argv is modified to point to a new array that contains
+ * all the previous elements contained in the vector, plus the values parsed.
+ * The @argc is updated to match the new number of parameters.
+ *
+ * If there is an error parsing, this method will terminate the process by
+ * calling exit(1).
+ *
+ * An alternative to this method that allows an arbitrary string to be parsed
+ * and does not exit on error is the `api:mono_parse_options_from`.
+ */
+void
+mono_parse_env_options (int *ref_argc, char **ref_argv [])
+{
+       char *ret;
+       
+       const char *env_options = g_getenv ("MONO_ENV_OPTIONS");
+       if (env_options == NULL)
+               return;
+       ret = mono_parse_options_from (env_options, ref_argc, ref_argv);
+       if (ret == NULL)
+               return;
+       fprintf (stderr, "%s", ret);
+       exit (1);
 }
+
index 4ef344ecdd9b0f1b5e005e5e9a1f6b258744dadb..de8ab61e3d5b64550e733981fcce690c013d7860 100644 (file)
@@ -1,10 +1,18 @@
 #include <config.h>
+#include <fcntl.h>
+#include <mono/metadata/assembly.h>
+#include <mono/utils/mono-mmap.h>
 #include "mini.h"
 
-#ifndef HOST_WIN32
-#ifndef BUILDVER_INCLUDED
-#include "buildver-boehm.h"
+#ifdef HAVE_UNISTD_H
+#  include <unistd.h>
 #endif
+#ifdef HOST_WIN32
+#  include <io.h>
+#else
+#  ifndef BUILDVER_INCLUDED
+#    include "buildver-boehm.h"
+#  endif
 #endif
 
 /*
@@ -20,6 +28,114 @@ mono_main_with_options (int argc, char *argv [])
        return mono_main (argc, argv);
 }
 
+#define STREAM_INT(x) (*(uint32_t*)x)
+#define STREAM_LONG(x) (*(uint64_t*)x)
+
+static gboolean
+probe_embedded (const char *program, int *ref_argc, char **ref_argv [])
+{
+       MonoBundledAssembly last = { NULL, 0, 0 };
+       char sigbuffer [16+sizeof (uint64_t)];
+       gboolean status = FALSE;
+       uint64_t directory_location;
+       off_t sigstart, baseline = 0;
+       uint64_t directory_size;
+       char *directory, *p;
+       int items, i;
+       unsigned char *mapaddress = NULL;
+       void *maphandle = NULL;
+       GArray *assemblies;
+       char *entry_point = NULL;
+       char **new_argv;
+       int j;
+
+       int fd = open (program, O_RDONLY);
+       if (fd == -1)
+               return FALSE;
+       if ((sigstart = lseek (fd, -(16+sizeof(uint64_t)), SEEK_END)) == -1)
+               goto doclose;
+       if (read (fd, sigbuffer, sizeof (sigbuffer)) == -1)
+               goto doclose;
+       if (memcmp (sigbuffer+sizeof(uint64_t), "xmonkeysloveplay", 16) != 0)
+               goto doclose;
+       directory_location = GUINT64_FROM_LE ((*(uint64_t *) &sigbuffer [0]));
+       if (lseek (fd, directory_location, SEEK_SET) == -1)
+               goto doclose;
+       directory_size = sigstart-directory_location;
+       directory = g_malloc (directory_size);
+       if (directory == NULL)
+               goto doclose;
+       if (read (fd, directory, directory_size) == -1)
+               goto dofree;
+
+       items = STREAM_INT (directory);
+       p = directory+4;
+
+       assemblies = g_array_new (0, 0, sizeof (MonoBundledAssembly*));
+       for (i = 0; i < items; i++){
+               char *kind;
+               int strsize = STREAM_INT (p);
+               uint64_t offset, item_size;
+               kind = p+4;
+               p += 4 + strsize;
+               offset = STREAM_LONG(p);
+               p += 8;
+               item_size = STREAM_INT (p);
+               p += 4;
+               
+               if (mapaddress == NULL){
+                       mapaddress = mono_file_map (directory_location-offset, MONO_MMAP_READ | MONO_MMAP_PRIVATE, fd, offset, &maphandle);
+                       if (mapaddress == NULL){
+                               perror ("Error mapping file");
+                               exit (1);
+                       }
+                       baseline = offset;
+               }
+               if (strncmp (kind, "assembly:", strlen ("assembly:")) == 0){
+                       char *aname = kind + strlen ("assembly:");
+                       MonoBundledAssembly mba = { aname, mapaddress + offset - baseline, item_size }, *ptr;
+                       ptr = g_new (MonoBundledAssembly, 1);
+                       memcpy (ptr, &mba, sizeof (MonoBundledAssembly));
+                       g_array_append_val  (assemblies, ptr);
+                       if (entry_point == NULL)
+                               entry_point = aname;
+               } else if (strncmp (kind, "config:", strlen ("config:")) == 0){
+                       printf ("c-Found: %s %llx\n", kind, offset);
+                       char *config = kind + strlen ("config:");
+                       char *aname = g_strdup (config);
+                       aname [strlen(aname)-strlen(".config")] = 0;
+                       mono_register_config_for_assembly (aname, config);
+               } else if (strncmp (kind, "system_config:", strlen ("system_config:")) == 0){
+                       printf ("TODO s-Found: %s %llx\n", kind, offset);
+               } else if (strncmp (kind, "options:", strlen ("options:")) == 0){
+                       mono_parse_options_from (kind + strlen("options:"), ref_argc, ref_argv);
+               } else if (strncmp (kind, "config_dir:", strlen ("config_dir:")) == 0){
+                       printf ("TODO Found: %s %llx\n", kind, offset);
+               } else {
+                       fprintf (stderr, "Unknown stream on embedded package: %s\n", kind);
+                       exit (1);
+               }
+       }
+       g_array_append_val (assemblies, last);
+       
+       mono_register_bundled_assemblies ((const MonoBundledAssembly **) assemblies->data);
+       new_argv = g_new (char *, (*ref_argc)+1);
+       for (j = 0; j < *ref_argc; j++)
+               new_argv [j] = (*ref_argv)[j];
+       new_argv [j] = entry_point;
+       *ref_argv = new_argv;
+       (*ref_argc)++;
+       
+       return TRUE;
+       
+dofree:
+       g_free (directory);
+doclose:
+       if (!status)
+               close (fd);
+       return status;
+}
+
 #ifdef HOST_WIN32
 
 #include <shellapi.h>
@@ -27,11 +143,13 @@ mono_main_with_options (int argc, char *argv [])
 int
 main (void)
 {
+       TCHAR szFileName[MAX_PATH];
        int argc;
        gunichar2** argvw;
        gchar** argv;
        int i;
-
+       DWORD count;
+       
        argvw = CommandLineToArgvW (GetCommandLine (), &argc);
        argv = g_new0 (gchar*, argc + 1);
        for (i = 0; i < argc; i++)
@@ -40,6 +158,11 @@ main (void)
 
        LocalFree (argvw);
 
+       if ((count = GetModuleFileName (NULL, szFileName, MAX_PATH)) != 0){
+               char *entry = g_utf16_to_utf8 (szFileName, count, NULL, NULL, NULL);
+               probe_embedded (entry, &argc, &argv);
+       }
+
        return mono_main_with_options  (argc, argv);
 }
 
@@ -49,7 +172,8 @@ int
 main (int argc, char* argv[])
 {
        mono_build_date = build_date;
-       
+
+       probe_embedded (argv [0], &argc, &argv);
        return mono_main_with_options (argc, argv);
 }
 
index e63fd7aa222d33be1b2f2e31e96ba75244e57e8c..3159149307040796ecef73de4c5a6fc3ae92d7e5 100644 (file)
@@ -2286,6 +2286,8 @@ mono_bb_last_inst (MonoBasicBlock *bb, int filter)
 MONO_API int         mono_main                      (int argc, char* argv[]);
 MONO_API void        mono_set_defaults              (int verbose_level, guint32 opts);
 MONO_API void        mono_parse_env_options         (int *ref_argc, char **ref_argv []);
+MONO_API char       *mono_parse_options_from        (const char *options, int *ref_argc, char **ref_argv []);
+
 MonoDomain* mini_init                      (const char *filename, const char *runtime_version);
 void        mini_cleanup                   (MonoDomain *domain);
 MONO_API MonoDebugOptions *mini_get_debug_options   (void);
index 1f44713976548f2ab5152b5f8716b182d2e2f225..4bd7ac33474b3f31f592213448c9774f3f3cbfe5 100644 (file)
@@ -669,6 +669,13 @@ mono_arch_create_specific_trampoline (gpointer arg1, MonoTrampolineType tramp_ty
        return NULL;
 }
 
+gpointer
+mono_arch_create_handler_block_trampoline (MonoTrampInfo **info, gboolean aot)
+{
+        g_assert_not_reached ();
+        return NULL;
+}
+
 gpointer
 mono_arch_get_unbox_trampoline (MonoMethod *m, gpointer addr)
 {
index 8392a8c693d0ffc3c43544747d5a976253d74651..487513f2c369be8282e3c4a4be25b3af208c821e 100644 (file)
@@ -659,6 +659,7 @@ mono_pagesize
 mono_param_get_objects
 mono_parse_default_optimizations
 mono_parse_env_options
+mono_parse_options_from
 mono_path_canonicalize
 mono_path_resolve_symlinks
 mono_pe_file_open
index eee61f0242607037e52f1ea8ba04f48fba57c491..d686ca0d90942115580eb285e3023703273a11f9 100644 (file)
@@ -661,6 +661,7 @@ mono_pagesize
 mono_param_get_objects
 mono_parse_default_optimizations
 mono_parse_env_options
+mono_parse_options_from
 mono_path_canonicalize
 mono_path_resolve_symlinks
 mono_pe_file_open