Bug 9002 - Debug Build - Error MT3001: Could not AOT the assembly - ServiceStack.Text.MonoTouch.dll.armv7.s: - branch out of range
Summary: Debug Build - Error MT3001: Could not AOT the assembly - ServiceStack.Text.Mo...
Status: RESOLVED DUPLICATE of bug 1102
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools ()
Version: 6.0.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
: 5093 18433 ()
Depends on:
Reported: 2012-12-17 16:09 UTC by Felix Collins
Modified: 2014-03-19 13:07 UTC (History)
5 users (show)

Is this bug a regression?: ---
Last known good build:

assembly (140.50 KB, application/octet-stream)
2013-01-22 20:21 UTC, Sebastien Pouliot

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Felix Collins 2012-12-17 16:09:03 UTC
I get the following errors in the build log.
using link-all but no llvm for a debug build.

ServiceStack.Text.MonoTouch.dll.armv7.s:459535:branch out of range (repeated many times with different addresses)

Error MT3001: Could not AOT the assembly 'ServiceStack.Text.MonoTouch.dll' (MT3001) (MobileBullet.MT)

For a release build with link-all it works with llvm(no thumb) or no llvm.
Comment 1 Sebastien Pouliot 2012-12-18 21:00:36 UTC
This can be reproduced with the attachment on bug #8875 (switch to release build) which use LLVM/Thumb2 and "Link SDK".
Comment 2 Felix Collins 2012-12-19 15:01:10 UTC
Is this related to the fact that SS makes heavy use of generics? I read somewhere that the AOT has to produce code for every value type for each generic. Is it possible to have a AOT control file that explicitly specifies which types to generate specified generic types for? This would also make it easier to workaround types that the AOT misses (rather than putting dummy code in the source).
Comment 3 Sebastien Pouliot 2013-01-22 19:48:18 UTC
The generated files are huge, the ServiceStack.Text.MonoTouch.dll assembly itself being 144kb, but this seems different from the other reports (e.g. bug #9628) where the error is about a 24 bits address encoding limit.

E.g. when building for armv7 / debug (works)

-rw-r--r--  1 sebastienpouliot  staff  122083419 22 Jan 19:33 ServiceStack.Text.MonoTouch.dll.armv7.s

E.g. when building for armv7 / llvm / thumb2 (fails)

-rw-r--r--  1 sebastienpouliot  staff  60004384 22 Jan 19:37 ServiceStack.Text.MonoTouch.dll.armv7.s

So half the .s file size (but thumb addressing could be an issue) in my test case (but it seems to occur too without llvm, so without thumb).
Comment 4 Zoltan Varga 2013-01-22 20:14:54 UTC
Where can I get that assembly ?
Comment 5 Sebastien Pouliot 2013-01-22 20:21:26 UTC
Created attachment 3265 [details]

The ServiceStack assembly is attached.

The first original description has a link to the bug with a full solution (not sure if the link is still active).
Comment 6 Zoltan Varga 2013-01-23 11:13:21 UTC
This is an AOT compiler problem, the original assembly has about 1k methods, while we AOT 27k.
Comment 7 Zoltan Varga 2013-01-23 13:20:10 UTC
The assembly contains a RegisterForAot method, which basically forces the generation of all these methods.
Comment 8 Sebastien Pouliot 2013-01-23 13:24:28 UTC
yep, that's what I described in https://bugzilla.xamarin.com/show_bug.cgi?id=9628#c4
Comment 9 Sebastien Pouliot 2014-03-19 09:16:19 UTC
*** Bug 18433 has been marked as a duplicate of this bug. ***
Comment 10 Sebastien Pouliot 2014-03-19 13:03:29 UTC
*** Bug 5093 has been marked as a duplicate of this bug. ***
Comment 11 Sebastien Pouliot 2014-03-19 13:07:50 UTC

*** This bug has been marked as a duplicate of bug 1102 ***