home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / next / programm / 8235 < prev    next >
Encoding:
Text File  |  1993-01-21  |  2.5 KB  |  58 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!unixhub!kaon.SLAC.Stanford.EDU!pfkeb
  3. From: pfkeb@kaon.SLAC.Stanford.EDU (Paul F. Kunz)
  4. Subject: NXBundles and external libraries
  5. Message-ID: <PFKEB.93Jan20214908@kaon.SLAC.Stanford.EDU>
  6. Lines: 47
  7. Sender: news@unixhub.SLAC.Stanford.EDU
  8. Organization: Stanford Linear Accelerator Center
  9. Date: Thu, 21 Jan 1993 05:49:11 GMT
  10.  
  11.    I would appreciate advice on how to best handle the following 
  12. situation...
  13.  
  14.    I have a large body of code with nibs which I've encapsulated in to
  15. a NXBundle.  The code makes calls to an external library package.  The
  16. purpose of the bundle is so that a number of other applications can
  17. load this bundle rather than compiling and linking their own copies of
  18. the source code.  These other applications also link against the same
  19. external library, but far fewer members of the library.
  20.  
  21.    The problem is how do I get all the external references from the 
  22. library resolved at run time and yet get the application to build.
  23. That is, if the application links against the external library, it
  24. only pulls out a few members and when the bundle loads, there will
  25. be many missing external symbols.   When I build the bundle I could
  26. include the library, but then I'll get duplicate segment problems.
  27.  
  28.    The two ideas I have to solve this problem; which might also help
  29. clarify what I'm talking about, are the following...
  30.  
  31. - Method 1:
  32.     o force the loading of the entire library into the bundle.
  33.     o don't link the Application against the library.
  34.     o tell the linker with the -U option to ignore the few undefined
  35.       symbols when building the application.
  36.     o Make sure that the application loads the bundle before attempting
  37.       to use any functions in the library.
  38.  
  39. The bundle needs the entire library anyway, so the first item is not 
  40. a problem.   Asking each application builder to list their references
  41. to the library via the -U mechanism is rather unpleasant.
  42.  
  43. - Method 2:
  44.     o don't load the library with the bundle.
  45.     o force the loading of the entire library in the application
  46.       with the -all_load option of ld
  47.  
  48. '-all_load' option seems to work on all libraries, so I'll have to take
  49. extra steps so it applies only to this one library.
  50.  
  51.    I think method 2 makes more sense, but haven't tried it yet.   But
  52. I'm wondering if I'm missing an even better mechanism to accomplish
  53. this.   Any suggestions?
  54. --
  55. Paul F. Kunz    pfkeb@slac.stanford.edu (NeXT mail ok)
  56. Stanford Linear Accelerator Center, Stanford University
  57. Voice: (415) 926-2884   (NeXT) Fax: (415) 926-3587
  58.