You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
[mtouch] Detect when we run into the 32-bit arm size limitation, and report a better error.Fixes#6526. (#6855)
Also limit the output from the native compiler, so that we don't overload theIDEs with output if the native compiler produces tens of thousands of errors.Fixes#6526.
mtouch.AssertError(5107,"The assembly 'Xamarin.iOS.dll' can't be AOT-compiled for 32-bit architectures because the native code is too big for the 32-bit ARM architecture.");
3030
+
mtouch.AssertWarning(5108,"The compiler output is too long, it's been limited to 1000 lines.");
if(line.Contains("can not encode offset")&&line.Contains("in resulting scattered relocation")){
302
+
if(!reported_5107){
303
+
// There can be thousands of these, but we only need one.
304
+
reported_5107=true;
305
+
exceptions.Add(ErrorHelper.CreateError(5107,"The assembly '{0}' can't be AOT-compiled for 32-bit architectures because the native code is too big for the 32-bit ARM architecture.",assembly_name));
306
+
}
307
+
}
308
+
}
309
+
310
+
// Writes a list of lines to stderr, writing only a limited number of lines if there are too many of them.
@@ -181,6 +193,8 @@ public class AOTTask : ProcessTask
181
193
publicstringAssemblyPath;// path to the .s file.
182
194
List<string>inputs;
183
195
publicAotInfoAotInfo;
196
+
List<Exception>exceptions=newList<Exception>();
197
+
List<string>output_lines=newList<string>();
184
198
185
199
publicoverrideIEnumerable<string>Outputs{
186
200
get{
@@ -226,6 +240,19 @@ public override bool IsUptodate {
226
240
}
227
241
}
228
242
243
+
protectedoverridevoidOutputReceived(stringline)
244
+
{
245
+
if(line==null)
246
+
return;
247
+
248
+
if(line.StartsWith("AOT restriction: Method '",StringComparison.Ordinal)&&line.Contains("must be static since it is decorated with [MonoPInvokeCallback]")){
Console.Error.WriteLine("AOT Compilation exited with code {0}, command:\n{1}{2}",exit_code,Command,Output.Length>0?("\n"+Output.ToString()):string.Empty);
245
-
if(Output.Length>0){
246
-
List<Exception>exceptions=newList<Exception>();
247
-
foreach(varlineinOutput.ToString().Split('\n')){
248
-
if(line.StartsWith("AOT restriction: Method '",StringComparison.Ordinal)&&line.Contains("must be static since it is decorated with [MonoPInvokeCallback]")){