support sandboxed rust rules
This commit adds support for compiling rust rules inside the sbox
sandbox. To compile a rust module with sandboxing enabled, the entry
point to the crate must be specified via the `crate_root` property, and
all input sources and compile-time data must be specified via the `srcs`
and `compile_data` properties.
Bug: 286077158
Change-Id: I8c9dc5cf7578037a583b4be2e2f73cf20ffd4408
diff --git a/cc/testing.go b/cc/testing.go
index dbdee9e..b75734c 100644
--- a/cc/testing.go
+++ b/cc/testing.go
@@ -68,6 +68,26 @@
func commonDefaultModules() string {
return `
+ prebuilt_build_tool {
+ name: "clang++",
+ src: "bin/clang++",
+ }
+ prebuilt_build_tool {
+ name: "clang++.real",
+ src: "bin/clang++.real",
+ }
+ prebuilt_build_tool {
+ name: "lld",
+ src: "bin/lld",
+ }
+ prebuilt_build_tool {
+ name: "ld.lld",
+ src: "bin/ld.lld",
+ }
+ prebuilt_build_tool {
+ name: "llvm-ar",
+ src: "bin/llvm-ar",
+ }
cc_defaults {
name: "toolchain_libs_defaults",
host_supported: true,
@@ -569,6 +589,12 @@
// Additional files needed in tests that disallow non-existent source.
android.MockFS{
+ "defaults/cc/common/bin/clang++": nil,
+ "defaults/cc/common/bin/clang++.real": nil,
+ "defaults/cc/common/bin/lld": nil,
+ "defaults/cc/common/bin/ld.lld": nil,
+ "defaults/cc/common/bin/llvm-ar": nil,
+
"defaults/cc/common/libc.map.txt": nil,
"defaults/cc/common/libdl.map.txt": nil,
"defaults/cc/common/libm.map.txt": nil,