aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgenii Stepanov <eugenis@google.com>2017-06-07 15:46:40 -0700
committerEvgenii Stepanov <eugenis@google.com>2017-06-07 16:19:17 -0700
commitc6482d69c287866e2052f014fee9296599662d71 (patch)
treef5aaf08e95c39e8b45a3a4e7baddf0aa9ed92560
parent3f050c8ea8db7b0a0fb025c20d26bbdb5a4e7249 (diff)
downloadbuild_soong-c6482d69c287866e2052f014fee9296599662d71.tar.gz
build_soong-c6482d69c287866e2052f014fee9296599662d71.tar.bz2
build_soong-c6482d69c287866e2052f014fee9296599662d71.zip
Don't add -lrt on Darwin for sanitized targets.
Bug: 34719251 Change-Id: Iff81c4d891a2341a8152e5603391b55b0222ebd7
-rw-r--r--cc/sanitize.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/cc/sanitize.go b/cc/sanitize.go
index fcb32896..168e6c89 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -351,7 +351,10 @@ func (sanitize *sanitize) flags(ctx ModuleContext, flags Flags) Flags {
if ctx.Host() {
flags.CFlags = append(flags.CFlags, "-fno-sanitize-recover=all")
flags.LdFlags = append(flags.LdFlags, sanitizeArg)
- flags.LdFlags = append(flags.LdFlags, "-lrt", "-ldl")
+ if ctx.Os() == android.Linux {
+ flags.LdFlags = append(flags.LdFlags, "-lrt")
+ }
+ flags.LdFlags = append(flags.LdFlags, "-ldl")
// Host sanitizers only link symbols in the final executable, so
// there will always be undefined symbols in intermediate libraries.
_, flags.LdFlags = removeFromList("-Wl,--no-undefined", flags.LdFlags)