Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OpenAL & prebinding warnings



On Wednesday, September 25, 2002, at 07:53 PM, Chris Hanson wrote:

So in the Project Builder project that builds OpenAL.framework, you need to specify the default address OpenAL.framework should be loaded at by specifying a -seg1addr value in the "Other Mach-O Linker Flags" portion of the Linker Settings panel for your framework's target. There are some restrictions on the addresses you can use with -seg1addr; check the archives at <http://cocoa.mamasam.com/> for more information. (At least, I think that's where I learned about this stuff. There might also be information in man pages or in Project Builder's documentation. Somewhere.)

The authoritative document is here, and discusses the address ranges which are legal for prebinding:

http://developer.apple.com/techpubs/macosx/ReleaseNotes/Prebinding.html

This is such a funny issue. I'm a newbie but I play with open source libraries and have done some digging in various notes. Here's a gem: the Prebinding release notes say this:

All libraries must be built in dependent order and built prebound. That is, libraries must be built before the libraries (and executables) that link against them are built. To build prebound, either pass the -prebind flag to ld(1), or define the LD_PREBIND environment variable.

but then the Project Builder Help file "Creating Applications/Prebinding Applications" says this:

Prebinding frameworks is difficult and not officially sanctioned. For more information, see Mac OS X Prebinding Notes

Hehe. But the story gets more interesting. Chris metions this:

This address is halfway important, because it can't overlap the default address of any other frameworks or executables in your project if you want the linker to generate prebinding information.

This is true, however, here is a point from the ld man page:

-prebind_allow_overlap
Have the static linker, ld(1), prebind the output
even if the addresses of the dynamic libraries it
uses overlap. The resulting output can then have
redo_prebinding(1) run on it to fix up the prebind-
ing after the overlapping dynamic libraries have
been rebuilt. This option can also be specified by
setting the environment variable LD_PRE-
BIND_ALLOW_OVERLAP.

Now I was sure I also read a release note somewhere suggesting this very option, but I couldn't find it. Anyway, I'd suggest using this facility as opposed to using manually specifying a seg1addr. If you run an application project in debug mode and open the Libraries... window (under the Debug menu), you'll see all the libraries and their addresses. Apple's stuff occupies a space below 0x178d000 and from 0x9000000 and above, and my test app starts at 0x1000. The prebinding release notes, meanwhile (granted form 10.1 era) specify 0x90000000 and higher as free for non-Apple use. Erm... Also, apps are usually to start at 0x0000, or so it says. (This app is a simple Cocoa OpenGL demo app I wrote, no linker settings besides the normal -prebinding ;-) ).

Have fun,

Brent
_______________________________________________
mac-games-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/mac-games-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: OpenAL & prebinding warnings (From: Chris Hanson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.