Merge "Make -ldl -lrt -lpthread implicit for host builds"
This commit is contained in:
12
cc/linker.go
12
cc/linker.go
@@ -213,6 +213,18 @@ func (linker *baseLinker) linkerFlags(ctx ModuleContext, flags Flags) Flags {
|
|||||||
CheckBadHostLdlibs(ctx, "host_ldlibs", linker.Properties.Host_ldlibs)
|
CheckBadHostLdlibs(ctx, "host_ldlibs", linker.Properties.Host_ldlibs)
|
||||||
|
|
||||||
flags.LdFlags = append(flags.LdFlags, 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")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user