-
Notifications
You must be signed in to change notification settings - Fork 66
Linker Error with the CouchCocoa.framework Archive build #36
Comments
Same problem with Xcode 4.3.3 on Lion |
I just realized that you didn't say anything about linking against TouchDB, but the code you added to the app uses CouchTouchDBServer. That's not going to work. What frameworks are you linking the new app target against? |
I'm also linking to: |
My current workaround is to change the build Settings for CouchCocoa Debug to match those of Release (e.g. Max optimization, strip debug symbols etc etc.), then build a normal "Debug" build and use that CouchCocoa.framework in my App project. I don't think it has anything to do with which other libraries I'm linking. The linker is complaining that in the compiled CouchDynamicObject.o there is an arm instruction (a particular thumb instruction) that isn't available on arm7. Why the compiler is producing such code in the Archive version I don't know. http://opensource.apple.com/source/ld64/ld64-127.2/src/ld/OutputFile.cpp was the only reference to the message on google which is the linker code. Or perhaps I am just missing a required framework in my App and in the Archive build the requires code is being stripped out of the framework and in the normal debug build is isn't getting stripped out? |
Another thing to try is the Product > Build For > Archiving menu command, which will build the Release configuration but not archive the output. It'd be interesting to see if that builds or not. |
Looking for anything related to Thumb, at the very bottom of the "iOS Library" target build settings I found a custom setting "GCC_THUMB_SUPPORT" set to NO. I have no idea where that came from — probably left over from the days of Xcode 4.1 before I was building with Clang, probably. Try deleting it and do a clean build and see if it helps. |
I'll try it, but.. |
I saw the GCC_THUMB_SUPPORT too, but that sound more like don't use THUMB instructions atall, that makes sense for arm6 but not arm7 AFAIK, but either way it sounds like it shouldn't procuse thumb instructions, so it seems strange that the linker is having to fix them up |
Try taking the GCC_THUMB_SUPPORT setting out anyway, and see if it changes anything. |
OK, all tests done, and there's good news. The only problem is that I now can't use my GIT submodules and Xcode subprojects as I would like to because when I want to make an Archive for AdHoc / AppStore deployment (Product > Archive) it would of course build both dependent subprojects (CouchCocoa and TouchDB) with Products > Archive too which produces unusable frameworks. This is interesting: (unfortunately no replies) Thanks for your support |
I had this error on a recent project and stumbled upon this thread while searching for possible resolutions. While I couldn't find any solution out there, after some investigation I managed to resolve it by setting the optimisation level for release builds to none. Hopefully this may help you also. |
After building the iOS Framework target using Product > Archive in Xcode Version 4.4 (4F250) and putting the framework into an bare bones iOS application created with the Xcode I get a linker error when trying to build the App to run on my iDevice.
This is the error:
ld: armv7 has no pc-rel bx thumb instruction. Can't fix up branch to NO BINDING in anon in anon from /Users/bond/Desktop/Archive/CouchCocoa.framework/CouchCocoa(CouchDynamicObject.o) for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Building to run on the iOS Simulator works fine.
If I use the Debug build of the CouchCocoa.framework it also compiles without problem.
To reproduce: Create the Archive build of the couchcocoa git master (commit 40a3aad)
Create an iOS application (e.g. with the Single View App Template)
Add the following to AppDelegate.m
Now connect an iDevice and try to run the app on the device. The build will fail with the linker error described.
I had the same problem in my real world app too.
I get the feeling this is a problem with Xcode 4.4 but I'm not sure. I will get an old Xcode installed asap and try that too asap.
The text was updated successfully, but these errors were encountered: