-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bazel 0.22 contains further updates to the new C++ API: bazelbuild/bazel#4570 It seems these updates removed access to the unmangled library names for C library dependencies. On MacOS, dynamic libraries contain the path to the unmangled library relative to the working directory in their "library name", which means that targets linking against these dynamic libraries will reference the unmangled target. These references are invalid if a binary is executed in a different working directory, and are unnecessarily long, which makes it easy to exceed the MACH-O header size limit on MacOS. Previously, rules_haskell would patch these load commands based on the unmangled libraries to point to the mangled libraries under a single RPATH entry. This shortened the load commands. Now that the unmangled libraries are no longer available, this patching is performed in a [linker wrapper script][osx_wrapper], similar to how Bazel itself handles this. Furthermore, GHC generates intermediate dynamic libraries which will try to load the unmangled libraries. The wrapper script approach allows to patch the intermediate library with additional RPATHs to avoid load failures during GHC compilation steps. The Hazel target for the swagger2 library, for example, triggers this issue. [osx_wrapper]: https://github.com/bazelbuild/bazel/blob/6aab2719d678057c4ef8edc3dfcad56803454732/tools/cpp/osx_cc_wrapper.sh.tpl.
- Loading branch information
Showing
10 changed files
with
412 additions
and
236 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
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
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
Oops, something went wrong.