[Pythonmac-SIG] Problem with compiling frozen module as bundle, bundle_loader option, and CodeWarrior

Bob Ippolito bob at redivi.com
Mon Mar 29 20:01:14 EST 2004


On Mar 29, 2004, at 7:06 PM, Read Roberts wrote:

> I have a 'frozen' python script that compiles nicely as a Mach-0 
> bundle library  with gcc, and is looadable as such by any random Mac 
> program. However, I have run into a glitch with converting to 
> CodeWarrior.
>
> The Python script uses the 'os' module. This in turn loads the 'posix' 
> module, and one of the setup functions in 'posix' references the 
> symbol 'environ'. 'environ' is defined only in the crt.0 library that 
> is linked only  into applications. As a result, in order to compile my 
> bundle library, I have to use the 'gcc' option ' -bundle-loader <some 
> application>' so that the gcc linker will find a source for the symbol 
> 'environ'.
>
>  Now, I need to do the same thing in CodeWarrior, but I have not been 
> able to find any way to set this option. Can any one tell me how to do 
> this in CodeWarrior 9.1?
>
>  I did find an alarming e-mail as of 5.13.2003 which commented that CW 
> 8.x is missing this feature, but haven't been able to confirm it, or 
> confirm with respect to CW 9.1
>
> P.S. My bundles that link with Python also are missing the symbol 
> '_file'. Can anyone tell me where that comes from? My project contains 
>  the frameworks Python , Carbon, and System, and the bundle1.o object 
> file.

What's wrong with the application bundle approach?  It's much easier to 
deal with...

I don't know anything at all about CW, but the way you are supposed to 
find symbols like _environ from a shared library or bundle is to use 
the accessor functions (see /usr/include/crt_externs.h).  It's entirely 
likely that the "freeze" functionality just doesn't understand the 
Mach-O way to do it, because all of the development effort has been on 
the application bundle approach.

-bob




More information about the Pythonmac-SIG mailing list