commit | 1b7885acf0574d2f52e7c011ce8e03ad3aed25ae | [log] [tgz] |
---|---|---|
author | Augie Fackler <raf@durin42.com> | Tue Mar 02 14:48:22 2021 -0500 |
committer | GitHub <noreply@github.com> | Tue Mar 02 20:48:22 2021 +0100 |
tree | 109ea56191f44c8bf712a46d8bf2f5acab3c0f19 | |
parent | 9b135bf348fd9e36abe90bb8ae6850588aa72f62 [diff] |
rustc: correctly handle alwayslink staticlibs (#606) * test: add test that demonstrates missing alwayslink libraries * refactor: inline get_libs_for_static_executable into rustc logic We then move the function to its only remaining caller in bindgen. I didn't inline it there because it's used in a few different ways and cleaning it up felt like more work than it was immediately worth. * refactor: make DepInfo carry around LibraryToLink and not File data We need this information to implement support for alwayslink, and it cascaded around the codebase more than a little. The next change will implement always link, which is currently left as a stub so that this change has no functional changes. * rustc: remove awkward file-ending check for _is_dylib Instead we just verify we're not going to link anything static. This removes the need for a toolchain in _is_dylib, which will allow further cleanups in a moment. * rustc: remove unused toolchain= argument to _make_link_flags This allows us to use a more efficient construction to add linker arguments to the command line. * rustc: add support for alwayslink library dependencies This follows up on the previous commit's refactoring and actually adds alwayslink support. Fixes #325. * tests: add coverage for a cdylib with alwayslink Makes sure that cdylibs also correctly pick up their alwayslink dependencies. * rustc: tote around LinkerInput for noncrate deps This lets us avoid reifying a depset a little longer, which is nice. Co-authored-by: Augie Fackler <augie@google.com>
This repository provides rules for building Rust projects with Bazel.
Please refer to the full documentation.