Skip to content

Fix address sanitizer being incorrectly applied to host tools - #3317

Open
adincebic wants to merge 1 commit into
mainfrom
adin/fix-address-sanitizer
Open

Fix address sanitizer being incorrectly applied to host tools#3317
adincebic wants to merge 1 commit into
mainfrom
adin/fix-address-sanitizer

Conversation

@adincebic

Copy link
Copy Markdown
Contributor

Enabling Address Sanitizer caused the app to fail to build because sanitizer flags were also being applied to host tools. Since host tools do not need to be sanitized when sanitizing the app, we use Bazel features to disable those flags for host tools while leaving the app target unchanged.

Signed-off-by: Adin Cebic <cebic.ad@gmail.com>
@adincebic
adincebic requested a review from a team as a code owner June 3, 2026 10:23
@adincebic

Copy link
Copy Markdown
Contributor Author

Perhaps we should not disable the features for host.

--copt=-Wno-macro-redefined
--copt=-D_FORTIFY_SOURCE=0
)
build_pre_config_flags+=(--features=asan --host_features=-asan)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is historical reasons for using the raw flags instead of the features. I don't recall what is it, but I think Git history will tell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants