Thread: 7.4.2 Build broken on (Sparc) Solaris 7 and 8
Hi, Environment: SunOS 5.8 Generic_108528-27 sun4u sparc SUNW,Ultra-250 gcc version 3.3.1 PostgreSQL-7.4.2 ./configure --with-java--enable-thread-safety "make" results in: gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes -Wmissing-declarations -fPIC -I. -I../../../src/include -DFRONTEND -DSYSCONFDIR='"/usr/local/pgsql/etc"' -c -o thread.o thread.c thread.c: In function `pqGetpwuid': thread.c:116:error: too many arguments to function `getpwuid_r' Environment: SunOS 5.7 Generic_106541-29 sun4u sparc SUNW,UltraSPARC-IIi-Engine gcc version 3.3.1 PostgreSQL-7.4.2 ./configure--with-java --enable-thread-safety "make' results in: gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes -Wmissing-declarations -fPIC -I. -I../../../src/include -DFRONTEND -DSYSCONFDIR='"/usr/local/pgsql/etc"' -c -o thread.o thread.c thread.c: In function `pqGetpwuid': thread.c:116:error: too many arguments to function `getpwuid_r' thread.c: In function `pqGethostbyname': thread.c:189:error: `resbuf' undeclared (first use in this function) thread.c:189: error: (Each undeclared identifier isreported only once thread.c:189: error: for each function it appears in.) Diff'ing thread.c between 7.4.1 and 7.4.2, it *looks* like, at first blush, nothing changed that should affect the relevant code. Anybody got any idea what's broken? Regards, Jim -- Jim Seymour | PGP Public Key available at: jseymour@LinxNet.com | http://www.uk.pgp.net/pgpnet/pks-commands.html http://jimsun.LinxNet.com |
jseymour@LinxNet.com (Jim Seymour) writes: > Diff'ing thread.c between 7.4.1 and 7.4.2, it *looks* like, at first > blush, nothing changed that should affect the relevant code. > Anybody got any idea what's broken? The relevant change is probably this one: 2004-02-11 12:32 momjian * configure, configure.in, src/include/pg_config.h.in(REL7_4_STABLE): Properly set NEED_REENTRANT_FUNCS for threadedlibpq/ecpg.Withoutthis patch, no thread locking or *_r functions were beingused. (I also see some post-7.4.1 changes in src/template/solaris, so you possibly should look there too.) I'm betting that thread.c never worked on your platform, but wasn't compiled before. Easiest answer is probably to not do --enable-thread-safety. If you really want that, you'll need to dig in and figure out how to make that code work on your platform. Send a patch if you figure it out. regards, tom lane
Tom Lane <tgl@sss.pgh.pa.us> wrote: > [snip] > > (I also see some post-7.4.1 changes in src/template/solaris, so you > possibly should look there too.) [snip] > I think I have the fix for part of it, but this remains... gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes -Wmissing-declarations -fPIC -I. -I../../../src/include -D_POSIX_PTHREAD_SEMANTICS -DFRONTEND -DSYSCONFDIR='"/usr/local/pgsql/etc"' -c -o thread.o thread.c thread.c: In function`pqGethostbyname': thread.c:189: error: `resbuf' undeclared (first use in this function) Looking at src/port/thread.c, line 189, it looks like somebody typo'd. Looks like that second parameter should be "resultbuf", not "resbuf"? The above compile error happens on Solaris 7, but not Solaris 8. So next I have to see why the difference and if there *should* be a difference. But I still suspect the above is a coding error. Let me know and, if so, I'll fix it here, look into the other part, and submit a patch for it all. Regards, Jim
Thanks. Fix applied to CVS head and 7.4.X. --------------------------------------------------------------------------- Jim Seymour wrote: > Tom Lane <tgl@sss.pgh.pa.us> wrote: > > > [snip] > > > > (I also see some post-7.4.1 changes in src/template/solaris, so you > > possibly should look there too.) > [snip] > > > > I think I have the fix for part of it, but this remains... > > gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes > -Wmissing-declarations -fPIC -I. -I../../../src/include > -D_POSIX_PTHREAD_SEMANTICS -DFRONTEND > -DSYSCONFDIR='"/usr/local/pgsql/etc"' -c -o thread.o thread.c > thread.c: In function `pqGethostbyname': > thread.c:189: error: `resbuf' undeclared (first use in this function) > > Looking at src/port/thread.c, line 189, it looks like somebody typo'd. > Looks like that second parameter should be "resultbuf", not "resbuf"? > > The above compile error happens on Solaris 7, but not Solaris 8. So > next I have to see why the difference and if there *should* be a > difference. But I still suspect the above is a coding error. Let me > know and, if so, I'll fix it here, look into the other part, and submit > a patch for it all. > > Regards, > Jim > > > > ---------------------------(end of broadcast)--------------------------- > TIP 7: don't forget to increase your free space map settings > -- 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, Pennsylvania19073