File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,15 @@ into the binary. Possible values are:
78
78
"_cc_toolchain" : attr .label (
79
79
default = Label ("@bazel_tools//tools/cpp:current_cc_toolchain" ),
80
80
),
81
+ # A late-bound attribute denoting the value of the `--custom_malloc`
82
+ # command line flag (or None if the flag is not provided).
83
+ "_custom_malloc" : attr .label (
84
+ default = configuration_field (
85
+ fragment = "cpp" ,
86
+ name = "custom_malloc" ,
87
+ ),
88
+ providers = [[CcInfo ]],
89
+ ),
81
90
# TODO(b/119082664): Used internally only.
82
91
"_grep_includes" : attr .label (
83
92
allow_single_file = True ,
@@ -215,10 +224,8 @@ def _swift_linking_rule_impl(
215
224
216
225
# If a custom malloc implementation has been provided, pass that to the
217
226
# linker as well.
218
- if ctx .attr .malloc :
219
- additional_linking_contexts .append (
220
- ctx .attr .malloc [CcInfo ].linking_context ,
221
- )
227
+ malloc = ctx .attr ._custom_malloc or ctx .attr .malloc
228
+ additional_linking_contexts .append (malloc [CcInfo ].linking_context )
222
229
223
230
# Finally, consider linker flags in the `linkopts` attribute and the
224
231
# `--linkopt` command line flag last, so they get highest priority.
You can’t perform that action at this time.
0 commit comments