By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,834 Members | 2,265 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,834 IT Pros & Developers. It's quick & easy.

Compile problem on old Debian Linux with glibc 2.0.7

P: n/a
Hi all,

I want to upgrade Postgres 7.1.3 on an old Debian Slink machine (with
glibc 2.0.7 and Kernel 2.2.17). That machine runs fine and I can not
simply upgrade the OS because it's a busy 24/7 machine.

When I try to compile PostgreSQL 7.2.4 or 7.4.1 then I get

|gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations
|-I../../../src/include -D_GNU_SOURCE -c hba.c -o hba.o
|hba.c: In function `parse_hba':
|hba.c:675: warning: implicit declaration of function `gai_strerror'
|hba.c:675: warning: format argument is not a pointer (arg 3)
|hba.c: In function `ident_unix':
|hba.c:1411: storage size of `peercred' isn't known
|hba.c:1411: warning: unused variable `peercred'
|make[3]: *** [hba.o] Error 1
|make[3]: Leaving directory
|`/usr/src/postgres/postgresql-7.4.1/src/backend/libpq'

But what's strange:
On my very old Linux libc5 machine (but with kernel 2.4) I can compile
7.2 and 7.4 versions without a problem. So it probably has to do with
glibc-2.0.7.

I cannot find "struct ucred" or "gai_strerror" definitions in my
machine's headerfiles.

How can I compile a recent version of PostgreSQL on that machine? I
don't need the "sameuser" local authentification.

Regards
Holger
--
PGP/GPG Key-ID:
http://blackhole.pca.dfn.de:11371/pk...rch=0xB5A1AFE1

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Holger Marzen <ho****@marzen.de> writes:
When I try to compile PostgreSQL 7.2.4 or 7.4.1 then I get |gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations
|-I../../../src/include -D_GNU_SOURCE -c hba.c -o hba.o
|hba.c: In function `parse_hba':
|hba.c:675: warning: implicit declaration of function `gai_strerror'
|hba.c:675: warning: format argument is not a pointer (arg 3)
|hba.c: In function `ident_unix':
|hba.c:1411: storage size of `peercred' isn't known
|hba.c:1411: warning: unused variable `peercred'
|make[3]: *** [hba.o] Error 1


The configure process assumes that any platform that supplies
getaddrinfo() will also supply gai_strerror(). Is that not true
in your version of glibc? If not, one possible workaround is to
force use of our own getaddrinfo replacement (#undef HAVE_GETADDRINFO
and add getaddrinfo.o to LIBOBJS).

Probably the easiest way around the peercred problem is just to disable
that chunk of code ("#elif defined(SO_PEERCRED)" to "#elif 0" at line
1409 of hba.c will probably do it). You may need to dike out the
corresponding code in client-side libpq as well.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 12 '05 #2

P: n/a
On Thu, 8 Jan 2004, Tom Lane wrote:
Holger Marzen <ho****@marzen.de> writes:
When I try to compile PostgreSQL 7.2.4 or 7.4.1 then I get
|gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations
|-I../../../src/include -D_GNU_SOURCE -c hba.c -o hba.o
|hba.c: In function `parse_hba':
|hba.c:675: warning: implicit declaration of function `gai_strerror'
|hba.c:675: warning: format argument is not a pointer (arg 3)
|hba.c: In function `ident_unix':
|hba.c:1411: storage size of `peercred' isn't known
|hba.c:1411: warning: unused variable `peercred'
|make[3]: *** [hba.o] Error 1


The configure process assumes that any platform that supplies
getaddrinfo() will also supply gai_strerror(). Is that not true
in your version of glibc? If not, one possible workaround is to
force use of our own getaddrinfo replacement (#undef HAVE_GETADDRINFO
and add getaddrinfo.o to LIBOBJS).


I changed the LIBOBJS in src/Makefile.global and put the #undef after
the #define in src/include/pg_config.h.

But unfortunately that's only half of the world domaination. I still
got:

hba.c: In function `ident_unix':
hba.c:1411: storage size of `peercred' isn't known
hba.c:1411: warning: unused variable `peercred'
make[3]: *** [hba.o] Error 1
Probably the easiest way around the peercred problem is just to disable
that chunk of code ("#elif defined(SO_PEERCRED)" to "#elif 0" at line
Yep. That's the other half!
1409 of hba.c will probably do it). You may need to dike out the
corresponding code in client-side libpq as well.


Not neccessary. It compiled and linked.

Thanks, Tom.
--
PGP/GPG Key-ID:
http://blackhole.pca.dfn.de:11371/pk...rch=0xB5A1AFE1

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.