public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: objc/2902: collect2 doesn't find ctors/dtors in shared libraries under hpux10.20
@ 2001-06-13  8:46 law
  0 siblings, 0 replies; 5+ messages in thread
From: law @ 2001-06-13  8:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR objc/2902; it has been noted by GNATS.

From: law@redhat.com
To: dave.anglin@nrc.ca
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: objc/2902: collect2 doesn't find ctors/dtors in shared libraries 
 under hpux10.20
Date: Tue, 12 Jun 2001 18:52:50 -0700

   In message <20010522184444.25021.qmail@sourceware.cygnus.com>you write:
   > 
   > >Number:         2902
   > >Category:       objc
   > >Synopsis:       collect2 doesn't find ctors/dtors in shared libraries unde
   > r hpux10.20
   > >Confidential:   no
   > >Severity:       serious
   > >Priority:       medium
   > >Responsible:    unassigned
   > >State:          open
   > >Class:          sw-bug
   > >Submitter-Id:   net
   > >Arrival-Date:   Tue May 22 11:46:00 PDT 2001
   > >Closed-Date:
   > >Last-Modified:
   > >Originator:     Dave Anglin
   > >Release:        gcc version 3.0 20010518 (prerelease)
   > >Organization:
   > >Environment:
   > # ../../gcc/configure  --host=hppa1.1-hp-hpux10.20 --target=hppa1.1-hp-hpux
   > 10.20 --srcdir=../../gcc --with-gcc-version-trigger=/xxx/gnu/gcc-3.0/gcc/ve
   > rsion.c --with-gnu-as --enable-shared --enable-threads --enable-debug=no
   > >Description:
   > The symptom is a large number of failures in the testsuite with the followi
   > ng error:
   > 
   > Executing on host: /xxx/gnu/gcc-3.0/objdir/gcc/xgcc -B/xxx/gnu/gcc-3.0/objd
   > ir/gcc/ /xxx/gnu/gcc-3.0/gcc/testsuite/objc/execute/_cmd.m  -w  -O  -I/xxx/
   > gnu/gcc-3.0/gcc/testsuite/../../libobjc -L/xxx/gnu/gcc-3.0/objdir/hppa1.1-h
   > p-hpux10.20/libobjc/.libs  -lobjc -lm   -fPIC -o /xxx/gnu/gcc-3.0/objdir/gc
   > c/testsuite/_cmd.x
   >   (timeout = 300)
   > PASS: objc/execute/_cmd.m compilation,  -O
   > objc runtime: cannot find class Object
   > FAIL: objc/execute/_cmd.m execution,  -O
   > 
   > In debugging this, I found that the constructors to build the
   > classes Object and NXConstantString don't run when the application
   > is linked with a shared libobjc.  This is apparently because
   > collect2 can't determine that these constructors are needed.
   > Here is part of the output generated by collect2 with `-debug'
   > linking _cmd.x:
   > 
   > /usr/ccs/bin/ld -L/lib/pa1.1 -L/usr/lib/pa1.1 -z -u main -o /xxx/gnu/gcc-3.
   > 0/objdir/gcc/testsuite/_cmd.x /usr/ccs/lib/crt0.o -L/xxx/gnu/gcc-3.0/objdir
   > /hppa1.1-hp-hpux10.20/libobjc/.libs -L/xxx/gnu/gcc-3.0/objdir/gcc -L/usr/lo
   > cal/lib/gcc-lib/hppa1.1-hp-hpux10.20/3.0 -L/usr/ccs/bin -L/usr/ccs/lib -L/o
   > pt/langtools/lib -L/usr/local/lib/gcc-lib/hppa1.1-hp-hpux10.20/3.0/../../..
   >  /var/tmp/ccapeMug.o -lobjc -lm -lgcc -lc -lgcc
   >  /usr/local/lib/gcc-lib/hppa1.1-hp-hpux10.20/3.0/../../../../hppa1.1-hp-hpu
   > x10.20/bin/nm -n /xxx/gnu/gcc-3.0/objdir/gcc/testsuite/_cmd.x
   > 
   > nm output with constructors/destructors.
   >         000025e8 T _GLOBAL__I_main
   > 
   >  /usr/ccs/bin/chatr /xxx/gnu/gcc-3.0/objdir/gcc/testsuite/_cmd.x
   > 
   > ldd output with constructors/destructors.
   >                      dynamic   /xxx/gnu/gcc-3.0/objdir/hppa1.1-hp-hpux10.20
   > /libobjc/.libs/libobjc.sl.1
   >                      dynamic   /usr/lib/libc.1
   > 
   >  /usr/local/lib/gcc-lib/hppa1.1-hp-hpux10.20/3.0/../../../../hppa1.1-hp-hpu
   > x10.20/bin/nm -n /xxx/gnu/gcc-3.0/objdir/hppa1.1-hp-hpux10.20/libobjc/.libs
   > /libobjc.sl.1
   > 
   > nm output with constructors/destructors.
   >         00017aa0 T _GLOBAL__I___objc_linking
   >         00017ad0 T _GLOBAL__I___objc_linking
   >         00018210 T _GLOBAL__I_.._.._.._libobjc_NXConstStr.mSFndDa
   >         00018228 T _GLOBAL__I_.._.._.._libobjc_NXConstStr.mSFndDa
   >         0001a1e0 T _GLOBAL__I_.._.._.._libobjc_Object.mOXKa8a
   >         0001a1f8 T _GLOBAL__I_.._.._.._libobjc_Object.mOXKa8a
   >         0001b058 T _GLOBAL__I_.._.._.._libobjc_Protocol.mxvicuc
   >         0001b070 T _GLOBAL__I_.._.._.._libobjc_Protocol.mxvicuc
   > 
   >  /usr/local/lib/gcc-lib/hppa1.1-hp-hpux10.20/3.0/../../../../hppa1.1-hp-hpu
   > x10.2
   > 0/bin/nm -n /usr/lib/libc.1
   > 
   > nm output with constructors/destructors.
   > 
   > 1 constructor(s) found
   > 0 destructor(s)  found
   > 0 frame table(s) found
   > [Leaving /xxx/gnu/gcc-3.0/objdir/gcc/testsuite/_cmd.x]
   > >How-To-Repeat:
   > Configure with `--enable-shared'.
   > >Fix:
   > 
   > >Release-Note:
   > >Audit-Trail:
   > >Unformatted:
 I'm not sure which constructors you're claiming need to be fired and
 where they're defined.
 
 For a shared library all the ctors/dtors should be fired by the shared
 library's ctor/dtor.  ie, there should be a ctor for the library as a 
 whole which fires off all the ctors/dtors within the library.
 
 jeff
 
 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: objc/2902: collect2 doesn't find ctors/dtors in shared libraries under hpux10.20
