Обсуждение: PG 9.0 Solaris compile error on Sparc

Поиск
Список
Период
Сортировка

PG 9.0 Solaris compile error on Sparc

От
Dave Page
Дата:
I'm working on setting up a new buildfarm member as we don't seem to
have any active Solaris ones :-(

cc -Xa -m64 -mt   -mt -D_REENTRANT -D_THREAD_SAFE
-D_POSIX_PTHREAD_SEMANTICS -KPIC -DFRONTEND -DUNSAFE_STAT_OK -I.
-I../../../src/include  -I../../../src/port -I../../../src/port
-DSO_MAJOR_VERSION=5  -c -o fe-connect.o fe-connect.c
"fe-connect.c", line 1789: undefined symbol: ucred_t
"fe-connect.c", line 1789: undefined symbol: ucred
"fe-connect.c", line 1792: warning: implicit function declaration: getpeerucred
"fe-connect.c", line 1792: undefined symbol: sock
"fe-connect.c", line 1800: warning: implicit function declaration: ucred_geteuid
"fe-connect.c", line 1805: warning: implicit function declaration: ucred_free
cc: acomp failed for fe-connect.c

That is with Sun Studio 12. This is with gcc:

gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing
-fwrapv -pthreads   -pthreads  -D_REENTRANT -D_THREAD_SAFE
-D_POSIX_PTHREAD_SEMANTICS -fPIC -DFRONTEND -DUNSAFE_STAT_OK -I.
-I../../../src/include  -I../../../src/port -I../../../src/port
-DSO_MAJOR_VERSION=5  -c -o fe-connect.o fe-connect.c
fe-connect.c: In function `PQconnectPoll':
fe-connect.c:1789: error: `ucred_t' undeclared (first use in this function)
fe-connect.c:1789: error: (Each undeclared identifier is reported only once
fe-connect.c:1789: error: for each function it appears in.)
fe-connect.c:1789: error: `ucred' undeclared (first use in this function)
fe-connect.c:1792: warning: implicit declaration of function `getpeerucred'
fe-connect.c:1792: error: `sock' undeclared (first use in this function)
fe-connect.c:1800: warning: implicit declaration of function `ucred_geteuid'
fe-connect.c:1805: warning: implicit declaration of function `ucred_free'
gmake[3]: *** [fe-connect.o] Error 1

Platform:

-bash-3.00$ uname -a
SunOS suzuka 5.10 Generic_118833-33 sun4u sparc SUNW,Sun-Blade-1000

Configured with:

./configure --with-perl --with-python --without-readline

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise Postgres Company

Re: PG 9.0 Solaris compile error on Sparc

От
Tom Lane
Дата:
Dave Page <dpage@pgadmin.org> writes:
> I'm working on setting up a new buildfarm member as we don't seem to
> have any active Solaris ones :-(

> cc -Xa -m64 -mt   -mt -D_REENTRANT -D_THREAD_SAFE
> -D_POSIX_PTHREAD_SEMANTICS -KPIC -DFRONTEND -DUNSAFE_STAT_OK -I.
> -I../../../src/include  -I../../../src/port -I../../../src/port
> -DSO_MAJOR_VERSION=5  -c -o fe-connect.o fe-connect.c
> "fe-connect.c", line 1789: undefined symbol: ucred_t
> "fe-connect.c", line 1789: undefined symbol: ucred
> "fe-connect.c", line 1792: warning: implicit function declaration: getpeerucred
> "fe-connect.c", line 1792: undefined symbol: sock
> "fe-connect.c", line 1800: warning: implicit function declaration: ucred_geteuid
> "fe-connect.c", line 1805: warning: implicit function declaration: ucred_free
> cc: acomp failed for fe-connect.c

That code wouldn't be getting compiled if configure hadn't found
getpeerucred present, so I'll bet the problem is just lack of the
#include file that declares the above symbols.  A bit of grepping
of /usr/include should give you the answer.

            regards, tom lane

Re: PG 9.0 Solaris compile error on Sparc

От
Zdenek Kotala
Дата:
Dave Page píše v po 19. 07. 2010 v 13:32 +0100:
> I'm working on setting up a new buildfarm member as we don't seem to
> have any active Solaris ones :-(

Unfortunately, I had to stop them :(. Sorry.

I cannot remember this bug. However for Solaris 10 is better to use
SunStudio 11. I see lot of bugs in SunStudio 12 and also postgresql with
dtrace is not possible compile with sunstudio 12 due some optimization.
It is bug in solaris 10 which is not fixed(backported) yet.

Anyway it is strange. I used following switches without any problem:

./configure --without-readline --enable-cassert --enable-debug
--enable-nls --enable-integer-datetimes --with-perl --with-python \
--with-tcl --with-krb5 --with-gssapi --with-openssl --with-pam \
--enable-thread-safety --with-includes=/usr/include/kerberosv5:/usr/sfw/include --with-libs=/usr/sfw/lib
--enable-dtrace--with-libxml --with-libxslt 

I see also that you use S10U3 which is not optimal for PostgreSQL. You
need to have S10U4 (at least for kerberos and dtrace).

Anyway it looks like that #include <ucred.h> is missing somewhere.

    Zdenek

> cc -Xa -m64 -mt   -mt -D_REENTRANT -D_THREAD_SAFE
> -D_POSIX_PTHREAD_SEMANTICS -KPIC -DFRONTEND -DUNSAFE_STAT_OK -I.
> -I../../../src/include  -I../../../src/port -I../../../src/port
> -DSO_MAJOR_VERSION=5  -c -o fe-connect.o fe-connect.c
> "fe-connect.c", line 1789: undefined symbol: ucred_t
> "fe-connect.c", line 1789: undefined symbol: ucred
> "fe-connect.c", line 1792: warning: implicit function declaration: getpeerucred
> "fe-connect.c", line 1792: undefined symbol: sock
> "fe-connect.c", line 1800: warning: implicit function declaration: ucred_geteuid
> "fe-connect.c", line 1805: warning: implicit function declaration: ucred_free
> cc: acomp failed for fe-connect.c
>
> That is with Sun Studio 12. This is with gcc:
>
> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
> -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing
> -fwrapv -pthreads   -pthreads  -D_REENTRANT -D_THREAD_SAFE
> -D_POSIX_PTHREAD_SEMANTICS -fPIC -DFRONTEND -DUNSAFE_STAT_OK -I.
> -I../../../src/include  -I../../../src/port -I../../../src/port
> -DSO_MAJOR_VERSION=5  -c -o fe-connect.o fe-connect.c
> fe-connect.c: In function `PQconnectPoll':
> fe-connect.c:1789: error: `ucred_t' undeclared (first use in this function)
> fe-connect.c:1789: error: (Each undeclared identifier is reported only once
> fe-connect.c:1789: error: for each function it appears in.)
> fe-connect.c:1789: error: `ucred' undeclared (first use in this function)
> fe-connect.c:1792: warning: implicit declaration of function `getpeerucred'
> fe-connect.c:1792: error: `sock' undeclared (first use in this function)
> fe-connect.c:1800: warning: implicit declaration of function `ucred_geteuid'
> fe-connect.c:1805: warning: implicit declaration of function `ucred_free'
> gmake[3]: *** [fe-connect.o] Error 1
>
> Platform:
>
> -bash-3.00$ uname -a
> SunOS suzuka 5.10 Generic_118833-33 sun4u sparc SUNW,Sun-Blade-1000
>
> Configured with:
>
> ./configure --with-perl --with-python --without-readline
>
> --
> Dave Page
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise Postgres Company
>

Re: PG 9.0 Solaris compile error on Sparc

От
Tom Lane
Дата:
I wrote:
> That code wouldn't be getting compiled if configure hadn't found
> getpeerucred present, so I'll bet the problem is just lack of the
> #include file that declares the above symbols.  A bit of grepping
> of /usr/include should give you the answer.

... but looking in src/backend/libpq/auth.c suggests that fe-connect
is lacking

#if defined(HAVE_STRUCT_CMSGCRED) || defined(HAVE_STRUCT_FCRED) || defined(HAVE_STRUCT_SOCKCRED)
#include <sys/uio.h>
#include <sys/ucred.h>
#endif
#ifdef HAVE_UCRED_H
#include <ucred.h>
#endif

            regards, tom lane

Re: PG 9.0 Solaris compile error on Sparc

От
Dave Page
Дата:
On Mon, Jul 19, 2010 at 2:03 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I wrote:
>> That code wouldn't be getting compiled if configure hadn't found
>> getpeerucred present, so I'll bet the problem is just lack of the
>> #include file that declares the above symbols. =A0A bit of grepping
>> of /usr/include should give you the answer.
>
> ... but looking in src/backend/libpq/auth.c suggests that fe-connect
> is lacking
>
> #if defined(HAVE_STRUCT_CMSGCRED) || defined(HAVE_STRUCT_FCRED) || define=
d(HAVE_STRUCT_SOCKCRED)
> #include <sys/uio.h>
> #include <sys/ucred.h>
> #endif
> #ifdef HAVE_UCRED_H
> #include <ucred.h>
> #endif

Adding that fixes it, though I also needed to change sock to
conn->sock on line 1801, somewhat like:
http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/interfaces/libpq/fe-conn=
ect.c?r1=3D1.400&r2=3D1.401

--=20
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise Postgres Company

Re: PG 9.0 Solaris compile error on Sparc

От
Dave Page
Дата:
On Mon, Jul 19, 2010 at 1:56 PM, Zdenek Kotala <Zdenek.Kotala@sun.com> wrot=
e:
> Dave Page p=C3=AD=C5=A1e v po 19. 07. 2010 v 13:32 +0100:
>> I'm working on setting up a new buildfarm member as we don't seem to
>> have any active Solaris ones :-(
>
> Unfortunately, I had to stop them :(. Sorry.
>
> I cannot remember this bug. However for Solaris 10 is better to use
> SunStudio 11. I see lot of bugs in SunStudio 12 and also postgresql with
> dtrace is not possible compile with sunstudio 12 due some optimization.
> It is bug in solaris 10 which is not fixed(backported) yet.

<grumble>

> Anyway it is strange. I used following switches without any problem:
>
> ./configure --without-readline --enable-cassert --enable-debug
> --enable-nls --enable-integer-datetimes --with-perl --with-python \
> --with-tcl --with-krb5 --with-gssapi --with-openssl --with-pam \
> --enable-thread-safety --with-includes=3D/usr/include/kerberosv5:/usr/sfw=
/include --with-libs=3D/usr/sfw/lib --enable-dtrace --with-libxml --with-li=
bxslt

Hmm. Perl fails here, as it seems to be 32 bit. OpenSSL fails, due to
lack of libcryto, and TCL seems to fail due to lack of headers (though
I didn't look very hard). I'm assuming these issues are largely due to
my inexperience with Solaris, or are there some development packages
or similar I should be downloading?

> I see also that you use S10U3 which is not optimal for PostgreSQL. You
> need to have S10U4 (at least for kerberos and dtrace).

Hmm, I'll have to see about upgrading it without annoying other users.

Thanks!

--=20
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise Postgres Company

Re: PG 9.0 Solaris compile error on Sparc

От
Zdenek Kotala
Дата:
Dave Page píše v po 19. 07. 2010 v 14:24 +0100:
> On Mon, Jul 19, 2010 at 1:56 PM, Zdenek Kotala <Zdenek.Kotala@sun.com> wrote:
> > Dave Page píše v po 19. 07. 2010 v 13:32 +0100:
> >> I'm working on setting up a new buildfarm member as we don't seem to
> >> have any active Solaris ones :-(
> >
> > Unfortunately, I had to stop them :(. Sorry.
> >
> > I cannot remember this bug. However for Solaris 10 is better to use
> > SunStudio 11. I see lot of bugs in SunStudio 12 and also postgresql with
> > dtrace is not possible compile with sunstudio 12 due some optimization.
> > It is bug in solaris 10 which is not fixed(backported) yet.
>
> <grumble>
>
> > Anyway it is strange. I used following switches without any problem:
> >
> > ./configure --without-readline --enable-cassert --enable-debug
> > --enable-nls --enable-integer-datetimes --with-perl --with-python \
> > --with-tcl --with-krb5 --with-gssapi --with-openssl --with-pam \
> > --enable-thread-safety --with-includes=/usr/include/kerberosv5:/usr/sfw/include --with-libs=/usr/sfw/lib
--enable-dtrace--with-libxml --with-libxslt 
>
> Hmm. Perl fails here, as it seems to be 32 bit.

I see, you compile it 64bits. 64bits perl does not exist - no PL/PgPerl

>  OpenSSL fails, due to
> lack of libcryto, and TCL seems to fail due to lack of headers (though
> I didn't look very hard).

You need to set RPATH. Openssl is in /usr/sfw/lib (/usr/sfw/lib/64)

You need this for 32bit
'LDFLAGS' => '-R/usr/sfw/lib',
'LDFLAGS_SL' => '-R/usr/sfw/lib',
'TCLSH' => '/usr/sfw/bin/tclsh8.3'

and 'LDFLAGS' => '-R/usr/sfw/lib/64', for 64bit.


>  I'm assuming these issues are largely due to
> my inexperience with Solaris, or are there some development packages
> or similar I should be downloading?

No you need only compiler and full Solaris 10 installation.

> > I see also that you use S10U3 which is not optimal for PostgreSQL. You
> > need to have S10U4 (at least for kerberos and dtrace).
>
> Hmm, I'll have to see about upgrading it without annoying other users.
>
> Thanks!
>

Re: PG 9.0 Solaris compile error on Sparc

От
Dave Page
Дата:
On Mon, Jul 19, 2010 at 2:36 PM, Zdenek Kotala <Zdenek.Kotala@sun.com> wrot=
e:
>> =A0OpenSSL fails, due to
>> lack of libcryto, and TCL seems to fail due to lack of headers (though
>> I didn't look very hard).
>
> You need to set RPATH. Openssl is in /usr/sfw/lib (/usr/sfw/lib/64)
>
> You need this for 32bit
> 'LDFLAGS' =3D> '-R/usr/sfw/lib',
> 'LDFLAGS_SL' =3D> '-R/usr/sfw/lib',
> 'TCLSH' =3D> '/usr/sfw/bin/tclsh8.3'
>
> and 'LDFLAGS' =3D> '-R/usr/sfw/lib/64', for 64bit.

Ah, OK - thanks.

>> =A0I'm assuming these issues are largely due to
>> my inexperience with Solaris, or are there some development packages
>> or similar I should be downloading?
>
> No you need only compiler and full Solaris 10 installation.

And knowledge of the odd places these things end up in on Solaris :-p



--=20
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise Postgres Company

Re: PG 9.0 Solaris compile error on Sparc

От
Peter Eisentraut
Дата:
On mån, 2010-07-19 at 13:32 +0100, Dave Page wrote:
> I'm working on setting up a new buildfarm member as we don't seem to
> have any active Solaris ones :-(
>
> cc -Xa -m64 -mt   -mt -D_REENTRANT -D_THREAD_SAFE
> -D_POSIX_PTHREAD_SEMANTICS -KPIC -DFRONTEND -DUNSAFE_STAT_OK -I.
> -I../../../src/include  -I../../../src/port -I../../../src/port
> -DSO_MAJOR_VERSION=5  -c -o fe-connect.o fe-connect.c
> "fe-connect.c", line 1789: undefined symbol: ucred_t
> "fe-connect.c", line 1789: undefined symbol: ucred
> "fe-connect.c", line 1792: warning: implicit function declaration:
> getpeerucred
> "fe-connect.c", line 1792: undefined symbol: sock
> "fe-connect.c", line 1800: warning: implicit function declaration:
> ucred_geteuid
> "fe-connect.c", line 1805: warning: implicit function declaration:
> ucred_free
> cc: acomp failed for fe-connect.c

I think you're compiling 9.1. :-)

Re: PG 9.0 Solaris compile error on Sparc

От
Dave Page
Дата:
On Mon, Jul 19, 2010 at 4:00 PM, Peter Eisentraut <peter_e@gmx.net> wrote:
> On m=E5n, 2010-07-19 at 13:32 +0100, Dave Page wrote:
>> I'm working on setting up a new buildfarm member as we don't seem to
>> have any active Solaris ones :-(
>>
>> cc -Xa -m64 -mt =A0 -mt -D_REENTRANT -D_THREAD_SAFE
>> -D_POSIX_PTHREAD_SEMANTICS -KPIC -DFRONTEND -DUNSAFE_STAT_OK -I.
>> -I../../../src/include =A0-I../../../src/port -I../../../src/port
>> -DSO_MAJOR_VERSION=3D5 =A0-c -o fe-connect.o fe-connect.c
>> "fe-connect.c", line 1789: undefined symbol: ucred_t
>> "fe-connect.c", line 1789: undefined symbol: ucred
>> "fe-connect.c", line 1792: warning: implicit function declaration:
>> getpeerucred
>> "fe-connect.c", line 1792: undefined symbol: sock
>> "fe-connect.c", line 1800: warning: implicit function declaration:
>> ucred_geteuid
>> "fe-connect.c", line 1805: warning: implicit function declaration:
>> ucred_free
>> cc: acomp failed for fe-connect.c
>
> I think you're compiling 9.1. :-)

Yeah, sorry - forgot we forked already :-p


--=20
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise Postgres Company

Re: PG 9.0 Solaris compile error on Sparc

От
Peter Eisentraut
Дата:
On mån, 2010-07-19 at 13:32 +0100, Dave Page wrote:
> I'm working on setting up a new buildfarm member as we don't seem to
> have any active Solaris ones :-(
>
> cc -Xa -m64 -mt   -mt -D_REENTRANT -D_THREAD_SAFE
> -D_POSIX_PTHREAD_SEMANTICS -KPIC -DFRONTEND -DUNSAFE_STAT_OK -I.
> -I../../../src/include  -I../../../src/port -I../../../src/port
> -DSO_MAJOR_VERSION=5  -c -o fe-connect.o fe-connect.c
> "fe-connect.c", line 1789: undefined symbol: ucred_t
> "fe-connect.c", line 1789: undefined symbol: ucred
> "fe-connect.c", line 1792: warning: implicit function declaration: getpeerucred
> "fe-connect.c", line 1792: undefined symbol: sock
> "fe-connect.c", line 1800: warning: implicit function declaration: ucred_geteuid
> "fe-connect.c", line 1805: warning: implicit function declaration: ucred_free
> cc: acomp failed for fe-connect.c

Should be fixed now.

Re: PG 9.0 Solaris compile error on Sparc

От
Dave Page
Дата:
On Mon, Jul 19, 2010 at 7:53 PM, Peter Eisentraut <peter_e@gmx.net> wrote:
> On m=E5n, 2010-07-19 at 13:32 +0100, Dave Page wrote:
>> I'm working on setting up a new buildfarm member as we don't seem to
>> have any active Solaris ones :-(
>>
>> cc -Xa -m64 -mt =A0 -mt -D_REENTRANT -D_THREAD_SAFE
>> -D_POSIX_PTHREAD_SEMANTICS -KPIC -DFRONTEND -DUNSAFE_STAT_OK -I.
>> -I../../../src/include =A0-I../../../src/port -I../../../src/port
>> -DSO_MAJOR_VERSION=3D5 =A0-c -o fe-connect.o fe-connect.c
>> "fe-connect.c", line 1789: undefined symbol: ucred_t
>> "fe-connect.c", line 1789: undefined symbol: ucred
>> "fe-connect.c", line 1792: warning: implicit function declaration: getpe=
erucred
>> "fe-connect.c", line 1792: undefined symbol: sock
>> "fe-connect.c", line 1800: warning: implicit function declaration: ucred=
_geteuid
>> "fe-connect.c", line 1805: warning: implicit function declaration: ucred=
_free
>> cc: acomp failed for fe-connect.c
>
> Should be fixed now.

Thanks - looks good.


--=20
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise Postgres Company