Merge "Switch to clang-r346389."
This commit is contained in:
@@ -91,7 +91,9 @@ var ClangUnknownLldflags = sorted([]string{
|
|||||||
"-Wl,-m,aarch64_elf64_le_vec",
|
"-Wl,-m,aarch64_elf64_le_vec",
|
||||||
})
|
})
|
||||||
|
|
||||||
var ClangLibToolingUnknownCflags []string = nil
|
var ClangLibToolingUnknownCflags = sorted([]string{
|
||||||
|
"-fno-sanitize=implicit-integer-sign-change",
|
||||||
|
})
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
pctx.StaticVariable("ClangExtraCflags", strings.Join([]string{
|
pctx.StaticVariable("ClangExtraCflags", strings.Join([]string{
|
||||||
|
@@ -120,8 +120,8 @@ var (
|
|||||||
|
|
||||||
// prebuilts/clang default settings.
|
// prebuilts/clang default settings.
|
||||||
ClangDefaultBase = "prebuilts/clang/host"
|
ClangDefaultBase = "prebuilts/clang/host"
|
||||||
ClangDefaultVersion = "clang-r344140b"
|
ClangDefaultVersion = "clang-r346389"
|
||||||
ClangDefaultShortVersion = "8.0.4"
|
ClangDefaultShortVersion = "8.0.5"
|
||||||
|
|
||||||
// Directories with warnings from Android.bp files.
|
// Directories with warnings from Android.bp files.
|
||||||
WarningAllowedProjects = []string{
|
WarningAllowedProjects = []string{
|
||||||
|
@@ -376,6 +376,22 @@ func (sanitize *sanitize) deps(ctx BaseModuleContext, deps Deps) Deps {
|
|||||||
return deps
|
return deps
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func toDisableImplicitIntegerChange(flags []string) bool {
|
||||||
|
// Returns true if any flag is fsanitize*integer, and there is
|
||||||
|
// no explicit flag about sanitize=implicit-integer-sign-change.
|
||||||
|
for _, f := range flags {
|
||||||
|
if strings.Contains(f, "sanitize=implicit-integer-sign-change") {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, f := range flags {
|
||||||
|
if strings.HasPrefix(f, "-fsanitize") && strings.Contains(f, "integer") {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func (sanitize *sanitize) flags(ctx ModuleContext, flags Flags) Flags {
|
func (sanitize *sanitize) flags(ctx ModuleContext, flags Flags) Flags {
|
||||||
minimalRuntimeLib := config.UndefinedBehaviorSanitizerMinimalRuntimeLibrary(ctx.toolchain()) + ".a"
|
minimalRuntimeLib := config.UndefinedBehaviorSanitizerMinimalRuntimeLibrary(ctx.toolchain()) + ".a"
|
||||||
minimalRuntimePath := "${config.ClangAsanLibDir}/" + minimalRuntimeLib
|
minimalRuntimePath := "${config.ClangAsanLibDir}/" + minimalRuntimeLib
|
||||||
@@ -533,6 +549,10 @@ func (sanitize *sanitize) flags(ctx ModuleContext, flags Flags) Flags {
|
|||||||
flags.LdFlags = append(flags.LdFlags, "-Wl,--exclude-libs,"+minimalRuntimeLib)
|
flags.LdFlags = append(flags.LdFlags, "-Wl,--exclude-libs,"+minimalRuntimeLib)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// http://b/119329758, Android core does not boot up with this sanitizer yet.
|
||||||
|
if toDisableImplicitIntegerChange(flags.CFlags) {
|
||||||
|
flags.CFlags = append(flags.CFlags, "-fno-sanitize=implicit-integer-sign-change")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(diagSanitizers) > 0 {
|
if len(diagSanitizers) > 0 {
|
||||||
|
Reference in New Issue
Block a user