2

I get the following compile errors when compiling to the device. (When compiling to simulator everything is OK)

/var/folders/3B/3BAjD+ANHHmfh-eIWrtXDU+++TI/-Tmp-/cc-hojnUD.s:1784380:branch out of range /var/folders/3B/3BAjD+ANHHmfh-eIWrtXDU+++TI/-Tmp-/cc-hojnUD.s:1784372:branch out of range /var/folders/3B/3BAjD+ANHHmfh-eIWrtXDU+++TI/-Tmp-/cc-hojnUD.s:1784364:branch out of range /var/folders/3B/3BAjD+ANHHmfh-eIWrtXDU+++TI/-Tmp-/cc-hojnUD.s:1784356:branch out of range

In various places I read something about turning off "Thumb". I don't really know if this would resolve the issue since I can't find this compile option anywhere.

I have some pretty large init files (with more than 50k lines) doing nothing else but defining NSMutuable array and stuf like that.

I can't get my app to compile for the iPhone anymore because of this error.

Do you have any idea what I can do about this?

ps. I use Xcode 4.2 with Apple LLVM 3.0 (using ARM, so I can't change the compiler)

Many thanks!

user387184
  • 10,953
  • 12
  • 77
  • 147
  • Is your init file one huge function? If so, it may help to break the function into smaller pieces and have a master function call the pieces in order. – hmakholm left over Monica Aug 14 '11 at 19:53
  • Thanks, that definitely helped. Now I can compile to iPhone. However, running Instruments with Build for Profile still hangs - I filed a bug report with Apple for this. If you could put your comment as an anwswer I will be glad to mark it – user387184 Aug 15 '11 at 07:09

2 Answers2

0

This is a known linker bug (rdar://16186742). The problem is with the armv7 compiler, when it needs to synthesize branch islands to jump further than 16 MB, and the jump happens to be exactly 16 MB. The work around is to rearrange the source files in the project build phases and/or libraries in the Link Binary with Libraries section. With a few re-arrangements this problem should go away.

Nikolay DS
  • 1,367
  • 1
  • 8
  • 8
0

(Moved from comment). Is your init file one huge function? If so, it may help to break the function into smaller pieces and have a master function call the pieces in order.

hmakholm left over Monica
  • 23,074
  • 3
  • 51
  • 73