Thread: are there any cons to linking libstdc++ with postgresql?
Hi! I'm not a linking guru... Is there a penalty for setting LDFLAGS+= -lstdc++ when building postgresql? > Postgis includes a bunch of useful functions for manipulating spatial > data. Some of them are provided by geos, a separate c++ library, with > postgis providing wrappers. > > According to postgis docs, postgresql _must_ be configured with LDFLAGS > containing -lstdc++ for this to work. I can confirm this. > > The postgis port provides the WITH_GEOS tunable, but it has no effect > unless the above adjustment is made to postgresql. The port makes no > mention of this. Is there a penalty in just leaving > LDFLAGS+= -lstdc++ > in the postgresql port Makefile? Bad idea? What do you think? /Palle
Palle Girgensohn <girgen@pingpong.net> writes: >> Is there a penalty in just leaving >> LDFLAGS+= -lstdc++ >> in the postgresql port Makefile? Bad idea? Yup. The portability hazards are considerable. I'm a bit surprised the postgis guys seem to think it works. regards, tom lane
Does the same arguments apply for linking with libc_r (pthreads)? It is needed by plpython, at least on FreeBSD 4.10 (probably all versions). /Palle --On onsdag, november 17, 2004 20.49.20 -0500 Tom Lane <tgl@sss.pgh.pa.us> wrote: > Palle Girgensohn <girgen@pingpong.net> writes: >>> Is there a penalty in just leaving >>> LDFLAGS+= -lstdc++ >>> in the postgresql port Makefile? Bad idea? > > Yup. The portability hazards are considerable. I'm a bit surprised the > postgis guys seem to think it works. > > regards, tom lane
On Thu, Nov 18, 2004 at 04:17:31AM +0100, Palle Girgensohn wrote: > Does the same arguments apply for linking with libc_r (pthreads)? > > It is needed by plpython, at least on FreeBSD 4.10 (probably all versions). There are problem with libc_r on FreeBSD: due to initializing of red zone for initial thread's stack, postgresql stack gets limited to just 1M. There are patch in queue for increasing initial stack to 8/32/xxxM, but official reaction was: "create new thread with right stack size and use it for main loop"
Palle Girgensohn schrieb: > I'm not a linking guru... Is there a penalty for setting LDFLAGS+= > -lstdc++ when building postgresql? > >> Postgis includes a bunch of useful functions for manipulating spatial >> data. Some of them are provided by geos, a separate c++ library, with >> postgis providing wrappers. >> >> According to postgis docs, postgresql _must_ be configured with LDFLAGS >> containing -lstdc++ for this to work. I can confirm this. >> >> The postgis port provides the WITH_GEOS tunable, but it has no effect >> unless the above adjustment is made to postgresql. The port makes no >> mention of this. Is there a penalty in just leaving >> LDFLAGS+= -lstdc++ >> in the postgresql port Makefile? Bad idea? What do you think? I'd rather use a libgeos wrapper using just extern "C" entry points, not the C++ mangled entries. Haven't checked yet how much trouble this may cause on geos, and if it will work with the exceptions. And if a simple .def with aliases would be enough. libgeos is huge. -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/