Thread: Re: [HACKERS] more dirmod CYGWIN

Re: [HACKERS] more dirmod CYGWIN

From
Reini Urban
Date:
Reini Urban schrieb:
> [BTW: there's no need to cc all, I'm subscribed to most lists]
> Reini Urban schrieb:
>> Bruce Momjian schrieb:
>>> Andrew Dunstan wrote:
>>>> Reini Urban wrote:
>>>>
>>>>> FYI: WIN32 is also defined because <windows.h> is included.
>>>>> (/usr/incluse/w32api/windef.h)
>>>>> If you want this or that, do proper nesting, and use #else.
>>>>
>>>> Ugh, yes. A little experimentation shows that __WIN32__ is defined
>>>> for MinGW only, but WIN32 is for both. I wonder how we missed that
>>>> in various places. Maybe we need a little audit of the use of WIN32.
>>>
>>> OK, fixed.  We should not be using __WIN32__, just Win32.  The proper
>>> test is #ifndef __CYGWIN__.
>>
>> very good. just think of future MSVC versions.
>>
>> Just one more glitch:
>>
>> #undef rename
>> #undef unlink
>>
>> has to be defined before #include <unistd.h> on CYGWIN, because
>> unistd.h has the declarations for rename and unlink, which are
>> required inside the pg versions.
>> without the #undef, the macros which rename rename to pgrename, ...
>> are still effective, which will lead to undeclared/falsely
>> autodeclared rename/unlink parts.
>>
>> I don't know for mingw, if they need the pgrename/pgunlink declaration.
>> For my CYGWIN patch I moved those two lines before #include <unistd.h>.
>
>
> FYI: latest cvs HEAD, without any patches.
>
> make runs now through with the expected implicit declaration warnings,
> but without any errors. Esp. the CYGWIN-specific SHMLIB linking errors
> are now gone. good!
>
> make[2]: Entering directory `/usr/src/postgresql/pgsql/src/port'
> gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes
> -Wmissing-declarations -I../../src/port -I../../src/include   -c -o
> dirmod.o dirmod.c
> dirmod.c: In Funktion >>pgunlink<<:
> dirmod.c:113: Warnung: implicit declaration of function `unlink'
> dirmod.c: In Funktion >>rmt_cleanup<<:
> dirmod.c:267: Warnung: implicit declaration of function `pgport_pfree'
> dirmod.c: In Funktion >>rmtree<<:
> dirmod.c:318: Warnung: implicit declaration of function `pgport_palloc'
> dirmod.c:318: Warnung: Zuweisung erzeugt Zeiger von Ganzzahl ohne
> Typkonvertierung
> dirmod.c:333: Warnung: implicit declaration of function `pgport_pstrdup'
> dirmod.c:333: Warnung: Zuweisung erzeugt Zeiger von Ganzzahl ohne
> Typkonvertierung
>
> make check hangs at:
> "running on port 65432 with pid 2304
> ============== creating database "regression"         ==============
> CREATE DATABASE
> ALTER DATABASE
> ============== dropping regression test user accounts ==============
> ============== installing PL/pgSQL                    ==============
> ============== running regression test queries        ==============
> parallel group (13 tests):  int2 int4 int8 float4 name varchar numeric"
>
> which means rename works ok. probably the false implicit declarations in
> the memory code break it.
>
> I'll come with another patch later.

parallel tests hang on cygwin. this is expected.

attached is the postmaster stackdump on the parallel test (if you care),
and the IPC's during the parallel test (not quite busy...):
$ ipcs
Message Queues:
T     ID               KEY        MODE       OWNER    GROUP

Shared Memory:
T     ID               KEY        MODE       OWNER    GROUP
m 1966080             65432001 --rw-------   rurban     root

Semaphores:
T     ID               KEY        MODE       OWNER    GROUP
s 1966080             65432001 --rw-------   rurban     root
s 1966081             65432002 --rw-------   rurban     root
s 1966082             65432003 --rw-------   rurban     root
s 1966083             65432004 --rw-------   rurban     root
s 1966084             65432005 --rw-------   rurban     root
s 1966085             65432006 --rw-------   rurban     root
s 1966086             65432007 --rw-------   rurban     root

with the serial schedule all tests but the last pass.
test tablespace           ... FAILED

This is the tail of the postmaster log for this failing test.

ERROR:  cannot alter table "fullname" because column "people"."fn" uses
its rowtype
ERROR:  could not create symbolic link
"/usr/src/postgresql/pgsql/src/test/regress/./tmp_check/data/pg_tblspc/155118":
No error
ERROR:  tablespace "testspace" does not exist
ERROR:  schema "testschema" does not exist
ERROR:  schema "testschema" does not exist
ERROR:  schema "testschema" does not exist
ERROR:  schema "testschema" does not exist
ERROR:  could not set permissions on directory "/no/such/location": No
such file or directory
ERROR:  tablespace "nosuchspace" does not exist
ERROR:  tablespace "testspace" does not exist
ERROR:  schema "testschema" does not exist
ERROR:  tablespace "testspace" does not exist
LOG:  received smart shutdown request
LOG:  shutting down
LOG:  database system is shut down

attached is the regression.diffs,

and also the overall patch against current CVS HEAD I used for this run.
(the move-#undef patch is probably already applied regarding bruce)
this should be applied.
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/
*** ./expected/tablespace.out    Fri Sep 10 13:42:08 2004
--- ./results/tablespace.out    Fri Sep 10 13:53:22 2004
***************
*** 1,34 ****
  -- create a tablespace we can use
  CREATE TABLESPACE testspace LOCATION '/usr/src/postgresql/pgsql/src/test/regress/testtablespace';
  -- create a schema in the tablespace
  CREATE SCHEMA testschema TABLESPACE testspace;
  -- sanity check
  SELECT nspname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_namespace n
      where n.nsptablespace = t.oid and n.nspname = 'testschema';
    nspname   |  spcname
! ------------+-----------
!  testschema | testspace
! (1 row)

  -- try a table
  CREATE TABLE testschema.foo (i int);
  SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c
      where c.reltablespace = t.oid AND c.relname = 'foo';
   relname |  spcname
! ---------+-----------
!  foo     | testspace
! (1 row)

  INSERT INTO testschema.foo VALUES(1);
  INSERT INTO testschema.foo VALUES(2);
  -- index
  CREATE INDEX foo_idx on testschema.foo(i);
  SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c
      where c.reltablespace = t.oid AND c.relname = 'foo_idx';
   relname |  spcname
! ---------+-----------
!  foo_idx | testspace
! (1 row)

  -- Will fail with bad path
  CREATE TABLESPACE badspace LOCATION '/no/such/location';
--- 1,37 ----
  -- create a tablespace we can use
  CREATE TABLESPACE testspace LOCATION '/usr/src/postgresql/pgsql/src/test/regress/testtablespace';
+ ERROR:  could not create symbolic link
"/usr/src/postgresql/pgsql/src/test/regress/./tmp_check/data/pg_tblspc/155118":No error 
  -- create a schema in the tablespace
  CREATE SCHEMA testschema TABLESPACE testspace;
+ ERROR:  tablespace "testspace" does not exist
  -- sanity check
  SELECT nspname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_namespace n
      where n.nsptablespace = t.oid and n.nspname = 'testschema';
   nspname | spcname
! ---------+---------
! (0 rows)

  -- try a table
  CREATE TABLE testschema.foo (i int);
+ ERROR:  schema "testschema" does not exist
  SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c
      where c.reltablespace = t.oid AND c.relname = 'foo';
   relname | spcname
! ---------+---------
! (0 rows)

  INSERT INTO testschema.foo VALUES(1);
+ ERROR:  schema "testschema" does not exist
  INSERT INTO testschema.foo VALUES(2);
+ ERROR:  schema "testschema" does not exist
  -- index
  CREATE INDEX foo_idx on testschema.foo(i);
+ ERROR:  schema "testschema" does not exist
  SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c
      where c.reltablespace = t.oid AND c.relname = 'foo_idx';
   relname | spcname
! ---------+---------
! (0 rows)

  -- Will fail with bad path
  CREATE TABLESPACE badspace LOCATION '/no/such/location';
***************
*** 38,45 ****
  ERROR:  tablespace "nosuchspace" does not exist
  -- Fail, not empty
  DROP TABLESPACE testspace;
! ERROR:  tablespace "testspace" is not empty
  DROP SCHEMA testschema CASCADE;
! NOTICE:  drop cascades to table testschema.foo
  -- Should succeed
  DROP TABLESPACE testspace;
--- 41,49 ----
  ERROR:  tablespace "nosuchspace" does not exist
  -- Fail, not empty
  DROP TABLESPACE testspace;
! ERROR:  tablespace "testspace" does not exist
  DROP SCHEMA testschema CASCADE;
! ERROR:  schema "testschema" does not exist
  -- Should succeed
  DROP TABLESPACE testspace;
+ ERROR:  tablespace "testspace" does not exist

======================================================================

--- ./src/include/utils/palloc.h.orig    2004-08-29 05:13:11.000000000 +0100
+++ ./src/include/utils/palloc.h    2004-09-10 13:33:04.587653100 +0100
@@ -80,7 +80,7 @@

 #define pstrdup(str)  MemoryContextStrdup(CurrentMemoryContext, (str))

-#ifdef WIN32
+#if defined(WIN32) || defined(__CYGWIN__)
 extern void *pgport_palloc(Size sz);
 extern char *pgport_pstrdup(const char *str);
 extern void pgport_pfree(void *pointer);
--- ./src/port/dirmod.c.orig    2004-09-10 10:29:36.500414700 +0100
+++ ./src/port/dirmod.c    2004-09-10 13:33:53.790148300 +0100
@@ -21,6 +21,9 @@
 #include "postgres_fe.h"
 #endif

+#undef rename
+#undef unlink
+
 #include <unistd.h>
 #include <dirent.h>
 #include <sys/stat.h>
@@ -33,9 +36,6 @@

 #include "miscadmin.h"

-#undef rename
-#undef unlink
-
 #ifndef __CYGWIN__
 #include <winioctl.h>
 #else

Re: [HACKERS] more dirmod CYGWIN

From
Bruce Momjian
Date:
I have applied all parts of your patch now.

---------------------------------------------------------------------------

Reini Urban wrote:
> Reini Urban schrieb:
> > [BTW: there's no need to cc all, I'm subscribed to most lists]
> > Reini Urban schrieb:
> >> Bruce Momjian schrieb:
> >>> Andrew Dunstan wrote:
> >>>> Reini Urban wrote:
> >>>>
> >>>>> FYI: WIN32 is also defined because <windows.h> is included.
> >>>>> (/usr/incluse/w32api/windef.h)
> >>>>> If you want this or that, do proper nesting, and use #else.
> >>>>
> >>>> Ugh, yes. A little experimentation shows that __WIN32__ is defined
> >>>> for MinGW only, but WIN32 is for both. I wonder how we missed that
> >>>> in various places. Maybe we need a little audit of the use of WIN32.
> >>>
> >>> OK, fixed.  We should not be using __WIN32__, just Win32.  The proper
> >>> test is #ifndef __CYGWIN__.
> >>
> >> very good. just think of future MSVC versions.
> >>
> >> Just one more glitch:
> >>
> >> #undef rename
> >> #undef unlink
> >>
> >> has to be defined before #include <unistd.h> on CYGWIN, because
> >> unistd.h has the declarations for rename and unlink, which are
> >> required inside the pg versions.
> >> without the #undef, the macros which rename rename to pgrename, ...
> >> are still effective, which will lead to undeclared/falsely
> >> autodeclared rename/unlink parts.
> >>
> >> I don't know for mingw, if they need the pgrename/pgunlink declaration.
> >> For my CYGWIN patch I moved those two lines before #include <unistd.h>.
> >
> >
> > FYI: latest cvs HEAD, without any patches.
> >
> > make runs now through with the expected implicit declaration warnings,
> > but without any errors. Esp. the CYGWIN-specific SHMLIB linking errors
> > are now gone. good!
> >
> > make[2]: Entering directory `/usr/src/postgresql/pgsql/src/port'
> > gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes
> > -Wmissing-declarations -I../../src/port -I../../src/include   -c -o
> > dirmod.o dirmod.c
> > dirmod.c: In Funktion >>pgunlink<<:
> > dirmod.c:113: Warnung: implicit declaration of function `unlink'
> > dirmod.c: In Funktion >>rmt_cleanup<<:
> > dirmod.c:267: Warnung: implicit declaration of function `pgport_pfree'
> > dirmod.c: In Funktion >>rmtree<<:
> > dirmod.c:318: Warnung: implicit declaration of function `pgport_palloc'
> > dirmod.c:318: Warnung: Zuweisung erzeugt Zeiger von Ganzzahl ohne
> > Typkonvertierung
> > dirmod.c:333: Warnung: implicit declaration of function `pgport_pstrdup'
> > dirmod.c:333: Warnung: Zuweisung erzeugt Zeiger von Ganzzahl ohne
> > Typkonvertierung
> >
> > make check hangs at:
> > "running on port 65432 with pid 2304
> > ============== creating database "regression"         ==============
> > CREATE DATABASE
> > ALTER DATABASE
> > ============== dropping regression test user accounts ==============
> > ============== installing PL/pgSQL                    ==============
> > ============== running regression test queries        ==============
> > parallel group (13 tests):  int2 int4 int8 float4 name varchar numeric"
> >
> > which means rename works ok. probably the false implicit declarations in
> > the memory code break it.
> >
> > I'll come with another patch later.
>
> parallel tests hang on cygwin. this is expected.
>
> attached is the postmaster stackdump on the parallel test (if you care),
> and the IPC's during the parallel test (not quite busy...):
> $ ipcs
> Message Queues:
> T     ID               KEY        MODE       OWNER    GROUP
>
> Shared Memory:
> T     ID               KEY        MODE       OWNER    GROUP
> m 1966080             65432001 --rw-------   rurban     root
>
> Semaphores:
> T     ID               KEY        MODE       OWNER    GROUP
> s 1966080             65432001 --rw-------   rurban     root
> s 1966081             65432002 --rw-------   rurban     root
> s 1966082             65432003 --rw-------   rurban     root
> s 1966083             65432004 --rw-------   rurban     root
> s 1966084             65432005 --rw-------   rurban     root
> s 1966085             65432006 --rw-------   rurban     root
> s 1966086             65432007 --rw-------   rurban     root
>
> with the serial schedule all tests but the last pass.
> test tablespace           ... FAILED
>
> This is the tail of the postmaster log for this failing test.
>
> ERROR:  cannot alter table "fullname" because column "people"."fn" uses
> its rowtype
> ERROR:  could not create symbolic link
> "/usr/src/postgresql/pgsql/src/test/regress/./tmp_check/data/pg_tblspc/155118":
> No error
> ERROR:  tablespace "testspace" does not exist
> ERROR:  schema "testschema" does not exist
> ERROR:  schema "testschema" does not exist
> ERROR:  schema "testschema" does not exist
> ERROR:  schema "testschema" does not exist
> ERROR:  could not set permissions on directory "/no/such/location": No
> such file or directory
> ERROR:  tablespace "nosuchspace" does not exist
> ERROR:  tablespace "testspace" does not exist
> ERROR:  schema "testschema" does not exist
> ERROR:  tablespace "testspace" does not exist
> LOG:  received smart shutdown request
> LOG:  shutting down
> LOG:  database system is shut down
>
> attached is the regression.diffs,
>
> and also the overall patch against current CVS HEAD I used for this run.
> (the move-#undef patch is probably already applied regarding bruce)
> this should be applied.
> --
> Reini Urban
> http://xarch.tu-graz.ac.at/home/rurban/

> *** ./expected/tablespace.out    Fri Sep 10 13:42:08 2004
> --- ./results/tablespace.out    Fri Sep 10 13:53:22 2004
> ***************
> *** 1,34 ****
>   -- create a tablespace we can use
>   CREATE TABLESPACE testspace LOCATION '/usr/src/postgresql/pgsql/src/test/regress/testtablespace';
>   -- create a schema in the tablespace
>   CREATE SCHEMA testschema TABLESPACE testspace;
>   -- sanity check
>   SELECT nspname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_namespace n
>       where n.nsptablespace = t.oid and n.nspname = 'testschema';
>     nspname   |  spcname
> ! ------------+-----------
> !  testschema | testspace
> ! (1 row)
>
>   -- try a table
>   CREATE TABLE testschema.foo (i int);
>   SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c
>       where c.reltablespace = t.oid AND c.relname = 'foo';
>    relname |  spcname
> ! ---------+-----------
> !  foo     | testspace
> ! (1 row)
>
>   INSERT INTO testschema.foo VALUES(1);
>   INSERT INTO testschema.foo VALUES(2);
>   -- index
>   CREATE INDEX foo_idx on testschema.foo(i);
>   SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c
>       where c.reltablespace = t.oid AND c.relname = 'foo_idx';
>    relname |  spcname
> ! ---------+-----------
> !  foo_idx | testspace
> ! (1 row)
>
>   -- Will fail with bad path
>   CREATE TABLESPACE badspace LOCATION '/no/such/location';
> --- 1,37 ----
>   -- create a tablespace we can use
>   CREATE TABLESPACE testspace LOCATION '/usr/src/postgresql/pgsql/src/test/regress/testtablespace';
> + ERROR:  could not create symbolic link
"/usr/src/postgresql/pgsql/src/test/regress/./tmp_check/data/pg_tblspc/155118":No error 
>   -- create a schema in the tablespace
>   CREATE SCHEMA testschema TABLESPACE testspace;
> + ERROR:  tablespace "testspace" does not exist
>   -- sanity check
>   SELECT nspname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_namespace n
>       where n.nsptablespace = t.oid and n.nspname = 'testschema';
>    nspname | spcname
> ! ---------+---------
> ! (0 rows)
>
>   -- try a table
>   CREATE TABLE testschema.foo (i int);
> + ERROR:  schema "testschema" does not exist
>   SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c
>       where c.reltablespace = t.oid AND c.relname = 'foo';
>    relname | spcname
> ! ---------+---------
> ! (0 rows)
>
>   INSERT INTO testschema.foo VALUES(1);
> + ERROR:  schema "testschema" does not exist
>   INSERT INTO testschema.foo VALUES(2);
> + ERROR:  schema "testschema" does not exist
>   -- index
>   CREATE INDEX foo_idx on testschema.foo(i);
> + ERROR:  schema "testschema" does not exist
>   SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c
>       where c.reltablespace = t.oid AND c.relname = 'foo_idx';
>    relname | spcname
> ! ---------+---------
> ! (0 rows)
>
>   -- Will fail with bad path
>   CREATE TABLESPACE badspace LOCATION '/no/such/location';
> ***************
> *** 38,45 ****
>   ERROR:  tablespace "nosuchspace" does not exist
>   -- Fail, not empty
>   DROP TABLESPACE testspace;
> ! ERROR:  tablespace "testspace" is not empty
>   DROP SCHEMA testschema CASCADE;
> ! NOTICE:  drop cascades to table testschema.foo
>   -- Should succeed
>   DROP TABLESPACE testspace;
> --- 41,49 ----
>   ERROR:  tablespace "nosuchspace" does not exist
>   -- Fail, not empty
>   DROP TABLESPACE testspace;
> ! ERROR:  tablespace "testspace" does not exist
>   DROP SCHEMA testschema CASCADE;
> ! ERROR:  schema "testschema" does not exist
>   -- Should succeed
>   DROP TABLESPACE testspace;
> + ERROR:  tablespace "testspace" does not exist
>
> ======================================================================
>

> --- ./src/include/utils/palloc.h.orig    2004-08-29 05:13:11.000000000 +0100
> +++ ./src/include/utils/palloc.h    2004-09-10 13:33:04.587653100 +0100
> @@ -80,7 +80,7 @@
>
>  #define pstrdup(str)  MemoryContextStrdup(CurrentMemoryContext, (str))
>
> -#ifdef WIN32
> +#if defined(WIN32) || defined(__CYGWIN__)
>  extern void *pgport_palloc(Size sz);
>  extern char *pgport_pstrdup(const char *str);
>  extern void pgport_pfree(void *pointer);
> --- ./src/port/dirmod.c.orig    2004-09-10 10:29:36.500414700 +0100
> +++ ./src/port/dirmod.c    2004-09-10 13:33:53.790148300 +0100
> @@ -21,6 +21,9 @@
>  #include "postgres_fe.h"
>  #endif
>
> +#undef rename
> +#undef unlink
> +
>  #include <unistd.h>
>  #include <dirent.h>
>  #include <sys/stat.h>
> @@ -33,9 +36,6 @@
>
>  #include "miscadmin.h"
>
> -#undef rename
> -#undef unlink
> -
>  #ifndef __CYGWIN__
>  #include <winioctl.h>
>  #else

>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo@postgresql.org so that your
>       message can get through to the mailing list cleanly

--
  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

Re: [HACKERS] more dirmod CYGWIN

From
Reini Urban
Date:
Bruce Momjian schrieb:
> I have applied all parts of your patch now.

Thanks. Core builds and works fine now. (plperl IPC problems aside)

But there's are still some more minor SHLIB glitches,
which only affects contrib, because -lpgport is missing for various dll's.

SHLIB_LINK doesn't contain the libs only the paths, because they are
filtered out somewhere.
But first I want to find the real cause of the problem.
Maybe LIB is just missing a -lpgport.


$ diff -bu src/Makefile.shlib.orig  src/Makefile.shlib
--- src/Makefile.shlib.orig     2004-09-03 00:06:43.000000000 +0100
+++ src/Makefile.shlib  2004-09-10 17:12:18.528655500 +0100
@@ -216,6 +216,7 @@

  ifeq ($(PORTNAME), cygwin)
    shlib                        = $(NAME)$(DLSUFFIX)
+  SHLIB_LINK           += -lpgport
  endif

  ifeq ($(PORTNAME), win32)

$ diff -bu src/makefiles/pgxs.mk.orig src/makefiles/pgxs.mk
--- src/makefiles/pgxs.mk.orig  2004-07-30 13:26:40.000000000 +0100
+++ src/makefiles/pgxs.mk       2004-09-10 17:09:15.499748300 +0100
@@ -63,7 +63,11 @@

  ifdef MODULES
  override CFLAGS += $(CFLAGS_SL)
-SHLIB_LINK += $(BE_DLLLIBS)
+ifeq ($(PORTNAME), cygwin)
+  SHLIB_LINK += $(BE_DLLLIBS) $(LDFLAGS) $(LIBS) -lpgport
+else
+  SHLIB_LINK += $(BE_DLLLIBS)
+endif
  endif

  ifdef PG_CPPFLAGS

--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/

Re: [HACKERS] more dirmod CYGWIN

From
Bruce Momjian
Date:
Reini Urban wrote:
> Bruce Momjian schrieb:
> > I have applied all parts of your patch now.
>
> Thanks. Core builds and works fine now. (plperl IPC problems aside)
>
> But there's are still some more minor SHLIB glitches,
> which only affects contrib, because -lpgport is missing for various dll's.
>

FYI, I think we fixed plperl for Win32 today.

> SHLIB_LINK doesn't contain the libs only the paths, because they are
> filtered out somewhere.
> But first I want to find the real cause of the problem.
> Maybe LIB is just missing a -lpgport.


Would you please post the link command and error that is failing below:

---------------------------------------------------------------------------

>
>
> $ diff -bu src/Makefile.shlib.orig  src/Makefile.shlib
> --- src/Makefile.shlib.orig     2004-09-03 00:06:43.000000000 +0100
> +++ src/Makefile.shlib  2004-09-10 17:12:18.528655500 +0100
> @@ -216,6 +216,7 @@
>
>   ifeq ($(PORTNAME), cygwin)
>     shlib                        = $(NAME)$(DLSUFFIX)
> +  SHLIB_LINK           += -lpgport
>   endif
>
>   ifeq ($(PORTNAME), win32)
>
> $ diff -bu src/makefiles/pgxs.mk.orig src/makefiles/pgxs.mk
> --- src/makefiles/pgxs.mk.orig  2004-07-30 13:26:40.000000000 +0100
> +++ src/makefiles/pgxs.mk       2004-09-10 17:09:15.499748300 +0100
> @@ -63,7 +63,11 @@
>
>   ifdef MODULES
>   override CFLAGS += $(CFLAGS_SL)
> -SHLIB_LINK += $(BE_DLLLIBS)
> +ifeq ($(PORTNAME), cygwin)
> +  SHLIB_LINK += $(BE_DLLLIBS) $(LDFLAGS) $(LIBS) -lpgport
> +else
> +  SHLIB_LINK += $(BE_DLLLIBS)
> +endif
>   endif
>
>   ifdef PG_CPPFLAGS
>
> --
> Reini Urban
> http://xarch.tu-graz.ac.at/home/rurban/
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" 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

Re: [HACKERS] more dirmod CYGWIN

From
Reini Urban
Date:
Bruce Momjian schrieb:
> Reini Urban wrote:
>>Bruce Momjian schrieb:
>>>I have applied all parts of your patch now.
>>Thanks. Core builds and works fine now. (plperl IPC problems aside)
>>
>>But there's are still some more minor SHLIB glitches,
>>which only affects contrib, because -lpgport is missing for various dll's.
>
> FYI, I think we fixed plperl for Win32 today.

!! good to hear.
I will come with my promised basic plperl regressiontests soon.
No time at all yet.

>>SHLIB_LINK doesn't contain the libs only the paths, because they are
>>filtered out somewhere.
>>But first I want to find the real cause of the problem.
>>Maybe LIB is just missing a -lpgport.
>
> Would you please post the link command and error that is failing below:

well, all dll contrib's which use pgport functions miss -lpgport.
ltree, spi, tsearch, tsearch2, ...

make[1]: Entering directory
`/usr/src/postgresql/postgresql-8.0.0cvs/contrib/ltree'
sed 's,MODULE_PATHNAME,$libdir/ltree,g' ltree.sql.in >ltree.sql
gcc -g -fno-strict-aliasing -Wall -Wmissing-prototypes
-Wmissing-declarations  -DLOWER_NODE -I. -I..
/../src/include   -c -o ltree_io.o ltree_io.c
gcc -g -fno-strict-aliasing -Wall -Wmissing-prototypes
-Wmissing-declarations  -DLOWER_NODE -I. -I..
/../src/include   -c -o ltree_op.o ltree_op.c
gcc -g -fno-strict-aliasing -Wall -Wmissing-prototypes
-Wmissing-declarations  -DLOWER_NODE -I. -I..
/../src/include   -c -o lquery_op.o lquery_op.c
gcc -g -fno-strict-aliasing -Wall -Wmissing-prototypes
-Wmissing-declarations  -DLOWER_NODE -I. -I..
/../src/include   -c -o _ltree_op.o _ltree_op.c
gcc -g -fno-strict-aliasing -Wall -Wmissing-prototypes
-Wmissing-declarations  -DLOWER_NODE -I. -I..
/../src/include   -c -o crc32.o crc32.c
gcc -g -fno-strict-aliasing -Wall -Wmissing-prototypes
-Wmissing-declarations  -DLOWER_NODE -I. -I..
/../src/include   -c -o ltxtquery_io.o ltxtquery_io.c
gcc -g -fno-strict-aliasing -Wall -Wmissing-prototypes
-Wmissing-declarations  -DLOWER_NODE -I. -I..
/../src/include   -c -o ltxtquery_op.o ltxtquery_op.c
gcc -g -fno-strict-aliasing -Wall -Wmissing-prototypes
-Wmissing-declarations  -DLOWER_NODE -I. -I..
/../src/include   -c -o ltree_gist.o ltree_gist.c
gcc -g -fno-strict-aliasing -Wall -Wmissing-prototypes
-Wmissing-declarations  -DLOWER_NODE -I. -I..
/../src/include   -c -o _ltree_gist.o _ltree_gist.c
dlltool --export-all  --output-def ltree.def ltree_io.o ltree_op.o
lquery_op.o _ltree_op.o crc32.o ltxtquery_io.o ltxtquery_op.o
ltree_gist.o _ltree_gist.o
dllwrap -o ltree.dll --dllname ltree.dll  --def ltree.def ltree_io.o
ltree_op.o lquery_op.o _ltree_op.o crc32.o ltxtquery_io.o ltxtquery_op.o
ltree_gist.o _ltree_gist.o ../../src/utils/dllinit.o -L../../src/port
-L/usr/local/lib -L../../src/backend -lpostgres
lquery_op.o(.text+0x1a4): In function `checkLevel':
/usr/src/postgresql/postgresql-8.0.0cvs/contrib/ltree/lquery_op.c:94:
undefined reference to `_pg_strncasecmp'
ltxtquery_op.o(.text+0x1b6): In function `checkcondition_str':
/usr/src/postgresql/postgresql-8.0.0cvs/contrib/ltree/ltxtquery_op.c:57:
undefined reference to `_pg_strncasecmp'
collect2: ld gab 1 als Ende-Status zur"uck
dllwrap: gcc exited with status 1
make[1]: *** [libltree.a] Fehler 1
make[1]: Leaving directory
`/usr/src/postgresql/postgresql-8.0.0cvs/contrib/ltree'

I still have to live with the attached patch, which will give then:

make[1]: Entering directory
`/usr/src/postgresql/postgresql-8.0.0cvs/contrib/ltree'
dlltool --export-all  --output-def ltree.def ltree_io.o ltree_op.o
lquery_op.o _ltree_op.o crc32.o ltxtquery_io.o ltxtquery_op.o
ltree_gist.o _ltree_gist.o
dllwrap -o ltree.dll --dllname ltree.dll  --def ltree.def ltree_io.o
ltree_op.o lquery_op.o _ltree_op.o crc32.o ltxtquery_io.o ltxtquery_op.o
ltree_gist.o _ltree_gist.o ../../src/utils/dllinit.o -L../
../src/port -L/usr/local/lib -L../../src/backend -lpostgres -lpgport
dlltool --dllname ltree.dll  --def ltree.def --output-lib libltree.a
make[1]: Leaving directory
`/usr/src/postgresql/postgresql-8.0.0cvs/contrib/ltree'

make -C src ok
make -C contrib ok

make check MAX_CONNECTIONS=5 ...
hangs as reported today in parallel schedule of create_misc.

INSERT INTO iportaltest (i, d, p)
    VALUES (2, 89.05, '(4.0,2.0),(3.0,1.0)'::polygon);
hangs ... until
   Cancel request sent
   FATAL:  terminating connection due to administrator command

I'll investigate why.
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/
--- postgresql-8.0.0cvs/src/Makefile.shlib.orig    2004-09-03 01:06:43.000000000 +0200
+++ postgresql-8.0.0cvs/src/Makefile.shlib    2004-10-04 12:39:15.000000000 +0200
@@ -216,6 +216,7 @@

 ifeq ($(PORTNAME), cygwin)
   shlib            = $(NAME)$(DLSUFFIX)
+  SHLIB_LINK        += -lpgport
 endif

 ifeq ($(PORTNAME), win32)


Re: [HACKERS] more dirmod CYGWIN

From
Bruce Momjian
Date:
I have added the attached patch to allow Cygwin /contrib compiles.  I am
a little confused why Cygwin requires -lpgport and no other platform
does, but it is in the Cygwin-specific section so we can always improve
it later if we find the cause.

Thanks.

---------------------------------------------------------------------------

Reini Urban wrote:
> Bruce Momjian schrieb:
> > Reini Urban wrote:
> >>Bruce Momjian schrieb:
> >>>I have applied all parts of your patch now.
> >>Thanks. Core builds and works fine now. (plperl IPC problems aside)
> >>
> >>But there's are still some more minor SHLIB glitches,
> >>which only affects contrib, because -lpgport is missing for various dll's.
> >
> > FYI, I think we fixed plperl for Win32 today.
>
> !! good to hear.
> I will come with my promised basic plperl regressiontests soon.
> No time at all yet.
>
> >>SHLIB_LINK doesn't contain the libs only the paths, because they are
> >>filtered out somewhere.
> >>But first I want to find the real cause of the problem.
> >>Maybe LIB is just missing a -lpgport.
> >
> > Would you please post the link command and error that is failing below:
>
> well, all dll contrib's which use pgport functions miss -lpgport.
> ltree, spi, tsearch, tsearch2, ...
>
> make[1]: Entering directory
> `/usr/src/postgresql/postgresql-8.0.0cvs/contrib/ltree'
> sed 's,MODULE_PATHNAME,$libdir/ltree,g' ltree.sql.in >ltree.sql
> gcc -g -fno-strict-aliasing -Wall -Wmissing-prototypes
> -Wmissing-declarations  -DLOWER_NODE -I. -I..
> /../src/include   -c -o ltree_io.o ltree_io.c
> gcc -g -fno-strict-aliasing -Wall -Wmissing-prototypes
> -Wmissing-declarations  -DLOWER_NODE -I. -I..
> /../src/include   -c -o ltree_op.o ltree_op.c
> gcc -g -fno-strict-aliasing -Wall -Wmissing-prototypes
> -Wmissing-declarations  -DLOWER_NODE -I. -I..
> /../src/include   -c -o lquery_op.o lquery_op.c
> gcc -g -fno-strict-aliasing -Wall -Wmissing-prototypes
> -Wmissing-declarations  -DLOWER_NODE -I. -I..
> /../src/include   -c -o _ltree_op.o _ltree_op.c
> gcc -g -fno-strict-aliasing -Wall -Wmissing-prototypes
> -Wmissing-declarations  -DLOWER_NODE -I. -I..
> /../src/include   -c -o crc32.o crc32.c
> gcc -g -fno-strict-aliasing -Wall -Wmissing-prototypes
> -Wmissing-declarations  -DLOWER_NODE -I. -I..
> /../src/include   -c -o ltxtquery_io.o ltxtquery_io.c
> gcc -g -fno-strict-aliasing -Wall -Wmissing-prototypes
> -Wmissing-declarations  -DLOWER_NODE -I. -I..
> /../src/include   -c -o ltxtquery_op.o ltxtquery_op.c
> gcc -g -fno-strict-aliasing -Wall -Wmissing-prototypes
> -Wmissing-declarations  -DLOWER_NODE -I. -I..
> /../src/include   -c -o ltree_gist.o ltree_gist.c
> gcc -g -fno-strict-aliasing -Wall -Wmissing-prototypes
> -Wmissing-declarations  -DLOWER_NODE -I. -I..
> /../src/include   -c -o _ltree_gist.o _ltree_gist.c
> dlltool --export-all  --output-def ltree.def ltree_io.o ltree_op.o
> lquery_op.o _ltree_op.o crc32.o ltxtquery_io.o ltxtquery_op.o
> ltree_gist.o _ltree_gist.o
> dllwrap -o ltree.dll --dllname ltree.dll  --def ltree.def ltree_io.o
> ltree_op.o lquery_op.o _ltree_op.o crc32.o ltxtquery_io.o ltxtquery_op.o
> ltree_gist.o _ltree_gist.o ../../src/utils/dllinit.o -L../../src/port
> -L/usr/local/lib -L../../src/backend -lpostgres
> lquery_op.o(.text+0x1a4): In function `checkLevel':
> /usr/src/postgresql/postgresql-8.0.0cvs/contrib/ltree/lquery_op.c:94:
> undefined reference to `_pg_strncasecmp'
> ltxtquery_op.o(.text+0x1b6): In function `checkcondition_str':
> /usr/src/postgresql/postgresql-8.0.0cvs/contrib/ltree/ltxtquery_op.c:57:
> undefined reference to `_pg_strncasecmp'
> collect2: ld gab 1 als Ende-Status zur"uck
> dllwrap: gcc exited with status 1
> make[1]: *** [libltree.a] Fehler 1
> make[1]: Leaving directory
> `/usr/src/postgresql/postgresql-8.0.0cvs/contrib/ltree'
>
> I still have to live with the attached patch, which will give then:
>
> make[1]: Entering directory
> `/usr/src/postgresql/postgresql-8.0.0cvs/contrib/ltree'
> dlltool --export-all  --output-def ltree.def ltree_io.o ltree_op.o
> lquery_op.o _ltree_op.o crc32.o ltxtquery_io.o ltxtquery_op.o
> ltree_gist.o _ltree_gist.o
> dllwrap -o ltree.dll --dllname ltree.dll  --def ltree.def ltree_io.o
> ltree_op.o lquery_op.o _ltree_op.o crc32.o ltxtquery_io.o ltxtquery_op.o
> ltree_gist.o _ltree_gist.o ../../src/utils/dllinit.o -L../
> ../src/port -L/usr/local/lib -L../../src/backend -lpostgres -lpgport
> dlltool --dllname ltree.dll  --def ltree.def --output-lib libltree.a
> make[1]: Leaving directory
> `/usr/src/postgresql/postgresql-8.0.0cvs/contrib/ltree'
>
> make -C src ok
> make -C contrib ok
>
> make check MAX_CONNECTIONS=5 ...
> hangs as reported today in parallel schedule of create_misc.
>
> INSERT INTO iportaltest (i, d, p)
>     VALUES (2, 89.05, '(4.0,2.0),(3.0,1.0)'::polygon);
> hangs ... until
>    Cancel request sent
>    FATAL:  terminating connection due to administrator command
>
> I'll investigate why.
> --
> Reini Urban
> http://xarch.tu-graz.ac.at/home/rurban/

> --- postgresql-8.0.0cvs/src/Makefile.shlib.orig    2004-09-03 01:06:43.000000000 +0200
> +++ postgresql-8.0.0cvs/src/Makefile.shlib    2004-10-04 12:39:15.000000000 +0200
> @@ -216,6 +216,7 @@
>
>  ifeq ($(PORTNAME), cygwin)
>    shlib            = $(NAME)$(DLSUFFIX)
> +  SHLIB_LINK        += -lpgport
>  endif
>
>  ifeq ($(PORTNAME), win32)
>

>
> ---------------------------(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
Index: src/Makefile.shlib
===================================================================
RCS file: /cvsroot/pgsql/src/Makefile.shlib,v
retrieving revision 1.83
diff -c -c -r1.83 Makefile.shlib
*** src/Makefile.shlib    13 Oct 2004 09:51:47 -0000    1.83
--- src/Makefile.shlib    13 Oct 2004 10:17:36 -0000
***************
*** 216,221 ****
--- 216,223 ----

  ifeq ($(PORTNAME), cygwin)
    shlib            = $(NAME)$(DLSUFFIX)
+   # needed for /contrib modules, not sure why
+   SHLIB_LINK        += -lpgport
  endif

  ifeq ($(PORTNAME), win32)

Re: [HACKERS] more dirmod CYGWIN

From
Reini Urban
Date:
Bruce Momjian schrieb:
> I have added the attached patch to allow Cygwin /contrib compiles.  I am
> a little confused why Cygwin requires -lpgport and no other platform
> does, but it is in the Cygwin-specific section so we can always improve
> it later if we find the cause.

thanks. duplicate does not harm.
I tell you when I'll find the real culprit.
I thought I knew it last month, but the LDFLAGS / LIBS issue
(adding all libs to LDFLAGS) is already fixed now.

> Index: src/Makefile.shlib
> ===================================================================
> RCS file: /cvsroot/pgsql/src/Makefile.shlib,v
> retrieving revision 1.83
> diff -c -c -r1.83 Makefile.shlib
> *** src/Makefile.shlib    13 Oct 2004 09:51:47 -0000    1.83
> --- src/Makefile.shlib    13 Oct 2004 10:17:36 -0000
> ***************
> *** 216,221 ****
> --- 216,223 ----
>
>   ifeq ($(PORTNAME), cygwin)
>     shlib            = $(NAME)$(DLSUFFIX)
> +   # needed for /contrib modules, not sure why
> +   SHLIB_LINK        += -lpgport
>   endif
>
>   ifeq ($(PORTNAME), win32)

--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/