From 2210e720c9a0f2d34f96bf5422f81aca6347a573 Mon Sep 17 00:00:00 2001 From: Stephen Hines Date: Wed, 15 Jul 2020 11:11:57 -0700 Subject: [PATCH] Switch to clang-r399163. Bug: http://b/155835175 Bug: http://b/151457797 Bug: http://b/165945989 Test: m with aosp_blueline Change-Id: Id2c2932ccbc34fcbb19cd0b4da0d66ea92cc099a --- cc/config/clang.go | 14 ++++++++++++-- cc/config/global.go | 10 ++++++++-- cc/config/x86_windows_host.go | 3 +++ 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/cc/config/clang.go b/cc/config/clang.go index 7db405c2e..441bff2a5 100644 --- a/cc/config/clang.go +++ b/cc/config/clang.go @@ -42,7 +42,6 @@ var ClangUnknownCflags = sorted([]string{ "-Wno-literal-suffix", "-Wno-maybe-uninitialized", "-Wno-old-style-declaration", - "-Wno-psabi", "-Wno-unused-but-set-parameter", "-Wno-unused-but-set-variable", "-Wno-unused-local-typedefs", @@ -93,7 +92,9 @@ var ClangLibToolingUnknownCflags = sorted([]string{}) // updated, some checks enabled by this module may be disabled if they have // become more strict, or if they are a new match for a wildcard group like // `modernize-*`. -var ClangTidyDisableChecks = []string{} +var ClangTidyDisableChecks = []string{ + "misc-no-recursion", +} func init() { pctx.StaticVariable("ClangExtraCflags", strings.Join([]string{ @@ -103,6 +104,10 @@ func init() { // not emit the table by default on Android since NDK still uses GNU binutils. "-faddrsig", + // Turn on -fcommon explicitly, since Clang now defaults to -fno-common. The cleanup bug + // tracking this is http://b/151457797. + "-fcommon", + // Help catch common 32/64-bit errors. "-Werror=int-conversion", @@ -183,6 +188,8 @@ func init() { "-Wno-enum-enum-conversion", // http://b/154138986 "-Wno-enum-float-conversion", // http://b/154255917 "-Wno-pessimizing-move", // http://b/154270751 + // New warnings to be fixed after clang-r399163 + "-Wno-non-c-typedef-for-linkage", // http://b/161304145 }, " ")) // Extra cflags for external third-party projects to disable warnings that @@ -205,6 +212,9 @@ func init() { "-Wno-xor-used-as-pow", // http://b/145211022 "-Wno-final-dtor-non-final-class", + + // http://b/165945989 + "-Wno-psabi", }, " ")) } diff --git a/cc/config/global.go b/cc/config/global.go index 32f163d88..098914eec 100644 --- a/cc/config/global.go +++ b/cc/config/global.go @@ -114,6 +114,12 @@ var ( noOverrideGlobalCflags = []string{ "-Werror=int-to-pointer-cast", "-Werror=pointer-to-int-cast", + // http://b/161386391 for -Wno-void-pointer-to-enum-cast + "-Wno-void-pointer-to-enum-cast", + // http://b/161386391 for -Wno-void-pointer-to-int-cast + "-Wno-void-pointer-to-int-cast", + // http://b/161386391 for -Wno-pointer-to-int-cast + "-Wno-pointer-to-int-cast", "-Werror=fortify-source", } @@ -130,8 +136,8 @@ var ( // prebuilts/clang default settings. ClangDefaultBase = "prebuilts/clang/host" - ClangDefaultVersion = "clang-r383902b" - ClangDefaultShortVersion = "11.0.2" + ClangDefaultVersion = "clang-r399163" + ClangDefaultShortVersion = "11.0.4" // Directories with warnings from Android.bp files. WarningAllowedProjects = []string{ diff --git a/cc/config/x86_windows_host.go b/cc/config/x86_windows_host.go index b5b555322..b77df7906 100644 --- a/cc/config/x86_windows_host.go +++ b/cc/config/x86_windows_host.go @@ -39,6 +39,9 @@ var ( // Get 64-bit off_t and related functions. "-D_FILE_OFFSET_BITS=64", + // Don't adjust the layout of bitfields like msvc does. + "-mno-ms-bitfields", + "--sysroot ${WindowsGccRoot}/${WindowsGccTriple}", } windowsClangCflags = append(ClangFilterUnknownCflags(windowsCflags), []string{}...)