aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-06-11 07:11:20 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-06-11 07:11:20 +0000
commit23b3579759aa89b0e088385c9e5bb3c2e51a1ad3 (patch)
tree5541c8653104dec4c609173814d35cb333ebda5a
parent08979c7567c5bcc510ff0f42655944fa478b3474 (diff)
parent3045195f5680bcd7dfb2127186e1006b64e2b6c7 (diff)
downloadbuild_soong-android-8.0.0_r1.tar.gz
build_soong-android-8.0.0_r1.tar.bz2
build_soong-android-8.0.0_r1.zip
Change-Id: I46f4dbcbd78ab3780853abba6609c5db55af9aa8
-rw-r--r--cc/sanitize.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/cc/sanitize.go b/cc/sanitize.go
index 0ccde976..4d749043 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -347,7 +347,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)