Re: CPU specific build flags for OS X Universal Binaries |
Re: CPU specific build flags for OS X Universal Binaries |
Stephane Marchesin
Guest
|
E. Wing wrote:
Doing so is not too big of a performance issue, so it could be used on all platforms if it works for you. Stephane |
|||||||||||||||
|
Re: CPU specific build flags for OS X Universal Binaries |
E. Wing
Guest
|
Okay, that seemed to work. But I'm getting a linker error now in the last step. ld: /Users/ewing/DEVELOPMENT/CODETEST/UniversalBinarySDL/SDL12/Xcode/SDL/build/SDL.build/Deployment/Framework.build/Objects-normal/i386/SDL_yuv_mmx.o has local relocation entries in non-writable section (__TEXT,__text) /usr/bin/libtool: internal link edit command failed I searched around for this but I don't see any solutions for it. I've verified that -mdynamic-no-pic is not being invoked, and that's about all I could find. Any ideas? Also, for the PowerPC problem, is there a way to use something like C preprocessor macros in the .asm files. Basically, I would like to put a #ifndef __ppc__ block around each file. Strangely when I tried it, this actually let the PowerPC side compile as normal, but the Intel side failed because of "error: label or instruction expected at start of line". Thanks, Eric |
|||||||||||||
|
Re: CPU specific build flags for OS X Universal Binaries |
Stephane Marchesin
Guest
|
E. Wing wrote:
tested and applied ?
might be an option with the words "position independent code" in it.
find how to do conditional file compilation in Xcode. This has to exist :) Stephane |
|||||||||||||||||||
|
Re: CPU specific build flags for OS X Universal Binaries |
E. Wing
Guest
|
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." Should I be doing this instead?
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.
Unfortunately, I'm fairly certain this doesn't exist. That's why I'm looking for something like a preprocessor trick. Any other ideas? Thanks, Eric |
|||||||||||||||||||||||
|
Re: CPU specific build flags for OS X Universal Binaries |
Stephane Marchesin
Guest
|
E. Wing wrote:
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 ;)
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...
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 |
|||||||||||||||||||||||||||||||
|