0
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1 

Hey all,

I've been working on a big update to my app that's involved a lot of coding (talking hundreds or thousands of lines here)

It's all been going really smoothly up until the latest code inset, I've added some code, that is in essence, the same as what's already in there with minor differences (a simple integer change from 77 to 78) and since then every time I try to build the code I get the above error message - now obviously it's not particulary helpful, any chance anyone can offer some good advice on this?

Edit as requested.

 {standard input}:1580:branch out of range {standard input}:1566:branch out of range Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1 

Now there's several more of the standard input's but I figured there was no need to paste all of them.

7
  • Are your source files added to the target? Commented Apr 25, 2011 at 9:45
  • That merely indicates there is an error. There should be more details around that line, you should post them. Commented Apr 25, 2011 at 9:54
  • Source files all in target - it's only this latest few lines (of which there are hundreds almost identical) that cause the problem to occur. Commented Apr 25, 2011 at 10:25
  • Editted with what I suspect you wanted to see Jano? Commented Apr 25, 2011 at 10:26
  • Ps if that's not what you wanted please can you let me know how to get it? Still figuring Xcode 4 out. Commented Apr 25, 2011 at 10:38

4 Answers 4

1

That seems GCC speak for I can't jump 32k instructions away on this ARM chip, which could be solved by tweaking compilation options or not (if you made some optimization, undo it and check if that works), I'm afraid I'm no expert on that. Or maybe you added code from other project which is non ARM friendly.

Sign up to request clarification or add additional context in comments.

2 Comments

Yeah I think you're on the right track about the amount of code, I have it running through everal 'if' statements - think I need to find a way to tune that somewhat, just not sure how exactly at this stage.
Yep - definitely the number of statements - splitting my code structure to make it more efficient - more coding work but a better (and usable) end product will make it worth it I figure.
0

I solved the problem in my projects by using LLVM-GCC-4.2 compiler (still XCode 3.25, don't know about the situation in XCode 4). Especially the library project that uses Obj-C, Obj-C++ and a heavily optimised C++ math template library called Eigen was otherwise not compileable.

To use LLVM-GCC go to the project info dialog (menu Project/Edit Project Settings) and click on the build tab. Look for C/C++ compiler Version and select LLVM GCC 4.2. Take care that the change is done in both configurations release and debug - you toggle between them (or edit both at once) in the configuration select box at the top.

3 Comments

Any chance you can elaborate for me on that? I've no idea what that is (I've since got around my problem, but always good to have options)
Turns out it was set on this already - nothing to change - thanks for the attempted answer regardless :)
Oh bad news for me. That means there is no such simple solution and I might run into this problem again in the future. Anyway, good luck for you :-)
0

Search for "Compile for Thumb" option in the project build settings of the project and uncheck it. Doing a clean build after that will fix your problem.

Comments

0

I recently had the same problem when I upgraded to Lion & xcode 4 on a new mac. I transferred my project over and the build failed with the error reported here. In my case, when I looked in the Build Phases/Compile Sources page, 3 of my files were shown in red indicating they hadn't been imported correctly. I removed the references and re-added the files to the project and it compiled fine.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.