home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / unix / ultrix / 9270 < prev    next >
Encoding:
Text File  |  1993-01-12  |  1.7 KB  |  56 lines

  1. Newsgroups: comp.unix.ultrix
  2. Path: sparky!uunet!well!moon!pixar!spinach.pixar.com!mccoy
  3. From: mccoy@spinach.pixar.com (Dan McCoy)
  4. Subject: Re: Any way to do a faster link??
  5. Message-ID: <1993Jan12.205013.18260@pixar.com>
  6. Summary: prelink "ld -r"
  7. Sender: news@pixar.com (Usenet Newsmaster)
  8. Nntp-Posting-Host: spinach.pixar.com
  9. Organization: Pixar -- Point Richmond, California
  10. References: <1iqm8b$807@agate.berkeley.edu> <9301110245.AA08082@TIS.COM>
  11. Date: Tue, 12 Jan 1993 20:50:13 GMT
  12. Lines: 42
  13.  
  14. In article <9301110245.AA08082@TIS.COM> mjr@TIS.COM writes:
  15. >>I need to know if there is any way to speed up compile time on a DECstation
  16. >>5000? The bottle neck seems to be the linking portion of the compile cycle,
  17. >>especially, if some of the libraries are coming off of NFS.
  18. >
  19. >    NFS is the problem here. One gross kludge would be to have your
  20. >makefile maintain *copies* of the library on local disk. I have done this
  21. >in the past, and while it's *ugly* it works. I.e.:
  22. >
  23. >
  24. >LIBS=    libX.a
  25. >foo:    foo.o $(LIBS)
  26. >    cc -o foo foo.o $(LIBS)
  27. >
  28. >libX.a:    /usr/lib/libX.a
  29. >    cp /usr/lib/libX.a $@
  30. >    ranlib $@
  31. >
  32. >clean:
  33. >    rm -f foo foo.o $(LIBS)
  34.  
  35. A better approach that even speeds up links when using non-NFS libraries
  36. is to prelink libraries or sections of libraries.
  37.  
  38. LIBS=  libX.a
  39.  
  40. foo:   foo.o libX.o
  41.        cc -o foo foo.o libX.o
  42.  
  43. libX.o:  myXrefs.o /usr/lib/libX.a
  44.     ld -r myXrefs.o libX.a -o libX.o
  45.  
  46. clean:
  47.        rm -f foo foo.o libX.o
  48.  
  49. Where myXrefs.c is either your programs interface to the library (clean
  50. way) or a dummy file which forces references to the library (less clean
  51. way, but it works).
  52. You can see the list of references you need to generate by linking
  53. without the library and saving the list of undefined symbols.
  54.  
  55. Dan McCoy    pixar.com
  56.