diff options
author | 2023-08-16 14:07:19 +0000 | |
---|---|---|
committer | 2023-08-16 14:07:19 +0000 | |
commit | b0e1035417e745f38938ce138784267003c22953 (patch) | |
tree | 0192f06909e37de446fe0f52a7da806fb9ee095a /rust/compiler.go | |
parent | f768e6e27ea7d9833ae324d58621b874a7144170 (diff) | |
parent | 2fcbffa4a1dd445586bb6be14caa38ba3ef4bdc3 (diff) |
Merge "rust: Add support for host fuzzers." into main
Diffstat (limited to 'rust/compiler.go')
-rw-r--r-- | rust/compiler.go | 9 |
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 } |