[Pythonmac-SIG] Upgrading /usr/bin/python to 2.3.1?

Bob Ippolito bob at redivi.com
Mon Feb 9 20:16:47 EST 2004


On Feb 9, 2004, at 2:40 PM, Mark Asbach wrote:

>> otool is more than just the 'counterpart to ldd'.. but I don't 
>> understand what your easy-to-use wrapper would actually do.  Do you 
>> mean it wouldn't be hard to cross-reference the symbol table of an 
>> extension bundle with Python.framework to see if there is any case #1 
>> happening?  That's not hard, but I wouldn't call it a conflict, and 
>> it can be checked just by relinking with the current options.
>
> I just thought, it would be nice to give end-users a chance to 
> discover duplicate symbol names easily, so they could check if #2 had 
> happened because of installing a module with "-undefined lookup" and 
> to other modules with conflicting names.

Names don't conflict in this scenario unless you're colliding with 
symbols from Python.framework itself.  There are no other possible 
cases (assuming you're doing things correctly otherwise).

>> 2) You managed to link something that overrides a symbol in 
>> Python.framework and the bundle looks up the wrong one (this is 
>> extremely unlikely because everything in Python is PyPrefixed and I 
>> think the search order would find Python.framework first, anyway).
>
> Wouldn't "-undefined lookup" also make other dependencies remain 
> unresolved at static link time? Say, you have three modules named A, B 
> and C. A and B have duplicate symbol names, C depends on A and was 
> linked with "-undefined lookup". Couldn't it happen that C will be 
> linked to B's symbols erroneously?

No.  When you link to a module, you only get its symbols, not the 
symbols it uses from other modules.  If you are module C and you link 
to A, you only see symbols that were defined originally in A (except in 
umbrellas, but I won't get into that).

>> BTW:  OS X has namespaces for modules, even in C
>
> Ah, that's the two-level namespace thing?!? If have to admit, that OS 
> X is still a deep black box to me in some respects ...

Yes, there is a namespace for every file that you link to.

>> It's also extremely unlikely to have bizarre "symbol conflicts" in 
>> Python code, because other operating systems do not have two level 
>> namespaces for symbols.
>
> But on other OSes you won't link with "-undefined lookup", but have an 
> RPATH set, right?

We're not talking about other OSes.  These linker flags don't even 
exist elsewhere.. and it's "-undefined dynamic_lookup"

-bob

P.S.  To anyone who has the spare time, please read the man pages for 
dyld and ld and become familiar with otool and install_name_tool as 
well as their man pages. Apple has additional documentation in HTML as 
well that may also be of use.  If you don't read the man pages, you 
probably won't understand this system and the tools.  I do my best to 
convey what's needed, but I'm not a technical writer.  Remember, this 
is an entirely different dynamic linking system than linux/bsd or 
win32, so don't assume you know anything about it... I can't stress 
that enough.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2357 bytes
Desc: not available
Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040209/9c47e2c0/smime-0001.bin


More information about the Pythonmac-SIG mailing list