From f1ff54a10b4abc248b0cfcc5d3c1ebbf534522c5 Mon Sep 17 00:00:00 2001 From: ThiƩbaud Weksteen Date: Mon, 22 Mar 2021 14:24:54 +0100 Subject: rust: Drop libgcc dependency Rustc unstable option "link-native-libraries" is used to prevent the linkage of other libraries via the #[link] directive. Add a dependency to libclang_rt.builtins, similarly to cc. Bug: 141331117 Test: lunch aosp_crosshatch-userdebug; m Change-Id: I5c232291a5dd08a99e6a12a1295e30bb8e4fcaf1 --- rust/compiler.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'rust/compiler.go') diff --git a/rust/compiler.go b/rust/compiler.go index 98ad7ad1b..200af9061 100644 --- a/rust/compiler.go +++ b/rust/compiler.go @@ -281,7 +281,7 @@ func (compiler *baseCompiler) compilerDeps(ctx DepsContext, deps Deps) Deps { return deps } -func bionicDeps(deps Deps, static bool) Deps { +func bionicDeps(ctx DepsContext, deps Deps, static bool) Deps { bionicLibs := []string{} bionicLibs = append(bionicLibs, "liblog") bionicLibs = append(bionicLibs, "libc") @@ -294,9 +294,9 @@ func bionicDeps(deps Deps, static bool) Deps { deps.SharedLibs = append(deps.SharedLibs, bionicLibs...) } - //TODO(b/141331117) libstd requires libgcc on Android - deps.StaticLibs = append(deps.StaticLibs, "libgcc") - + if libRuntimeBuiltins := config.BuiltinsRuntimeLibrary(ctx.toolchain()); libRuntimeBuiltins != "" { + deps.StaticLibs = append(deps.StaticLibs, libRuntimeBuiltins) + } return deps } -- cgit v1.2.3-59-g8ed1b