Revert addition of -lpgport, which breaks the build on platforms that

Started by Tom Laneabout 22 years ago8 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

Log Message:
-----------
Revert addition of -lpgport, which breaks the build on platforms that
are sticky about non-PIC code in shared libraries. Windows will have
to find another solution (probably similar to the way libpq does it).

Modified Files:
--------------
pgsql-server/src/interfaces/ecpg/ecpglib:
Makefile (r1.18 -> r1.19)
(http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/interfaces/ecpg/ecpglib/Makefile.diff?r1=1.18&r2=1.19)

#2Neil Conway
neilc@samurai.com
In reply to: Tom Lane (#1)
Re: Revert addition of -lpgport, which breaks the build

Tom Lane wrote:

Revert addition of -lpgport, which breaks the build on platforms that
are sticky about non-PIC code in shared libraries. Windows will have
to find another solution (probably similar to the way libpq does it).

I need to apply the attached patch to get ecpg to link successfully on
my machine (OSX 10.3). Is this a known issue?

-Neil

Attachments:

ecpg-build-fix-1.patchtext/plain; name=ecpg-build-fix-1.patch; x-mac-creator=0; x-mac-type=0Download+4-4
#3Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#1)
Re: Revert addition of -lpgport, which breaks the build

Tom Lane wrote:

Log Message:
-----------
Revert addition of -lpgport, which breaks the build on platforms that
are sticky about non-PIC code in shared libraries. Windows will have
to find another solution (probably similar to the way libpq does it).

OK, done only for Win32.

-- 
  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
#4Bruce Momjian
bruce@momjian.us
In reply to: Neil Conway (#2)
Re: Revert addition of -lpgport, which breaks the build

I modified to code so only Win32 will do it.

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

Neil Conway wrote:

Tom Lane wrote:

Revert addition of -lpgport, which breaks the build on platforms that
are sticky about non-PIC code in shared libraries. Windows will have
to find another solution (probably similar to the way libpq does it).

I need to apply the attached patch to get ecpg to link successfully on
my machine (OSX 10.3). Is this a known issue?

-Neil

Index: src/interfaces/ecpg/ecpglib/Makefile
===================================================================
RCS file: /Users/neilc/local/cvs/pgsql-server/src/interfaces/ecpg/ecpglib/Makefile,v
retrieving revision 1.19
diff -c -r1.19 Makefile
*** src/interfaces/ecpg/ecpglib/Makefile	21 May 2004 00:14:38 -0000	1.19
--- src/interfaces/ecpg/ecpglib/Makefile	21 May 2004 00:47:23 -0000
***************
*** 23,29 ****
OBJS= execute.o typename.o descriptor.o data.o error.o prepare.o memory.o \
connect.o misc.o

! SHLIB_LINK = -L../pgtypeslib -lpgtypes $(libpq) \
$(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt -lm, $(LIBS)) $(PTHREAD_LIBS)

all: all-lib
--- 23,29 ----
OBJS= execute.o typename.o descriptor.o data.o error.o prepare.o memory.o \
connect.o misc.o

! SHLIB_LINK = -L../pgtypeslib -lpgtypes -lpgport $(libpq) \
$(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt -lm, $(LIBS)) $(PTHREAD_LIBS)

all: all-lib
Index: src/interfaces/ecpg/compatlib/Makefile
===================================================================
RCS file: /Users/neilc/local/cvs/pgsql-server/src/interfaces/ecpg/compatlib/Makefile,v
retrieving revision 1.17
diff -c -r1.17 Makefile
*** src/interfaces/ecpg/compatlib/Makefile	30 Apr 2004 04:14:05 -0000	1.17
--- src/interfaces/ecpg/compatlib/Makefile	21 May 2004 00:48:08 -0000
***************
*** 19,25 ****
override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir) \
-I$(top_srcdir)/src/include/utils $(CPPFLAGS)
override CFLAGS += $(PTHREAD_CFLAGS)
! SHLIB_LINK = -L../ecpglib -lecpg -L../pgtypeslib -lpgtypes $(libpq) \
$(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt -lm, $(LIBS)) $(PTHREAD_LIBS)
OBJS= informix.o
--- 19,25 ----
override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir) \
-I$(top_srcdir)/src/include/utils $(CPPFLAGS)
override CFLAGS += $(PTHREAD_CFLAGS)
! SHLIB_LINK = -L../ecpglib -lecpg -L../pgtypeslib -lpgtypes -lpgport $(libpq) \
$(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt -lm, $(LIBS)) $(PTHREAD_LIBS)

OBJS= informix.o

---------------------------(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
#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#4)
Re: Revert addition of -lpgport, which breaks the build

Bruce Momjian <pgman@candle.pha.pa.us> writes:

I modified to code so only Win32 will do it.

I think Neil's point is that it fails on OSX as well. Really we have to
do this the way libpq does, namely pull out the specific files it needs
and recompile those with the correct shared-library-compatible CFLAGS.

regards, tom lane

#6Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#5)
Re: Revert addition of -lpgport, which breaks the build

Tom Lane wrote:

Bruce Momjian <pgman@candle.pha.pa.us> writes:

I modified to code so only Win32 will do it.

I think Neil's point is that it fails on OSX as well. Really we have to
do this the way libpq does, namely pull out the specific files it needs
and recompile those with the correct shared-library-compatible CFLAGS.

Oh, that one? Yea, I see your point. I thought you meant this from
libpq:

ifeq ($(PORTNAME), win32)
OBJS+=win32.o
endif

Now I realize we are making a library and has to use the same flags.

I will make the separate build change when I return on Sunday.

-- 
  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
#7Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#6)
Re: Revert addition of -lpgport, which breaks the build

Bruce Momjian <pgman@candle.pha.pa.us> writes:

Tom Lane wrote:

I think Neil's point is that it fails on OSX as well. Really we have to
do this the way libpq does, namely pull out the specific files it needs
and recompile those with the correct shared-library-compatible CFLAGS.

I will make the separate build change when I return on Sunday.

I applied the necessary changes to get OS X to build again. Does Win32
need any more port modules besides path.c in ecpglib?

regards, tom lane

#8Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#7)
Re: Revert addition of -lpgport, which breaks the build

Tom Lane wrote:

Bruce Momjian <pgman@candle.pha.pa.us> writes:

Tom Lane wrote:

I think Neil's point is that it fails on OSX as well. Really we have to
do this the way libpq does, namely pull out the specific files it needs
and recompile those with the correct shared-library-compatible CFLAGS.

I will make the separate build change when I return on Sunday.

I applied the necessary changes to get OS X to build again. Does Win32
need any more port modules besides path.c in ecpglib?

I see that you didn't use $filter() like we do in libpq/Makefile. I now
remember we have two types of files in libpgport, those that are used
only if the platform needs it, and those that are always in the library,
so they don't need filter.

I have applied the following patch to remove a few unneeded uses of
$filter().

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