Skip to content

Commit

Permalink
pw_malloc: Add alwayslink
Browse files Browse the repository at this point in the history
The wrapped dynamic memory operations may be used exclusively in source
files coming from the toolchain (not in any sources in project code
itself). In this case, these symbols will appear unused and be garbage
collected by the linker.

I'm not entirely sure if this is the correct fix. (What if your binary
really does not use dynamic memory allocation, will cc_binary still
burden it with a dep on malloc when you set
--custom_malloc=@pigweed//pw_malloc?)

Bug: 342510882
Change-Id: Iaffa27dc5614d27d3a81ac869e96fbf4dba57689
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/256453
Lint: Lint 🤖 <[email protected]>
Presubmit-Verified: CQ Bot Account <[email protected]>
Reviewed-by: Alexei Frolov <[email protected]>
Commit-Queue: Ted Pudlik <[email protected]>
Docs-Not-Needed: Ted Pudlik <[email protected]>
  • Loading branch information
tpudlik authored and CQ Bot Account committed Dec 26, 2024
1 parent 210617a commit 46f4dc7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pw_malloc/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ pw_facade(
":common",
":config_override",
],
alwayslink = 1,
)

label_flag(
Expand Down

0 comments on commit 46f4dc7

Please sign in to comment.