Opened 2 months ago

Closed 2 months 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: trunk
Keywords: Cc:


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 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 Changed 2 months ago by pramsey

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

comment:2 Changed 2 months ago by Algunenano

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 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 Changed 2 months ago by robe

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 Changed 2 months ago by Raul Marin

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

Note: See TracTickets for help on using tickets.