diff options
Diffstat (limited to 'cc/builder.go')
| -rw-r--r-- | cc/builder.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cc/builder.go b/cc/builder.go index 8719d4f87..367bda380 100644 --- a/cc/builder.go +++ b/cc/builder.go @@ -798,9 +798,12 @@ func transformObjToStaticLib(ctx android.ModuleContext, // Generate a Rust staticlib from a list of rlibDeps. Returns nil if TransformRlibstoStaticlib is nil or rlibDeps is empty. func generateRustStaticlib(ctx android.ModuleContext, rlibDeps []RustRlibDep) android.Path { if TransformRlibstoStaticlib == nil && len(rlibDeps) > 0 { - // This should only be reachable if a module defines static_rlibs and + // This should only be reachable if a module defines Rust deps in static_libs and // soong-rust hasn't been loaded alongside soong-cc (e.g. in soong-cc tests). - panic(fmt.Errorf("TransformRlibstoStaticlib is not set and static_rlibs is defined in %s", ctx.ModuleName())) + panic(fmt.Errorf( + "TransformRlibstoStaticlib is not set and rust deps are defined in static_libs for %s", + ctx.ModuleName())) + } else if len(rlibDeps) == 0 { return nil } @@ -829,6 +832,7 @@ func generateRustStaticlib(ctx android.ModuleContext, rlibDeps []RustRlibDep) an func genRustStaticlibSrcFile(crateNames []string) string { lines := []string{ "// @Soong generated Source", + "#![no_std]", // pre-emptively set no_std to support both std and no_std. } for _, crate := range crateNames { lines = append(lines, fmt.Sprintf("extern crate %s;", crate)) |