summaryrefslogtreecommitdiff
path: root/rust/compiler.go
diff options
context:
space:
mode:
author Ivan Lozano <ivanlozano@google.com> 2021-08-13 13:14:06 -0400
committer Ivan Lozano <ivanlozano@google.com> 2021-08-13 13:15:31 -0400
commit8711c5cf8c90ddae7971f0c1deeae2edaa1ca7ed (patch)
tree1f50ba5d23157942e986a5a444b3406ec25e9d1f /rust/compiler.go
parente21bb67be9831f01a9610105c181f21b9b18f6ad (diff)
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
Diffstat (limited to 'rust/compiler.go')
-rw-r--r--rust/compiler.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/rust/compiler.go b/rust/compiler.go
index 6b3ccfcfa..e0d89ac1d 100644
--- a/rust/compiler.go
+++ b/rust/compiler.go
@@ -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)
}