diff --git a/.bazelrc b/.bazelrc index 45da579b7c1d..33a54aaa2e67 100644 --- a/.bazelrc +++ b/.bazelrc @@ -94,7 +94,7 @@ build --custom_malloc=//bazel/malloc:tcmalloc_if_linux_opt # optimized or other build configurations. Note that ASan and TCMalloc are # incompatible so this explicitly forces the system malloc. build:asan --features=asan -build:asan --custom_malloc=//bazel/malloc:system_malloc +build:asan --custom_malloc=@bazel_tools//tools/cpp:malloc # Configuration for enabling LibFuzzer (along with ASan). build:fuzzer --features=fuzzer diff --git a/bazel/malloc/BUILD b/bazel/malloc/BUILD index 2d6d519037d9..b404ee5fafdf 100644 --- a/bazel/malloc/BUILD +++ b/bazel/malloc/BUILD @@ -23,17 +23,12 @@ selects.config_setting_group( ], ) -# A placeholder empty library that can be used as a `malloc` attribute or with -# the `--custom_malloc` bazel flag to have no custom malloc and use the system -# malloc instead. -cc_library(name = "system_malloc") - # A library that enables TCMalloc for optimized builds on Linux. On other # platforms and configurations, this falls back on the system malloc. cc_library( name = "tcmalloc_if_linux_opt", deps = select({ ":linux_opt": ["@tcmalloc//tcmalloc"], - "//conditions:default": [":system_malloc"], + "//conditions:default": ["@bazel_tools//tools/cpp:malloc"], }), )