Skip to content

#13427 Broke mac C++ toolchains #15214

@det

Description

@det

Description of the bug:

The only use of runtime_solib_name in the bazel repo is this:

tools/osx/crosstool/cc_toolchain_config.bzl:                            "-Wl,-install_name,@rpath/%{runtime_solib_name}",

This line is now broken.

The way it worked previously is bazel will inject rpaths into an executable, ie:

path @loader_path/../../_solib_arm64/

This directory contains symlinks for all the mangled names of shared libraries that have been built.

This can only work if the install_name for a shared library is set to the mangled name. #13427 changes it so that runtime_solib_name is no longer mangled. ie, it went from libexternal_Sboost_Slibasio.dylib to libasio.dylib.

Also, the test as it existed was also correct as cc_test will link its dependencies using dynamic linking by default. The new test is broken as it does not capture the use case this feature was written to support (and I expect the change caused the test to start failing before it was rewritten).

Also see the description of the variable:

  /** The name of the runtime solib symlink of the shared library. */
  RUNTIME_SOLIB_NAME("runtime_solib_name");

which states that it is the mangled name that exists in the _solib_* dir.

Can we please revert #13427? @csmulhern @oquenchil

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

No response

Which operating system are you running Bazel on?

Macos

What is the output of bazel info release?

5.1.1

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions