This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

target/6428: gmon.out is not generated when application to be profiled is linked with shared libgcc



>Number:         6428
>Category:       target
>Synopsis:       gmon.out is not generated when application to be profiled is linked with shared libgcc
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 23 09:06:03 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Dave Anglin
>Release:        gcc 3.1 (prerelease)
>Organization:
>Environment:
hppa*-hp-hpux*
>Description:
Using g++.old-deja/g++.law/profile1.C,

g++ -pg -o profile1 profile1.C
./profile1

no gmon.out file is generated.

Whereas,

gcc -pg -o profile1 profile1.C
./profile1

produces a gmon.out file.
 
gcc -pg -o profile1 profile1.C -shared-libgcc
./profile1

does not produce a gmon.out file.
.

When using g++, we have the following link command:

/opt/gnu/lib/gcc-lib/hppa2.0w-hp-hpux11.11/3.1/collect2 -L/lib/pa1.1 -L/usr/lib/pa1.1 -z -u main -o profile1 /usr/ccs/lib/gcrt0.o -L/opt/gnu/lib/gcc-lib/hppa2.0w-hp-hpux11.11/3.1 -L/usr/ccs/bin -L/usr/ccs/lib -L/opt/langtools/lib -L/opt/gnu/lib/gcc-lib/hppa2.0w-hp-hpux11.11/3.1/../../.. /var/tmp//cccLhdMV.o -lstdc++ -lm -lgcc_s -lgcc -L/lib/libp/ -lc -lgcc_s -lgcc

As can be seen, -lgcc_s occurs before -L/lib/libp/ -lc.

The shared library list for libgcc_s.1 is:

         shared library list:
             dynamic   /usr/lib/libc.2

This version of libc isn't suitable for profiling.
Looking at the undefined symbols in the object, there
are various undefined references including _close.
I appears that various routines are duplicated and
probably the wrong version of close is being called
at exit. 

/usr/libp contains libc.a and libpthread.a.  There
is no shared libc support for profiling.  As a result,
it doesn't make any sense to use shared libraries with
"-pg".
>How-To-Repeat:

>Fix:
Add "-static" to link command.  Update specs.
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]