[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: 2.0-alpha and Solaris 7

Kurt D. Zeilenga writes:
> Does anyone know if the current tests work with the vendor's C compiler?
> 	(I suspect the "-mt" is used).

The latest version of configure gives:

LTHREAD_LIBS@% -mt -lrt%g

The manpage says we should use -lpthread as well.

> Does anyone know what the vendor compiler does with:
> 	-mt, -pthread, -kthread, etc?

Of the threading options tested by configure:

 -mt -kthread -pthread -pthreads -mthreads -thread -threads -Wl,-woff,85
 -all_load -lc_r -lexc -llwp -lmach -lpthread -lpthreads -lrt -lthread

cc succeeds and links with one or more of these options:

  -mt: adds the options -D_REENTRANT -lthread.

  -lthread: threads library.

  -lpthread: Posix threads library.

  -lrt (or obsolete alias -lposix4): POSIX.1b Realtime Extensions:
     aio_cancel           aio_error             aio_fsync
     aio_read             aio_return            aio_suspend
     aio_write            clock_getres          clock_gettime
     clock_settime        fdatasync             lio_listio
     mq_close             mq_getattr            mq_notify
     mq_open              mq_receive            mq_send
     mq_setattr           mq_unlink             nanosleep
     sched_getparam      sched_get_priority_max sched_get_priority_min
     sched_getscheduler  sched_rr_get_interval  sched_setparam
     sched_setscheduler   sched_yield           sem_close
     sem_destroy          sem_getvalue          sem_init
     sem_open             sem_post              sem_trywait
     sem_unlink           sem_wait              shm_open
     shm_unlink           sigqueue              sigtimedwait
     sigwaitinfo          timer_create          timer_delete
     timer_getoverrun     timer_gettime         timer_settime

cc returns success with `illegal option' *warning* (not error) for:

  -kthread -mthreads

cc returns error because these options are parsed as something else:

  -pthread -pthreads -thread -threads -Wl,-woff,85 -all_load

  (-all_load is the only one caught by cc -c, the others need to
  link in order to fail)

cc returns error with library not found:

 -lc_r -lexc -llwp -lmach -lpthreads

>>    pthread_create is not usable, check environment settings
> I believe we at least fixed pthread detection when the vendor's
> compiler is used.  Some versions (or derivities of GNU cc) may
> also work.
>>  In both cases, the cause is generally the same (Solaris' libc including
>>  a bogus pthread_create stub - Solaris 2.6 and 7, but not 2.5.1).
> I trust that you have complained to your vendor.

Stubs are a feature, not a bug.  It is not the vendor's fault that
configure attempts to use pthread_create in another way than the
documentation specifies (i.e. with -mt -lpthread).

> Can you keep to see which pthreads routines are NOT stubbed in libc?

There seems to be stubs for all of them.
> Does the -mt test fail under gcc?

Yes, it says cc1: invalid option 't'.

> If so, why does the -kthread test not fail.

gcc: unrecognized option `-kthread'