Switch to clang-r407598 (12.0.1).
Also suppress a clang-tidy warning and a ubsan check to pass compilation. Bug: 171348143 Test: build. Change-Id: Ie5162c15df172cefd7cff9776e54531fd620bc23
This commit is contained in:
@@ -94,6 +94,7 @@ var ClangLibToolingUnknownCflags = sorted([]string{})
|
|||||||
// `modernize-*`.
|
// `modernize-*`.
|
||||||
var ClangTidyDisableChecks = []string{
|
var ClangTidyDisableChecks = []string{
|
||||||
"misc-no-recursion",
|
"misc-no-recursion",
|
||||||
|
"readability-function-cognitive-complexity", // http://b/175055536
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -190,6 +191,8 @@ func init() {
|
|||||||
"-Wno-pessimizing-move", // http://b/154270751
|
"-Wno-pessimizing-move", // http://b/154270751
|
||||||
// New warnings to be fixed after clang-r399163
|
// New warnings to be fixed after clang-r399163
|
||||||
"-Wno-non-c-typedef-for-linkage", // http://b/161304145
|
"-Wno-non-c-typedef-for-linkage", // http://b/161304145
|
||||||
|
// New warnings to be fixed after clang-r407598
|
||||||
|
"-Wno-string-concatenation", // http://b/175068488
|
||||||
}, " "))
|
}, " "))
|
||||||
|
|
||||||
// Extra cflags for external third-party projects to disable warnings that
|
// Extra cflags for external third-party projects to disable warnings that
|
||||||
|
@@ -135,8 +135,8 @@ var (
|
|||||||
|
|
||||||
// prebuilts/clang default settings.
|
// prebuilts/clang default settings.
|
||||||
ClangDefaultBase = "prebuilts/clang/host"
|
ClangDefaultBase = "prebuilts/clang/host"
|
||||||
ClangDefaultVersion = "clang-r399163b"
|
ClangDefaultVersion = "clang-r407598"
|
||||||
ClangDefaultShortVersion = "11.0.5"
|
ClangDefaultShortVersion = "12.0.1"
|
||||||
|
|
||||||
// Directories with warnings from Android.bp files.
|
// Directories with warnings from Android.bp files.
|
||||||
WarningAllowedProjects = []string{
|
WarningAllowedProjects = []string{
|
||||||
|
@@ -458,6 +458,22 @@ func toDisableImplicitIntegerChange(flags []string) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func toDisableUnsignedShiftBaseChange(flags []string) bool {
|
||||||
|
// Returns true if any flag is fsanitize*integer, and there is
|
||||||
|
// no explicit flag about sanitize=unsigned-shift-base.
|
||||||
|
for _, f := range flags {
|
||||||
|
if strings.Contains(f, "sanitize=unsigned-shift-base") {
|
||||||
|
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
|
||||||
@@ -614,6 +630,10 @@ func (sanitize *sanitize) flags(ctx ModuleContext, flags Flags) Flags {
|
|||||||
if toDisableImplicitIntegerChange(flags.Local.CFlags) {
|
if toDisableImplicitIntegerChange(flags.Local.CFlags) {
|
||||||
flags.Local.CFlags = append(flags.Local.CFlags, "-fno-sanitize=implicit-integer-sign-change")
|
flags.Local.CFlags = append(flags.Local.CFlags, "-fno-sanitize=implicit-integer-sign-change")
|
||||||
}
|
}
|
||||||
|
// http://b/171275751, Android doesn't build with this sanitizer yet.
|
||||||
|
if toDisableUnsignedShiftBaseChange(flags.Local.CFlags) {
|
||||||
|
flags.Local.CFlags = append(flags.Local.CFlags, "-fno-sanitize=unsigned-shift-base")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(sanitize.Properties.DiagSanitizers) > 0 {
|
if len(sanitize.Properties.DiagSanitizers) > 0 {
|
||||||
|
Reference in New Issue
Block a user