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]

Re: objc runtime: cannot find class Object



  In message <199906142129.RAA11559@hiauly1.hia.nrc.ca>you write:
  > Another solution is to change the Makefile to compile init.c with
  > -fno-inline-functions, or possibly -fkeep-inline-functions.  This
  > prevents the static function __objc_force_linking from being inlined
  > and eliminated at -O3 optimisation.
Err, it can't be __objc_force_linking that's being inlined because it is
self-recursive.  We don't inline self recursive functions last I checked.

It is more likely the case that we deferred output of the function because
of automatic inlining, then found out it was never referenced, so the function
was never output.

If that is the case, then an easy solution is to put a reference to the
function in another function or variable that is *always* output.  For
example, storing the function's address into a global (non-static variable).

Or just don't compile the target libraries with -O3 at all.  Generally I'd
prefer to see folks stick with -O2 -g instead of having everyone using their
own wild and fun CFLAGS which makes problem reproduction a *(&@#$ nightmare.

jeff


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