http://gcc.gnu.org/ml/gcc-bugs/2001-05/msg00749.html
Title: John David Anglin - Re: objc/2902: collect2 doesn't ...: libtool should use collect2?

This is the mail archive of the [EMAIL PROTECTED] 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]

Re: objc/2902: collect2 doesn't ...: libtool should use collect2?

  • To: gcc-bugs at gcc dot gnu dot org
  • Subject: Re: objc/2902: collect2 doesn't ...: libtool should use collect2?
  • From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
  • Date: Thu, 24 May 2001 18:50:02 -0400 (EDT)

> 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

I started looking into the cause of the above.  The problem is caused
by using libtool rather than gcc to link libobjc.sl.  Libtool
directly invokes `ld' to link the objects in the shared library.  On the
otherhand, gcc under hpux will invoke collect2 to link the objects.
Collect2 will notice that the objects contain constructors/destructors
and add initializer and finalizer functions to the shared library.
When an application is linked with the shared library using gcc, collect2
will add these functions to the constructor/destructor list for the 
application and all will be well (hopefully).

This is a regression from the previous release which didn't use libtool.

Dave
-- 
J. David Anglin                                  [EMAIL PROTECTED]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)


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

Reply via email to