@ 2002-01-04 22:51 rodrigc
  0 siblings, 0 replies; 5+ messages in thread
From: rodrigc @ 2002-01-04 22:51 UTC (permalink / raw)
  To: dave.anglin, gcc-bugs, gcc-prs, law, rodrigc, nobody

Synopsis: collect2 doesn't find ctors/dtors in shared libraries under hpux10.20

State-Changed-From-To: feedback->closed
State-Changed-By: rodrigc
State-Changed-When: Fri Jan  4 22:51:16 2002
State-Changed-Why:
    Closed upon request of submitter.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=2902


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: objc/2902: collect2 doesn't find ctors/dtors in shared libraries under hpux10.20
@ 2002-01-04 22:46 John David Anglin
  0 siblings, 0 replies; 5+ messages in thread
From: John David Anglin @ 2002-01-04 22:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR objc/2902; it has been noted by GNATS.

From: "John David Anglin" <dave@hiauly1.hia.nrc.ca>
To: rodrigc@gcc.gnu.org, dave.anglin@nrc.ca, gcc-bugs@gcc.gnu.org,
   gcc-prs@gcc.gnu.org, law@redhat.com, rodrigc@gcc.gnu.org,
   nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: objc/2902: collect2 doesn't find ctors/dtors in shared libraries under hpux10.20
Date: Sat, 5 Jan 2002 01:44:55 -0500 (EST)

 > Synopsis: collect2 doesn't find ctors/dtors in shared libraries under hpux10.20
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: rodrigc
 > State-Changed-When: Fri Jan  4 22:33:29 2002
 > State-Changed-Why:
 >     Does this problem still occur in gcc 3.0.3 or
 >     in gcc 3.1 CVS?
 > 
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=2902
 
 This problem was fixed prior to the 3.0 release.  As I recall, certain
 symbols were in the wrong section.
 
 Please close 2902.
 
 Dave
 -- 
 J. David Anglin                                  dave.anglin@nrc.ca
 National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: objc/2902: collect2 doesn't find ctors/dtors in shared libraries under hpux10.20
@ 2002-01-04 22:33 rodrigc
  0 siblings, 0 replies; 5+ messages in thread
From: rodrigc @ 2002-01-04 22:33 UTC (permalink / raw)
  To: dave.anglin, gcc-bugs, gcc-prs, law, rodrigc, nobody

Synopsis: collect2 doesn't find ctors/dtors in shared libraries under hpux10.20

State-Changed-From-To: open->feedback
State-Changed-By: rodrigc
State-Changed-When: Fri Jan  4 22:33:29 2002
State-Changed-Why:
    Does this problem still occur in gcc 3.0.3 or
    in gcc 3.1 CVS?

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=2902


^ permalink raw reply	[flat|nested] 5+ messages in thread

* objc/2902: collect2 doesn't find ctors/dtors in shared libraries under hpux10.20
@ 2001-05-22 11:46 dave.anglin
  0 siblings, 0 replies; 5+ messages in thread
From: dave.anglin @ 2001-05-22 11:46 UTC (permalink / raw)
  To: gcc-gnats

