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