Merge "Make -ldl -lrt -lpthread implicit for host builds"

This commit is contained in:
Treehugger Robot
2017-09-09 01:32:23 +00:00
committed by Gerrit Code Review

View File

@@ -213,6 +213,18 @@ func (linker *baseLinker) linkerFlags(ctx ModuleContext, flags Flags) Flags {
CheckBadHostLdlibs(ctx, "host_ldlibs", linker.Properties.Host_ldlibs)
flags.LdFlags = append(flags.LdFlags, linker.Properties.Host_ldlibs...)
if !ctx.Windows() {
// Add -ldl, -lpthread and -lrt to host builds to match the default behavior of device
// builds
flags.LdFlags = append(flags.LdFlags,
"-ldl",
"-lpthread",
)
if !ctx.Darwin() {
flags.LdFlags = append(flags.LdFlags, "-lrt")
}
}
}
}