🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sun
Article #13296

prof and gprof question

#13296
From: Williams, Greg
Date: Wed, 13 Dec 1989 21:49
42 lines
1854 bytes
I'm having a problem using prof and gprof on a SPARCstation 1 running
4.0.3.  Everytime I try to link a c or FORTRAN program that I've compiled
with either the -p or -pg option, I get an undefined symbol error on the
symbol "mcount".  I'm assuming that mcount is used by the profiler
somehow.  How do I get the program to link so I can use the profiler?  Are
the libraries the problem?  Is there a profile library I should be
including?  

Here is the makefile that I use.  I get the error when doing the linking.
The programs compile and run fine when not using the profile option when
compiling.

----------------------------------------------------------------------------
CFLAGS = -c -w -g -pg

.c.o:
	$(CC) $(CFLAGS) $<

newdisdb: newdisdb.o libgraphsubs.a graphmain
	f77 -L. -o newdisdb newdisdb.o -lgraphsubs -lgtvis -lgks \
	-lsuntool -lsunwindow -lpixrect -lm

newdisdb.o: newdisdb.f
	f77 -c -w -g -pg newdisdb.f

graphmain: graphmain.o libgraphsubs.a
	cc -L. -o graphmain graphmain.o -lgraphsubs -lgks -lsuntool \
	-lsunwindow -lpixrect -lm

graphmain.o: graphmain.c

libgraphsubs.a: graphsubs.o comcalls.o findfil.o gkscalls.o
	ar r libgraphsubs.a graphsubs.o comcalls.o findfil.o gkscalls.o
	ranlib libgraphsubs.a

graphsubs.o: graphsubs.c graphtypes.h

comcalls.o: comcalls.c comtypes.h

findfil.o: findfil.c graphtypes.h

gkscalls.o: gkscalls.c graphtypes.h
Technical Details
Message-ID: <3969@brazos.Rice.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!cs.utexas.edu!rice!sun-spots-request

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!cs.utexas.edu!rice!sun-spots-request
From: gw18%prism@gatech.edu (Williams, Greg)
Newsgroups: comp.sys.sun
Subject: prof and gprof question
Keywords: Software
Message-ID: <3969@brazos.Rice.edu>
Date: 13 Dec 89 21:49:08 GMT
Sender: root@rice.edu
Organization: Sun-Spots
Lines: 42
Approved: Sun-Spots@rice.edu
X-Sun-Spots-Digest: Volume 8, Issue 226, message 19 of 19