E. Wing wrote:
Replace each “.align 16” with a “.align 8”.
Can you send the exact patch you used to the list so that it can be
tested and applied ?
Before I do that, I’ve been posting to the Xcode list for help too and
somebody said this:
“Better replace it with 4. “.align x” means “align to 2^x” here, so
currently you’re aligning to 256 byte boundaries.”
No, .align X aligns over the next X boundary. He’s probably confusing it
with .p2align X which aligns over the next 2^X.
Try it if you don’t believe me (and here I hope the gcc guys didn’t
change the .align semantics in a recent version
Should I be doing this instead?
No.
verified that -mdynamic-no-pic is not being invoked, and that’s about
Are you sure you’re using the -fPIC flag ? If you’re using an IDE, that
might be an option with the words “position independent code” in it.
According to the gcc man page, -fPIC is the default on Darwin and Mac
OS X. Just in case, I manually added the switch. The only related
switch to be found in the Xcode IDE is “Generate Position-Dependent
Code” which has the description:
Faster function calls for applications. Not appropriate for shared
libraries (which need to be position-independent).
[GCC_DYNAMIC_NO_PIC, -mdynamic-no-pic]
I have made sure to keep this switch off.
The same person on the Xcode list from above said this:
“Since you are using assembler, I guess it’s your assembler that
contains non-pic code.”
I’m not sure if that’s true or not.
Well, some of this code is not PIC-clean, since no one made it PIC-clean
so far. However, even though this could probably cause crashes at
runtime with some compilers on some systems, this shouldn’t prevent it
from compiling.
To be perfectly honest, I don’t like this code because it adds a
dependency on nasm, and thus can’t be used on platforms with no nasm
support (qnx for example), because it’s not PIC-clean, and because some
ld versions are buggy when linking nasm files. A gcc rewrite has been
for a long time in my todo list, I even started it IIRC…
Also, for the PowerPC problem, is there a way to use something like C
preprocessor macros in the .asm files.
Well, you definitely do not want to do that. I think the right way is to
find how to do conditional file compilation in Xcode. This has to exist
Unfortunately, I’m fairly certain this doesn’t exist. That’s why I’m
looking for something like a preprocessor trick. Any other ideas?
Yet another reason to rewrite that stuff in gcc style, where you could
simply use gcc #ifdefs
Also, to use some nasm-specific preprocessor stuff, you’d need to have
nasm (an x86-specific assembler) to work under powerpc, if only in order
to parse the .asm files. It sounds like there is very little chance this
can be accomplished.
Stephane