public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: dave@hiauly1.hia.nrc.ca
To: gcc-gnats@gcc.gnu.org
Subject: target/6428: gmon.out is not generated when application to be profiled is linked with shared libgcc
Date: Tue, 23 Apr 2002 09:06:00 -0000	[thread overview]
Message-ID: <20020423160203.7097.qmail@sources.redhat.com> (raw)


>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:


                 reply	other threads:[~2002-04-23 16:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020423160203.7097.qmail@sources.redhat.com \
    --to=dave@hiauly1.hia.nrc.ca \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).