Merge \\"Support global and local sanitizers\\" am: 2c4841800e
am: 19d8d566c3
Change-Id: I1e48fca96a32d50cd8479af6e417efbf4a9e1656
This commit is contained in:
@@ -170,10 +170,12 @@ func (sanitize *sanitize) deps(ctx BaseModuleContext, deps Deps) Deps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ctx.Device() {
|
if ctx.Device() {
|
||||||
deps.SharedLibs = append(deps.SharedLibs, "libdl")
|
|
||||||
if Bool(sanitize.Properties.Sanitize.Address) {
|
if Bool(sanitize.Properties.Sanitize.Address) {
|
||||||
deps.StaticLibs = append(deps.StaticLibs, "libasan")
|
deps.StaticLibs = append(deps.StaticLibs, "libasan")
|
||||||
}
|
}
|
||||||
|
if Bool(sanitize.Properties.Sanitize.Address) || Bool(sanitize.Properties.Sanitize.Thread) {
|
||||||
|
deps.SharedLibs = append(deps.SharedLibs, "libdl")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return deps
|
return deps
|
||||||
@@ -274,8 +276,9 @@ func (sanitize *sanitize) flags(ctx ModuleContext, flags Flags) Flags {
|
|||||||
flags.LdFlags = append(flags.LdFlags, sanitizeArg)
|
flags.LdFlags = append(flags.LdFlags, sanitizeArg)
|
||||||
flags.LdFlags = append(flags.LdFlags, "-lrt", "-ldl")
|
flags.LdFlags = append(flags.LdFlags, "-lrt", "-ldl")
|
||||||
} else {
|
} else {
|
||||||
if !Bool(sanitize.Properties.Sanitize.Address) {
|
flags.CFlags = append(flags.CFlags, "-fsanitize-trap=all", "-ftrap-function=abort")
|
||||||
flags.CFlags = append(flags.CFlags, "-fsanitize-trap=all", "-ftrap-function=abort")
|
if Bool(sanitize.Properties.Sanitize.Address) || Bool(sanitize.Properties.Sanitize.Thread) {
|
||||||
|
flags.CFlags = append(flags.CFlags, "-fno-sanitize-trap=address,thread")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user