pgevent warnings on mingw

Started by Andrew Dunstanalmost 17 years ago12 messages
#1Andrew Dunstan
andrew@dunslane.net

I just noticed these warnings on pgevent/mingw. I guess we've probably
been living with it for years, but it would be nice to get it clean.
(There are also some similar warnings earlier in the build regarding
RegisterWaitForSingleObject.)

dllwrap --def pgevent.def -o pgevent.dll pgevent.o pgmsgevent.o
Warning: resolving _DllUnregisterServer by linking to _DllUnregisterServer@0
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Warning: resolving _DllRegisterServer by linking to _DllRegisterServer@0
Warning: resolving _DllUnregisterServer by linking to _DllUnregisterServer@0
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Warning: resolving _DllRegisterServer by linking to _DllRegisterServer@0

What do we have to do to clean this stuff up?

cheers

andrew

#2Magnus Hagander
magnus@hagander.net
In reply to: Andrew Dunstan (#1)
Re: pgevent warnings on mingw

Andrew Dunstan wrote:

I just noticed these warnings on pgevent/mingw. I guess we've probably
been living with it for years, but it would be nice to get it clean.
(There are also some similar warnings earlier in the build regarding
RegisterWaitForSingleObject.)

dllwrap --def pgevent.def -o pgevent.dll pgevent.o pgmsgevent.o
Warning: resolving _DllUnregisterServer by linking to
_DllUnregisterServer@0
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Warning: resolving _DllRegisterServer by linking to _DllRegisterServer@0
Warning: resolving _DllUnregisterServer by linking to
_DllUnregisterServer@0
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Warning: resolving _DllRegisterServer by linking to _DllRegisterServer@0

What do we have to do to clean this stuff up?

Yeah, they've been there forever. This happened, IIRC, when we changed
the files to actually do what the documentation says. The commit message is:
"2) Change the pgevent DLL file so it doens't specify ordinal for the
functions. You're not supposed to do that. You're actually supposed to
declare them as PRIVATE as well, but mingw doesn't support that. VC++
will throw a warning and not an error though, so we can live with it.
"

The change was required to build at all with MSVC.

//Magnus

#3Hiroshi Saito
z-saito@guitar.ocn.ne.jp
In reply to: Andrew Dunstan (#1)
1 attachment(s)
Re: pgevent warnings on mingw

Hi.

dllwrap --def pgevent.def -o pgevent.dll pgevent.o pgmsgevent.o
Warning: resolving _DllUnregisterServer by linking to
_DllUnregisterServer@0
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Warning: resolving _DllRegisterServer by linking to _DllRegisterServer@0
Warning: resolving _DllUnregisterServer by linking to
_DllUnregisterServer@0
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Warning: resolving _DllRegisterServer by linking to _DllRegisterServer@0

What do we have to do to clean this stuff up?

I was solved for Marko-san at the time of the work of pgbouncer, and obtained the solution.
The patch is this.

== Before ==
$ make
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing
-fwrapv -g -I../../../src/include -I/C/work/MinGW_WORK/include -I./src/include/port/win32 -DEXEC_BACKEND
"-I../../../src/include/port/win32" -c -o pgevent.o pgevent.c
sed -e 's;FILEDESC;"Eventlog message formatter";' -e 's;VFT_APP;VFT_DLL;' -e 's;_ICO_;;' -e
's;\(VERSION.*\),0 *$;\1,'`date '+%y%j' | sed 's/^0*//'`';' ../../../src/port/win32ver.rc

win32ver.rc

windres pgmsgevent.rc -o
pgmsgevent.o --include-dir=../../../src/include --include-dir=../../../src/include --include-dir=.
dllwrap --def pgevent.def -o pgevent.dll pgevent.o pgmsgevent.o
Warning: resolving _DllUnregisterServer by linking to _DllUnregisterServer@0
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Warning: resolving _DllRegisterServer by linking to _DllRegisterServer@0
Warning: resolving _DllUnregisterServer by linking to _DllUnregisterServer@0
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Warning: resolving _DllRegisterServer by linking to _DllRegisterServer@0

== After patch. ==

$ make
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing
-fwrapv -g -I../../../src/include -I/C/work/MinGW_WORK/include -I./src/include/port/win32 -DEXEC_BACKEND
"-I../../../src/include/port/win32" -c -o pgevent.o pgevent.c
sed -e 's;FILEDESC;"Eventlog message formatter";' -e 's;VFT_APP;VFT_DLL;' -e 's;_ICO_;;' -e
's;\(VERSION.*\),0 *$;\1,'`date '+%y%j' | sed 's/^0*//'`';' ../../../src/port/win32ver.rc

win32ver.rc

windres pgmsgevent.rc -o
pgmsgevent.o --include-dir=../../../src/include --include-dir=../../../src/include --include-dir=.
dlltool --export-all-symbols -A --output-def pgevent.def pgevent.o pgmsgevent.o
dllwrap --def pgevent.def -o pgevent.dll pgevent.o pgmsgevent.o
==

It will be great if this is taken into consideration.

Regards,
Hiroshi Saito

Attachments:

pgevent_patchapplication/octet-stream; name=pgevent_patchDownload
#4Magnus Hagander
magnus@hagander.net
In reply to: Hiroshi Saito (#3)
Re: pgevent warnings on mingw

Hiroshi Saito wrote:

Hi.

dllwrap --def pgevent.def -o pgevent.dll pgevent.o pgmsgevent.o
Warning: resolving _DllUnregisterServer by linking to
_DllUnregisterServer@0
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Warning: resolving _DllRegisterServer by linking to _DllRegisterServer@0
Warning: resolving _DllUnregisterServer by linking to
_DllUnregisterServer@0
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Warning: resolving _DllRegisterServer by linking to _DllRegisterServer@0

What do we have to do to clean this stuff up?

I was solved for Marko-san at the time of the work of pgbouncer, and
obtained the solution.
The patch is this.

This appears to be exactly what you are *not* supposed to do. Which is
assign an ordinal. See:
http://msdn.microsoft.com/en-us/library/8e705t74(VS.71).aspx

(that's just about the warning, there is a page somewhere with more
details, but I can't find it right now)

//Magnus

#5Hiroshi Saito
z-saito@guitar.ocn.ne.jp
In reply to: Andrew Dunstan (#1)
Re: pgevent warnings on mingw

Hi.

Sorry, I was not able to find the point to which you point.

This appears to be exactly what you are *not* supposed to do. Which is
assign an ordinal. See:
http://msdn.microsoft.com/en-us/library/8e705t74(VS.71).aspx

(that's just about the warning, there is a page somewhere with more
details, but I can't find it right now)

Please see this, if the point which you suggest becomes about output image size.
== Before ==
-rwxr-xr-x 1 HIROSHI Administ 425977 Feb 1 00:33 pgevent.dll
== After patch. ==
-rwxr-xr-x 1 HIROSHI Administ 425955 Feb 1 00:34 pgevent.dll

Then, new pgevent.def is this.
; C:\MinGW\bin\dlltool.exe --export-all-symbols -A --output-def pgevent.def pgevent.o pgmsgevent.o
EXPORTS
DllRegisterServer@0 @ 1
DllUnregisterServer = DllUnregisterServer@0 @ 2
DllUnregisterServer@0 @ 3
g_module @ 4 DATA
DllRegisterServer = DllRegisterServer@0 @ 5

Regards,
Hiroshi Saito

#6Marko Kreen
markokr@gmail.com
In reply to: Magnus Hagander (#4)
Re: pgevent warnings on mingw

On 1/31/09, Magnus Hagander <magnus@hagander.net> wrote:

Hiroshi Saito wrote:

Hi.

dllwrap --def pgevent.def -o pgevent.dll pgevent.o pgmsgevent.o
Warning: resolving _DllUnregisterServer by linking to
_DllUnregisterServer@0
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Warning: resolving _DllRegisterServer by linking to _DllRegisterServer@0
Warning: resolving _DllUnregisterServer by linking to
_DllUnregisterServer@0
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Warning: resolving _DllRegisterServer by linking to _DllRegisterServer@0

What do we have to do to clean this stuff up?

I was solved for Marko-san at the time of the work of pgbouncer, and
obtained the solution.
The patch is this.

This appears to be exactly what you are *not* supposed to do. Which is
assign an ordinal. See:
http://msdn.microsoft.com/en-us/library/8e705t74(VS.71).aspx

AFAICS by default the mingw assigns the ordinal anyway?

So whats your point?

(that's just about the warning, there is a page somewhere with more
details, but I can't find it right now)

I found this:

http://www.geocities.com/yongweiwu/stdcall.htm

which definitely has too much detail...

--
marko

#7Marko Kreen
markokr@gmail.com
In reply to: Marko Kreen (#6)
Re: pgevent warnings on mingw

On 1/31/09, Marko Kreen <markokr@gmail.com> wrote:

On 1/31/09, Magnus Hagander <magnus@hagander.net> wrote:

Hiroshi Saito wrote:

Hi.

dllwrap --def pgevent.def -o pgevent.dll pgevent.o pgmsgevent.o
Warning: resolving _DllUnregisterServer by linking to
_DllUnregisterServer@0
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Warning: resolving _DllRegisterServer by linking to _DllRegisterServer@0
Warning: resolving _DllUnregisterServer by linking to
_DllUnregisterServer@0
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Warning: resolving _DllRegisterServer by linking to _DllRegisterServer@0

What do we have to do to clean this stuff up?

I was solved for Marko-san at the time of the work of pgbouncer, and
obtained the solution.
The patch is this.

This appears to be exactly what you are *not* supposed to do. Which is
assign an ordinal. See:
http://msdn.microsoft.com/en-us/library/8e705t74(VS.71).aspx

AFAICS by default the mingw assigns the ordinal anyway?

So whats your point?

FWIW, I experimented with various approaches on DLL generation,
and my theory is now that numeric slot is mandatory for export,
name slot optional. And what the above link above warns about
is that if you manually assign a numeric slot, you may create gaps in
slot table, thus resulting in larger image. But this assumes
you already have slots that are manually assigned, which should
not happen with pgevent.dll.

Does it sound sane?

With pgbouncer I used "dlltool --export-all-symbols -A" to generate
the .def file, thus the slots are actually assigned automatically
by dlltool, so no gap problems should arise. As Postgres does not
generate .def automatically, thus Hiroshi simply posted the resulting
.def file, which should not have gap problems.

But such detailed .def avoids the confusing warnings from dllwrap.
If you are worried about gap problems I suggest instead doing the
same and making the .def file auto-generated.

--
marko

ps. I suggest also tagging the "g_module" as static.

#8Hiroshi Saito
z-saito@guitar.ocn.ne.jp
In reply to: Andrew Dunstan (#1)
1 attachment(s)
Re: pgevent warnings on mingw

Hi.

I am checking that consider sufficient test as Marko-san and it is satisfactory.
However, That there is a portion which does not suit the solution of MSVC
also understands. Therefore, How is this proposal?

1. )remove pgevent.def
It is always generated.

2.) improvement of the Makefile and Solution.pm

What do you think?

Regards,
Hiroshi Saito

----- Original Message -----
From: "Marko Kreen" <markokr@gmail.com>

Show quoted text

On 1/31/09, Marko Kreen <markokr@gmail.com> wrote:

On 1/31/09, Magnus Hagander <magnus@hagander.net> wrote:

Hiroshi Saito wrote:

Hi.

dllwrap --def pgevent.def -o pgevent.dll pgevent.o pgmsgevent.o
Warning: resolving _DllUnregisterServer by linking to
_DllUnregisterServer@0
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Warning: resolving _DllRegisterServer by linking to _DllRegisterServer@0
Warning: resolving _DllUnregisterServer by linking to
_DllUnregisterServer@0
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Warning: resolving _DllRegisterServer by linking to _DllRegisterServer@0

What do we have to do to clean this stuff up?

I was solved for Marko-san at the time of the work of pgbouncer, and
obtained the solution.
The patch is this.

This appears to be exactly what you are *not* supposed to do. Which is
assign an ordinal. See:
http://msdn.microsoft.com/en-us/library/8e705t74(VS.71).aspx

AFAICS by default the mingw assigns the ordinal anyway?

So whats your point?

FWIW, I experimented with various approaches on DLL generation,
and my theory is now that numeric slot is mandatory for export,
name slot optional. And what the above link above warns about
is that if you manually assign a numeric slot, you may create gaps in
slot table, thus resulting in larger image. But this assumes
you already have slots that are manually assigned, which should
not happen with pgevent.dll.

Does it sound sane?

With pgbouncer I used "dlltool --export-all-symbols -A" to generate
the .def file, thus the slots are actually assigned automatically
by dlltool, so no gap problems should arise. As Postgres does not
generate .def automatically, thus Hiroshi simply posted the resulting
.def file, which should not have gap problems.

But such detailed .def avoids the confusing warnings from dllwrap.
If you are worried about gap problems I suggest instead doing the
same and making the .def file auto-generated.

--
marko

ps. I suggest also tagging the "g_module" as static.

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

pgevent_def_patchapplication/octet-stream; name=pgevent_def_patchDownload
*** src/bin/pgevent/Makefile.orig	Mon Jan  5 18:27:19 2009
--- src/bin/pgevent/Makefile	Sun Feb  1 11:21:59 2009
***************
*** 24,29 ****
--- 24,32 ----
  pgevent.dll: pgevent.def $(OBJS)
  	$(DLLWRAP) --def $< -o $(NAME) $(OBJS)
  
+ pgevent.def: $(OBJS)
+ 	dlltool --export-all-symbols -A --output-def $@ $(OBJS)
+ 
  pgmsgevent.o: pgmsgevent.rc win32ver.rc
  	$(WINDRES) $< -o $@ --include-dir=$(top_builddir)/src/include --include-dir=$(top_srcdir)/src/include --include-dir=$(srcdir)
  
***************
*** 36,42 ****
  	rm -f '$(DESTDIR)$(libdir)/$(NAME)'
  
  clean distclean:
! 	rm -f $(OBJS) $(NAME) win32ver.rc
  
  clean-lib:
  	rm -f $(NAME)
--- 39,45 ----
  	rm -f '$(DESTDIR)$(libdir)/$(NAME)'
  
  clean distclean:
! 	rm -f $(OBJS) $(NAME) win32ver.rc pgevent.def
  
  clean-lib:
  	rm -f $(NAME)
*** src/bin/pgevent/exports.txt.orig	Sun Feb  1 11:30:12 2009
--- src/bin/pgevent/exports.txt	Sun Feb  1 11:13:47 2009
***************
*** 0 ****
--- 1,3 ----
+ ; dlltool --output-def pgevent.def pgevent.o pgmsgevent.o
+ DllUnregisterServer
+ DllRegisterServer
*** src/tools/msvc/Solution.pm.orig	Wed Jan  7 03:37:50 2009
--- src/tools/msvc/Solution.pm	Sun Feb  1 11:07:47 2009
***************
*** 199,204 ****
--- 199,205 ----
      $self->GenerateDefFile("src\\interfaces\\ecpg\\ecpglib\\ecpglib.def","src\\interfaces\\ecpg\\ecpglib\\exports.txt","LIBECPG");
      $self->GenerateDefFile("src\\interfaces\\ecpg\\compatlib\\compatlib.def","src\\interfaces\\ecpg\\compatlib\\exports.txt","LIBECPG_COMPAT");
      $self->GenerateDefFile("src\\interfaces\\ecpg\\pgtypeslib\\pgtypeslib.def","src\\interfaces\\ecpg\\pgtypeslib\\exports.txt","LIBPGTYPES");
+     $self->GenerateDefFile("src\\bin\\pgevent\\pgevent.def","src\\bin\\pgevent\\exports.txt","PGEVENT");
  
      if (IsNewer('src\backend\utils\fmgrtab.c','src\include\catalog\pg_proc.h'))
      {
#9Hiroshi Saito
z-saito@guitar.ocn.ne.jp
In reply to: Hiroshi Saito (#8)
1 attachment(s)
Re: pgevent warnings on mingw

Ooops, sorry., One mistake:-(
Please this.

----- Original Message -----
From: "Hiroshi Saito" <z-saito@guitar.ocn.ne.jp>

Show quoted text

Hi.

I am checking that consider sufficient test as Marko-san and it is satisfactory.
However, That there is a portion which does not suit the solution of MSVC
also understands. Therefore, How is this proposal?

1. )remove pgevent.def
It is always generated.

2.) improvement of the Makefile and Solution.pm

What do you think?

Regards,
Hiroshi Saito

Attachments:

pgevent_def_patch_v2application/octet-stream; name=pgevent_def_patch_v2Download
*** src/bin/pgevent/Makefile.orig	Mon Jan  5 18:27:19 2009
--- src/bin/pgevent/Makefile	Sun Feb  1 11:21:59 2009
***************
*** 24,29 ****
--- 24,32 ----
  pgevent.dll: pgevent.def $(OBJS)
  	$(DLLWRAP) --def $< -o $(NAME) $(OBJS)
  
+ pgevent.def: $(OBJS)
+ 	dlltool --export-all-symbols -A --output-def $@ $(OBJS)
+ 
  pgmsgevent.o: pgmsgevent.rc win32ver.rc
  	$(WINDRES) $< -o $@ --include-dir=$(top_builddir)/src/include --include-dir=$(top_srcdir)/src/include --include-dir=$(srcdir)
  
***************
*** 36,42 ****
  	rm -f '$(DESTDIR)$(libdir)/$(NAME)'
  
  clean distclean:
! 	rm -f $(OBJS) $(NAME) win32ver.rc
  
  clean-lib:
  	rm -f $(NAME)
--- 39,45 ----
  	rm -f '$(DESTDIR)$(libdir)/$(NAME)'
  
  clean distclean:
! 	rm -f $(OBJS) $(NAME) win32ver.rc pgevent.def
  
  clean-lib:
  	rm -f $(NAME)
*** src/bin/pgevent/exports.txt.orig	Sun Feb  1 11:30:12 2009
--- src/bin/pgevent/exports.txt	Sun Feb  1 11:47:37 2009
***************
*** 0 ****
--- 1,3 ----
+ DllUnregisterServer=DllUnregisterServer@0 
+ DllRegisterServer=DllRegisterServer@0 
+ 
*** src/tools/msvc/Solution.pm.orig	Wed Jan  7 03:37:50 2009
--- src/tools/msvc/Solution.pm	Sun Feb  1 11:07:47 2009
***************
*** 199,204 ****
--- 199,205 ----
      $self->GenerateDefFile("src\\interfaces\\ecpg\\ecpglib\\ecpglib.def","src\\interfaces\\ecpg\\ecpglib\\exports.txt","LIBECPG");
      $self->GenerateDefFile("src\\interfaces\\ecpg\\compatlib\\compatlib.def","src\\interfaces\\ecpg\\compatlib\\exports.txt","LIBECPG_COMPAT");
      $self->GenerateDefFile("src\\interfaces\\ecpg\\pgtypeslib\\pgtypeslib.def","src\\interfaces\\ecpg\\pgtypeslib\\exports.txt","LIBPGTYPES");
+     $self->GenerateDefFile("src\\bin\\pgevent\\pgevent.def","src\\bin\\pgevent\\exports.txt","PGEVENT");
  
      if (IsNewer('src\backend\utils\fmgrtab.c','src\include\catalog\pg_proc.h'))
      {
#10Hiroshi Saito
z-saito@guitar.ocn.ne.jp
In reply to: Hiroshi Saito (#9)
1 attachment(s)
Re: pgevent warnings on mingw

Ahh, sorry..like the spam....
again!

I thought over that the existing msvc the did not have uneasines.
so, I wish to make it this as correspondence with worried Magnus-san.
It is after sufficient test.

Regards,
Hiroshi Saito

----- Original Message -----
From: "Hiroshi Saito" <z-saito@guitar.ocn.ne.jp>

Ooops, sorry., One mistake:-(
Please this.

----- Original Message -----
From: "Hiroshi Saito" <z-saito@guitar.ocn.ne.jp>

Hi.

I am checking that consider sufficient test as Marko-san and it is satisfactory.
However, That there is a portion which does not suit the solution of MSVC
also understands. Therefore, How is this proposal?

1. )remove pgevent.def
It is always generated.

2.) improvement of the Makefile and Solution.pm

What do you think?

Regards,
Hiroshi Saito

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

Show quoted text

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

pgevent_def_patch_v3application/octet-stream; name=pgevent_def_patch_v3Download
*** src/bin/pgevent/Makefile.orig	Mon Jan  5 18:27:19 2009
--- src/bin/pgevent/Makefile	Sun Feb  1 11:21:59 2009
***************
*** 24,29 ****
--- 24,32 ----
  pgevent.dll: pgevent.def $(OBJS)
  	$(DLLWRAP) --def $< -o $(NAME) $(OBJS)
  
+ pgevent.def: $(OBJS)
+ 	dlltool --export-all-symbols -A --output-def $@ $(OBJS)
+ 
  pgmsgevent.o: pgmsgevent.rc win32ver.rc
  	$(WINDRES) $< -o $@ --include-dir=$(top_builddir)/src/include --include-dir=$(top_srcdir)/src/include --include-dir=$(srcdir)
  
***************
*** 36,42 ****
  	rm -f '$(DESTDIR)$(libdir)/$(NAME)'
  
  clean distclean:
! 	rm -f $(OBJS) $(NAME) win32ver.rc
  
  clean-lib:
  	rm -f $(NAME)
--- 39,45 ----
  	rm -f '$(DESTDIR)$(libdir)/$(NAME)'
  
  clean distclean:
! 	rm -f $(OBJS) $(NAME) win32ver.rc pgevent.def
  
  clean-lib:
  	rm -f $(NAME)
*** src/bin/pgevent/exports.txt.orig	Sun Feb  1 11:30:12 2009
--- src/bin/pgevent/exports.txt	Sun Feb  1 12:30:29 2009
***************
*** 0 ****
--- 1,4 ----
+ ;Note - ';' is by the reason for not adding a number for MSVC. 
+ DllUnregisterServer;
+ DllRegisterServer;
+ 
*** src/tools/msvc/Solution.pm.orig	Wed Jan  7 03:37:50 2009
--- src/tools/msvc/Solution.pm	Sun Feb  1 11:07:47 2009
***************
*** 199,204 ****
--- 199,205 ----
      $self->GenerateDefFile("src\\interfaces\\ecpg\\ecpglib\\ecpglib.def","src\\interfaces\\ecpg\\ecpglib\\exports.txt","LIBECPG");
      $self->GenerateDefFile("src\\interfaces\\ecpg\\compatlib\\compatlib.def","src\\interfaces\\ecpg\\compatlib\\exports.txt","LIBECPG_COMPAT");
      $self->GenerateDefFile("src\\interfaces\\ecpg\\pgtypeslib\\pgtypeslib.def","src\\interfaces\\ecpg\\pgtypeslib\\exports.txt","LIBPGTYPES");
+     $self->GenerateDefFile("src\\bin\\pgevent\\pgevent.def","src\\bin\\pgevent\\exports.txt","PGEVENT");
  
      if (IsNewer('src\backend\utils\fmgrtab.c','src\include\catalog\pg_proc.h'))
      {
#11Magnus Hagander
magnus@hagander.net
In reply to: Hiroshi Saito (#10)
Re: pgevent warnings on mingw

Hiroshi Saito wrote:

Ahh, sorry..like the spam....
again!

I thought over that the existing msvc the did not have uneasines.
so, I wish to make it this as correspondence with worried Magnus-san.
It is after sufficient test.

If I read this patch right, it does an "export all symbols" when run on
mingw? That surely can't be right? We may not have any additional
symbols there now, but it's certaily not the intention? Plus, it makes
msvc behave differently from mingw (since msvc uses the exports.txt)?

I did some more checking, and it seems MS has changed the warnings in
the new version of VIsual Studio. Right now, the following exports.txt
file passes without warnings. Can someone check if it does on mingw?

EXPORTS
DllUnregisterServer @ 1;
DllRegisterServer @ 2;

Do you need all that extra decoration junk on mingw, or does it work
this way?

//Magnus

#12Hiroshi Saito
z-saito@guitar.ocn.ne.jp
In reply to: Hiroshi Saito (#9)
Re: pgevent warnings on mingw

----- Original Message -----
From: "Magnus Hagander" <magnus@hagander.net>

Hiroshi Saito wrote:

Ahh, sorry..like the spam....
again!

I thought over that the existing msvc the did not have uneasines.
so, I wish to make it this as correspondence with worried Magnus-san.
It is after sufficient test.

If I read this patch right, it does an "export all symbols" when run on
mingw? That surely can't be right? We may not have any additional
symbols there now, but it's certaily not the intention? Plus, it makes
msvc behave differently from mingw (since msvc uses the exports.txt)?

I did some more checking, and it seems MS has changed the warnings in
the new version of VIsual Studio. Right now, the following exports.txt
file passes without warnings. Can someone check if it does on mingw?

EXPORTS
DllUnregisterServer @ 1;
DllRegisterServer @ 2;

Do you need all that extra decoration junk on mingw, or does it work
this way?

It was checked.

$ cat pgevent.def
EXPORTS
DllUnregisterServer @ 1;
DllRegisterServer @ 2;

$ make
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing
-fwrapv -g -I../../../src/include -I/C/work/MinGW_WORK/include -I./src/include/port/win32 -DEXEC_BACKEND
"-I../../../src/include/port/win32" -c -o pgevent.o pgevent.c
sed -e 's;FILEDESC;"Eventlog message formatter";' -e 's;VFT_APP;VFT_DLL;' -e 's;_ICO_;;' -e
's;\(VERSION.*\),0 *$;\1,'`date '+%y%j' | sed 's/^0*//'`';' ../../../src/port/win32ver.rc

win32ver.rc

windres pgmsgevent.rc -o
pgmsgevent.o --include-dir=../../../src/include --include-dir=../../../src/include --include-dir=.
dllwrap --def pgevent.def -o pgevent.dll pgevent.o pgmsgevent.o
Warning: resolving _DllUnregisterServer by linking to _DllUnregisterServer@0
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Warning: resolving _DllRegisterServer by linking to _DllRegisterServer@0
Warning: resolving _DllUnregisterServer by linking to _DllUnregisterServer@0
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Warning: resolving _DllRegisterServer by linking to _DllRegisterServer@0

Regards,
Hiroshi Saito