diff options
Diffstat (limited to 'compiler_wrapper/config.go')
-rw-r--r-- | compiler_wrapper/config.go | 60 |
1 files changed, 43 insertions, 17 deletions
diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index 8b5432b8..6c28287c 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -26,7 +26,8 @@ type config struct { // by the user). clangPostFlags []string // Toolchain root path relative to the wrapper binary. - rootRelPath string + clangRootRelPath string + gccRootRelPath string // Directory to store errors that were prevented with -Wno-error. newWarningsDir string // Directory to store nits in when using `WITH_TIDY=tricium`. @@ -105,8 +106,12 @@ func getConfig(configName string, useCCache bool, useLlvmNext bool, version stri // Full hardening. // Temporarily disable function splitting because of chromium:434751. var crosHardenedConfig = &config{ - rootRelPath: "../../../../..", + clangRootRelPath: "../..", + gccRootRelPath: "../../../../..", + // Pass "-fcommon" till the packages are fixed to work with new clang/gcc + // default of "-fno-common", crbug.com/1060413. commonFlags: []string{ + "-fcommon", "-fstack-protector-strong", "-fPIE", "-pie", @@ -122,29 +127,34 @@ var crosHardenedConfig = &config{ // Temporarily add no-unknown-warning-option to deal with old clang versions. // Temporarily disable Wsection since kernel gets a bunch of these. chromium:778867 // Disable "-faddrsig" since it produces object files that strip doesn't understand, chromium:915742. - // Pass "-fcommon" till the packages are fixed to work with new clang default - // "-fno-common", crbug.com/1060413. // crbug.com/1103065: -grecord-gcc-switches pollutes the Goma cache; // removed that flag for now. + // Temporarily disable Wdeprecated-declarations. b/193860318 + clangFlags: []string{ "-Qunused-arguments", "-fno-addrsig", - "-fcommon", + "-fdebug-default-version=5", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-Wno-section", - "-static-libgcc", "-fuse-ld=lld", + "--unwindlib=libgcc", "-Wno-final-dtor-non-final-class", "-Werror=poison-system-directories", "-fexperimental-new-pass-manager", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-declarations", }, + + // Temporarily disable Wdeprecated-copy. b/191479033 clangPostFlags: []string{ "-Wno-implicit-int-float-conversion", "-Wno-compound-token-split-by-space", "-Wno-string-concatenation", + "-Wno-deprecated-copy", + "-Wno-unused-but-set-variable", }, newWarningsDir: "/tmp/fatal_clang_warnings", triciumNitsDir: "/tmp/linting_output/clang-tidy", @@ -153,8 +163,9 @@ var crosHardenedConfig = &config{ // Flags to be added to non-hardened toolchain. var crosNonHardenedConfig = &config{ - rootRelPath: "../../../../..", - commonFlags: []string{}, + clangRootRelPath: "../..", + gccRootRelPath: "../../../../..", + commonFlags: []string{}, gccFlags: []string{ "-Wno-maybe-uninitialized", "-Wno-unused-local-typedefs", @@ -164,22 +175,28 @@ var crosNonHardenedConfig = &config{ // Temporarily disable tautological-*-compare chromium:778316. // Temporarily add no-unknown-warning-option to deal with old clang versions. // Temporarily disable Wsection since kernel gets a bunch of these. chromium:778867 + // Temporarily disable Wdeprecated-declarations. b/193860318 clangFlags: []string{ "-Qunused-arguments", + "-fdebug-default-version=5", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-Wno-section", - "-static-libgcc", "-Wno-final-dtor-non-final-class", "-Werror=poison-system-directories", "-fexperimental-new-pass-manager", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-declarations", }, + + // Temporarily disable Wdeprecated-copy. b/191479033 clangPostFlags: []string{ "-Wno-implicit-int-float-conversion", "-Wno-compound-token-split-by-space", "-Wno-string-concatenation", + "-Wno-deprecated-copy", + "-Wno-unused-but-set-variable", }, newWarningsDir: "/tmp/fatal_clang_warnings", triciumNitsDir: "/tmp/linting_output/clang-tidy", @@ -188,9 +205,14 @@ var crosNonHardenedConfig = &config{ // Flags to be added to host toolchain. var crosHostConfig = &config{ - isHostWrapper: true, - rootRelPath: "../..", - commonFlags: []string{}, + isHostWrapper: true, + clangRootRelPath: "../..", + gccRootRelPath: "../..", + // Pass "-fcommon" till the packages are fixed to work with new clang/gcc + // default of "-fno-common", crbug.com/1060413. + commonFlags: []string{ + "-fcommon", + }, gccFlags: []string{ "-Wno-maybe-uninitialized", "-Wno-unused-local-typedefs", @@ -198,17 +220,15 @@ var crosHostConfig = &config{ }, // Temporarily disable tautological-*-compare chromium:778316. // Temporarily add no-unknown-warning-option to deal with old clang versions. - // Pass "-fcommon" till the packages are fixed to work with new clang default - // "-fno-common", crbug.com/1060413. // crbug.com/1103065: -grecord-gcc-switches pollutes the Goma cache; // removed that flag for now. + // Temporarily disable Wdeprecated-declarations. b/193860318 clangFlags: []string{ "-Qunused-arguments", "-fno-addrsig", - "-fcommon", "-fuse-ld=lld", + "-fdebug-default-version=5", "-Wno-unused-local-typedefs", - "-Wno-deprecated-declarations", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-final-dtor-non-final-class", @@ -216,11 +236,16 @@ var crosHostConfig = &config{ "-Wno-unknown-warning-option", "-fexperimental-new-pass-manager", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-declarations", }, + + // Temporarily disable Wdeprecated-copy. b/191479033 clangPostFlags: []string{ "-Wno-implicit-int-float-conversion", "-Wno-compound-token-split-by-space", "-Wno-string-concatenation", + "-Wno-deprecated-copy", + "-Wno-unused-but-set-variable", }, newWarningsDir: "/tmp/fatal_clang_warnings", triciumNitsDir: "/tmp/linting_output/clang-tidy", @@ -230,7 +255,8 @@ var crosHostConfig = &config{ var androidConfig = &config{ isHostWrapper: false, isAndroidWrapper: true, - rootRelPath: "./", + gccRootRelPath: "./", + clangRootRelPath: "./", commonFlags: []string{}, gccFlags: []string{}, clangFlags: []string{}, |