7.3 Beta 1 Build Error on Cygwin

Started by Dave Pageover 23 years ago11 messages
#1Dave Page
dpage@vale-housing.co.uk

I get the following error when building beta 1 on CYGWIN_NT-5.1 PC9
1.3.10(0.51/3/2) 2002-02-25 11:14 i686 unknown:

make[3]: Entering directory
`/usr/local/src/postgresql-7.3b1/src/backend/utils/mb/conversion_procs/c
yrillic_and_mic'
gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations
-I../../../../../../src/include -I/usr/local/include -DBUILDING_DLL=1
-c -o cyrillic_and_mic.o cyrillic_and_mic.c
dlltool --export-all --output-def cyrillic_and_mic.def
cyrillic_and_mic.o
dllwrap -o cyrillic_and_mic.dll --dllname cyrillic_and_mic.dll --def
cyrillic_and_mic.def cyrillic_and_mic.o
../../../../../../src/utils/dllinit.o -lcygipc -lcrypt -L/usr/local/lib
-L../../../../../../src/backend -lpostgres
Warning: resolving _CurrentMemoryContext by linking to
__imp__CurrentMemoryContext (auto-import)
fu000001.o(.idata$3+0xc): undefined reference to `libpostgres_a_iname'
fu000002.o(.idata$3+0xc): undefined reference to `libpostgres_a_iname'
fu000003.o(.idata$3+0xc): undefined reference to `libpostgres_a_iname'
fu000004.o(.idata$3+0xc): undefined reference to `libpostgres_a_iname'
fu000005.o(.idata$3+0xc): undefined reference to `libpostgres_a_iname'
fu000006.o(.idata$3+0xc): more undefined references to
`libpostgres_a_iname' follow
nmth000000.o(.idata$4+0x0): undefined reference to
`_nm__CurrentMemoryContext'
collect2: ld returned 1 exit status
dllwrap: gcc exited with status 1
make[3]: *** [cyrillic_and_mic.dll] Error 1
make[3]: Leaving directory
`/usr/local/src/postgresql-7.3b1/src/backend/utils/mb
/conversion_procs/cyrillic_and_mic'
make[2]: *** [all] Error 2
make[2]: Leaving directory
`/usr/local/src/postgresql-7.3b1/src/backend/utils/mb
/conversion_procs'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/local/src/postgresql-7.3b1/src'
make: *** [all] Error 2
PC9 $

Regards, Dave

