This is the mail archive of the gcc@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: all Objective-C tests failing on Solaris


Joe Buck <jbuck@Synopsys.COM> writes:
> > On Wed, 13 Jan 1999, Helge Hess wrote:
> > 
> > : > pthread_getspecific                 .../libobjc/libobjc.a(thr-posix.o)
> > : > pthread_self                        .../libobjc/libobjc.a(thr-posix.o)
> > : > sched_yield                         .../libobjc/libobjc.a(thr-posix.o)
> > : > pthread_key_create                  .../libobjc/libobjc.a(thr-posix.o)
> > : > pthread_setspecific                 .../libobjc/libobjc.a(thr-posix.o)
> > : > pthread_create                      .../libobjc/libobjc.a(thr-posix.o)
> > : > pthread_exit                        .../libobjc/libobjc.a(thr-posix.o)
> > 
> > Pretty obvious; it's missing POSIX threading, by missing -l options.  :>
> > 
> > : I think thr-posix is supposed to be the Solaris Posix frontend. So
> > : sched_yield is probably a Solaris function from the thread library, you
> > : have to link -lthread -lpthread in this setup.
> > 
> > Solaris documentation specifically states that you have to link -lpthread
> > -lthread, not just -lpthread.
> 
> That won't provide a definition of sched_yield; it is in neither library.

Here's what I wrote for the GNOME ObjC configure check:

  AC_REQUIRE([GNOME_PTHREAD_CHECK])

  OBJC_LIBS="-lobjc $PTHREAD_LIB"
  AC_CHECK_FUNC(sched_yield,,[
    AC_CHECK_LIB(posix4,sched_yield,
                OBJC_LIBS="$OBJC_LIBS -lposix4",, $OBJC_LIBS)])
  AC_SUBST(OBJC_LIBS)

Where $PTHREAD_LIB is defined in GNOME_PTHREAD_CHECK.  The relevant
part, however, is the check for the -lposix4 library to get
`sched_yield'.  Note that the pthread library doesn't need -lposix4;
the ObjC runtime does, since it calls `sched_yield' directly.

HTH
- Hari
-- 
Raja R Harinath ------------------------------ harinath@cs.umn.edu
"When all else fails, read the instructions."      -- Cahn's Axiom
"Our policy is, when in doubt, do the right thing."   -- Roy L Ash


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