[postgis-devel] Languishing in a Linking Labyrinth (lwgeom_init_allocators)

Sandro Santilli strk at keybit.net
Fri Aug 19 09:36:11 PDT 2011


I see an void lwgeom_init_allocators(void) in libpgcommon and another
in raster/rt_pg/rt_pg.c. Try dropping the latter.

--strk;

On Fri, Aug 19, 2011 at 04:05:34PM +0000, Bryce L Nordgren wrote:
> I've been beating my head against quirky linking issues for the past couple
> of days. This may be related to #1158, and may not be. I'm on arch linux
> instead of windows, and I'm missing a different symbol in a different target
> (lwgeom_init_allocators missing from rtpostgis-2.0.so instead of
> PG_MODULE_MAGIC missing in postgis-2.0.dll). However, in both cases, the
> linker just seems to be refusing to copy symbols to the destination, and in
> both cases, the missing symbol is not directly referenced by anything else
> which is being linked into the same target.  The effect is that compilation
> completes successfully, but the shared library won't load. Note that when
> libpgcommon is linked against postgis-2.0.so, the symbol is included. See:
> 
> [bnordgren at ghosty-mosty postgis]$ !nm
> nm -a raster/rt_pg/rtpostgis-2.0.so | grep lwgeom_ini
>                  U lwgeom_init_allocators
> [bnordgren at ghosty-mosty postgis]$ nm -a postgis/postgis-2.0.so | grep
> lwgeom_ini
> 0000000000045b80 T lwgeom_init_allocators
> [bnordgren at ghosty-mosty postgis]$
> 
> 
> The most aggravating thing is that there's no observable reason for it;
> while at the same time, it's reproducible.  Yesterday I identified "working"
> and "non-working" commits in the git repo I'm using for raster iterator
> development. Performing a "diff" on the build output revealed one extra
> compile and one extra item on the linking line in /postgis (the commits were
> "before/working" and "after/broken" for the patch on #1163). Well, my
> problem is between libpgcommon and raster; postgis should have nothing to do
> with it (and the symbol is present in postgis-2.0.so anyway).  The
> working/non-working link commands which produce rtpostgis-2.0.so are line
> for line and character-for-character identical, as is everything involving
> the building of liblwgeom.a, libpgcommon.a, and everything in raster.
> 
> Here's the real kicker: I updated against svn this morning, reverting my own
> local version of #1163 to bring in strk's. The update involves two
> branches:  the branch containing my development code (branch ri-gen2-arch)
> and the branch which reflects svn head + my own hardcoded adaptation to
> address #960 on arch (branch archpostgis). Before the merge, both branches
> were including lwgeom_init_allocators in rtpostgis-2.0.so. After the merge,
> ri-gen2-arch is not including lwgeom_init_allocators. I can repeatably
> checkout the pre-merge source, and everything is fine. Also reliably, I can
> checkout the post-merge source and the symbol is missing.
> 
> So it's happened to me twice. This morning I reverted the commits which were
> causing my issue yesterday, and this had become my pre-merge source which is
> reliably working.  Strk re-introduced these changes to SVN via my patch on
> #1163, and this became my "archpostgis" branch, which is reliably working.
> Reunited, these two hard-working branches become broken.
> 
> The graphical depiction of my flailing around blindly may be found at:
> 
> https://github.com/bnordgren/postgis/network
> 
> Specifically, I have found that commits
> fb7b369beade85f0c1dd<https://github.com/bnordgren/postgis/commit/fb7b369beade85f0c1dd62b7bea63971e149eebf>and
> 50fbb5ef6cf7c9deeaad<https://github.com/bnordgren/postgis/commit/50fbb5ef6cf7c9deeaad37a8f419c14f8ee971cc>include
> the symbol, whereas commit
> 62a627b78779ce372c85<https://github.com/bnordgren/postgis/commit/62a627b78779ce372c85f4d87e50160eda520149>does
> not.
> 
> Does anyone have any ideas?
> 
> Bryce

> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel


-- 

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html



More information about the postgis-devel mailing list