1load("//bazel:defs.bzl", "compatible_with_rp2")
2
3package(default_visibility = ["//visibility:public"])
4
5cc_library(
6    name = "pico_malloc",
7    srcs = ["malloc.c"],
8    hdrs = ["include/pico/malloc.h"],
9    includes = ["include"],
10    linkopts = [
11        "-Wl,--wrap=malloc",
12        "-Wl,--wrap=calloc",
13        "-Wl,--wrap=realloc",
14        "-Wl,--wrap=free",
15    ],
16    target_compatible_with = compatible_with_rp2(),
17    deps = [
18        "//src/common/pico_sync",
19        "//src/rp2_common:pico_platform",
20        "//src/rp2_common/pico_multicore",
21    ],
22    alwayslink = True,  # Ensures the wrapped symbols are linked in.
23)
24