Re: More on OSX port

From: Christian Holm Christensen (cholm@hehi03.nbi.dk)
Date: Mon Sep 02 2002 - 08:02:50 EDT

  • Next message: Kris Hagel: "Re: Brat update"

    Hi Steve, 
    
    On Sun, 01 Sep 2002 22:26:54 -0500
    "Stephen J. Sanders" <ssanders@ku.edu> wrote
    concerning "More on OSX port":
    > OK,
    > I've just finished replaying a run using bratmain under Macintosh OSX 
    > (Darwin).
    
    So far so good. 
    
    > However, the only way I'm able to get this working is to explictly
    > load all of the brat libraries that are not actually needed  by the
    > bratroot or bratmain programs.  I  
    
    You do mean `the libraries that are actually needed' don't you?  
    
    > do this using gSystem->Load() and run through all of the libraries
    > in the script BratLoad.C (except for those used for the main
    > programs--if  I load one of the libraries already needed to link the
    > programs, I run into problems with "lost" instances of classes). 
    
    That's because we have a lot of managers, which are initialised to
    zero in the library - that is, at load time. 
     
    > My question is if I'm doing explicitly what is implicit on the other  
    > systems that brat runs on.  In particular, I'm wondering if my
    > problem is related to the way Darwin treats dynamic load libraries
    > and loadable modules differently.  
    
    Haven't got any idea.  I don't know the guts of BSD (I believe Darwin
    is the uKernel, not the one that does the actual loading). 
    
    > When I use gSystem->Load() I reference the module (.so) files.
    > However, when I initially link the program I need to supply
    > references to the dynamic library (.dylib) files. 
    
    It's the same code in both files I should think.   Try do 
    
       nm -C libfoo.dylib | sort > list.dylib 
       nm -C foo.so | sort > list.so 
       diff -u list.dylib list.so | less 
    
    and see if there's anything different (and yes, address are probably
    important too). 
       
    However, all this is very hard to say anything clever about as I don't
    have access to a MacOSX machine myself.  Also try running bratroot in
    gdb and see if you can list a class in BRAT or something: 
    
       gdb /usr/bin/bratroot 
       (gdb) break 'main' 
       (gdb) run 
       (gdb) break 'BrSiRdoModule::BrSiRdoModule(char const*, char const*)' 
    
    if it reports that it doesn't know `BrSiRdoModule', then something is
    wrong with your link. 
    
    Check the linker documentation, wether it strips `unneeded symbols' -
    if it does, try and see if you can force it not to.  
    
    Yours, 
    
     ____ |  Christian Holm Christensen 
      |_| |	 -------------------------------------------------------------
        | |	 Address: Sankt Hansgade 23, 1. th.  Phone:  (+45) 35 35 96 91
         _|	          DK-2200 Copenhagen N       Cell:   (+45) 24 61 85 91
        _|	          Denmark                    Office: (+45) 353  25 305
     ____|	 Email:   cholm@nbi.dk               Web:    www.nbi.dk/~cholm
     | |
    



    This archive was generated by hypermail 2b30 : Mon Sep 02 2002 - 08:05:04 EDT