clang 3.1 error: assembler failed compiling ChipmunkSpace

Discuss any Chipmunk bugs here.
Post Reply
carlbrown
Posts: 2
Joined: Wed Apr 18, 2012 6:38 pm
Contact:

clang 3.1 error: assembler failed compiling ChipmunkSpace

Post by carlbrown »

I'm trying to compile ChimpunkPro from git using the iphonestatic.command with clang 3.1 (Xcode 4.3.2) and I'm getting the following error (clang flags trimmed for brevity):

Code: Select all

clang -x objective-c -arch armv6 -fmessage-length=0 -std=gnu99 -O3 [Snip] -c Objective-Chipmunk/ChipmunkSpace.m -o build/Release-iphoneos/ObjectiveChipmunk.build/Objects-normal/armv6/ChipmunkSpace.o
/var/folders/0w/3jczp7354_1_ftd0b__886f40000gn/T/ChipmunkSpace-IUGaT2.s:1484:selected processor does not support `vmov.i32 q8,#0x0'
[...Snip...]
clang: error: assembler command failed with exit code 1 (use -v to see invocation)
I get the same error (but a slightly different output) if I switch from "Apple LLVM compiler 3.1" to "LLVM GCC 4.2"

Running macstatic.command seems to work fine.

I have the relevant parts of the build log I can send if that helps (although I can't seem to attach a .txt or .log file to the post). The only change I've made is setting IOS_SDK_VERSION = "5.1" in iphonestatic.command (because 5.0 isn't on this version of Xcode).

I'm happy to try to help fix the issue, but I haven't tried to program in assembler in years, and even then, it was x86, not ARM, so it would take me a long time to figure out on my own.

Any ideas where to go from here ?
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: clang 3.1 error: assembler failed compiling ChipmunkSpac

Post by slembcke »

Freaking joy. That is almost certainly a compiler bug. There is no conceivable reason why the compiler should spit out code that it can't assemble.

So I've heard a number of people grumble about bizzare issues with Xcode 4.3 and Clang 3.1 now. I've been "in the middle" of a project for months now so I haven't upgraded from Xcode 4.2. This wouldn't be the first time there was a Clang compiler bug that broke Chipmunk. Clang 2.1 was borked too, the optimizer choked on sqrt(x*x + y*y)... seriously, it was a well known optimizer bug.

I'm not sure what I can do about it until I install 4.3 (and Lion) myself to be able to hack up a workaround.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: clang 3.1 error: assembler failed compiling ChipmunkSpac

Post by slembcke »

In the meantime, the precompiled static library that ships with ChipmunkPro should work just fine. You really only need to recompile if you want to reconfigure something or modify the Chipmunk source.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
carlbrown
Posts: 2
Joined: Wed Apr 18, 2012 6:38 pm
Contact:

Re: clang 3.1 error: assembler failed compiling ChipmunkSpac

Post by carlbrown »

OK. Thanks.

Also, for the record, as a work around, I seem to be able to get it to build by setting the "Valid Architectures" to "$(ARCHS_STANDARD_32_BIT)" (instead of armv6/armv7) - which means the bug exists only in the ARMv6 code generator of clang 3.1.

So if there's any one else out there running into this problem and who (like me) is an unrepentant geek who wants to be able to look at the source code of what I'm building (which is one of the reasons I upgraded to Pro in the first place), then as long as you're willing to give up support for iPhone 1+3G and iPodTouch 1st+2nd gen (and, let's face it, those are a pain to support now anyway), then you can just tell Xcode to skip armv6 and it seems to work. (But don't forget to require ARMv7 in your info.plist or you'll get rejected).

-Carl
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: clang 3.1 error: assembler failed compiling ChipmunkSpac

Post by slembcke »

Oh. Hmm. That's entirely possible. No arm6 device actually supports more that iOS 4.2, so I wouldn't be too surprised if Apple simply didn't bother to test their compiler for arm6.

Actually... I did see that it was compiling for armv6 in the log you posted but forgot if armv6 or armv7 was the new instruction set. :oops: Too many random numbers to memorize and keep in one head. :(
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Post Reply

Who is online

Users browsing this forum: Heise IT-Markt [Crawler] and 5 guests