>Number:         2902
>Category:       objc
>Synopsis:       collect2 doesn't find ctors/dtors in shared libraries under hpux10.20
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue May 22 11:46:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Dave Anglin
>Release:        gcc version 3.0 20010518 (prerelease)
>Organization:
>Environment:
# ../../gcc/configure  --host=hppa1.1-hp-hpux10.20 --target=hppa1.1-hp-hpux10.20 --srcdir=../../gcc --with-gcc-version-trigger=/xxx/gnu/gcc-3.0/gcc/version.c --with-gnu-as --enable-shared --enable-threads --enable-debug=no
>Description:
The symptom is a large number of failures in the testsuite with the following error:

Executing on host: /xxx/gnu/gcc-3.0/objdir/gcc/xgcc -B/xxx/gnu/gcc-3.0/objdir/gcc/ /xxx/gnu/gcc-3.0/gcc/testsuite/objc/execute/_cmd.m  -w  -O  -I/xxx/gnu/gcc-3.0/gcc/testsuite/../../libobjc -L/xxx/gnu/gcc-3.0/objdir/hppa1.1-hp-hpux10.20/libobjc/.libs  -lobjc -lm   -fPIC -o /xxx/gnu/gcc-3.0/objdir/gcc/testsuite/_cmd.x
  (timeout = 300)
PASS: objc/execute/_cmd.m compilation,  -O
objc runtime: cannot find class Object
FAIL: objc/execute/_cmd.m execution,  -O

In debugging this, I found that the constructors to build the
classes Object and NXConstantString don't run when the application
is linked with a shared libobjc.  This is apparently because
collect2 can't determine that these constructors are needed.
Here is part of the output generated by collect2 with `-debug'
linking _cmd.x:

/usr/ccs/bin/ld -L/lib/pa1.1 -L/usr/lib/pa1.1 -z -u main -o /xxx/gnu/gcc-3.0/objdir/gcc/testsuite/_cmd.x /usr/ccs/lib/crt0.o -L/xxx/gnu/gcc-3.0/objdir/hppa1.1-hp-hpux10.20/libobjc/.libs -L/xxx/gnu/gcc-3.0/objdir/gcc -L/usr/local/lib/gcc-lib/hppa1.1-hp-hpux10.20/3.0 -L/usr/ccs/bin -L/usr/ccs/lib -L/opt/langtools/lib -L/usr/local/lib/gcc-lib/hppa1.1-hp-hpux10.20/3.0/../../.. /var/tmp/ccapeMug.o -lobjc -lm -lgcc -lc -lgcc
 /usr/local/lib/gcc-lib/hppa1.1-hp-hpux10.20/3.0/../../../../hppa1.1-hp-hpux10.20/bin/nm -n /xxx/gnu/gcc-3.0/objdir/gcc/testsuite/_cmd.x

nm output with constructors/destructors.
        000025e8 T _GLOBAL__I_main

 /usr/ccs/bin/chatr /xxx/gnu/gcc-3.0/objdir/gcc/testsuite/_cmd.x

ldd output with constructors/destructors.
                     dynamic   /xxx/gnu/gcc-3.0/objdir/hppa1.1-hp-hpux10.20/libobjc/.libs/libobjc.sl.1
                     dynamic   /usr/lib/libc.1

 /usr/local/lib/gcc-lib/hppa1.1-hp-hpux10.20/3.0/../../../../hppa1.1-hp-hpux10.20/bin/nm -n /xxx/gnu/gcc-3.0/objdir/hppa1.1-hp-hpux10.20/libobjc/.libs/libobjc.sl.1

nm output with constructors/destructors.
        00017aa0 T _GLOBAL__I___objc_linking
        00017ad0 T _GLOBAL__I___objc_linking
        00018210 T _GLOBAL__I_.._.._.._libobjc_NXConstStr.mSFndDa
        00018228 T _GLOBAL__I_.._.._.._libobjc_NXConstStr.mSFndDa
        0001a1e0 T _GLOBAL__I_.._.._.._libobjc_Object.mOXKa8a
        0001a1f8 T _GLOBAL__I_.._.._.._libobjc_Object.mOXKa8a
        0001b058 T _GLOBAL__I_.._.._.._libobjc_Protocol.mxvicuc
        0001b070 T _GLOBAL__I_.._.._.._libobjc_Protocol.mxvicuc

 /usr/local/lib/gcc-lib/hppa1.1-hp-hpux10.20/3.0/../../../../hppa1.1-hp-hpux10.2
0/bin/nm -n /usr/lib/libc.1

nm output with constructors/destructors.

1 constructor(s) found
0 destructor(s)  found
0 frame table(s) found
[Leaving /xxx/gnu/gcc-3.0/objdir/gcc/testsuite/_cmd.x]
>How-To-Repeat:
Configure with `--enable-shared'.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-01-05  6:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-13  8:46 objc/2902: collect2 doesn't find ctors/dtors in shared libraries under hpux10.20 law
  -- strict thread matches above, loose matches on Subject: below --
2002-01-04 22:51 rodrigc
2002-01-04 22:46 John David Anglin
2002-01-04 22:33 rodrigc
2001-05-22 11:46 dave.anglin

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).