Opened 5 years ago

Closed 5 years ago

#4321 closed defect (fixed)

OSX cannot link libwagyu without -lstdc++

Reported by: pramsey Owned by: Algunenano
Priority: blocker Milestone: PostGIS 3.0.0
Component: postgis Version: master
Keywords: Cc:

Description

Seems like a platform difference, haven't seen this issue since we banished the GEOS c++ API many moons ago, but we cannot build —with-wagyu on OSX either (#4320) since that requires a link entry for libstdc++. The failure is in linking the postgis.so module, and it looks kind of like

  "std::logic_error::logic_error(char const*)", referenced from:
      std::__1::vector<mapbox::geometry::point<int>, std::__1::allocator<mapbox::geometry::point<int> > >::reserve(unsigned long) in libwagyu.a(lwgeom_wagyu.o)

etc, etc.

And it is fixed by adding -lstdc++ to the link line. Why are we not also seeing this kind of failure under Windows?

Change History (5)

comment:1 by pramsey, 5 years ago

Actually, -lc++ is considered more correct on OSX and also works

comment:2 by Algunenano, 5 years ago

Why are we not also seeing this kind of failure under Windows?

I've only tested wagyu with a couple of Linux distributions and, for now, it's off by default, so it might be broken in Windows too.

This might have to do with postgis-3.so being generated with a C compiler which, by default, won't include libc++ or libstdc++. I'll try to find what's the proper way to address this.

comment:4 by robe, 5 years ago

yah I haven't tested it on windows. Didn't even know it was committed already. thought it was still a pull request.

comment:5 by Raul Marin, 5 years ago

Resolution: fixed
Status: assignedclosed

In 17250:

Wagyu build improvements

Use same compiler as postgresql (adds extra -x cxx)
Pass the C++ standard library to postgres when linking wagyu

Closes #4321
Closes https://github.com/postgis/postgis/pull/371

Note: See TracTickets for help on using tickets.