home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.ultrix
- Path: sparky!uunet!well!moon!pixar!spinach.pixar.com!mccoy
- From: mccoy@spinach.pixar.com (Dan McCoy)
- Subject: Re: Any way to do a faster link??
- Message-ID: <1993Jan12.205013.18260@pixar.com>
- Summary: prelink "ld -r"
- Sender: news@pixar.com (Usenet Newsmaster)
- Nntp-Posting-Host: spinach.pixar.com
- Organization: Pixar -- Point Richmond, California
- References: <1iqm8b$807@agate.berkeley.edu> <9301110245.AA08082@TIS.COM>
- Date: Tue, 12 Jan 1993 20:50:13 GMT
- Lines: 42
-
- In article <9301110245.AA08082@TIS.COM> mjr@TIS.COM writes:
- >>I need to know if there is any way to speed up compile time on a DECstation
- >>5000? The bottle neck seems to be the linking portion of the compile cycle,
- >>especially, if some of the libraries are coming off of NFS.
- >
- > NFS is the problem here. One gross kludge would be to have your
- >makefile maintain *copies* of the library on local disk. I have done this
- >in the past, and while it's *ugly* it works. I.e.:
- >
- >
- >LIBS= libX.a
- >foo: foo.o $(LIBS)
- > cc -o foo foo.o $(LIBS)
- >
- >libX.a: /usr/lib/libX.a
- > cp /usr/lib/libX.a $@
- > ranlib $@
- >
- >clean:
- > rm -f foo foo.o $(LIBS)
-
- A better approach that even speeds up links when using non-NFS libraries
- is to prelink libraries or sections of libraries.
-
- LIBS= libX.a
-
- foo: foo.o libX.o
- cc -o foo foo.o libX.o
-
- libX.o: myXrefs.o /usr/lib/libX.a
- ld -r myXrefs.o libX.a -o libX.o
-
- clean:
- rm -f foo foo.o libX.o
-
- Where myXrefs.c is either your programs interface to the library (clean
- way) or a dummy file which forces references to the library (less clean
- way, but it works).
- You can see the list of references you need to generate by linking
- without the library and saving the list of undefined symbols.
-
- Dan McCoy pixar.com
-