#2Jason Tishler
jason@tishler.net
In reply to: Dave Page (#1)
2 attachment(s)
Re: [CYGWIN] 7.3 Beta 1 Build Error on Cygwin

The following build error under Cygwin was recently reported:

On Thu, Sep 05, 2002 at 12:54:50PM +0100, Dave Page wrote:

I get the following error when building beta 1 on CYGWIN_NT-5.1 PC9
1.3.10(0.51/3/2) 2002-02-25 11:14 i686 unknown:

make[3]: Entering directory `/usr/local/src/postgresql-7.3b1/src/backend/utils/mb/conversion_procs/cyrillic_and_mic'
gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -I../../../../../../src/include -I/usr/local/include -DBUILDING_DLL=1 -c -o cyrillic_and_mic.o cyrillic_and_mic.c
[snip]
dllwrap -o cyrillic_and_mic.dll --dllname cyrillic_and_mic.dll --def cyrillic_and_mic.def cyrillic_and_mic.o ../../../../../../src/utils/dllinit.o -lcygipc -lcrypt -L/usr/local/lib -L../../../../../../src/backend -lpostgres
Warning: resolving _CurrentMemoryContext by linking to __imp__CurrentMemoryContext (auto-import)
[snip]
nmth000000.o(.idata$4+0x0): undefined reference to `_nm__CurrentMemoryContext'

The first patch fixes the above, the second one fixes the following:

make[4]: Entering directory `/home/jt/src/pgsql/src/pl/plpgsql/src'
[snip]
dllwrap -o plpgsql.dll --dllname plpgsql.dll --def plpgsql.def pl_gram.o pl_scan.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o ../../../../src/utils/dllinit.o -L../../../../src/backend -lpostgres -lcygipc -lcrypt -L/usr/local/lib
Warning: resolving _InterruptPending by linking to __imp__InterruptPending (auto-import)
Warning: resolving _SortMem by linking to __imp__SortMem (auto-import)
[snip]
nmth000000.o(.idata$4+0x0): undefined reference to `_nm__InterruptPending'
nmth000002.o(.idata$4+0x0): undefined reference to `_nm__SortMem'

After applying these patches, PostgreSQL CVS builds cleanly under Cygwin
again.

Thanks,
Jason

P.S. Dave, thanks for the heads up!

Attachments:

Makefile.win.difftext/plain; NAME=Makefile.win.diff; charset=us-asciiDownload
Index: Makefile.win
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/makefiles/Makefile.win,v
retrieving revision 1.17
diff -u -p -r1.17 Makefile.win
--- Makefile.win	2002/07/27 20:10:05	1.17
+++ Makefile.win	2002/09/05 13:48:25
@@ -22,7 +22,9 @@ CFLAGS_SL =
 	rm -f $*.def
 
 ifeq ($(findstring backend,$(subdir)), backend)
+ifneq ($(findstring conversion_procs,$(subdir)), conversion_procs)
 override CPPFLAGS+= -DBUILDING_DLL=1
+endif
 endif
 
 ifeq ($(findstring ecpg/lib,$(subdir)), ecpg/lib)
miscadmin.h.difftext/plain; NAME=miscadmin.h.diff; charset=us-asciiDownload
Index: miscadmin.h
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/include/miscadmin.h,v
retrieving revision 1.109
diff -u -p -r1.109 miscadmin.h
--- miscadmin.h	2002/09/04 20:31:36	1.109
+++ miscadmin.h	2002/09/05 15:11:31
@@ -62,7 +62,7 @@
 
 /* in globals.c */
 /* these are marked volatile because they are set by signal handlers: */
-extern volatile bool InterruptPending;
+extern DLLIMPORT volatile bool InterruptPending;
 extern volatile bool QueryCancelPending;
 extern volatile bool ProcDiePending;
 
@@ -166,7 +166,7 @@ extern char DateFormat[];
 
 extern bool enableFsync;
 extern bool allowSystemTableMods;
-extern int	SortMem;
+extern DLLIMPORT int SortMem;
 extern int	VacuumMem;
 
 /*
#3Jason Tishler
jason@tishler.net
In reply to: Dave Page (#1)
Re: 7.3 Beta 1 Build Error on Cygwin

Dave,

On Thu, Sep 05, 2002 at 12:54:50PM +0100, Dave Page wrote:

I get the following error when building beta 1 on CYGWIN_NT-5.1 PC9
1.3.10(0.51/3/2) 2002-02-25 11:14 i686 unknown:

make[3]: Entering directory `/usr/local/src/postgresql-7.3b1/src/backend/utils/mb/conversion_procs/cyrillic_and_mic'
gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -I../../../../../../src/include -I/usr/local/include -DBUILDING_DLL=1 -c -o cyrillic_and_mic.o cyrillic_and_mic.c
[snip]
dllwrap -o cyrillic_and_mic.dll --dllname cyrillic_and_mic.dll --def cyrillic_and_mic.def cyrillic_and_mic.o ../../../../../../src/utils/dllinit.o -lcygipc -lcrypt -L/usr/local/lib -L../../../../../../src/backend -lpostgres
Warning: resolving _CurrentMemoryContext by linking to __imp__CurrentMemoryContext (auto-import)
[snip]
nmth000000.o(.idata$4+0x0): undefined reference to `_nm__CurrentMemoryContext'

I just submitted a patch to pgsql-patches to fix the above and to add a
couple of missing DLLIMPORTs to src/include/miscadmin.h.

FYI, plperl no longer builds cleanly against Cygwin Perl 5.6.1 because
PostgreSQL no longer uses the Perl extension infrastructure. However,
upgrading Cygwin Perl to 5.8.0 solves the problem because this version
uses the conventional name for libperl.a instead of one that has the
version embedded in it.

Thanks again for the heads up.

Jason

#4Dave Page
dpage@vale-housing.co.uk
In reply to: Jason Tishler (#3)
Re: 7.3 Beta 1 Build Error on Cygwin

-----Original Message-----
From: Jason Tishler [mailto:jason@tishler.net]
Sent: 05 September 2002 16:30
To: Dave Page
Cc: pgsql-hackers; pgsql-cygwin
Subject: Re: [CYGWIN] 7.3 Beta 1 Build Error on Cygwin

I just submitted a patch to pgsql-patches to fix the above
and to add a couple of missing DLLIMPORTs to src/include/miscadmin.h.

Yup, saw that, thanks.

FYI, plperl no longer builds cleanly against Cygwin Perl
5.6.1 because PostgreSQL no longer uses the Perl extension
infrastructure. However, upgrading Cygwin Perl to 5.8.0
solves the problem because this version uses the conventional
name for libperl.a instead of one that has the version embedded in it.

I'll bear that in mind, though I don't normally use Perl.

Thanks again for the heads up.

You're welcome, just trying to get a headstart on the testing of pgAdmin
for 7.3 and the 7.3 regression testing...

Show quoted text

Jason

#5Peter Eisentraut
peter_e@gmx.net
In reply to: Dave Page (#1)
Re: [HACKERS] 7.3 Beta 1 Build Error on Cygwin

Dave Page writes:

I get the following error when building beta 1 on CYGWIN_NT-5.1 PC9
1.3.10(0.51/3/2) 2002-02-25 11:14 i686 unknown:

Should all be fixed now.

--
Peter Eisentraut peter_e@gmx.net

#6Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Jason Tishler (#2)
Re: [CYGWIN] 7.3 Beta 1 Build Error on Cygwin

Your changes have been applied by Peter.

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

Jason Tishler wrote:

The following build error under Cygwin was recently reported:

On Thu, Sep 05, 2002 at 12:54:50PM +0100, Dave Page wrote:

I get the following error when building beta 1 on CYGWIN_NT-5.1 PC9
1.3.10(0.51/3/2) 2002-02-25 11:14 i686 unknown:

make[3]: Entering directory `/usr/local/src/postgresql-7.3b1/src/backend/utils/mb/conversion_procs/cyrillic_and_mic'
gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -I../../../../../../src/include -I/usr/local/include -DBUILDING_DLL=1 -c -o cyrillic_and_mic.o cyrillic_and_mic.c
[snip]
dllwrap -o cyrillic_and_mic.dll --dllname cyrillic_and_mic.dll --def cyrillic_and_mic.def cyrillic_and_mic.o ../../../../../../src/utils/dllinit.o -lcygipc -lcrypt -L/usr/local/lib -L../../../../../../src/backend -lpostgres
Warning: resolving _CurrentMemoryContext by linking to __imp__CurrentMemoryContext (auto-import)
[snip]
nmth000000.o(.idata$4+0x0): undefined reference to `_nm__CurrentMemoryContext'

The first patch fixes the above, the second one fixes the following:

make[4]: Entering directory `/home/jt/src/pgsql/src/pl/plpgsql/src'
[snip]
dllwrap -o plpgsql.dll --dllname plpgsql.dll --def plpgsql.def pl_gram.o pl_scan.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o ../../../../src/utils/dllinit.o -L../../../../src/backend -lpostgres -lcygipc -lcrypt -L/usr/local/lib
Warning: resolving _InterruptPending by linking to __imp__InterruptPending (auto-import)
Warning: resolving _SortMem by linking to __imp__SortMem (auto-import)
[snip]
nmth000000.o(.idata$4+0x0): undefined reference to `_nm__InterruptPending'
nmth000002.o(.idata$4+0x0): undefined reference to `_nm__SortMem'

After applying these patches, PostgreSQL CVS builds cleanly under Cygwin
again.

Thanks,
Jason

P.S. Dave, thanks for the heads up!

[ Attachment, skipping... ]

[ Attachment, skipping... ]

---------------------------(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
#7Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Bruce Momjian (#6)
Re: [HACKERS] 7.3 Beta 1 Build Error on Cygwin

Jason Tishler wrote:

Peter,

On Thu, Sep 05, 2002 at 08:33:20PM +0200, Peter Eisentraut wrote:

Dave Page writes:

I get the following error when building beta 1 on CYGWIN_NT-5.1 PC9
1.3.10(0.51/3/2) 2002-02-25 11:14 i686 unknown:

Should all be fixed now.

Huh? I don't see any recent CVS commits to indicate this.

I see as a commit:

Assorted fixes for Cygwin:

Eliminate the mysterious games that the Cygwin build plays with the linker
flag variables. DLLLIBS is gone, use SHLIB_LINK like everyone else.
Detect cygipc in configure, after the linker flags are set up, otherwise
configure might not work at all.

Make sure everything is covered by make clean.

Fix the build of the new conversion procedure modules.

Add new DLLIMPORT markers where required.

Finally, the compiler complains if we use an explicit
-I/usr/local/include, so don't do that. Curiously, -L/usr/local/lib is
still necessary.

I assume it was in there.

-- 
  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
#8Jason Tishler
jason@tishler.net
In reply to: Peter Eisentraut (#5)
Re: [HACKERS] 7.3 Beta 1 Build Error on Cygwin

Peter,

On Thu, Sep 05, 2002 at 08:33:20PM +0200, Peter Eisentraut wrote:

Dave Page writes:

I get the following error when building beta 1 on CYGWIN_NT-5.1 PC9
1.3.10(0.51/3/2) 2002-02-25 11:14 i686 unknown:

Should all be fixed now.

Huh? I don't see any recent CVS commits to indicate this.

Jason

#9Jason Tishler
jason@tishler.net
In reply to: Bruce Momjian (#7)
Re: [HACKERS] 7.3 Beta 1 Build Error on Cygwin

Peter,

On Thu, Sep 05, 2002 at 02:51:31PM -0400, Bruce Momjian wrote:

Jason Tishler wrote:

On Thu, Sep 05, 2002 at 08:33:20PM +0200, Peter Eisentraut wrote:

Should all be fixed now.

Huh? I don't see any recent CVS commits to indicate this.

I see as a commit:

[snip]

I assume it was in there.

Sorry for the noise, but at the time:

cvs status include/miscadmin.h makefiles/Makefile.win

did *not* indicate any recent commits. Maybe you sent the above email
before you committed your changes?

Anyway, I just tried a:

make distclean
rm include/miscadmin.h makefiles/Makefile.win # remove my patch
cvs update
make

and got the following error:

[snip]
make[3]: Leaving directory `/home/jt/src/pgsql/src/backend/utils'
dlltool --dllname postgres.exe --output-exp postgres.exp --def postgres.def
gcc -L/usr/local/lib -o postgres.exe -Wl,--base-file,postgres.base postgres.exp access/SUBSYS.o bootstrap/SUBSYS.o catalog/SUBSYS.o parser/SUBSYS.o commands/SUBSYS.o executor/SUBSYS.o lib/SUBSYS.o libpq/SUBSYS.o main/SUBSYS.o nodes/SUBSYS.o optimizer/SUBSYS.o port/SUBSYS.o postmaster/SUBSYS.o regex/SUBSYS.o rewrite/SUBSYS.o storage/SUBSYS.o tcop/SUBSYS.o utils/SUBSYS.o
libpq/SUBSYS.o(.text+0x1c84):crypt.c: undefined reference to `crypt'
port/SUBSYS.o(.text+0x262):pg_sema.c: undefined reference to `semget'
[snip]

I can get postgres.exe to successfully link by manually appending
"-lcrypt -lcygipc" to the end of the above gcc command line.

Since you are already working on this, would you be willing to fix this
problem?

Thanks,
Jason

#10Dave Page
dpage@vale-housing.co.uk
In reply to: Jason Tishler (#9)
Re: [HACKERS] 7.3 Beta 1 Build Error on Cygwin

Seems to build cleanly here now. Perhaps anoncvs just hadn't sync'd up
when you tried Jason?

Regards, Dave.

Show quoted text

-----Original Message-----
From: Jason Tishler [mailto:jason@tishler.net]
Sent: 05 September 2002 20:38
To: Peter Eisentraut
Cc: Bruce Momjian; Dave Page; pgsql-hackers; pgsql-cygwin
Subject: Re: [HACKERS] 7.3 Beta 1 Build Error on Cygwin

Peter,

On Thu, Sep 05, 2002 at 02:51:31PM -0400, Bruce Momjian wrote:

Jason Tishler wrote:

On Thu, Sep 05, 2002 at 08:33:20PM +0200, Peter Eisentraut wrote:

Should all be fixed now.

Huh? I don't see any recent CVS commits to indicate this.

I see as a commit:

[snip]

I assume it was in there.

Sorry for the noise, but at the time:

cvs status include/miscadmin.h makefiles/Makefile.win

did *not* indicate any recent commits. Maybe you sent the
above email before you committed your changes?

Anyway, I just tried a:

make distclean
rm include/miscadmin.h makefiles/Makefile.win # remove my patch
cvs update
make

and got the following error:

[snip]
make[3]: Leaving directory `/home/jt/src/pgsql/src/backend/utils'
dlltool --dllname postgres.exe --output-exp postgres.exp
--def postgres.def
gcc -L/usr/local/lib -o postgres.exe
-Wl,--base-file,postgres.base postgres.exp access/SUBSYS.o
bootstrap/SUBSYS.o catalog/SUBSYS.o parser/SUBSYS.o
commands/SUBSYS.o executor/SUBSYS.o lib/SUBSYS.o
libpq/SUBSYS.o main/SUBSYS.o nodes/SUBSYS.o
optimizer/SUBSYS.o port/SUBSYS.o postmaster/SUBSYS.o
regex/SUBSYS.o rewrite/SUBSYS.o storage/SUBSYS.o
tcop/SUBSYS.o utils/SUBSYS.o
libpq/SUBSYS.o(.text+0x1c84):crypt.c: undefined reference
to `crypt'
port/SUBSYS.o(.text+0x262):pg_sema.c: undefined reference
to `semget'
[snip]

I can get postgres.exe to successfully link by manually
appending "-lcrypt -lcygipc" to the end of the above gcc command line.

Since you are already working on this, would you be willing
to fix this problem?

Thanks,
Jason

#11Jason Tishler
jason@tishler.net
In reply to: Dave Page (#10)
Re: [HACKERS] 7.3 Beta 1 Build Error on Cygwin

Peter,

On Fri, Sep 06, 2002 at 12:54:13PM +0100, Dave Page wrote:

Seems to build cleanly here now.

And here (and now) too.

Perhaps anoncvs just hadn't sync'd up when you tried Jason?

I guess so -- very strange...

Anyway, sorry (again) for the noise and thanks for fixing the Cygwin
build.

Jason