Skip to content

Commit

Permalink
buck: make objcopy available via cxx_genrule
Browse files Browse the repository at this point in the history
Summary:
following advice in:

https://fb.workplace.com/groups/930797200910874/permalink/1352691642054759/

this diff makes it possible to use a reference to the toolchain's objcopy via, e.g.

```
cxx_genrule(
    name = "embed_default_sensor_data",
    srcs = [
        "sensor_data",
        "embed.sh",
    ],
    outs = {
        "object": ["default_sensor_data_lib"],
    },
    bash = "./embed.sh $(ld) $(objcopy)",
    visibility = ["PUBLIC"],
)
```

Reviewed By: dtolnay

Differential Revision: D52817209

fbshipit-source-id: 92ae52a595a185641310c8c1fe200fdaa1dcc54b
  • Loading branch information
Daniel James authored and facebook-github-bot committed Jan 18, 2024
1 parent 5faaeef commit b1bbf80
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions prelude/cxx/cxx_toolchain_types.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ def cxx_toolchain_infos(
"ldflags-shared": _shell_quote(linker_info.linker_flags),
"ldflags-static": _shell_quote(linker_info.linker_flags),
"ldflags-static-pic": _shell_quote(linker_info.linker_flags),
"objcopy": binary_utilities_info.objcopy,
# TODO(T110378148): $(platform-name) is almost unusued. Should we remove it?
"platform-name": platform_name,
}
Expand Down

0 comments on commit b1bbf80

Please sign in to comment.