Thread: Error installing Postgres on Solaris 9
Hi, when I run: ./configure --without-readline, I get errors that aborts the configure process: "checking types of arguments for accept()... configure: error: could not determine argument types". Please see following from the config.log. Thanks, Thanh > > configure:10983: gcc -c -O2 -fno-strict-aliasing conftest.c >&5 > In file included from /usr/include/netinet/in.h:41, > from /usr/include/sys/socket.h:203, > from configure:10963: > /usr/include/sys/stream.h:307: parse error before "projid_t" > configure:10965: parse error before "accept" > configure:10965: conflicting types for `accept' > /usr/include/sys/socket.h:450: previous declaration of `accept' > configure:10965: warning: data definition has no type or storage class > configure:10986: $? = 1 > configure: failed program was: > #line 10958 "configure" > #include "confdefs.h" > #ifdef HAVE_SYS_TYPES_H > #include <sys/types.h> > #endif > #ifdef HAVE_SYS_SOCKET_H > #include <sys/socket.h> > #endif > extern unsigned int PASCAL accept (unsigned int, void *, socklen_t *); > #ifdef F77_DUMMY_MAIN > # ifdef __cplusplus > extern "C" > # endif > int F77_DUMMY_MAIN() { return 1; } > #endif > int > main () > { > > ; > return 0; > } > configure:10983: gcc -c -O2 -fno-strict-aliasing conftest.c >&5 > In file included from /usr/include/netinet/in.h:41, > from /usr/include/sys/socket.h:203, > from configure:10963: > /usr/include/sys/stream.h:307: parse error before "projid_t" > configure:10965: parse error before "accept" > configure:10965: conflicting types for `accept' > /usr/include/sys/socket.h:450: previous declaration of `accept' > configure:10965: warning: data definition has no type or storage class > configure:10986: $? = 1 > configure: failed program was: > #line 10958 "configure" > #include "confdefs.h" > #ifdef HAVE_SYS_TYPES_H > #include <sys/types.h> > #endif > #ifdef HAVE_SYS_SOCKET_H > #include <sys/socket.h> > #endif > extern unsigned int PASCAL accept (unsigned int, void *, unsigned int *); > #ifdef F77_DUMMY_MAIN > # ifdef __cplusplus > extern "C" > # endif > int F77_DUMMY_MAIN() { return 1; } > #endif > int > main () > { > > ; > return 0; > } > configure:10983: gcc -c -O2 -fno-strict-aliasing conftest.c >&5 > In file included from /usr/include/netinet/in.h:41, > from /usr/include/sys/socket.h:203, > from configure:10963: > /usr/include/sys/stream.h:307: parse error before "projid_t" > configure:10965: parse error before "accept" > configure:10965: conflicting types for `accept' > /usr/include/sys/socket.h:450: previous declaration of `accept' > configure:10965: warning: data definition has no type or storage class > configure:10986: $? = 1 > configure: failed program was: > #line 10958 "configure" > #include "confdefs.h" > #ifdef HAVE_SYS_TYPES_H > #include <sys/types.h> > #endif > #ifdef HAVE_SYS_SOCKET_H > #include <sys/socket.h> > #endif > extern unsigned int PASCAL accept (unsigned int, void *, void *); > #ifdef F77_DUMMY_MAIN > # ifdef __cplusplus > extern "C" > # endif > int F77_DUMMY_MAIN() { return 1; } > #endif > int > main () > { > > ; > return 0; > } > configure:11006: error: could not determine argument types > >
Thanh Q Lam <thanh.q.lam@alcatel.com> writes: > when I run: ./configure --without-readline, I get errors that aborts the > configure process: "checking types of arguments for accept()... > configure: error: could not determine argument types". >> In file included from /usr/include/netinet/in.h:41, >> from /usr/include/sys/socket.h:203, >> from configure:10963: >> /usr/include/sys/stream.h:307: parse error before "projid_t" >> configure:10965: parse error before "accept" >> configure:10965: conflicting types for `accept' >> /usr/include/sys/socket.h:450: previous declaration of `accept' >> configure:10965: warning: data definition has no type or storage class Hmm --- the "parse error" suggests that sys/socket.h on your platform has some inclusion dependency that we are failing to provide for. Can you find out what it is? (Hint: look for "projid_t") regards, tom lane
Hi Tom, Thanks for your quick reply! I have looked into those system header files, and don't know what they're for because I'm not a C programmer :-( Following is the Data block descriptor in the stream.h file that declares the projid_t. Thanks again, Thanh /* * Data block descriptor * * NOTE: db_base, db_lim, db_ref and db_type are the *only* public fields, * as described in datab(9S). Everything else is implementation-private. */ #define DBLK_REFMAX 255U typedef struct datab { frtn_t *db_frtnp; unsigned char *db_base; unsigned char *db_lim; unsigned char db_ref; unsigned char db_type; unsigned char db_flags; unsigned char db_struioflag; void *db_cache; /* kmem cache descriptor */ struct msgb *db_mblk; void (*db_free)(struct msgb *, struct datab *); void (*db_lastfree)(struct msgb *, struct datab *); #ifndef _LP64 void *db_pad; /* unused -- needed for alignment*/ #endif unsigned char *db_struiobase; unsigned char *db_struiolim; unsigned char *db_struioptr; union { double enforce_alignment; unsigned char data[8]; unsigned u16:16; /* used to store hw-calculated cksum */ /* * Union used for future extensions (pointer to data ?). */ } db_struioun; fthdr_t *db_fthdr; ftflw_t ***db_ftflw; uid_t db_uid; /* Effective userid */ /* project ID - EXPERIMENTAL - may change in future release */ projid_t db_projid; } dblk_t; Tom Lane wrote: Thanh Q Lam <thanh.q.lam@alcatel.com> writes: when I run: ./configure --without-readline, I get errors that aborts the configure process: "checking types of arguments for accept()... configure: error: could not determine argument types". In file included from /usr/include/netinet/in.h:41, from /usr/include/sys/socket.h:203, from configure:10963: /usr/include/sys/stream.h:307: parse error before "projid_t" configure:10965: parse error before "accept" configure:10965: conflicting types for `accept' /usr/include/sys/socket.h:450: previous declaration of `accept' configure:10965: warning: data definition has no type or storage class Hmm --- the "parse error" suggests that sys/socket.h on your platform has some inclusion dependency that we are failing to provide for. Can you find out what it is? (Hint: look for "projid_t") regards, tom lane
On Tue, Jul 05, 2005 at 02:25:07PM -0400, Tom Lane wrote: > > Hmm --- the "parse error" suggests that sys/socket.h on your platform > has some inclusion dependency that we are failing to provide for. Can > you find out what it is? (Hint: look for "projid_t") I wonder what's different between Thanh's Solaris 9 box and mine. Mine's a sparc with all recommended patches; my compiler is gcc 3.4.2. I can build all versions of PostgreSQL from 7.2 through HEAD (all from CVS) without any problems. What version of PostgreSQL is this? Based on the line numbers in the configure script I'd guess 7.4.X. -- Michael Fuhr http://www.fuhr.org/~mfuhr/
Michael Fuhr <mike@fuhr.org> writes: > On Tue, Jul 05, 2005 at 02:25:07PM -0400, Tom Lane wrote: >> Hmm --- the "parse error" suggests that sys/socket.h on your platform >> has some inclusion dependency that we are failing to provide for. Can >> you find out what it is? (Hint: look for "projid_t") > I wonder what's different between Thanh's Solaris 9 box and mine. It would be useful for you guys to compare the results of cd /usr/include grep projid_t *.h */*.h regards, tom lane
On Tue, Jul 05, 2005 at 03:27:49PM -0400, Tom Lane wrote: > Michael Fuhr <mike@fuhr.org> writes: > > I wonder what's different between Thanh's Solaris 9 box and mine. > > It would be useful for you guys to compare the results of > > cd /usr/include > grep projid_t *.h */*.h Results from my box attached. Here are some other tidbits: % ls -l `grep -l projid_t *.h */*.h` -rw-r--r-- 1 root bin 18587 Apr 6 2002 nss_dbdefs.h -rw-r--r-- 1 root bin 1681 Apr 6 2002 project.h -rw-r--r-- 1 root bin 4129 May 23 2002 sys/exacct_impl.h -rw-r--r-- 1 root bin 31559 Mar 18 2004 sys/procfs.h -rw-r--r-- 1 root bin 1063 Apr 6 2002 sys/project.h -rw-r--r-- 1 root bin 25923 Mar 18 2004 sys/stream.h -rw-r--r-- 1 root bin 1890 Apr 6 2002 sys/task.h -rw-r--r-- 1 root bin 16231 May 17 09:51 sys/types.h -rw-r--r-- 1 root bin 3530 Apr 6 2002 userdefs.h % what `grep -l projid_t *.h */*.h` nss_dbdefs.h: nss_dbdefs.h 1.32 01/02/08 SMI project.h: project.h 1.3 01/09/14 SMI userdefs.h: userdefs.h 1.13 01/09/20 SMI sys/exacct_impl.h: exacct_impl.h 1.4 02/03/15 SMI sys/procfs.h: procfs.h 1.23 02/10/08 SMI sys/project.h: project.h 1.4 01/09/07 SMI sys/stream.h: stream.h 1.92 03/01/28 SMI sys/task.h: task.h 1.3 01/04/05 SMI sys/types.h: types.h 1.75 04/01/06 SMI -- Michael Fuhr http://www.fuhr.org/~mfuhr/
Attachment
Michael Fuhr <mike@fuhr.org> writes: > sys/types.h:typedef id_t projid_t; Well, we certainly include sys/types.h before including sys/socket.h. I wonder if the problem is that that typedef is inside an #if that for some reason is not firing on Thanh's setup? regards, tom lane
On Tue, Jul 05, 2005 at 01:46:42PM -0600, Michael Fuhr wrote: > On Tue, Jul 05, 2005 at 03:27:49PM -0400, Tom Lane wrote: > > Michael Fuhr <mike@fuhr.org> writes: > > > I wonder what's different between Thanh's Solaris 9 box and mine. > > > > It would be useful for you guys to compare the results of > > > > cd /usr/include > > grep projid_t *.h */*.h > > Results from my box attached. I just ran truss on gcc and noticed that it's reading <sys/types.h> from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/include/sys/types.h instead of from /usr/include/sys/types.h. I don't know if that matters; I've attached the diff of the two. Thanh, what compiler are you using? -- Michael Fuhr http://www.fuhr.org/~mfuhr/
Attachment
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-15"> Hi Tom/Michael, To answer Michael's question, I'm trying to install 7.4.8 on Solaris 9. I tried 8.0 which failed at the same problem. Here is the result of grep from my box: nsmapp1{postgres}: usr/include> grep projid_t *.h */*.h nss_dbdefs.h: projid_t projid; project.h: projid_t pj_projid; /* numerical project id */ project.h:extern struct project *getprojbyid(projid_t, struct project *, void *, size_t); project.h:extern projid_t getprojidbyname(const char *); project.h:extern projid_t getprojid(void); project.h:extern projid_t setproject(const char *, const char *, int); project.h:extern int project_walk(int (*)(projid_t, void *), void *); userdefs.h: projid_t defproj; /* default project id */ sys/exacct_impl.h: projid_t pu_projid; /* project ID */ sys/exacct_impl.h: projid_t fu_projid; /* project ID */ sys/procfs.h: projid_t pr_projid; /* project id */ sys/procfs.h: projid_t pr_projid; /* project id */ sys/project.h: projid_t kpj_id; /* project ID */ sys/project.h:kproject_t *project_hold_by_id(projid_t, int); sys/project.h:projid_t curprojid(void); sys/stream.h: projid_t db_projid; sys/task.h:extern task_t *task_create(projid_t); sys/task.h:extern taskid_t settaskid(projid_t, uint_t); sys/types.h:typedef id_t projid_t; nsmapp1{postgres}: usr/include> ls -l `grep -l projid_t *.h */*.h` -rw-r--r-- 1 root bin 18587 Apr 6 2002 nss_dbdefs.h -rw-r--r-- 1 root bin 1681 Apr 6 2002 project.h -rw-r--r-- 1 root bin 4129 May 23 2002 sys/exacct_impl.h -rw-r--r-- 1 root bin 31559 Mar 18 2004 sys/procfs.h -rw-r--r-- 1 root bin 1063 Apr 6 2002 sys/project.h -rw-r--r-- 1 root bin 25923 Mar 18 2004 sys/stream.h -rw-r--r-- 1 root bin 1890 Apr 6 2002 sys/task.h -rw-r--r-- 1 root bin 16231 May 3 11:40 sys/types.h -rw-r--r-- 1 root bin 3530 Apr 6 2002 userdefs.h nsmapp1{postgres}: usr/include> what `grep -l projid_t *.h */*.h` nss_dbdefs.h: nss_dbdefs.h 1.32 01/02/08 SMI project.h: project.h 1.3 01/09/14 SMI userdefs.h: userdefs.h 1.13 01/09/20 SMI sys/exacct_impl.h: exacct_impl.h 1.4 02/03/15 SMI sys/procfs.h: procfs.h 1.23 02/10/08 SMI sys/project.h: project.h 1.4 01/09/07 SMI sys/stream.h: stream.h 1.92 03/01/28 SMI sys/task.h: task.h 1.3 01/04/05 SMI sys/types.h: types.h 1.75 04/01/06 SMI Michael Fuhr wrote: On Tue, Jul 05, 2005 at 03:27:49PM -0400, Tom Lane wrote: Michael Fuhr <mike@fuhr.org> writes: I wonder what's different between Thanh's Solaris 9 box and mine. It would be useful for you guys to compare the results of cd /usr/include grep projid_t *.h */*.h Results from my box attached. Here are some other tidbits: % ls -l `grep -l projid_t *.h */*.h` -rw-r--r-- 1 root bin 18587 Apr 6 2002 nss_dbdefs.h -rw-r--r-- 1 root bin 1681 Apr 6 2002 project.h -rw-r--r-- 1 root bin 4129 May 23 2002 sys/exacct_impl.h -rw-r--r-- 1 root bin 31559 Mar 18 2004 sys/procfs.h -rw-r--r-- 1 root bin 1063 Apr 6 2002 sys/project.h -rw-r--r-- 1 root bin 25923 Mar 18 2004 sys/stream.h -rw-r--r-- 1 root bin 1890 Apr 6 2002 sys/task.h -rw-r--r-- 1 root bin 16231 May 17 09:51 sys/types.h -rw-r--r-- 1 root bin 3530 Apr 6 2002 userdefs.h % what `grep -l projid_t *.h */*.h` nss_dbdefs.h: nss_dbdefs.h 1.32 01/02/08 SMI project.h: project.h 1.3 01/09/14 SMI userdefs.h: userdefs.h 1.13 01/09/20 SMI sys/exacct_impl.h: exacct_impl.h 1.4 02/03/15 SMI sys/procfs.h: procfs.h 1.23 02/10/08 SMI sys/project.h: project.h 1.4 01/09/07 SMI sys/stream.h: stream.h 1.92 03/01/28 SMI sys/task.h: task.h 1.3 01/04/05 SMI sys/types.h: types.h 1.75 04/01/06 SMI nss_dbdefs.h: projid_t projid; project.h: projid_t pj_projid; /* numerical project id */ project.h:extern struct project *getprojbyid(projid_t, struct project *, void *, size_t); project.h:extern projid_t getprojidbyname(const char *); project.h:extern projid_t getprojid(void); project.h:extern projid_t setproject(const char *, const char *, int); project.h:extern int project_walk(int (*)(projid_t, void *), void *); userdefs.h: projid_t defproj; /* default project id */ sys/exacct_impl.h: projid_t pu_projid; /* project ID */ sys/exacct_impl.h: projid_t fu_projid; /* project ID */ sys/procfs.h: projid_t pr_projid; /* project id */ sys/procfs.h: projid_t pr_projid; /* project id */ sys/project.h: projid_t kpj_id; /* project ID */ sys/project.h:kproject_t *project_hold_by_id(projid_t, int); sys/project.h:projid_t curprojid(void); sys/stream.h: projid_t db_projid; sys/task.h:extern task_t *task_create(projid_t); sys/task.h:extern taskid_t settaskid(projid_t, uint_t); sys/types.h:typedef id_t projid_t;
Michael Fuhr <mike@fuhr.org> writes: > I just ran truss on gcc and noticed that it's reading <sys/types.h> > from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/include/sys/types.h > instead of from /usr/include/sys/types.h. I don't know if that > matters; I've attached the diff of the two. Good catch. The diffs in this file don't seem relevant to our problem, but maybe there are other substituted headers that *are* relevant (such as ones defining symbols that are used in #if's in this header...) regards, tom lane
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-15"> My compiler is gcc 3.2. Thanks, Thanh Michael Fuhr wrote: On Tue, Jul 05, 2005 at 02:25:07PM -0400, Tom Lane wrote: Hmm --- the "parse error" suggests that sys/socket.h on your platform has some inclusion dependency that we are failing to provide for. Can you find out what it is? (Hint: look for "projid_t") I wonder what's different between Thanh's Solaris 9 box and mine. Mine's a sparc with all recommended patches; my compiler is gcc 3.4.2. I can build all versions of PostgreSQL from 7.2 through HEAD (all from CVS) without any problems. What version of PostgreSQL is this? Based on the line numbers in the configure script I'd guess 7.4.X.
Thanh Q Lam <thanh.q.lam@alcatel.com> writes: > My compiler is gcc 3.2. I wonder if the problem is that the modified system header files used by your copy of gcc are too far out of sync with the actual headers under /usr/include. Michael indicates he's using gcc 3.4.2 which'd presumably be a lot newer build, and probably derived from newer /usr/include files. You might try updating the gcc installation, or running the fixincludes script to re-sync the modified headers with /usr/include. regards, tom lane