-
Notifications
You must be signed in to change notification settings - Fork 4.4k
cc_library rule should support additional_linker_inputs option #17788
Description
Description of the bug:
Relevant discussion: https://groups.google.com/g/bazel-discuss/c/1VFvNBDqzVU
I am trying to pass a (pre-generated) linker response file to a cc_library rule on MacOS, and was pointed to the additional_linker_inputs option in case of a cc_binary, which would allow me to make the file available to the linker.
Unfortunately, it seems the cc_library rule does not support the additional_linker_inputs option. So this can also be considered a feature request for linker file input support for cc_library rules.
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
The desired end result (adapted from the thread):
filegroup(
name = "linker_response_file",
srcs = ["linker_response_file.sym"],
)
cc_library(
name = "main",
srcs = ["main.cc"],
additional_linker_inputs = [":linker_response_file.sym"], # <- throws an ERROR: no such attribute 'additional_linker_inputs' in 'cc_library' rule
linkopts = ["-Wl,@$(location :linker_response_file.sym)"],
)
Which operating system are you running Bazel on?
MacOS
What is the output of bazel info release?
release 6.1.0
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?
This is a follow-up to https://groups.google.com/g/bazel-discuss/c/1VFvNBDqzVU
(The commenter there told me to open this bug report, but the message does not seem to appear for some reason.)
Any other information, logs, or outputs that you want to share?
No response