forked from bazelbuild/bazel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the runfiles directory to the runtime library search paths
When executing a C++ binary through REv2 directly (e.g., directly as a genrule, not as a dependency of another script/executable), the input root will only contain a \_solib\_arch directory inside the executable's runfiles directory. This means that library lookups also need to consider rpath $ORIGIN/$executable.runfiles/$workspace/\_solib\_$arch/. Only looking at ../../../\_solib\_$arch/ is not sufficient. This issue isn't noticeable when doing local execution, for the reason that rtld/dyld will first do a realpath() on the executable, meaning the lookup of shared objects takes place outside of the sandbox, inside of bazel-out/ directly. This change extends LibrariesToLinkCollector to duplicate all runtime library search paths. One for bare execution, and one for execution inside a runfiles directory. Closes bazelbuild#14600. Change-Id: I4256cb46fee737139aba6f1cfb0531aea5deb315 PiperOrigin-RevId: 469733573
- Loading branch information
1 parent
60973a2
commit 3d123ed
Showing
2 changed files
with
47 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters