Re: Compile/Link Error for Postgres 8.1.0 on Solaris 8

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Compile/Link Error for Postgres 8.1.0 on Solaris 8
Дата
Msg-id 200512081943.jB8JhcR27471@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: Compile/Link Error for Postgres 8.1.0 on Solaris 8  (Alan Stange <stange@rentec.com>)
Список pgsql-novice
Alan Stange wrote:
> Tom Lane wrote:
> > Alan Stange <stange@rentec.com> writes:
> >
> >> Bhide, Rajan wrote:
> >>
> >>> ./configure --without-readline --enable-thread-safety CFLAGS=-xO4
> >>> -D_REENTRANT -xipo -mt -lpthread
> >>> CC=/export/home/uxapps/workshop/SUNWspro/bin/cc
> >>>
> >
> >
> >> Given that you've enabled -xipo, and the error is related to ipo, I'd
> >> suggest dropping that option for now.
> >>
> >
> > Putting -lpthread into CFLAGS seems pretty foolish as well.  If you
> > needed to specify that explicitly (which you do not) it would belong
> > in LDFLAGS --- putting it in CFLAGS is pretty certain to screw up
> > link order and so on.  And what is -mt?
> >
> >             regards, tom lane
> >
>      -mt  Passes D_REENTRANT to preprocessor. Appends -lthread
>           after all other user-specified libraries on the command
>           line.  If you are doing your own multithread coding,
>           you must use this option in the compile and link steps.
>           To obtain faster execution, this option requires a mul-
>           tiprocessor system. On a single-processor system, the
>           resulting executable usually runs more slowly with this
>           option.

Are you saying that --enable-thread-safety isn't setting PTHREAD_CFLAGS
and PTHREAD_LIBS in Makefile.global properly?  If so, please check out
config.log to see why it isn't trying those flags?  What settings to you
have for those anyway?

We have this in config/acx_pthread.m4 which modifies the flags tried on
Solaris:

  case "${host_cpu}-${host_os}" in
        *solaris*)

        # On Solaris (at least, for some versions), libc contains stubbed
        # (non-functional) versions of the pthreads routines, so link-based
        # tests will erroneously succeed.  (We need to link with -pthread or
        # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
        # a function called by this macro, so we could check for that, but
        # who knows whether they'll stub that too in a future libc.)  So,
        # we'll just look for -pthreads and -lpthread first:

        acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags"
        ;;
  esac

Is this incorrect?  Feel free to wack around configure (which is built
from  config/acx_pthread.m4) and let us know what works.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

В списке pgsql-novice по дате отправления:

Предыдущее
От: Alan Stange
Дата:
Сообщение: Re: Compile/Link Error for Postgres 8.1.0 on Solaris 8
Следующее
От: "Bhide, Rajan"
Дата:
Сообщение: Re: Compile/Link Error for Postgres 8.1.0 on Solaris 8