mapbox / mapbox/mason

Please use the system default c++ ABI

Open
#496 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
258
Forks
68
PR merge metrics
No merged PRs in 30d

Description

The mason build of mapnik fails to link against mason-built boost libraries on Debian stretch and probably on other modern linux distros with GCC 6 based toolchain. The reason is this snippet on the build script
```
if [[ $(uname -s) == 'Linux' ]]; then
echo "CUSTOM_LDFLAGS = '${LDFLAGS} -Wl,-z,origin -Wl,-rpath=\\\$\$ORIGIN/../lib/ -Wl,-rpath=\\\$\$ORIGIN/../../'" > config.py
echo "CUSTOM_CXXFLAGS = '${CXXFLAGS} -D_GLIBCXX_USE_CXX11_ABI=0'" >> config.py
else
...
```
which sets _GLIBCXX_USE_CXX11_ABI=0, where the default in modern systems is to use the c++11 ABI, i.e. to set this to '1'.

A bit more fine-grained conditional than just checking for the OS kernel would be useful here. The only one I can think of right now is to check if the compiler is GCC and its version is >=6, but there is probably a more clever way.

Grepping for GLIBCXX_USE_CXX11_ABI also shows that this problem is present also in the or-tools-6.0 build script.

This is probably related to #319.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The affected Linux branch is shown in the build script, and the same macro appears in the or-tools-6.0 build script. Start by grepping for GLIBCXX_USE_CXX11_ABI and compare the compiler and platform conditions around each occurrence. Done means mason-built Boost and or-tools link successfully on Debian stretch or another modern Linux system using the system-default C++ ABI.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux, python
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.