cygwin 8.0.0beta1 postmaster/syslogger.c, port/dirmod.c, timezone/pgtz.c
Attached patches are required for cygwin:
2004-08-24 21:23:53 rurban@x-ray.at
* (postmaster/syslogger.c) struct timeval is
declared in sys/time.h, not in time.h
2004-08-24 20:20:54 rurban:
* (port/dirmod.c) cygwin needs different header locations,
and unlink is a macro. There are no pgport_palloc
versions yet
timezone/pgtz.c:
Pending is a patch against postgresql-8.0.0beta1/config/c-library.m4:
PGAC_VAR_INT_TIMEZONE
In the meantime I've hacked it with a cast from time_t to (int) in
timezone/pgtz.c: get_timezone_offset
but timezone really is of time_t, not int. I don't know what you are
trying to do here.
There's on remaining issue for the cygwin build:
../../src/port/libpgport.a(dirmod.o)(.text+0x5ee):dirmod.c: undefined
reference to `__imp__CurrentMemoryContext'
../../src/port/libpgport.a(dirmod.o)(.text+0x64b):dirmod.c: undefined
reference to `__imp__CurrentMemoryContext'
which explains the pgport_palloc problem.
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/
On Tue, Aug 24, 2004 at 09:49:51PM +0200, Reini Urban wrote:
There's on remaining issue for the cygwin build:
../../src/port/libpgport.a(dirmod.o)(.text+0x5ee):dirmod.c: undefined
reference to `__imp__CurrentMemoryContext'
../../src/port/libpgport.a(dirmod.o)(.text+0x64b):dirmod.c: undefined
reference to `__imp__CurrentMemoryContext'
Note I have no experience with 8.0 so the following is a WAG...
The above is likely caused by not linking against an import library
(i.e., libpostgres.a).
HTH,
Jason
--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6
Jason Tishler schrieb:
On Tue, Aug 24, 2004 at 09:49:51PM +0200, Reini Urban wrote:
There's on remaining issue for the cygwin build:
../../src/port/libpgport.a(dirmod.o)(.text+0x5ee):dirmod.c: undefined
reference to `__imp__CurrentMemoryContext'
../../src/port/libpgport.a(dirmod.o)(.text+0x64b):dirmod.c: undefined
reference to `__imp__CurrentMemoryContext'Note I have no experience with 8.0 so the following is a WAG...
The above is likely caused by not linking against an import library
(i.e., libpostgres.a).
Yes, it is defined in libpostgres.a. Hmm, a cross-dependency problem in
the Makefile. With an added -lpostgres postgres.exe builds fine.
But I'll try to add the single object file only where it is defined.
I also see that it is still linking against cygipc.
LIBS=-lintl -lssl -lcrypto -lz -lreadline -lcygipc -lcrypt -lresolv -lm
Do we still need this? As I see it, pgsql has its own ipc mechanism.
Without -lcygipc it also builds fine. ...
I'm quite willing to help to ensure a smooth transition and to help
minimize your "pain." :,) Maybe 8.0 can be a joint effort, with you
taking over fully with 8.0.x or 8.1?
Sure, why not?
But I'm also trying to build the 7.4.5 now, because I want to see the
changes in the new 8 branch. So you can sit and have a rest. :)
From another thread...
Is "--with-template=cygwin" required? It wasn't before.
Yes, this is apparently new for 8.x.
And it does help to be precise in the configure line.
BTW: I will convert your build.sh to the cygwin generic-build-script
system. This is much easier.
Does "--with-tcl" no longer build cleanly?
This wasn't in your 7.4.3 build.sh included and I didn't install the
tcl/tk sources (only under my perltk tree). But I can have a try.
I have tclsh, the headers and the libs, just a tclConfig.sh script is
missing from the cygwin build. Should not be that hard. All the libs and
includes are at the standard paths.
I'll finish the 8.0.0-beta1 port to cygwin, and post to the patches list
then the cumulative patches. Questions to pgsql-hackers or pgsql-cygwin?
The 8.x build is almost okay now. Just a remaining libreadline issue in
src/bin/psql/tab-complete.c
And testing.
And sockets would also be fine.
$ postgresql-8.0.0beta1-1/src/backend/postgres.exe
FATAL: unrecognized configuration parameter "tcpip_socket"
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/
Reini,
On Wed, Aug 25, 2004 at 01:12:46AM +0200, Reini Urban wrote:
Jason Tishler schrieb:
On Tue, Aug 24, 2004 at 09:49:51PM +0200, Reini Urban wrote:
There's on remaining issue for the cygwin build:
../../src/port/libpgport.a(dirmod.o)(.text+0x5ee):dirmod.c: undefined
reference to `__imp__CurrentMemoryContext'
../../src/port/libpgport.a(dirmod.o)(.text+0x64b):dirmod.c: undefined
reference to `__imp__CurrentMemoryContext'Note I have no experience with 8.0 so the following is a WAG...
The above is likely caused by not linking against an import library
(i.e., libpostgres.a).Yes, it is defined in libpostgres.a. Hmm, a cross-dependency problem in
the Makefile. With an added -lpostgres postgres.exe builds fine.
In previous versions, postgres.exe built fine without -lpostgres. Other
components needed to link with libpostgres.a -- not postgres.exe. As
you indicated above, seems like there is a cross-dependency issue
introduced in 8.0.
But I'll try to add the single object file only where it is defined.
IMO, linking against libpostgres.a is preferable assuming the
cross-dependency issue cannot be solved.
I also see that it is still linking against cygipc.
LIBS=-lintl -lssl -lcrypto -lz -lreadline -lcygipc -lcrypt -lresolv -lm
The shouldn't happen. Do you have cygipc installed? If so, then
uninstall and try again. Any better?
Do we still need this?
AFAICT, no.
As I see it, pgsql has its own ipc mechanism.
Does the above imply that 8.0 will not need the IPC in cygserver?
Without -lcygipc it also builds fine. ...
Yes. For example, 7.4.3 build fine against cygserver.
I'm quite willing to help to ensure a smooth transition and to help
minimize your "pain." :,) Maybe 8.0 can be a joint effort, with you
taking over fully with 8.0.x or 8.1?Sure, why not?
Thanks!
But I'm also trying to build the 7.4.5 now, because I want to see the
changes in the new 8 branch. So you can sit and have a rest. :)
Thanks again. I can use the rest. :,)
From another thread...
Is "--with-template=cygwin" required? It wasn't before.
Yes, this is apparently new for 8.x.
OK, I was just surprised that configure didn't automatically detect the
platform.
And it does help to be precise in the configure line.
Precise is good -- redundant is not necessarily good.
BTW: I will convert your build.sh to the cygwin generic-build-script
system. This is much easier.
OK.
Does "--with-tcl" no longer build cleanly?
This wasn't in your 7.4.3 build.sh included and I didn't install the
tcl/tk sources (only under my perltk tree).
Sorry, for the above. I temporarily forgot that Cygwin PostgreSQL has
TCL issues.
But I can have a try.
OK, but IMO I would address the other issues first since Cygwin
PostgreSQL never supported TCL in the past. BTW, check the archives,
Patrick Samson and I have made some progress in the past.
I have tclsh, the headers and the libs, just a tclConfig.sh script is
missing from the cygwin build. Should not be that hard. All the libs and
includes are at the standard paths.
It may be harder than anticipated -- remember the Cygwin Tcl/Tk package
is really a native Win32 package not a Cygwin one... :,(
I'll finish the 8.0.0-beta1 port to cygwin,
Thanks.
and post to the patches list then the cumulative patches
Sounds good.
Questions to pgsql-hackers or pgsql-cygwin?
Depends on the question. :,)
The 8.x build is almost okay now. Just a remaining libreadline issue in
src/bin/psql/tab-complete.c
And testing.
Let me know how is goes.
And sockets would also be fine.
$ postgresql-8.0.0beta1-1/src/backend/postgres.exe
FATAL: unrecognized configuration parameter "tcpip_socket"
See the following:
http://archives.postgresql.org/pgsql-general/2004-08/msg01181.php
Thanks,
Jason
--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6
Attached is my 7.4.5 build script,
not yet converted to the new generic-build-script mechanism.
In order to fix the tcl issues I needed perl.
There are still minor tcl issues, but I'll fix them soon.
There's another short Makefile.cygwin patch to build contrib/dbase
correctly. Hope this will be accepted (or looked at) upstream.
With the standard order of libs from configure it will fail, because our
libiconv is shared.
With just the needed libs in the correct order it builds fine:
$ gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes
-Wmissing-declarations dbf.o dbf2pg.o endian.o -lpq -L../../src/port
-lpgport -lintl -o dbf2pg
*************************
The first standard regression test attempt (--max-connections=10) failed
with:
creating template1 database in
/usr/src/postgresql/postgresql-7.4.5-1/src/test/regress/./tmp_check/data/base/1...
FATAL: could not create shared memory segment: Function not implemented
DETAIL: Failed system call was shmget(key=1, size=1081344, 03600).
Seems to be a cygserver issue. cygserver is running as service.
I'll hunt that down, but looks strange. Seems that I really linked
against cygipc and so it doesn't use cygserver :(
$ tmp_check/install/usr/bin/initdb -D "tmp_check/data" -L
tmp_check/install/usr/share/postgresql --debug --no-locale -E Latin1
creating template1 database in tmp_check/data/base/1... DEBUG: invoking
IpcMemoryCreate(size=1081344)
FATAL: could not create shared memory segment: Function not implemented
DETAIL: Failed system call was shmget(key=1, size=1081344, 03600).
Jason Tishler schrieb:
On Wed, Aug 25, 2004 at 01:12:46AM +0200, Reini Urban wrote:
Jason Tishler schrieb:
On Tue, Aug 24, 2004 at 09:49:51PM +0200, Reini Urban wrote:
There's on remaining issue for the cygwin build:
../../src/port/libpgport.a(dirmod.o)(.text+0x5ee):dirmod.c: undefined
reference to `__imp__CurrentMemoryContext'
../../src/port/libpgport.a(dirmod.o)(.text+0x64b):dirmod.c: undefined
reference to `__imp__CurrentMemoryContext'Note I have no experience with 8.0 so the following is a WAG...
The above is likely caused by not linking against an import library
(i.e., libpostgres.a).Yes, it is defined in libpostgres.a. Hmm, a cross-dependency problem in
the Makefile. With an added -lpostgres postgres.exe builds fine.In previous versions, postgres.exe built fine without -lpostgres. Other
components needed to link with libpostgres.a -- not postgres.exe. As
you indicated above, seems like there is a cross-dependency issue
introduced in 8.0.
It's just one simple backend object file, so I'll try to hunt that down
later. So the developers can fix their Makefile also.
But I'll try to add the single object file only where it is defined.
IMO, linking against libpostgres.a is preferable assuming the
cross-dependency issue cannot be solved.I also see that it is still linking against cygipc.
LIBS=-lintl -lssl -lcrypto -lz -lreadline -lcygipc -lcrypt -lresolv -lmThe shouldn't happen. Do you have cygipc installed? If so, then
uninstall and try again. Any better?
That is probably some left-over autoconf issue.
Do we still need this?
AFAICT, no.
As I see it, pgsql has its own ipc mechanism.
Does the above imply that 8.0 will not need the IPC in cygserver?
Looks like so, but I'll check later. First I want to finish 7.4.5
because of the pending perl problems.
Without -lcygipc it also builds fine. ...
Yes. For example, 7.4.3 build fine against cygserver.
I'm quite willing to help to ensure a smooth transition and to help
minimize your "pain." :,) Maybe 8.0 can be a joint effort, with you
taking over fully with 8.0.x or 8.1?Sure, why not?
Thanks!
But I'm also trying to build the 7.4.5 now, because I want to see the
changes in the new 8 branch. So you can sit and have a rest. :)Thanks again. I can use the rest. :,)
From another thread...
Is "--with-template=cygwin" required? It wasn't before.
Yes, this is apparently new for 8.x.
OK, I was just surprised that configure didn't automatically detect the
platform.And it does help to be precise in the configure line.
Precise is good -- redundant is not necessarily good.
BTW: I will convert your build.sh to the cygwin generic-build-script
system. This is much easier.OK.
Does "--with-tcl" no longer build cleanly?
This wasn't in your 7.4.3 build.sh included and I didn't install the
tcl/tk sources (only under my perltk tree).Sorry, for the above. I temporarily forgot that Cygwin PostgreSQL has
TCL issues.But I can have a try.
OK, but IMO I would address the other issues first since Cygwin
PostgreSQL never supported TCL in the past. BTW, check the archives,
Patrick Samson and I have made some progress in the past.I have tclsh, the headers and the libs, just a tclConfig.sh script is
missing from the cygwin build. Should not be that hard. All the libs and
includes are at the standard paths.It may be harder than anticipated -- remember the Cygwin Tcl/Tk package
is really a native Win32 package not a Cygwin one... :,(I'll finish the 8.0.0-beta1 port to cygwin,
Thanks.
and post to the patches list then the cumulative patches
Sounds good.
Questions to pgsql-hackers or pgsql-cygwin?
Depends on the question. :,)
The 8.x build is almost okay now. Just a remaining libreadline issue in
src/bin/psql/tab-complete.c
And testing.Let me know how is goes.
Uh, this was my old readline lib leftover in /usr/local/lib
It builds fine now.
And sockets would also be fine.
$ postgresql-8.0.0beta1-1/src/backend/postgres.exe
FATAL: unrecognized configuration parameter "tcpip_socket"See the following:
http://archives.postgresql.org/pgsql-general/2004-08/msg01181.php
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/
Attachments:
build.shtext/plain; name=build.shDownload+11-0
Reini,
On Wed, Aug 25, 2004 at 04:13:29PM +0200, Reini Urban wrote:
Attached is my 7.4.5 build script,
not yet converted to the new generic-build-script mechanism.In order to fix the tcl issues I needed perl.
There are still minor tcl issues, but I'll fix them soon.
IMO, I would hold off on Tcl until 8.0 in order to get 7.4.5 out ASAP.
There's another short Makefile.cygwin patch to build contrib/dbase
correctly. Hope this will be accepted (or looked at) upstream.
Sending patches to pgsql-patches@ is a better way to get noticed. :,)
With the standard order of libs from configure it will fail, because
our libiconv is shared.
With just the needed libs in the correct order it builds fine:
$ gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes
-Wmissing-declarations dbf.o dbf2pg.o endian.o -lpq -L../../src/port
-lpgport -lintl -o dbf2pg
dbf2pg from 7.4.3 built cleanly for me:
gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes -Wmissing-declarations dbf.o dbf2pg.o endian.o -L../../src/interfaces/libpq -lpq -L../../src/port -L/usr/local/lib -lssl -lcrypto -lz -lreadline -lcrypt -lpgport -o dbf2pg
Why is it failing for you?
The first standard regression test attempt (--max-connections=10)
failed with:
I recommend using the following:
make MAX_CONNECTIONS=1 check
I certainly wouldn't use MAX_CONNECTIONS > 5 as indicated in the README.
[snip]
Seems to be a cygserver issue. cygserver is running as service. I'll
hunt that down, but looks strange. Seems that I really linked against
cygipc and so it doesn't use cygserver :(
Hmm... What does cygcheck indicate?
Thanks,
Jason
--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6
ok, postgresql-7.4.5-1 is ready.
The problems were cygipc related (of course), which I
patched away in configure.
All tests passed ok (besides one minor cr/lf issue. see attached)
The files are at
http://xarch.tu-graz.ac.at/home/rurban/software/cygwin/postgresql/postgresql-7.4.5-1/
just the setup.hint is missing. This is your (Jason) job :)
The src package is similar to your old setup,
(orisrc/ plus orisrc/CYGWIN-PATCHES/)
but it really should be changed to
<orisrc>.tar.bz2 and the build and patch file.
I'll to change that with the 8.0.0beta1 package.
Jason Tishler schrieb:
On Wed, Aug 25, 2004 at 04:13:29PM +0200, Reini Urban wrote:
Attached is my 7.4.5 build script,
not yet converted to the new generic-build-script mechanism.In order to fix the tcl issues I needed perl.
There are still minor tcl issues, but I'll fix them soon.IMO, I would hold off on Tcl until 8.0 in order to get 7.4.5 out ASAP.
There's another short Makefile.cygwin patch to build contrib/dbase
correctly. Hope this will be accepted (or looked at) upstream.Sending patches to pgsql-patches@ is a better way to get noticed. :,)
ok, I'll do.
With the standard order of libs from configure it will fail, because
our libiconv is shared.
With just the needed libs in the correct order it builds fine:
$ gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes
-Wmissing-declarations dbf.o dbf2pg.o endian.o -lpq -L../../src/port
-lpgport -lintl -o dbf2pgdbf2pg from 7.4.3 built cleanly for me:
gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes -Wmissing-declarations dbf.o dbf2pg.o endian.o -L../../src/interfaces/libpq -lpq -L../../src/port -L/usr/local/lib -lssl -lcrypto -lz -lreadline -lcrypt -lpgport -o dbf2pg
Why is it failing for you?
Because a had -lintl also, which is dynamically resolved.
your built doesn't use libintl.
I wanted to have nls support. :)
The first standard regression test attempt (--max-connections=10)
failed with:I recommend using the following:
make MAX_CONNECTIONS=1 check
I certainly wouldn't use MAX_CONNECTIONS > 5 as indicated in the README.
[snip]
Seems to be a cygserver issue. cygserver is running as service. I'll
hunt that down, but looks strange. Seems that I really linked against
cygipc and so it doesn't use cygserver :(Hmm... What does cygcheck indicate?
The problem was this autoconf line (configure.in):
AC_CHECK_LIB(cygipc, shmget)
we have now "native" cygwin shmget support. so this check is bogus.
we really should add a check if shmget is in sys/shm.h
something like
AC_CHECK_LIB(, shmget)
(untested)
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/
Attachments:
regression.diffstext/plain; name=regression.diffsDownload+8-8
Reini,
On Wed, Aug 25, 2004 at 08:09:26PM +0200, Reini Urban wrote:
ok, postgresql-7.4.5-1 is ready.
Thanks, but I'm going to upload a postgresql-7.4.5-1 shortly. Let's
transition maintainership in the 8.0 time frame.
The problems were cygipc related (of course), which I patched away in
configure.
AFAICT, there should not be any cygipc problems as long as it is not
installed on the build system.
All tests passed ok (besides one minor cr/lf issue. see attached)
horology fails for me too, but the failure is due to daylight saving
issues (i.e., PDT vs. PST) not a textmode issue.
just the setup.hint is missing. This is your (Jason) job :)
The setup.hint already on sources does not require any updating.
The src package is similar to your old setup,
(orisrc/ plus orisrc/CYGWIN-PATCHES/)
but it really should be changed to
<orisrc>.tar.bz2 and the build and patch file.I'll to change that with the 8.0.0beta1 package.
The above is fine -- just call me old fashioned... :,)
Jason Tishler schrieb:
Hmm... What does cygcheck indicate?
The problem was this autoconf line (configure.in):
AC_CHECK_LIB(cygipc, shmget)we have now "native" cygwin shmget support. so this check is bogus.
we really should add a check if shmget is in sys/shm.h
something like
AC_CHECK_LIB(, shmget)
AFAICT, the above change is not necessary:
checking for shmget in -lcygipc... no
...
checking sys/ipc.h usability... yes
checking sys/ipc.h presence... yes
checking for sys/ipc.h... yes
Jason
--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6
Jason Tishler schrieb:
On Wed, Aug 25, 2004 at 08:09:26PM +0200, Reini Urban wrote:
ok, postgresql-7.4.5-1 is ready.
Thanks, but I'm going to upload a postgresql-7.4.5-1 shortly. Let's
transition maintainership in the 8.0 time frame.
Super. So I can check tcl also.
Please also check my version of the cygwin README.
I added a "Whats new" section.
The new native win32 server is very good, but the cygwin port is much
more compatible to the unix version, and most people will prefer cygwin
as development platform. Just to test it.
AFAICT, the above change is not necessary:
checking for shmget in -lcygipc... no
...
checking sys/ipc.h usability... yes
checking sys/ipc.h presence... yes
checking for sys/ipc.h... yes
The problem is, that I still have cygipc installed, so it will find it,
even if cygserver is running.
Others maybe also. Call it defensive programming.
Anyway my postgresql-7.4.5-1 cygipc configure.in patch is pending, and
will be useful for the 8 series also.
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/
Reini,
On Thu, Aug 26, 2004 at 06:59:24PM +0200, Reini Urban wrote:
Jason Tishler schrieb:
On Wed, Aug 25, 2004 at 08:09:26PM +0200, Reini Urban wrote:
ok, postgresql-7.4.5-1 is ready.
Thanks, but I'm going to upload a postgresql-7.4.5-1 shortly. Let's
transition maintainership in the 8.0 time frame.Super. So I can check tcl also.
Please do. Building with Tcl is only the first step, I never got PL/Tcl
to work.
Please also check my version of the cygwin README. I added a "Whats
new" section.
Will do.
AFAICT, the above change is not necessary:
checking for shmget in -lcygipc... no
...
checking sys/ipc.h usability... yes
checking sys/ipc.h presence... yes
checking for sys/ipc.h... yesThe problem is, that I still have cygipc installed, so it will find
it, even if cygserver is running. Others maybe also. Call it
defensive programming.
If you are going to maintain Cygwin PostgreSQL, then I highly recommend
uninstalling the deprecated cygipc package.
Anyway my postgresql-7.4.5-1 cygipc configure.in patch is pending, and
will be useful for the 8 series also.
AFAICT, your configure.in patch has been rejected. Sorry, but I have to
agree with Peter.
Jason
--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6
Your patch highlighted several bugs in our code. First, I wasn't
testing for CYGWIN in the backend pgport_palloc code. Second, I added
an #undef to prevent compiler warnings. Third I added your Cygwin
includes with an #ifdef. These will appear in beta2.
On the timezone issue, I see this in dt.h:
/* Global variable holding time zone information. */
#if !defined(__CYGWIN__) && !defined(WIN32)
#define TIMEZONE_GLOBAL timezone
#else
#define TIMEZONE_GLOBAL _timezone
#define tzname _tzname /* should be in time.h? */
#endif
so are you saying your _timezone is time_t and not an int? Sometimes it
is just a short because it is only minutes west of GMT, not an actually
seconds since 1970 or anything. Making it time_t actually sounds like
overkill, but we can work around that in dt.h if indeed that is how your
OS defines it. The easiest fix would probably be to add the cast to int
right in dt.h and only for Cygwin:
#define TIMEZONE_GLOBAL ((int)_timezone)
Does that work for you?
---------------------------------------------------------------------------
Reini Urban wrote:
Attached patches are required for cygwin:
2004-08-24 21:23:53 rurban@x-ray.at
* (postmaster/syslogger.c) struct timeval is
declared in sys/time.h, not in time.h2004-08-24 20:20:54 rurban:
* (port/dirmod.c) cygwin needs different header locations,
and unlink is a macro. There are no pgport_palloc
versions yettimezone/pgtz.c:
Pending is a patch against postgresql-8.0.0beta1/config/c-library.m4:
PGAC_VAR_INT_TIMEZONEIn the meantime I've hacked it with a cast from time_t to (int) in
timezone/pgtz.c: get_timezone_offsetbut timezone really is of time_t, not int. I don't know what you are
trying to do here.There's on remaining issue for the cygwin build:
../../src/port/libpgport.a(dirmod.o)(.text+0x5ee):dirmod.c: undefined
reference to `__imp__CurrentMemoryContext'
../../src/port/libpgport.a(dirmod.o)(.text+0x64b):dirmod.c: undefined
reference to `__imp__CurrentMemoryContext'which explains the pgport_palloc problem.
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/
2004-08-24 20:20:54 rurban:
* cygwin needs different header locations, and unlink is a macro
* There are no pgport_palloc versions yet--- postgresql-8.0.0beta1/src/port/dirmod.c.orig 2004-08-08 07:44:36.000000000 +0100 +++ postgresql-8.0.0beta1/src/port/dirmod.c 2004-08-24 19:20:56.557435000 +0100 @@ -33,16 +33,28 @@#include "miscadmin.h" + +#ifdef __CYGWIN__ +#include <windows.h> +#include <w32api/winioctl.h> +#else #include <winioctl.h> +#undef unlink +#endif#undef rename
-#undef unlink+/* 2004-08-24 20:20:54 rurban: There are no pgport_palloc versions yet */ +#if 0 #ifndef FRONTEND +#undef palloc +#undef pstrdup +#undef pfree #define palloc(sz) pgport_palloc(sz) #define pstrdup(str) pgport_pstrdup(str) #define pfree(pointer) pgport_pfree(pointer) #endif +#endif/*
2004-08-24 21:23:53 rurban@x-ray.at
* struct timeval is declared in sys/time.h, not in time.h--- postgresql-8.0.0beta1/src/backend/postmaster/syslogger.c.orig 2004-08-06 20:17:31.000000000 +0100 +++ postgresql-8.0.0beta1/src/backend/postmaster/syslogger.c 2004-08-24 20:21:26.057851800 +0100 @@ -28,6 +28,7 @@ #include <signal.h> #include <time.h> #include <unistd.h> +#include <sys/time.h> #include <sys/stat.h>#include "libpq/pqsignal.h"
--- postgresql-8.0.0beta1/src/timezone/pgtz.c.orig 2004-07-31 20:12:15.000000000 +0100 +++ postgresql-8.0.0beta1/src/timezone/pgtz.c 2004-08-24 19:56:30.686367800 +0100 @@ -97,9 +97,9 @@ return tm->tm_gmtoff; #elif defined(HAVE_INT_TIMEZONE) #ifdef HAVE_UNDERSCORE_TIMEZONE - return -_timezone; + return -(int)_timezone; #else - return -timezone; + return -(int)timezone; #endif #else #error No way to determine TZ? Can this happen?
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match
--
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
Attachments:
/bjm/difftext/plainDownload+14-4
Bruce Momjian schrieb:
Your patch highlighted several bugs in our code. First, I wasn't
testing for CYGWIN in the backend pgport_palloc code. Second, I added
an #undef to prevent compiler warnings. Third I added your Cygwin
includes with an #ifdef. These will appear in beta2.On the timezone issue, I see this in dt.h:
/* Global variable holding time zone information. */
#if !defined(__CYGWIN__) && !defined(WIN32)
#define TIMEZONE_GLOBAL timezone
#else
#define TIMEZONE_GLOBAL _timezone
#define tzname _tzname /* should be in time.h? */
#endifso are you saying your _timezone is time_t and not an int? Sometimes it
is just a short because it is only minutes west of GMT, not an actually
seconds since 1970 or anything. Making it time_t actually sounds like
overkill, but we can work around that in dt.h if indeed that is how your
OS defines it. The easiest fix would probably be to add the cast to int
right in dt.h and only for Cygwin:#define TIMEZONE_GLOBAL ((int)_timezone)
Does that work for you?
yes, that's better.
FYI /usr/include/time.h:
/* defines for the opengroup specifications Derived from Issue 1 of the
SVID. */
extern __IMPORT time_t _timezone;
...
BTW: I see that CYGWIN also has a struct timezone in sys/time.h, but
configure didn't check for that.
I'll come with better patches after beta2.
---------------------------------------------------------------------------
Reini Urban wrote:
Attached patches are required for cygwin:
2004-08-24 21:23:53 rurban@x-ray.at
* (postmaster/syslogger.c) struct timeval is
declared in sys/time.h, not in time.h2004-08-24 20:20:54 rurban:
* (port/dirmod.c) cygwin needs different header locations,
and unlink is a macro. There are no pgport_palloc
versions yettimezone/pgtz.c:
Pending is a patch against postgresql-8.0.0beta1/config/c-library.m4:
PGAC_VAR_INT_TIMEZONEIn the meantime I've hacked it with a cast from time_t to (int) in
timezone/pgtz.c: get_timezone_offsetbut timezone really is of time_t, not int. I don't know what you are
trying to do here.There's on remaining issue for the cygwin build:
../../src/port/libpgport.a(dirmod.o)(.text+0x5ee):dirmod.c: undefined
reference to `__imp__CurrentMemoryContext'
../../src/port/libpgport.a(dirmod.o)(.text+0x64b):dirmod.c: undefined
reference to `__imp__CurrentMemoryContext'which explains the pgport_palloc problem.
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/2004-08-24 20:20:54 rurban:
* cygwin needs different header locations, and unlink is a macro
* There are no pgport_palloc versions yet--- postgresql-8.0.0beta1/src/port/dirmod.c.orig 2004-08-08 07:44:36.000000000 +0100 +++ postgresql-8.0.0beta1/src/port/dirmod.c 2004-08-24 19:20:56.557435000 +0100 @@ -33,16 +33,28 @@#include "miscadmin.h" + +#ifdef __CYGWIN__ +#include <windows.h> +#include <w32api/winioctl.h> +#else #include <winioctl.h> +#undef unlink +#endif#undef rename
-#undef unlink+/* 2004-08-24 20:20:54 rurban: There are no pgport_palloc versions yet */ +#if 0 #ifndef FRONTEND +#undef palloc +#undef pstrdup +#undef pfree #define palloc(sz) pgport_palloc(sz) #define pstrdup(str) pgport_pstrdup(str) #define pfree(pointer) pgport_pfree(pointer) #endif +#endif/*
2004-08-24 21:23:53 rurban@x-ray.at
* struct timeval is declared in sys/time.h, not in time.h--- postgresql-8.0.0beta1/src/backend/postmaster/syslogger.c.orig 2004-08-06 20:17:31.000000000 +0100 +++ postgresql-8.0.0beta1/src/backend/postmaster/syslogger.c 2004-08-24 20:21:26.057851800 +0100 @@ -28,6 +28,7 @@ #include <signal.h> #include <time.h> #include <unistd.h> +#include <sys/time.h> #include <sys/stat.h>#include "libpq/pqsignal.h"
--- postgresql-8.0.0beta1/src/timezone/pgtz.c.orig 2004-07-31 20:12:15.000000000 +0100 +++ postgresql-8.0.0beta1/src/timezone/pgtz.c 2004-08-24 19:56:30.686367800 +0100 @@ -97,9 +97,9 @@ return tm->tm_gmtoff; #elif defined(HAVE_INT_TIMEZONE) #ifdef HAVE_UNDERSCORE_TIMEZONE - return -_timezone; + return -(int)_timezone; #else - return -timezone; + return -(int)timezone; #endif #else #error No way to determine TZ? Can this happen?---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match------------------------------------------------------------------------
Index: src/backend/utils/mmgr/mcxt.c =================================================================== RCS file: /cvsroot/pgsql-server/src/backend/utils/mmgr/mcxt.c,v retrieving revision 1.47 diff -c -c -r1.47 mcxt.c *** src/backend/utils/mmgr/mcxt.c 8 Aug 2004 06:44:32 -0000 1.47 --- src/backend/utils/mmgr/mcxt.c 29 Aug 2004 02:50:25 -0000 *************** *** 631,637 **** }! #ifdef WIN32 /* * Memory support routines for libpgport on Win32 * --- 631,637 ---- }! #if defined(WIN32) || defined(__CYGWIN__) /* * Memory support routines for libpgport on Win32 * *************** *** 649,654 **** --- 649,655 ---- return palloc(sz); }+ char * pgport_pstrdup(const char *str) { Index: src/port/dirmod.c =================================================================== RCS file: /cvsroot/pgsql-server/src/port/dirmod.c,v retrieving revision 1.19 diff -c -c -r1.19 dirmod.c *** src/port/dirmod.c 29 Aug 2004 01:44:02 -0000 1.19 --- src/port/dirmod.c 29 Aug 2004 02:50:28 -0000 *************** *** 31,48 ****#if defined(WIN32) || defined(__CYGWIN__)
-
#include "miscadmin.h"
- #include <winioctl.h>#undef rename
#undef unlink#ifndef FRONTEND /* * Call non-macro versions of palloc, can't reference CurrentMemoryContext * because of DLLIMPORT. */ #define palloc(sz) pgport_palloc(sz) #define pstrdup(str) pgport_pstrdup(str) #define pfree(pointer) pgport_pfree(pointer) --- 31,57 ----#if defined(WIN32) || defined(__CYGWIN__)
#include "miscadmin.h"
#undef rename
#undef unlink+ #ifdef __WIN32__ + #include <winioctl.h> + #else + /* __CYGWIN__ */ + #include <windows.h> + #include <w32api/winioctl.h> + #endif + #ifndef FRONTEND /* * Call non-macro versions of palloc, can't reference CurrentMemoryContext * because of DLLIMPORT. */ + #undef palloc + #undef pstrdup + #undef pfree #define palloc(sz) pgport_palloc(sz) #define pstrdup(str) pgport_pstrdup(str) #define pfree(pointer) pgport_pfree(pointer)
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/
Should I apply this change?
#define TIMEZONE_GLOBAL ((int)_timezone)
---------------------------------------------------------------------------
Reini Urban wrote:
Bruce Momjian schrieb:
Your patch highlighted several bugs in our code. First, I wasn't
testing for CYGWIN in the backend pgport_palloc code. Second, I added
an #undef to prevent compiler warnings. Third I added your Cygwin
includes with an #ifdef. These will appear in beta2.On the timezone issue, I see this in dt.h:
/* Global variable holding time zone information. */
#if !defined(__CYGWIN__) && !defined(WIN32)
#define TIMEZONE_GLOBAL timezone
#else
#define TIMEZONE_GLOBAL _timezone
#define tzname _tzname /* should be in time.h? */
#endifso are you saying your _timezone is time_t and not an int? Sometimes it
is just a short because it is only minutes west of GMT, not an actually
seconds since 1970 or anything. Making it time_t actually sounds like
overkill, but we can work around that in dt.h if indeed that is how your
OS defines it. The easiest fix would probably be to add the cast to int
right in dt.h and only for Cygwin:#define TIMEZONE_GLOBAL ((int)_timezone)
Does that work for you?
yes, that's better.
FYI /usr/include/time.h:
/* defines for the opengroup specifications Derived from Issue 1 of the
SVID. */
extern __IMPORT time_t _timezone;
...BTW: I see that CYGWIN also has a struct timezone in sys/time.h, but
configure didn't check for that.
I'll come with better patches after beta2.---------------------------------------------------------------------------
Reini Urban wrote:
Attached patches are required for cygwin:
2004-08-24 21:23:53 rurban@x-ray.at
* (postmaster/syslogger.c) struct timeval is
declared in sys/time.h, not in time.h2004-08-24 20:20:54 rurban:
* (port/dirmod.c) cygwin needs different header locations,
and unlink is a macro. There are no pgport_palloc
versions yettimezone/pgtz.c:
Pending is a patch against postgresql-8.0.0beta1/config/c-library.m4:
PGAC_VAR_INT_TIMEZONEIn the meantime I've hacked it with a cast from time_t to (int) in
timezone/pgtz.c: get_timezone_offsetbut timezone really is of time_t, not int. I don't know what you are
trying to do here.There's on remaining issue for the cygwin build:
../../src/port/libpgport.a(dirmod.o)(.text+0x5ee):dirmod.c: undefined
reference to `__imp__CurrentMemoryContext'
../../src/port/libpgport.a(dirmod.o)(.text+0x64b):dirmod.c: undefined
reference to `__imp__CurrentMemoryContext'which explains the pgport_palloc problem.
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/2004-08-24 20:20:54 rurban:
* cygwin needs different header locations, and unlink is a macro
* There are no pgport_palloc versions yet--- postgresql-8.0.0beta1/src/port/dirmod.c.orig 2004-08-08 07:44:36.000000000 +0100 +++ postgresql-8.0.0beta1/src/port/dirmod.c 2004-08-24 19:20:56.557435000 +0100 @@ -33,16 +33,28 @@#include "miscadmin.h" + +#ifdef __CYGWIN__ +#include <windows.h> +#include <w32api/winioctl.h> +#else #include <winioctl.h> +#undef unlink +#endif#undef rename
-#undef unlink+/* 2004-08-24 20:20:54 rurban: There are no pgport_palloc versions yet */ +#if 0 #ifndef FRONTEND +#undef palloc +#undef pstrdup +#undef pfree #define palloc(sz) pgport_palloc(sz) #define pstrdup(str) pgport_pstrdup(str) #define pfree(pointer) pgport_pfree(pointer) #endif +#endif/*
2004-08-24 21:23:53 rurban@x-ray.at
* struct timeval is declared in sys/time.h, not in time.h--- postgresql-8.0.0beta1/src/backend/postmaster/syslogger.c.orig 2004-08-06 20:17:31.000000000 +0100 +++ postgresql-8.0.0beta1/src/backend/postmaster/syslogger.c 2004-08-24 20:21:26.057851800 +0100 @@ -28,6 +28,7 @@ #include <signal.h> #include <time.h> #include <unistd.h> +#include <sys/time.h> #include <sys/stat.h>#include "libpq/pqsignal.h"
--- postgresql-8.0.0beta1/src/timezone/pgtz.c.orig 2004-07-31 20:12:15.000000000 +0100 +++ postgresql-8.0.0beta1/src/timezone/pgtz.c 2004-08-24 19:56:30.686367800 +0100 @@ -97,9 +97,9 @@ return tm->tm_gmtoff; #elif defined(HAVE_INT_TIMEZONE) #ifdef HAVE_UNDERSCORE_TIMEZONE - return -_timezone; + return -(int)_timezone; #else - return -timezone; + return -(int)timezone; #endif #else #error No way to determine TZ? Can this happen?---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match------------------------------------------------------------------------
Index: src/backend/utils/mmgr/mcxt.c =================================================================== RCS file: /cvsroot/pgsql-server/src/backend/utils/mmgr/mcxt.c,v retrieving revision 1.47 diff -c -c -r1.47 mcxt.c *** src/backend/utils/mmgr/mcxt.c 8 Aug 2004 06:44:32 -0000 1.47 --- src/backend/utils/mmgr/mcxt.c 29 Aug 2004 02:50:25 -0000 *************** *** 631,637 **** }! #ifdef WIN32 /* * Memory support routines for libpgport on Win32 * --- 631,637 ---- }! #if defined(WIN32) || defined(__CYGWIN__) /* * Memory support routines for libpgport on Win32 * *************** *** 649,654 **** --- 649,655 ---- return palloc(sz); }+ char * pgport_pstrdup(const char *str) { Index: src/port/dirmod.c =================================================================== RCS file: /cvsroot/pgsql-server/src/port/dirmod.c,v retrieving revision 1.19 diff -c -c -r1.19 dirmod.c *** src/port/dirmod.c 29 Aug 2004 01:44:02 -0000 1.19 --- src/port/dirmod.c 29 Aug 2004 02:50:28 -0000 *************** *** 31,48 ****#if defined(WIN32) || defined(__CYGWIN__)
-
#include "miscadmin.h"
- #include <winioctl.h>#undef rename
#undef unlink#ifndef FRONTEND /* * Call non-macro versions of palloc, can't reference CurrentMemoryContext * because of DLLIMPORT. */ #define palloc(sz) pgport_palloc(sz) #define pstrdup(str) pgport_pstrdup(str) #define pfree(pointer) pgport_pfree(pointer) --- 31,57 ----#if defined(WIN32) || defined(__CYGWIN__)
#include "miscadmin.h"
#undef rename
#undef unlink+ #ifdef __WIN32__ + #include <winioctl.h> + #else + /* __CYGWIN__ */ + #include <windows.h> + #include <w32api/winioctl.h> + #endif + #ifndef FRONTEND /* * Call non-macro versions of palloc, can't reference CurrentMemoryContext * because of DLLIMPORT. */ + #undef palloc + #undef pstrdup + #undef pfree #define palloc(sz) pgport_palloc(sz) #define pstrdup(str) pgport_pstrdup(str) #define pfree(pointer) pgport_pfree(pointer)--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
--
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
Bruce Momjian schrieb:
Should I apply this change?
#define TIMEZONE_GLOBAL ((int)_timezone)
yes, please.
I have no time yet, to come up with the better patch. It's already monday.
---------------------------------------------------------------------------
Reini Urban wrote:
Bruce Momjian schrieb:
Your patch highlighted several bugs in our code. First, I wasn't
testing for CYGWIN in the backend pgport_palloc code. Second, I added
an #undef to prevent compiler warnings. Third I added your Cygwin
includes with an #ifdef. These will appear in beta2.On the timezone issue, I see this in dt.h:
/* Global variable holding time zone information. */
#if !defined(__CYGWIN__) && !defined(WIN32)
#define TIMEZONE_GLOBAL timezone
#else
#define TIMEZONE_GLOBAL _timezone
#define tzname _tzname /* should be in time.h? */
#endifso are you saying your _timezone is time_t and not an int? Sometimes it
is just a short because it is only minutes west of GMT, not an actually
seconds since 1970 or anything. Making it time_t actually sounds like
overkill, but we can work around that in dt.h if indeed that is how your
OS defines it. The easiest fix would probably be to add the cast to int
right in dt.h and only for Cygwin:#define TIMEZONE_GLOBAL ((int)_timezone)
Does that work for you?
yes, that's better.
FYI /usr/include/time.h:
/* defines for the opengroup specifications Derived from Issue 1 of the
SVID. */
extern __IMPORT time_t _timezone;
...BTW: I see that CYGWIN also has a struct timezone in sys/time.h, but
configure didn't check for that.
I'll come with better patches after beta2.---------------------------------------------------------------------------
Reini Urban wrote:
Attached patches are required for cygwin:
2004-08-24 21:23:53 rurban@x-ray.at
* (postmaster/syslogger.c) struct timeval is
declared in sys/time.h, not in time.h2004-08-24 20:20:54 rurban:
* (port/dirmod.c) cygwin needs different header locations,
and unlink is a macro. There are no pgport_palloc
versions yettimezone/pgtz.c:
Pending is a patch against postgresql-8.0.0beta1/config/c-library.m4:
PGAC_VAR_INT_TIMEZONEIn the meantime I've hacked it with a cast from time_t to (int) in
timezone/pgtz.c: get_timezone_offsetbut timezone really is of time_t, not int. I don't know what you are
trying to do here.There's on remaining issue for the cygwin build:
../../src/port/libpgport.a(dirmod.o)(.text+0x5ee):dirmod.c: undefined
reference to `__imp__CurrentMemoryContext'
../../src/port/libpgport.a(dirmod.o)(.text+0x64b):dirmod.c: undefined
reference to `__imp__CurrentMemoryContext'which explains the pgport_palloc problem.
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/2004-08-24 20:20:54 rurban:
* cygwin needs different header locations, and unlink is a macro
* There are no pgport_palloc versions yet--- postgresql-8.0.0beta1/src/port/dirmod.c.orig 2004-08-08 07:44:36.000000000 +0100 +++ postgresql-8.0.0beta1/src/port/dirmod.c 2004-08-24 19:20:56.557435000 +0100 @@ -33,16 +33,28 @@#include "miscadmin.h" + +#ifdef __CYGWIN__ +#include <windows.h> +#include <w32api/winioctl.h> +#else #include <winioctl.h> +#undef unlink +#endif#undef rename
-#undef unlink+/* 2004-08-24 20:20:54 rurban: There are no pgport_palloc versions yet */ +#if 0 #ifndef FRONTEND +#undef palloc +#undef pstrdup +#undef pfree #define palloc(sz) pgport_palloc(sz) #define pstrdup(str) pgport_pstrdup(str) #define pfree(pointer) pgport_pfree(pointer) #endif +#endif/*
2004-08-24 21:23:53 rurban@x-ray.at
* struct timeval is declared in sys/time.h, not in time.h--- postgresql-8.0.0beta1/src/backend/postmaster/syslogger.c.orig 2004-08-06 20:17:31.000000000 +0100 +++ postgresql-8.0.0beta1/src/backend/postmaster/syslogger.c 2004-08-24 20:21:26.057851800 +0100 @@ -28,6 +28,7 @@ #include <signal.h> #include <time.h> #include <unistd.h> +#include <sys/time.h> #include <sys/stat.h>#include "libpq/pqsignal.h"
--- postgresql-8.0.0beta1/src/timezone/pgtz.c.orig 2004-07-31 20:12:15.000000000 +0100 +++ postgresql-8.0.0beta1/src/timezone/pgtz.c 2004-08-24 19:56:30.686367800 +0100 @@ -97,9 +97,9 @@ return tm->tm_gmtoff; #elif defined(HAVE_INT_TIMEZONE) #ifdef HAVE_UNDERSCORE_TIMEZONE - return -_timezone; + return -(int)_timezone; #else - return -timezone; + return -(int)timezone; #endif #else #error No way to determine TZ? Can this happen?---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match------------------------------------------------------------------------
Index: src/backend/utils/mmgr/mcxt.c =================================================================== RCS file: /cvsroot/pgsql-server/src/backend/utils/mmgr/mcxt.c,v retrieving revision 1.47 diff -c -c -r1.47 mcxt.c *** src/backend/utils/mmgr/mcxt.c 8 Aug 2004 06:44:32 -0000 1.47 --- src/backend/utils/mmgr/mcxt.c 29 Aug 2004 02:50:25 -0000 *************** *** 631,637 **** }! #ifdef WIN32 /* * Memory support routines for libpgport on Win32 * --- 631,637 ---- }! #if defined(WIN32) || defined(__CYGWIN__) /* * Memory support routines for libpgport on Win32 * *************** *** 649,654 **** --- 649,655 ---- return palloc(sz); }+ char * pgport_pstrdup(const char *str) { Index: src/port/dirmod.c =================================================================== RCS file: /cvsroot/pgsql-server/src/port/dirmod.c,v retrieving revision 1.19 diff -c -c -r1.19 dirmod.c *** src/port/dirmod.c 29 Aug 2004 01:44:02 -0000 1.19 --- src/port/dirmod.c 29 Aug 2004 02:50:28 -0000 *************** *** 31,48 ****#if defined(WIN32) || defined(__CYGWIN__)
-
#include "miscadmin.h"
- #include <winioctl.h>#undef rename
#undef unlink#ifndef FRONTEND /* * Call non-macro versions of palloc, can't reference CurrentMemoryContext * because of DLLIMPORT. */ #define palloc(sz) pgport_palloc(sz) #define pstrdup(str) pgport_pstrdup(str) #define pfree(pointer) pgport_pfree(pointer) --- 31,57 ----#if defined(WIN32) || defined(__CYGWIN__)
#include "miscadmin.h"
#undef rename
#undef unlink+ #ifdef __WIN32__ + #include <winioctl.h> + #else + /* __CYGWIN__ */ + #include <windows.h> + #include <w32api/winioctl.h> + #endif + #ifndef FRONTEND /* * Call non-macro versions of palloc, can't reference CurrentMemoryContext * because of DLLIMPORT. */ + #undef palloc + #undef pstrdup + #undef pfree #define palloc(sz) pgport_palloc(sz) #define pstrdup(str) pgport_pstrdup(str) #define pfree(pointer) pgport_pfree(pointer)--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/
OK, patch attached and applied that casts _timezone to (int) on Cygwin.
---------------------------------------------------------------------------
Reini Urban wrote:
Bruce Momjian schrieb:
Should I apply this change?
#define TIMEZONE_GLOBAL ((int)_timezone)
yes, please.
I have no time yet, to come up with the better patch. It's already monday.---------------------------------------------------------------------------
Reini Urban wrote:
Bruce Momjian schrieb:
Your patch highlighted several bugs in our code. First, I wasn't
testing for CYGWIN in the backend pgport_palloc code. Second, I added
an #undef to prevent compiler warnings. Third I added your Cygwin
includes with an #ifdef. These will appear in beta2.On the timezone issue, I see this in dt.h:
/* Global variable holding time zone information. */
#if !defined(__CYGWIN__) && !defined(WIN32)
#define TIMEZONE_GLOBAL timezone
#else
#define TIMEZONE_GLOBAL _timezone
#define tzname _tzname /* should be in time.h? */
#endifso are you saying your _timezone is time_t and not an int? Sometimes it
is just a short because it is only minutes west of GMT, not an actually
seconds since 1970 or anything. Making it time_t actually sounds like
overkill, but we can work around that in dt.h if indeed that is how your
OS defines it. The easiest fix would probably be to add the cast to int
right in dt.h and only for Cygwin:#define TIMEZONE_GLOBAL ((int)_timezone)
Does that work for you?
yes, that's better.
FYI /usr/include/time.h:
/* defines for the opengroup specifications Derived from Issue 1 of the
SVID. */
extern __IMPORT time_t _timezone;
...BTW: I see that CYGWIN also has a struct timezone in sys/time.h, but
configure didn't check for that.
I'll come with better patches after beta2.---------------------------------------------------------------------------
Reini Urban wrote:
Attached patches are required for cygwin:
2004-08-24 21:23:53 rurban@x-ray.at
* (postmaster/syslogger.c) struct timeval is
declared in sys/time.h, not in time.h2004-08-24 20:20:54 rurban:
* (port/dirmod.c) cygwin needs different header locations,
and unlink is a macro. There are no pgport_palloc
versions yettimezone/pgtz.c:
Pending is a patch against postgresql-8.0.0beta1/config/c-library.m4:
PGAC_VAR_INT_TIMEZONEIn the meantime I've hacked it with a cast from time_t to (int) in
timezone/pgtz.c: get_timezone_offsetbut timezone really is of time_t, not int. I don't know what you are
trying to do here.There's on remaining issue for the cygwin build:
../../src/port/libpgport.a(dirmod.o)(.text+0x5ee):dirmod.c: undefined
reference to `__imp__CurrentMemoryContext'
../../src/port/libpgport.a(dirmod.o)(.text+0x64b):dirmod.c: undefined
reference to `__imp__CurrentMemoryContext'which explains the pgport_palloc problem.
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/2004-08-24 20:20:54 rurban:
* cygwin needs different header locations, and unlink is a macro
* There are no pgport_palloc versions yet--- postgresql-8.0.0beta1/src/port/dirmod.c.orig 2004-08-08 07:44:36.000000000 +0100 +++ postgresql-8.0.0beta1/src/port/dirmod.c 2004-08-24 19:20:56.557435000 +0100 @@ -33,16 +33,28 @@#include "miscadmin.h" + +#ifdef __CYGWIN__ +#include <windows.h> +#include <w32api/winioctl.h> +#else #include <winioctl.h> +#undef unlink +#endif#undef rename
-#undef unlink+/* 2004-08-24 20:20:54 rurban: There are no pgport_palloc versions yet */ +#if 0 #ifndef FRONTEND +#undef palloc +#undef pstrdup +#undef pfree #define palloc(sz) pgport_palloc(sz) #define pstrdup(str) pgport_pstrdup(str) #define pfree(pointer) pgport_pfree(pointer) #endif +#endif/*
2004-08-24 21:23:53 rurban@x-ray.at
* struct timeval is declared in sys/time.h, not in time.h--- postgresql-8.0.0beta1/src/backend/postmaster/syslogger.c.orig 2004-08-06 20:17:31.000000000 +0100 +++ postgresql-8.0.0beta1/src/backend/postmaster/syslogger.c 2004-08-24 20:21:26.057851800 +0100 @@ -28,6 +28,7 @@ #include <signal.h> #include <time.h> #include <unistd.h> +#include <sys/time.h> #include <sys/stat.h>#include "libpq/pqsignal.h"
--- postgresql-8.0.0beta1/src/timezone/pgtz.c.orig 2004-07-31 20:12:15.000000000 +0100 +++ postgresql-8.0.0beta1/src/timezone/pgtz.c 2004-08-24 19:56:30.686367800 +0100 @@ -97,9 +97,9 @@ return tm->tm_gmtoff; #elif defined(HAVE_INT_TIMEZONE) #ifdef HAVE_UNDERSCORE_TIMEZONE - return -_timezone; + return -(int)_timezone; #else - return -timezone; + return -(int)timezone; #endif #else #error No way to determine TZ? Can this happen?---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match------------------------------------------------------------------------
Index: src/backend/utils/mmgr/mcxt.c =================================================================== RCS file: /cvsroot/pgsql-server/src/backend/utils/mmgr/mcxt.c,v retrieving revision 1.47 diff -c -c -r1.47 mcxt.c *** src/backend/utils/mmgr/mcxt.c 8 Aug 2004 06:44:32 -0000 1.47 --- src/backend/utils/mmgr/mcxt.c 29 Aug 2004 02:50:25 -0000 *************** *** 631,637 **** }! #ifdef WIN32 /* * Memory support routines for libpgport on Win32 * --- 631,637 ---- }! #if defined(WIN32) || defined(__CYGWIN__) /* * Memory support routines for libpgport on Win32 * *************** *** 649,654 **** --- 649,655 ---- return palloc(sz); }+ char * pgport_pstrdup(const char *str) { Index: src/port/dirmod.c =================================================================== RCS file: /cvsroot/pgsql-server/src/port/dirmod.c,v retrieving revision 1.19 diff -c -c -r1.19 dirmod.c *** src/port/dirmod.c 29 Aug 2004 01:44:02 -0000 1.19 --- src/port/dirmod.c 29 Aug 2004 02:50:28 -0000 *************** *** 31,48 ****#if defined(WIN32) || defined(__CYGWIN__)
-
#include "miscadmin.h"
- #include <winioctl.h>#undef rename
#undef unlink#ifndef FRONTEND /* * Call non-macro versions of palloc, can't reference CurrentMemoryContext * because of DLLIMPORT. */ #define palloc(sz) pgport_palloc(sz) #define pstrdup(str) pgport_pstrdup(str) #define pfree(pointer) pgport_pfree(pointer) --- 31,57 ----#if defined(WIN32) || defined(__CYGWIN__)
#include "miscadmin.h"
#undef rename
#undef unlink+ #ifdef __WIN32__ + #include <winioctl.h> + #else + /* __CYGWIN__ */ + #include <windows.h> + #include <w32api/winioctl.h> + #endif + #ifndef FRONTEND /* * Call non-macro versions of palloc, can't reference CurrentMemoryContext * because of DLLIMPORT. */ + #undef palloc + #undef pstrdup + #undef pfree #define palloc(sz) pgport_palloc(sz) #define pstrdup(str) pgport_pstrdup(str) #define pfree(pointer) pgport_pfree(pointer)--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend
--
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
Attachments:
/bjm/difftext/plainDownload+4-0
Now I've found time to test beta2 and came up
with the attached better patch:
Added configure time_t timezone check for the SUSV definition.
Not only cygwin, all newlib installations without struct tm timezone.
Casted to (int) timezone.
(configure should really be re-created by autoconf. I patched it just
for completeness in the forthcoming cygwin package.)
Bruce Momjian schrieb:
OK, patch attached and applied that casts _timezone to (int) on Cygwin.
---------------------------------------------------------------------------Reini Urban wrote:
Bruce Momjian schrieb:
Should I apply this change?
#define TIMEZONE_GLOBAL ((int)_timezone)
yes, please.
I have no time yet, to come up with the better patch. It's already monday.---------------------------------------------------------------------------
Reini Urban wrote:
Bruce Momjian schrieb:
Your patch highlighted several bugs in our code. First, I wasn't
testing for CYGWIN in the backend pgport_palloc code. Second, I added
an #undef to prevent compiler warnings. Third I added your Cygwin
includes with an #ifdef. These will appear in beta2.On the timezone issue, I see this in dt.h:
/* Global variable holding time zone information. */
#if !defined(__CYGWIN__) && !defined(WIN32)
#define TIMEZONE_GLOBAL timezone
#else
#define TIMEZONE_GLOBAL _timezone
#define tzname _tzname /* should be in time.h? */
#endifso are you saying your _timezone is time_t and not an int? Sometimes it
is just a short because it is only minutes west of GMT, not an actually
seconds since 1970 or anything. Making it time_t actually sounds like
overkill, but we can work around that in dt.h if indeed that is how your
OS defines it. The easiest fix would probably be to add the cast to int
right in dt.h and only for Cygwin:#define TIMEZONE_GLOBAL ((int)_timezone)
Does that work for you?
yes, that's better.
FYI /usr/include/time.h:
/* defines for the opengroup specifications Derived from Issue 1 of the
SVID. */
extern __IMPORT time_t _timezone;
...BTW: I see that CYGWIN also has a struct timezone in sys/time.h, but
configure didn't check for that.
I'll come with better patches after beta2.---------------------------------------------------------------------------
Reini Urban wrote:
Attached patches are required for cygwin:
2004-08-24 21:23:53 rurban@x-ray.at
* (postmaster/syslogger.c) struct timeval is
declared in sys/time.h, not in time.h2004-08-24 20:20:54 rurban:
* (port/dirmod.c) cygwin needs different header locations,
and unlink is a macro. There are no pgport_palloc
versions yettimezone/pgtz.c:
Pending is a patch against postgresql-8.0.0beta1/config/c-library.m4:
PGAC_VAR_INT_TIMEZONEIn the meantime I've hacked it with a cast from time_t to (int) in
timezone/pgtz.c: get_timezone_offsetbut timezone really is of time_t, not int. I don't know what you are
trying to do here.There's on remaining issue for the cygwin build:
../../src/port/libpgport.a(dirmod.o)(.text+0x5ee):dirmod.c: undefined
reference to `__imp__CurrentMemoryContext'
../../src/port/libpgport.a(dirmod.o)(.text+0x64b):dirmod.c: undefined
reference to `__imp__CurrentMemoryContext'which explains the pgport_palloc problem.
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/2004-08-24 20:20:54 rurban:
* cygwin needs different header locations, and unlink is a macro
* There are no pgport_palloc versions yet--- postgresql-8.0.0beta1/src/port/dirmod.c.orig 2004-08-08 07:44:36.000000000 +0100 +++ postgresql-8.0.0beta1/src/port/dirmod.c 2004-08-24 19:20:56.557435000 +0100 @@ -33,16 +33,28 @@#include "miscadmin.h" + +#ifdef __CYGWIN__ +#include <windows.h> +#include <w32api/winioctl.h> +#else #include <winioctl.h> +#undef unlink +#endif#undef rename
-#undef unlink+/* 2004-08-24 20:20:54 rurban: There are no pgport_palloc versions yet */ +#if 0 #ifndef FRONTEND +#undef palloc +#undef pstrdup +#undef pfree #define palloc(sz) pgport_palloc(sz) #define pstrdup(str) pgport_pstrdup(str) #define pfree(pointer) pgport_pfree(pointer) #endif +#endif/*
2004-08-24 21:23:53 rurban@x-ray.at
* struct timeval is declared in sys/time.h, not in time.h--- postgresql-8.0.0beta1/src/backend/postmaster/syslogger.c.orig 2004-08-06 20:17:31.000000000 +0100 +++ postgresql-8.0.0beta1/src/backend/postmaster/syslogger.c 2004-08-24 20:21:26.057851800 +0100 @@ -28,6 +28,7 @@ #include <signal.h> #include <time.h> #include <unistd.h> +#include <sys/time.h> #include <sys/stat.h>#include "libpq/pqsignal.h"
--- postgresql-8.0.0beta1/src/timezone/pgtz.c.orig 2004-07-31 20:12:15.000000000 +0100 +++ postgresql-8.0.0beta1/src/timezone/pgtz.c 2004-08-24 19:56:30.686367800 +0100 @@ -97,9 +97,9 @@ return tm->tm_gmtoff; #elif defined(HAVE_INT_TIMEZONE) #ifdef HAVE_UNDERSCORE_TIMEZONE - return -_timezone; + return -(int)_timezone; #else - return -timezone; + return -(int)timezone; #endif #else #error No way to determine TZ? Can this happen?---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match------------------------------------------------------------------------
Index: src/backend/utils/mmgr/mcxt.c =================================================================== RCS file: /cvsroot/pgsql-server/src/backend/utils/mmgr/mcxt.c,v retrieving revision 1.47 diff -c -c -r1.47 mcxt.c *** src/backend/utils/mmgr/mcxt.c 8 Aug 2004 06:44:32 -0000 1.47 --- src/backend/utils/mmgr/mcxt.c 29 Aug 2004 02:50:25 -0000 *************** *** 631,637 **** }! #ifdef WIN32 /* * Memory support routines for libpgport on Win32 * --- 631,637 ---- }! #if defined(WIN32) || defined(__CYGWIN__) /* * Memory support routines for libpgport on Win32 * *************** *** 649,654 **** --- 649,655 ---- return palloc(sz); }+ char * pgport_pstrdup(const char *str) { Index: src/port/dirmod.c =================================================================== RCS file: /cvsroot/pgsql-server/src/port/dirmod.c,v retrieving revision 1.19 diff -c -c -r1.19 dirmod.c *** src/port/dirmod.c 29 Aug 2004 01:44:02 -0000 1.19 --- src/port/dirmod.c 29 Aug 2004 02:50:28 -0000 *************** *** 31,48 ****#if defined(WIN32) || defined(__CYGWIN__)
-
#include "miscadmin.h"
- #include <winioctl.h>#undef rename
#undef unlink#ifndef FRONTEND /* * Call non-macro versions of palloc, can't reference CurrentMemoryContext * because of DLLIMPORT. */ #define palloc(sz) pgport_palloc(sz) #define pstrdup(str) pgport_pstrdup(str) #define pfree(pointer) pgport_pfree(pointer) --- 31,57 ----#if defined(WIN32) || defined(__CYGWIN__)
#include "miscadmin.h"
#undef rename
#undef unlink+ #ifdef __WIN32__ + #include <winioctl.h> + #else + /* __CYGWIN__ */ + #include <windows.h> + #include <w32api/winioctl.h> + #endif + #ifndef FRONTEND /* * Call non-macro versions of palloc, can't reference CurrentMemoryContext * because of DLLIMPORT. */ + #undef palloc + #undef pstrdup + #undef pfree #define palloc(sz) pgport_palloc(sz) #define pstrdup(str) pgport_pstrdup(str) #define pfree(pointer) pgport_pfree(pointer)--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend------------------------------------------------------------------------
Index: src/interfaces/ecpg/pgtypeslib/dt.h =================================================================== RCS file: /cvsroot/pgsql-server/src/interfaces/ecpg/pgtypeslib/dt.h,v retrieving revision 1.17 diff -c -c -r1.17 dt.h *** src/interfaces/ecpg/pgtypeslib/dt.h 19 Jan 2004 19:04:40 -0000 1.17 --- src/interfaces/ecpg/pgtypeslib/dt.h 1 Sep 2004 04:00:49 -0000 *************** *** 220,226 **** --- 220,230 ---- #if !defined(__CYGWIN__) && !defined(WIN32) #define TIMEZONE_GLOBAL timezone #else + #if defined(WIN32) #define TIMEZONE_GLOBAL _timezone + #else + #define TIMEZONE_GLOBAL ((int)_timezone) /* time_t on Cywgin */ + #endif #define tzname _tzname /* should be in time.h? */ #endif
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/
Attachments:
pgtz.patchtext/plain; name=pgtz.patchDownload+94-4
Reini Urban <rurban@x-ray.at> writes:
Added configure time_t timezone check for the SUSV definition.
Kindly do not claim that this is per SUS spec.
http://www.opengroup.org/onlinepubs/007908799/xsh/timezone.html
regards, tom lane
Tom Lane schrieb:
Reini Urban <rurban@x-ray.at> writes:
Added configure time_t timezone check for the SUSV definition.
Kindly do not claim that this is per SUS spec.
http://www.opengroup.org/onlinepubs/007908799/xsh/timezone.html
oops! sorry :(
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/
I am inclined to leave the #ifdef Cygwin test in the code rather than
add a configure check.
---------------------------------------------------------------------------
Reini Urban wrote:
Tom Lane schrieb:
Reini Urban <rurban@x-ray.at> writes:
Added configure time_t timezone check for the SUSV definition.
Kindly do not claim that this is per SUS spec.
http://www.opengroup.org/onlinepubs/007908799/xsh/timezone.html
oops! sorry :(
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
--
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
Bruce Momjian schrieb:
I am inclined to leave the #ifdef Cygwin test in the code rather than
add a configure check.
No,
There are a lot of other systems with time_t timezone!
newlib explains it like this:
/* defines for the opengroup specifications Derived from Issue 1 of the
SVID. */
extern __IMPORT time_t _timezone;
extern __IMPORT int _daylight;
extern __IMPORT char *_tzname[2];
SVID (System V Interface Definition) seems to be an interesting spec,
which I found here:
http://www.caldera.com/developers/devspecs/vol1a.pdf
(nothing about the type of timezone though)
But the time_t timezone issue is here:
"XSHd7 Aardvark Change Request Report"
http://www.opengroup.org/austin/docs/austin_97.txt
(ERN 20 Accept as marked, page 1177)
SUSV2 only defines it as long int
http://www.opengroup.org/onlinepubs/007908799/xsh/timezone.html
Caldera, redhat and IRIX 6.2 at least use time_t
http://uw713doc.sco.com/en/man/html.3C/ctime.3C.html
http://www.opensource.apple.com/darwinsource/10.0.4/tcl-3.1/tcl/unix/tcl.m4
Please google for "time_t timezone" and the accompanying autoconf .m4
files. tcl.m4 could be quite useful, if you don't like my hack.
php also uses time_t and not long int.
PS: For compatibility newlib has:
#ifdef __CYGWIN__
#ifdef timezonevar
#ifndef timezone
#define timezone ((long int) _timezone)
#endif
#endif
Looks like we only have to define timezonevar in our hint,
eh Makefile.port, but then the other platforms will loose.
---------------------------------------------------------------------------
Reini Urban wrote:
Tom Lane schrieb:
Reini Urban <rurban@x-ray.at> writes:
Added configure time_t timezone check for the SUSV definition.
Kindly do not claim that this is per SUS spec.
http://www.opengroup.org/onlinepubs/007908799/xsh/timezone.htmloops! sorry :(
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/