Operating System - HP-UX
1753797 Members
7747 Online
108799 Solutions
New Discussion юеВ

Re: Code Profiling in 'C' programs by using gcc compiling suite

 
Maurizio_12
Occasional Contributor

Code Profiling in 'C' programs by using gcc compiling suite

I'm trying to profile some C program code on HP-UX by using gcc via following command:

mygcc +DA1.1 -Wl,+s -D__BIGMSGQUEUE_ENABLED -I$TUXDIR/include -o ../../TMPBIN//TrafficArchiverE BS-5f07.c -L${TUXDIR}/lib ../../TMPOBJ//TrafficArchiverE.o -pg /dsk2/pri/h3gcallt/libcbin/LIB_DataBase.a /dsk2/pri/h3gcallt/libcbin/LIB_FileManager.a /dsk2/pri/h3gcallt/libcbin/LIB_Log.a /dsk2/pri/h3gcallt/libcbin/LIB_SHMManager.a /dsk2/pri/h3gcallt/libcbin/LIB_Expression.a /dsk2/pri/h3gcallt/libcbin/LIB_Timing.a /dsk2/pri/h3gcallt/libcbin/LIB_LicManager.a /dsk2/pri/h3gcallt/libcbin/LIB_InterProcComm.a -L/usr/local/ssl/lib -lcrypto -ltux -lbuft -L${ORACLE_HOME}/lib -lm -lc -lnsl -lclient8 -lclntsh -lsql8 -lcommon8 -lgeneric8 -lnls8 -lcore8 -lwtc8 -lfml -lfml32 -lengine -lpthread -lcl -lnsl

Code is not profiled, and the following error is reported by the command execution:

/usr/ccs/bin/ld: Can't open gcrt0.o
/usr/ccs/bin/ld: No such file or directory

Trying using -p instead of -pg the following errors are displyed:

/usr/ccs/bin/ld: Can't open mcrt0.o
/usr/ccs/bin/ld: No such file or directory

Does patch PHSS-26559 solve this problem totally or partially?

Could be the problem originated by incomplete/damaged installation of gcc/OS?

Thankyou
3 REPLIES 3
Stephen Keane
Honored Contributor

Re: Code Profiling in 'C' programs by using gcc compiling suite

mcrt0.o, gcrt0.o etc are sym links from /usr/lib into /usr/ccs/lib

If you have the sym link in /usr/lib, but don't actually have the files in /usr/ccs/lib, then you will get the problem you describe.
Maurizio_12
Occasional Contributor

Re: Code Profiling in 'C' programs by using gcc compiling suite

h3gcallt[ta]:/lib>ls -lrt /usr/ccs/lib/*.o
-r--r--r-- 1 bin bin 11608 Feb 1 2001 /usr/ccs/lib/crt0.o
-r--r--r-- 1 bin bin 588 Feb 1 2001 /usr/ccs/lib/dyncall.o
h3gcallt[ta]:/lib>ls -lrt /usr/lib/*.o
-r--r--r-- 1 bin bin 624 Nov 7 1997 /usr/lib/unix95.o
lr--r--r-T 1 root sys 19 Mar 23 2002 /usr/lib/crt0.o@ -> /usr/ccs/lib/crt0.o
lr--r--r-T 1 root sys 22 Mar 23 2002 /usr/lib/dyncall.o@ -> /usr/ccs/lib/dyncall.o
lrwxrwxrwt 1 root sys 20 Mar 23 2002 /usr/lib/gcrt0.o@ -> /usr/ccs/lib/gcrt0.o
lrwxrwxrwt 1 root sys 20 Mar 23 2002 /usr/lib/icrt0.o@ -> /usr/ccs/lib/icrt0.o
lrwxrwxrwt 1 root sys 20 Mar 23 2002 /usr/lib/mcrt0.o@ -> /usr/ccs/lib/mcrt0.o

Actual files do not exist there!
thank you
Stephen Keane
Honored Contributor

Re: Code Profiling in 'C' programs by using gcc compiling suite

I don't have the file either, but I use gcc, not aCC. Maybe the files come with the HP-UX C/C++ compiler? Presumably you have to pay if you want them.