Apple Intel Assembly Frustrations

For the most part, the x86 transition has been really smooth. Only minor changes needed here or there to make things work. But there are a couple of places where it’s clear they didn’t spend much time looking at their infrastructure. Assembly is one of them.

I can’t imagine they didn’t think “Well, there’s all this linux x86 code out there that’s gonna suddenly be enabled when people start building things. Perhaps we should make sure stuff works.” but apparently they didn’t. 🙂 There are some obvious things, like Apple’s gas being very old and heavily modified, that should have set off warning signals.

For example, Apple’s gas has no “.balign” keyword. Instead, it has “.align”. So if you used to use “.balign 16” you now use “.align 4”. Similarly, “.balign 8” becomes “.align 3”.

Also, apparently the AT&T-style “.rept” and “.endr” are not supported, even though they work everywhere else. So now this:

__asm__ __volatile__ (
".rept 8 \n\t"
"(something) \n\t"
".endr \n\t"
);

…becomes…

__asm__ __volatile__ (
"(something) \n\t"
"(something) \n\t"
"(something) \n\t"
"(something) \n\t"
"(something) \n\t"
"(something) \n\t"
"(something) \n\t"
"(something) \n\t"
);

How convenient!

I can only hope the tools will get better, this is their first XCode release to a wide audience on the x86 platform, so some surprises were bound to happen, but it’s a bit silly that they didn’t try to build large, well-known, asm-using projects like mplayer to see what happens.

Share on Facebook

2 comments to Apple Intel Assembly Frustrations