Xcode 4 GM - Apple Mach-O Liker Error

293 views
Skip to first unread message

gib

unread,
Feb 16, 2011, 8:22:25 AM2/16/11
to ASIHTTPRequest
I get this error while compiling the iPhone project [code taken from
GIT today 16 feb 2011] on Xcode 4 GM (LLVM compiler 2.0, Latest iOS
(iOS 4.2), Target: iPhone device):

Apple Mach-O Liker Error

Ld "/Users/gib/Library/Developer/Xcode/DerivedData/iPhone-
bkamajibummucbelwlgghtbzdxkh/Build/Products/Debug-iphoneos/
ASIHTTPRequest iPhone.app/ASIHTTPRequest iPhone" normal armv7
cd /Users/gib/Documents/Progetti/ASIHTTPRequest_GIT
setenv IPHONEOS_DEPLOYMENT_TARGET 3.1.3
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/
bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang -
arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/
SDKs/iPhoneOS4.2.sdk -L/Users/gib/Library/Developer/Xcode/DerivedData/
iPhone-bkamajibummucbelwlgghtbzdxkh/Build/Products/Debug-iphoneos -F/
Users/gib/Library/Developer/Xcode/DerivedData/iPhone-
bkamajibummucbelwlgghtbzdxkh/Build/Products/Debug-iphoneos -filelist "/
Users/gib/Library/Developer/Xcode/DerivedData/iPhone-
bkamajibummucbelwlgghtbzdxkh/Build/Intermediates/iPhone.build/Debug-
iphoneos/iPhone.build/Objects-normal/armv7/ASIHTTPRequest
iPhone.LinkFileList" -dead_strip -miphoneos-version-min=3.1.3 -
framework CFNetwork -framework CoreGraphics -framework Foundation -
framework MobileCoreServices -framework SystemConfiguration -framework
UIKit -lxml2 -lz -o "/Users/gib/Library/Developer/Xcode/DerivedData/
iPhone-bkamajibummucbelwlgghtbzdxkh/Build/Products/Debug-iphoneos/
ASIHTTPRequest iPhone.app/ASIHTTPRequest iPhone"

ld: in /Users/gib/Library/Developer/Xcode/DerivedData/iPhone-
bkamajibummucbelwlgghtbzdxkh/Build/Intermediates/iPhone.build/Debug-
iphoneos/iPhone.build/Objects-normal/armv7/ASIHTTPRequest.o, in
section __TEXT,__text reloc 804: R_ABS reloc but no absolute symbol at
target address
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang
failed with exit code 1


any hint?
Thank you for this wonderful lib!

Anoop Ranganath

unread,
Feb 16, 2011, 9:12:58 AM2/16/11
to asihttp...@googlegroups.com
This is unrelated to ASIHTTPRequest and is a bug in Xcode 4 when
building for the device. If you go to your Build Settings and set
your optimization level to -O1, it will work. Unfortunately, you lose
the ability to view variables in the debugger when you do this.
Optimizing -O0 works fine in the simulator.

> --
> You received this message because you are subscribed to the Google Groups "ASIHTTPRequest" group.
> To post to this group, send email to asihttp...@googlegroups.com.
> To unsubscribe from this group, send email to asihttpreques...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/asihttprequest?hl=en.
>
>

--
Anoop Ranganath | an...@foursquare.com | @anoopr

Constantine Fry

unread,
Mar 2, 2011, 1:45:26 AM3/2/11
to ASIHTTPRequest
change your compiler to GCC4.2 in project settings

Garfeild

unread,
Mar 9, 2011, 1:36:34 PM3/9/11
to ASIHTTPRequest
But this isn't good solution. LLVM will be main compiler in Xcode 4,
as I know.

Nick Bonatsakis

unread,
Mar 27, 2011, 10:29:24 PM3/27/11
to ASIHTTPRequest
Has anyone figure out a viable workaround for this? There can't be
this few people using XCode 4, losing debugging and/or switching to
GCC are very unfavorable options.

On Mar 9, 2:36 pm, Garfeild <garfeild.ubu...@gmail.com> wrote:
> But this isn't good solution. LLVM will be main compiler in Xcode 4,
> as I know.
>

James

unread,
May 6, 2011, 3:45:26 AM5/6/11
to ASIHTTPRequest
I'm also having this issue. Switching my optimization level AND
switching my compiler didn't work. Not sure where to go; it's a super
great framework and would love to use it...but it's gotta work first
=P

Developing for iOS 4.3, on XCode 4.

Ralf (@24z)

unread,
May 12, 2011, 4:22:23 PM5/12/11
to ASIHTTPRequest
Did you find a solution for this issue?

Ben Copsey

unread,
May 14, 2011, 7:15:39 AM5/14/11
to asihttp...@googlegroups.com
I may be mistaken, but I was under the impression that the issue where you'd be unable to build without changing your optimisation level was fixed in an update to the iOS SDK a while ago. Certainly, I'm able to build the sample projects using LLVM, LLVM-GCC or GCC, and any optimisation level, under Xcode 4.02. Are you all unable to build the sample projects? If so, double check that you have the latest SDK.

@Ralf in your case, it looks as though you have a mix of Mac and iOS stuff in your build configuration. It might be easiest to start with a clean project.

Best,

Ben

David Most

unread,
May 15, 2011, 10:09:59 AM5/15/11
to asihttp...@googlegroups.com

I can understand the confusion surround this crash, even I wrote "works for me" earlier in this thread, and then later discovered probably the same crash issue once we were doing more testing and/or our code called ASI with just the right combination of enchantments.

I last tested this issue with XCODE v4.0.1 and LLVM 2.0.  For us, the crash only happens with LLVM w/ full optimization while running on iPodTouch 2nd gen w/ iOS 4.2.1.  We've tested on all the devices, and many iOS variants for each device, and it only happens (for us) with that single iOS configuration.  (Not that exact piece of hardware, but any iPodTouch 2nd gen running iOS 4.2.1. crashes when our our app makes a network request -- stack gets wiped out.)  Unfortunately, I only tested our code, and not the out-of-the-box ASI sample apps.

I'll re-test this on soon as I can get to it (hopefully late Monday), using XCode v4.0.2; and report back.  Perhaps the issue is fixed.

Personally, I do not believe there is anything (related to this issue) to fix in the ASI library, or that much effort should be put into working around the issue.  If this isn't fixed yet and we can get this to happen with a simple sample, it would be good fodder for the LLVM team.  Previous searching on this subject led me to believe they are already aware of this class of issue and that it will be addressed.

--Dave


Reply all
Reply to author
Forward
0 new messages