Skip to content

1.87.0 has more overlinking than prior Boost versions (to Boost.Container/Boost.Graph)Β #985

@cho-m

Description

@cho-m

Seen while testing beta at Homebrew/homebrew-core#198115

In Homebrew, we build both Boost.Python and Boost.MPI modules separately from rest of Boost as Homebrew doesn't have standard split packages.

With Boost 1.87.0.beta1, both modules end up building and trying to link to Boost.Container and Boost.Graph (and linkage cascades to dependents via installed CMake files)

However, when built with GNU ld --as-needed or macOS ld -dead_strip_dylibs, the linkage is stripped implying no symbols are used from Boost.Container and Boost.Graph shared libraries.

I wanted to check if this is intentional or a regression from some change (perhaps the various build system refactoring for modular builds).


The build is done via b2.

Roughly (there are other build environment details that are automatically handled in Homebrew), the build steps for Boost.Python on macOS are like:

$ ./bootstrap.sh --prefix=<prefix> --libdir=<lib> --with-libraries=python --with-python=<path/to/python3> --with-python-root=<path/to/python/root>
$ ./b2 \
  --build-dir=build-python3 \
  --stagedir=stage-python3 \
  --libdir=install-python3/lib \
  --prefix=install-python3 \
  python=3.12 \
  -d2 \
  -j4 \
  --layout=system \
  --user-config=user-config.jam \
  install \
  threading=multi \
  link=shared,static \
  cxxflags=-std=c++14 \
  cxxflags=-stdlib=libc++ \
  linkflags=-stdlib=libc++

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions