From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8018 invoked by alias); 23 Apr 2002 16:06:06 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 7991 invoked by uid 71); 23 Apr 2002 16:06:04 -0000 Resent-Date: 23 Apr 2002 16:06:04 -0000 Resent-Message-ID: <20020423160604.7989.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, dave@hiauly1.hia.nrc.ca Received:(qmail 7106 invoked by uid 61); 23 Apr 2002 16:02:03 -0000 Message-Id:<20020423160203.7097.qmail@sources.redhat.com> Date: Tue, 23 Apr 2002 09:06:00 -0000 From: dave@hiauly1.hia.nrc.ca Reply-To: dave@hiauly1.hia.nrc.ca To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: target/6428: gmon.out is not generated when application to be profiled is linked with shared libgcc X-SW-Source: 2002-04/txt/msg01207.txt.bz2 List-Id: >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: