summaryrefslogtreecommitdiff
path: root/rust/compiler.go
diff options
context:
space:
mode:
author Ivan Lozano <ivanlozano@google.com> 2023-08-16 14:07:19 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2023-08-16 14:07:19 +0000
commitb0e1035417e745f38938ce138784267003c22953 (patch)
tree0192f06909e37de446fe0f52a7da806fb9ee095a /rust/compiler.go
parentf768e6e27ea7d9833ae324d58621b874a7144170 (diff)
parent2fcbffa4a1dd445586bb6be14caa38ba3ef4bdc3 (diff)
Merge "rust: Add support for host fuzzers." into main
Diffstat (limited to 'rust/compiler.go')
-rw-r--r--rust/compiler.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/rust/compiler.go b/rust/compiler.go
index 84c1fce9b..e6a7a9356 100644
--- a/rust/compiler.go
+++ b/rust/compiler.go
@@ -318,6 +318,15 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags) Flag
flags.LinkFlags = append(flags.LinkFlags, cc.RpathFlags(ctx)...)
}
+ if !ctx.toolchain().Bionic() && ctx.Os() != android.LinuxMusl && !ctx.Windows() {
+ // Add -ldl, -lpthread, -lm and -lrt to host builds to match the default behavior of device
+ // builds. This is irrelevant for the Windows target as these are Posix specific.
+ flags.LinkFlags = append(flags.LinkFlags,
+ "-ldl",
+ "-lpthread",
+ "-lm",
+ )
+ }
return flags
}