Enable the ability to change the sandboxee's malloc implementation. The default is set to "@bazel_tools//tools/cpp:malloc", which is also the default for Bazel's cc_binary [1].

[1] https://bazel.build/reference/be/c-cpp#cc_binary

PiperOrigin-RevId: 583081047
Change-Id: I08e7f6d0dffb1926e7bf9a9a96a7d6727d4cd3d6
This commit is contained in:
Oliver Kunz 2023-11-16 10:00:29 -08:00 committed by Copybara-Service
parent 9a171c7e5f
commit a0ba1c520f

View File

@ -236,6 +236,7 @@ def sapi_library(
name, name,
lib, lib,
lib_name, lib_name,
malloc = "@bazel_tools//tools/cpp:malloc",
namespace = "", namespace = "",
api_version = 1, api_version = 1,
embed = True, embed = True,
@ -355,6 +356,7 @@ def sapi_library(
# The sandboxing client must have access to all # The sandboxing client must have access to all
"-Wl,-E", # symbols used in the sandboxed library, so these "-Wl,-E", # symbols used in the sandboxed library, so these
] + exported_funcs, # must be both referenced, and exported ] + exported_funcs, # must be both referenced, and exported
malloc = malloc,
deps = [ deps = [
":" + name + ".lib", ":" + name + ".lib",
"//sandboxed_api:client", "//sandboxed_api:client",