home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / hp / 8701 < prev    next >
Encoding:
Internet Message Format  |  1992-07-29  |  2.1 KB

  1. Path: sparky!uunet!cs.utexas.edu!swrinde!sdd.hp.com!uakari.primate.wisc.edu!usenet.coe.montana.edu!news.u.washington.edu!zeus!davidb
  2. From: davidb@zeus.ce.washington.edu (David W. Barts)
  3. Newsgroups: comp.sys.hp
  4. Subject: Re: -lPW causes problems building R5 on HP 9000/700s
  5. Message-ID: <1992Jul30.001812.11531@u.washington.edu>
  6. Date: 30 Jul 92 00:18:12 GMT
  7. References: <1992Jul22.220419.9528@elroy.jpl.nasa.gov> <4310267@hpindda.cup.hp.com>
  8. Sender: news@u.washington.edu (USENET News System)
  9. Organization: University of Washington
  10. Lines: 36
  11.  
  12. In article <4310267@hpindda.cup.hp.com>, spero@hpindda.cup.hp.com (Spero Koulouras) writes:
  13. > The following text was lifted from the man page for regex and discusses
  14. > the proper cc invocation of -lPW ...
  15. > Regards,
  16. >   Spero Koulouras
  17. > -------------
  18. >  WARNINGS
  19. >       regcmp() and regex() are kept in /lib/libPW.a.  Unfortunately,
  20. >       /lib/libPW.a also contains some functions that have the same names as
  21. >       functions contained in the default C library, /lib/libc.a.  To prevent
  22. >       unexpected results due to these name conflicts, always search libc
  23. >       before searching libPW.  This is done with the ld (or cc) command line
  24. >       option sequence -lc -lPW which satisifies all standard C functions
  25. >       from libc then searches libPW for the regcmp() and regex() functions
  26. >       (there is also an implied -lc following the explicit -lPW to satisfy
  27. >       any additional C functions required by regcmp() and regex()).
  28.  
  29. Of course, if you do this, then ld will simply grab all the routines in
  30. libc.a instead of using shared libraries (and X is bloated enough software
  31. as it is even with the shared libraries being used).
  32.  
  33. A better idea is to use ar(1) to extract the modules that contain the
  34. code you want (it lists regex.o and regcmp.o; you may need others) and
  35. link these in by hand.
  36.  
  37. I found I had to do something similar to get Gnu tar to compile on
  38. the 400 in my office -- gtar wants to use alloca(), so I simply pulled
  39. alloca.o out of libPW.a and linked it in myself.
  40.  
  41. --
  42. David Barts  N5JRN                      UW Civil Engineering, FX-10
  43. davidb@ce.washington.edu                Seattle, WA  98195
  44.