-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add additional_linker_inputs
option to cc_library
rule
#18952
Conversation
additional_linker_inputs
option to cc_library
ruleadditional_linker_inputs
option to cc_library
rule
This change needs bazelbuild/bazel#18952 to be merged first. Fixes macOS linkage of GBM's nanobind bindings on macOS by supplying a linker response file instead of `-undefined dynamic_lookup`. The latter has since been deprecated on macOS.
This is achieved by the following related changes: 1) Moving the `additional_linker_inputs` attribute up from the `cc_binary_base` rule to the `cc_rule`. The rationale here is that any rule that allows `linkopts` to be set should also support `additional_linker_inputs`. 2) Adding the `additional_linker_inputs` attr to the `cc_library` rule context. This was copied verbatim from the existing `cc_binary` attribute list. 3) Appending the `ctx.files.additional_linker_inputs` list to the list of linker scripts wherever they are passed as `additional_inputs` in the `cc_library.bzl` builtin file corresponding to the `cc_library` rule.
@bazel-io flag |
@brentleyjones I just want to make sure since google/benchmark#1636 was mentioned.. Do we want this to be part of release-6.4.0 or some other release? cc: @bazelbuild/triage |
I believe this is an additive change and can go into 6.4.0. Do you agree @nicholasjng? |
Fully agreed, would appreciate to see this in 6.4.0 if possible |
@bazel-io fork 6.4.0 |
This is achieved by the following related changes: 1) Moving the `additional_linker_inputs` attribute up from the `cc_binary_base` rule to the `cc_rule`. The rationale here is that any rule that allows `linkopts` to be set should also support `additional_linker_inputs`. 2) Adding the `additional_linker_inputs` attr to the `cc_library` rule context. This was copied verbatim from the existing `cc_binary` attribute list. 3) Appending the `ctx.files.additional_linker_inputs` list to the list of linker scripts wherever they are passed as `additional_inputs` in the `cc_library.bzl` builtin file corresponding to the `cc_library` rule. ---------------------- For context on this PR, see issue bazelbuild#17788 as well as the original [Google group discussion](https://groups.google.com/g/bazel-discuss/c/1VFvNBDqzVU/m/F5UmYO-RAAAJ), which inspired the feature request. Resolves bazelbuild#17788. Closes bazelbuild#18952. PiperOrigin-RevId: 557505297 Change-Id: I4811b60e102c6426697efcb202296fe77a3d5f25
…19264) This is achieved by the following related changes: 1) Moving the `additional_linker_inputs` attribute up from the `cc_binary_base` rule to the `cc_rule`. The rationale here is that any rule that allows `linkopts` to be set should also support `additional_linker_inputs`. 2) Adding the `additional_linker_inputs` attr to the `cc_library` rule context. This was copied verbatim from the existing `cc_binary` attribute list. 3) Appending the `ctx.files.additional_linker_inputs` list to the list of linker scripts wherever they are passed as `additional_inputs` in the `cc_library.bzl` builtin file corresponding to the `cc_library` rule. ---------------------- For context on this PR, see issue #17788 as well as the original [Google group discussion](https://groups.google.com/g/bazel-discuss/c/1VFvNBDqzVU/m/F5UmYO-RAAAJ), which inspired the feature request. Resolves #17788. Closes #18952. Commit 0589995 PiperOrigin-RevId: 557505297 Change-Id: I4811b60e102c6426697efcb202296fe77a3d5f25 Co-authored-by: Nicholas Junge <nicholas.junge@web.de>
This change needs bazelbuild/bazel#18952 to be merged first. Fixes macOS linkage of GBM's nanobind bindings on macOS by supplying a linker response file instead of `-undefined dynamic_lookup`. The latter has since been deprecated on macOS.
This change needs bazelbuild/bazel#18952 to be merged first. Fixes macOS linkage of GBM's nanobind bindings on macOS by supplying a linker response file instead of `-undefined dynamic_lookup`. The latter has since been deprecated on macOS.
* Change nanobind linkage to response file approach This change needs bazelbuild/bazel#18952 to be merged first. Fixes macOS linkage of GBM's nanobind bindings on macOS by supplying a linker response file instead of `-undefined dynamic_lookup`. The latter has since been deprecated on macOS. * Fix bazel_skylib checksum, bump skylib version in MODULE.bazel * Bump Bazel to version 6.4.0 for linker response file support
This is achieved by the following related changes:
Moving the
additional_linker_inputs
attribute up from thecc_binary_base
rule to thecc_rule
. The rationale here is that any rule that allowslinkopts
to be set should also supportadditional_linker_inputs
.Adding the
additional_linker_inputs
attr to thecc_library
rule context. This was copied verbatim from the existingcc_binary
attribute list.Appending the
ctx.files.additional_linker_inputs
list to the list of linker scripts wherever they are passed asadditional_inputs
in thecc_library.bzl
builtin file corresponding to thecc_library
rule.For context on this PR, see issue #17788 as well as the original Google group discussion, which inspired the feature request.
Resolves #17788.