rust: Link libunwind into Rust static executables.

Rust static executables fail to build due to missing unwind symbols.
Make sure we link libunwind when building these.

Bug: 194386505
Test: rust_binary with static_executable: true builds.
Change-Id: I74bab25e186e181bc1ac8fdd608687707c662e4d
This commit is contained in:
Ivan Lozano
2021-08-13 13:14:06 -04:00
parent e21bb67be9
commit 8711c5cf8c

View File

@@ -362,7 +362,9 @@ func bionicDeps(ctx DepsContext, deps Deps, static bool) Deps {
} else {
deps.SharedLibs = append(deps.SharedLibs, bionicLibs...)
}
if ctx.RustModule().StaticExecutable() {
deps.StaticLibs = append(deps.StaticLibs, "libunwind")
}
if libRuntimeBuiltins := config.BuiltinsRuntimeLibrary(ctx.toolchain()); libRuntimeBuiltins != "" {
deps.StaticLibs = append(deps.StaticLibs, libRuntimeBuiltins)
}