From 2124be5caee6803d5bfe6f7cdc8e3367cb375807 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Thu, 21 Apr 2022 10:27:37 -0700 Subject: toolchain_utils: s/Cr OS/CrOS/g Result of running `sed -ri 's/Chrom(ium|e) OS/Chrom\1OS/g' $(find -type f)`. BUG=None TEST=None Change-Id: I59be92537aa19bc989f52b585e307e76dbde401b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3600147 Reviewed-by: Manoj Gupta Commit-Queue: George Burgess Tested-by: George Burgess --- compiler_wrapper/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler_wrapper/config.go') diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index 6c28287c..fdd17763 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -1,4 +1,4 @@ -// Copyright 2019 The Chromium OS Authors. All rights reserved. +// Copyright 2019 The ChromiumOS Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -- cgit v1.2.3 From b20378020a1863ea6dd6b4becc31ab20ff0ec28c Mon Sep 17 00:00:00 2001 From: Michael Benfield Date: Fri, 29 Apr 2022 16:37:52 +0000 Subject: Remove "-Wno-unused-but-set-variable" from config.go. BUG=b:227655984 TEST=CQ Change-Id: Ib8928cab96f8e3b4dfe50e5d89645e8ec5e905d4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3613766 Auto-Submit: Michael Benfield Reviewed-by: Manoj Gupta Tested-by: Manoj Gupta Commit-Queue: Manoj Gupta --- compiler_wrapper/config.go | 3 --- 1 file changed, 3 deletions(-) (limited to 'compiler_wrapper/config.go') diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index fdd17763..0d24c9a9 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -154,7 +154,6 @@ var crosHardenedConfig = &config{ "-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", @@ -196,7 +195,6 @@ var crosNonHardenedConfig = &config{ "-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", @@ -245,7 +243,6 @@ var crosHostConfig = &config{ "-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", -- cgit v1.2.3 From d7e5c879964eee1a3c9d04d592a75ccbc06d2875 Mon Sep 17 00:00:00 2001 From: Manoj Gupta Date: Mon, 2 May 2022 09:31:15 -0700 Subject: Sync unwindlib option with current llvm Use unwindlib=libunwind to match current production wrapper. BUG=None TEST=go test Change-Id: I6cdace48ed871ac87a093addf2b96b86ee5153c2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3621381 Reviewed-by: George Burgess Tested-by: Manoj Gupta Commit-Queue: George Burgess Auto-Submit: Manoj Gupta --- compiler_wrapper/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler_wrapper/config.go') diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index 0d24c9a9..301dda6d 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -140,7 +140,7 @@ var crosHardenedConfig = &config{ "-Wno-unknown-warning-option", "-Wno-section", "-fuse-ld=lld", - "--unwindlib=libgcc", + "--unwindlib=libunwind", "-Wno-final-dtor-non-final-class", "-Werror=poison-system-directories", "-fexperimental-new-pass-manager", -- cgit v1.2.3 From 58bd94f0cf7bba9b91e24d75e991f098723d81ee Mon Sep 17 00:00:00 2001 From: Manoj Gupta Date: Mon, 9 May 2022 20:21:03 -0700 Subject: compiler_wrapper: Disable warning implicit-function-declaration Wimplicit-function-declaration has been promoted to be an default error even with Wno-error. Disable the error by default since it is breaking a lot of packages. BUG=b:230345382 TEST=cq Change-Id: Ib46b0b47a3e1dea3797739370a4d9cf92a4d25f9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3637117 Tested-by: Manoj Gupta Auto-Submit: Manoj Gupta Reviewed-by: George Burgess Commit-Queue: Manoj Gupta --- compiler_wrapper/config.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'compiler_wrapper/config.go') diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index 301dda6d..e6708ebf 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -130,6 +130,7 @@ var crosHardenedConfig = &config{ // crbug.com/1103065: -grecord-gcc-switches pollutes the Goma cache; // removed that flag for now. // Temporarily disable Wdeprecated-declarations. b/193860318 + // b/230345382: Temporarily disable Wimplicit-function-declaration. clangFlags: []string{ "-Qunused-arguments", @@ -146,6 +147,7 @@ var crosHardenedConfig = &config{ "-fexperimental-new-pass-manager", "-Wno-compound-token-split-by-macro", "-Wno-deprecated-declarations", + "-Wno-error=implicit-function-declaration", }, // Temporarily disable Wdeprecated-copy. b/191479033 @@ -175,6 +177,7 @@ var crosNonHardenedConfig = &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 // Temporarily disable Wdeprecated-declarations. b/193860318 + // b/230345382: Temporarily disable Wimplicit-function-declaration. clangFlags: []string{ "-Qunused-arguments", "-fdebug-default-version=5", @@ -187,6 +190,7 @@ var crosNonHardenedConfig = &config{ "-fexperimental-new-pass-manager", "-Wno-compound-token-split-by-macro", "-Wno-deprecated-declarations", + "-Wno-error=implicit-function-declaration", }, // Temporarily disable Wdeprecated-copy. b/191479033 @@ -221,6 +225,7 @@ var crosHostConfig = &config{ // crbug.com/1103065: -grecord-gcc-switches pollutes the Goma cache; // removed that flag for now. // Temporarily disable Wdeprecated-declarations. b/193860318 + // b/230345382: Temporarily disable Wimplicit-function-declaration. clangFlags: []string{ "-Qunused-arguments", "-fno-addrsig", @@ -235,6 +240,7 @@ var crosHostConfig = &config{ "-fexperimental-new-pass-manager", "-Wno-compound-token-split-by-macro", "-Wno-deprecated-declarations", + "-Wno-error=implicit-function-declaration", }, // Temporarily disable Wdeprecated-copy. b/191479033 -- cgit v1.2.3 From 24ac18e68a75cf876d7bb0e2880945085373668b Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Tue, 10 May 2022 13:02:14 -0700 Subject: compiler_wrapper: un-pointer-ify all configs We do nothing with these but immediately deref them. It's simpler (and should be infinitesimally faster) to just have values here. BUG=None TEST=go test Change-Id: I6df8eda8f36032e856f9abad3e090c62c9d6beb0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3639684 Commit-Queue: George Burgess Reviewed-by: Jordan Abrahams-Whitehead Tested-by: George Burgess --- compiler_wrapper/config.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'compiler_wrapper/config.go') diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index e6708ebf..4e9c4f10 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -83,13 +83,13 @@ func getConfig(configName string, useCCache bool, useLlvmNext bool, version stri cfg := config{} switch configName { case "cros.hardened": - cfg = *crosHardenedConfig + cfg = crosHardenedConfig case "cros.nonhardened": - cfg = *crosNonHardenedConfig + cfg = crosNonHardenedConfig case "cros.host": - cfg = *crosHostConfig + cfg = crosHostConfig case "android": - cfg = *androidConfig + cfg = androidConfig default: return nil, newErrorwithSourceLocf("unknown config name: %s", configName) } @@ -105,7 +105,7 @@ func getConfig(configName string, useCCache bool, useLlvmNext bool, version stri // Full hardening. // Temporarily disable function splitting because of chromium:434751. -var crosHardenedConfig = &config{ +var crosHardenedConfig = config{ clangRootRelPath: "../..", gccRootRelPath: "../../../../..", // Pass "-fcommon" till the packages are fixed to work with new clang/gcc @@ -163,7 +163,7 @@ var crosHardenedConfig = &config{ } // Flags to be added to non-hardened toolchain. -var crosNonHardenedConfig = &config{ +var crosNonHardenedConfig = config{ clangRootRelPath: "../..", gccRootRelPath: "../../../../..", commonFlags: []string{}, @@ -206,7 +206,7 @@ var crosNonHardenedConfig = &config{ } // Flags to be added to host toolchain. -var crosHostConfig = &config{ +var crosHostConfig = config{ isHostWrapper: true, clangRootRelPath: "../..", gccRootRelPath: "../..", @@ -255,7 +255,7 @@ var crosHostConfig = &config{ crashArtifactsDir: "/tmp/clang_crash_diagnostics", } -var androidConfig = &config{ +var androidConfig = config{ isHostWrapper: false, isAndroidWrapper: true, gccRootRelPath: "./", -- cgit v1.2.3 From ea4a522b15b2e1b22ad7b97c8b91f0791c426edc Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Tue, 10 May 2022 11:44:23 -0700 Subject: compiler_wrapper: factor clangPostFlags into a function; sort Since order doesn't matter, make this sorted. Otherwise, these are all shared, so no point in repeating them. BUG=b:232114933 TEST=go test Change-Id: Ide3c620de9018fed3fe8d898b21b3d5d4f42700f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3639281 Reviewed-by: Jordan Abrahams-Whitehead Commit-Queue: George Burgess Tested-by: George Burgess --- compiler_wrapper/config.go | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) (limited to 'compiler_wrapper/config.go') diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index 4e9c4f10..7e6e4896 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -103,6 +103,16 @@ func getConfig(configName string, useCCache bool, useLlvmNext bool, version stri return &cfg, nil } +func crosCommonClangPostFlags() []string { + // Temporarily disable Wdeprecated-copy. b/191479033 + return []string{ + "-Wno-compound-token-split-by-space", + "-Wno-deprecated-copy", + "-Wno-implicit-int-float-conversion", + "-Wno-string-concatenation", + } +} + // Full hardening. // Temporarily disable function splitting because of chromium:434751. var crosHardenedConfig = config{ @@ -150,13 +160,7 @@ var crosHardenedConfig = config{ "-Wno-error=implicit-function-declaration", }, - // 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", - }, + clangPostFlags: crosCommonClangPostFlags(), newWarningsDir: "/tmp/fatal_clang_warnings", triciumNitsDir: "/tmp/linting_output/clang-tidy", crashArtifactsDir: "/tmp/clang_crash_diagnostics", @@ -193,13 +197,7 @@ var crosNonHardenedConfig = config{ "-Wno-error=implicit-function-declaration", }, - // 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", - }, + clangPostFlags: crosCommonClangPostFlags(), newWarningsDir: "/tmp/fatal_clang_warnings", triciumNitsDir: "/tmp/linting_output/clang-tidy", crashArtifactsDir: "/tmp/clang_crash_diagnostics", @@ -244,12 +242,7 @@ var crosHostConfig = config{ }, // 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", - }, + clangPostFlags: crosCommonClangPostFlags(), newWarningsDir: "/tmp/fatal_clang_warnings", triciumNitsDir: "/tmp/linting_output/clang-tidy", crashArtifactsDir: "/tmp/clang_crash_diagnostics", -- cgit v1.2.3 From 5cab4b87ccc87292502d74a222f4c005bc300ad8 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Tue, 10 May 2022 11:53:14 -0700 Subject: compiler_wrapper: sort clangFlags; partition for dedup This CL sorts clang flags, and puts ones shared across all CrOS configurations into their own textual blocks. This should make factoring these out into their own function not require golden updates, which makes verifying the CL that actually _does_ that simpler. BUG=b:232114933 TEST=go test Change-Id: I7dc6110d680505d4ad2af98709730e85c386ae5d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3639682 Reviewed-by: Jordan Abrahams-Whitehead Tested-by: George Burgess Commit-Queue: George Burgess --- compiler_wrapper/config.go | 53 ++++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 25 deletions(-) (limited to 'compiler_wrapper/config.go') diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index 7e6e4896..13df2b9f 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -144,20 +144,21 @@ var crosHardenedConfig = config{ clangFlags: []string{ "-Qunused-arguments", - "-fno-addrsig", - "-fdebug-default-version=5", + "-Werror=poison-system-directories", + "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-declarations", + "-Wno-error=implicit-function-declaration", + "-Wno-final-dtor-non-final-class", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", + "-fdebug-default-version=5", + "-fexperimental-new-pass-manager", + + "--unwindlib=libunwind", "-Wno-section", + "-fno-addrsig", "-fuse-ld=lld", - "--unwindlib=libunwind", - "-Wno-final-dtor-non-final-class", - "-Werror=poison-system-directories", - "-fexperimental-new-pass-manager", - "-Wno-compound-token-split-by-macro", - "-Wno-deprecated-declarations", - "-Wno-error=implicit-function-declaration", }, clangPostFlags: crosCommonClangPostFlags(), @@ -184,17 +185,18 @@ var crosNonHardenedConfig = config{ // b/230345382: Temporarily disable Wimplicit-function-declaration. clangFlags: []string{ "-Qunused-arguments", - "-fdebug-default-version=5", - "-Wno-tautological-constant-compare", - "-Wno-tautological-unsigned-enum-zero-compare", - "-Wno-unknown-warning-option", - "-Wno-section", - "-Wno-final-dtor-non-final-class", "-Werror=poison-system-directories", - "-fexperimental-new-pass-manager", "-Wno-compound-token-split-by-macro", "-Wno-deprecated-declarations", "-Wno-error=implicit-function-declaration", + "-Wno-final-dtor-non-final-class", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-fdebug-default-version=5", + "-fexperimental-new-pass-manager", + + "-Wno-section", }, clangPostFlags: crosCommonClangPostFlags(), @@ -226,19 +228,20 @@ var crosHostConfig = config{ // b/230345382: Temporarily disable Wimplicit-function-declaration. clangFlags: []string{ "-Qunused-arguments", - "-fno-addrsig", - "-fuse-ld=lld", - "-fdebug-default-version=5", - "-Wno-unused-local-typedefs", - "-Wno-tautological-constant-compare", - "-Wno-tautological-unsigned-enum-zero-compare", - "-Wno-final-dtor-non-final-class", "-Werror=poison-system-directories", - "-Wno-unknown-warning-option", - "-fexperimental-new-pass-manager", "-Wno-compound-token-split-by-macro", "-Wno-deprecated-declarations", "-Wno-error=implicit-function-declaration", + "-Wno-final-dtor-non-final-class", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-fdebug-default-version=5", + "-fexperimental-new-pass-manager", + + "-Wno-unused-local-typedefs", + "-fno-addrsig", + "-fuse-ld=lld", }, // Temporarily disable Wdeprecated-copy. b/191479033 -- cgit v1.2.3 From 8e528cae0c5067ef1ec26764dabc6ce7c23be9ad Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Tue, 10 May 2022 11:58:26 -0700 Subject: compiler_wrapper: move common clangFlags to a function BUG=b:232114933 TEST=go test Change-Id: Iffc686c47c21017a31b9fb69e1f2764390fe29f3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3639683 Reviewed-by: Jordan Abrahams-Whitehead Commit-Queue: George Burgess Tested-by: George Burgess --- compiler_wrapper/config.go | 87 ++++++++++++++++------------------------------ 1 file changed, 29 insertions(+), 58 deletions(-) (limited to 'compiler_wrapper/config.go') diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index 13df2b9f..5cbb9748 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -103,6 +103,26 @@ func getConfig(configName string, useCCache bool, useLlvmNext bool, version stri return &cfg, nil } +func crosCommonClangFlags() []string { + // Temporarily disable tautological-*-compare chromium:778316. + // Temporarily add no-unknown-warning-option to deal with old clang versions. + // Temporarily disable Wdeprecated-declarations. b/193860318 + // b/230345382: Temporarily disable Wimplicit-function-declaration. + return []string{ + "-Qunused-arguments", + "-Werror=poison-system-directories", + "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-declarations", + "-Wno-error=implicit-function-declaration", + "-Wno-final-dtor-non-final-class", + "-Wno-tautological-constant-compare", + "-Wno-tautological-unsigned-enum-zero-compare", + "-Wno-unknown-warning-option", + "-fdebug-default-version=5", + "-fexperimental-new-pass-manager", + } +} + func crosCommonClangPostFlags() []string { // Temporarily disable Wdeprecated-copy. b/191479033 return []string{ @@ -133,34 +153,17 @@ var crosHardenedConfig = config{ "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", }, - // 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 // Disable "-faddrsig" since it produces object files that strip doesn't understand, chromium:915742. // crbug.com/1103065: -grecord-gcc-switches pollutes the Goma cache; // removed that flag for now. - // Temporarily disable Wdeprecated-declarations. b/193860318 - // b/230345382: Temporarily disable Wimplicit-function-declaration. - - clangFlags: []string{ - "-Qunused-arguments", - "-Werror=poison-system-directories", - "-Wno-compound-token-split-by-macro", - "-Wno-deprecated-declarations", - "-Wno-error=implicit-function-declaration", - "-Wno-final-dtor-non-final-class", - "-Wno-tautological-constant-compare", - "-Wno-tautological-unsigned-enum-zero-compare", - "-Wno-unknown-warning-option", - "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", - + clangFlags: append( + crosCommonClangFlags(), "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", "-fuse-ld=lld", - }, - + ), clangPostFlags: crosCommonClangPostFlags(), newWarningsDir: "/tmp/fatal_clang_warnings", triciumNitsDir: "/tmp/linting_output/clang-tidy", @@ -178,27 +181,11 @@ var crosNonHardenedConfig = config{ "-Wno-deprecated-declarations", "-Wtrampolines", }, - // 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 - // b/230345382: Temporarily disable Wimplicit-function-declaration. - clangFlags: []string{ - "-Qunused-arguments", - "-Werror=poison-system-directories", - "-Wno-compound-token-split-by-macro", - "-Wno-deprecated-declarations", - "-Wno-error=implicit-function-declaration", - "-Wno-final-dtor-non-final-class", - "-Wno-tautological-constant-compare", - "-Wno-tautological-unsigned-enum-zero-compare", - "-Wno-unknown-warning-option", - "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", - + clangFlags: append( + crosCommonClangFlags(), "-Wno-section", - }, - + ), clangPostFlags: crosCommonClangPostFlags(), newWarningsDir: "/tmp/fatal_clang_warnings", triciumNitsDir: "/tmp/linting_output/clang-tidy", @@ -220,30 +207,14 @@ var crosHostConfig = config{ "-Wno-unused-local-typedefs", "-Wno-deprecated-declarations", }, - // Temporarily disable tautological-*-compare chromium:778316. - // Temporarily add no-unknown-warning-option to deal with old clang versions. // crbug.com/1103065: -grecord-gcc-switches pollutes the Goma cache; // removed that flag for now. - // Temporarily disable Wdeprecated-declarations. b/193860318 - // b/230345382: Temporarily disable Wimplicit-function-declaration. - clangFlags: []string{ - "-Qunused-arguments", - "-Werror=poison-system-directories", - "-Wno-compound-token-split-by-macro", - "-Wno-deprecated-declarations", - "-Wno-error=implicit-function-declaration", - "-Wno-final-dtor-non-final-class", - "-Wno-tautological-constant-compare", - "-Wno-tautological-unsigned-enum-zero-compare", - "-Wno-unknown-warning-option", - "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", - + clangFlags: append( + crosCommonClangFlags(), "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", - }, - + ), // Temporarily disable Wdeprecated-copy. b/191479033 clangPostFlags: crosCommonClangPostFlags(), newWarningsDir: "/tmp/fatal_clang_warnings", -- cgit v1.2.3 From 76b677b89b385083ab2b243308e745abb6b4261c Mon Sep 17 00:00:00 2001 From: Manoj Gupta Date: Wed, 11 May 2022 11:59:37 -0700 Subject: compiler_wrapper: Disable warning implicit-int Wimplicit-int has been promoted to be an default error even with Wno-error. Disable the error by default since it is breaking a lot of packages. BUG=b:231987783 TEST=cq Change-Id: If88877cb63cdd5c392fcf05c2940751547466213 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3642338 Tested-by: Manoj Gupta Reviewed-by: George Burgess Commit-Queue: George Burgess Auto-Submit: Manoj Gupta --- compiler_wrapper/config.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'compiler_wrapper/config.go') diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index 5cbb9748..c275ae9f 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -108,12 +108,14 @@ func crosCommonClangFlags() []string { // Temporarily add no-unknown-warning-option to deal with old clang versions. // Temporarily disable Wdeprecated-declarations. b/193860318 // b/230345382: Temporarily disable Wimplicit-function-declaration. + // b/231987783: Temporarily disable Wimplicit-int. return []string{ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", "-Wno-deprecated-declarations", "-Wno-error=implicit-function-declaration", + "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", -- cgit v1.2.3 From d9d151871f0500e8cdad2432e40698ca15fbf8b4 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Thu, 9 Jun 2022 10:33:57 -0700 Subject: compiler_wrapper: add a --version_suffix flag to build.py This allows us to provide more information about the compiler being wrapped to the wrapper. The intended use of this is to embed hashes of the compiler being wrapped into the wrapper itself, so as the compiler changes, the wrapper's SHA changes with it. While I'm in the area, fix up a comment, and apply this flag to our manual wrapper installation script. BUG=b:222321317 TEST=`emerge llvm` Change-Id: I20380722e1e539d51fe7ea708c63dad696d84c87 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3696434 Reviewed-by: Denis Nikitin Tested-by: George Burgess Commit-Queue: George Burgess --- compiler_wrapper/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler_wrapper/config.go') diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index c275ae9f..25df476f 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -34,7 +34,7 @@ type config struct { triciumNitsDir string // Directory to store crash artifacts in. crashArtifactsDir string - // Version. Only used for printing via -print-cmd. + // Version. Only exposed via -print-config. version string } -- cgit v1.2.3 From 341ee8c2cf75bd3b8f3297f5025416bdfcc97b0c Mon Sep 17 00:00:00 2001 From: Manoj Gupta Date: Thu, 23 Jun 2022 18:16:25 +0000 Subject: compiler_wrapper: Stop managing pie flags With CL:3710850, pie will be defaults for clang and GCC (cross-compiles). No need to manage them separately. BUG=b:190047257 TEST=go test Change-Id: Icf8e74d6a31c5de678ec9a6a5c321a17a0154d37 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3722436 Reviewed-by: Jordan Abrahams-Whitehead Reviewed-by: George Burgess Auto-Submit: Manoj Gupta Tested-by: Manoj Gupta Commit-Queue: George Burgess --- compiler_wrapper/config.go | 2 -- 1 file changed, 2 deletions(-) (limited to 'compiler_wrapper/config.go') diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index 25df476f..9f49e259 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -145,8 +145,6 @@ var crosHardenedConfig = config{ commonFlags: []string{ "-fcommon", "-fstack-protector-strong", - "-fPIE", - "-pie", "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", }, -- cgit v1.2.3 From 0665748ca334615e7f41978c36b8fba7817ed2c7 Mon Sep 17 00:00:00 2001 From: Ryan Beltran Date: Thu, 1 Sep 2022 17:51:48 +0000 Subject: compiler_wrapper: redisable unused-but-set-var This CL add the Wno-unused-but-set-variable flag back into the compiler wrapper. It was previously removed, but there are still occurances of the warning and so we were never able to bundle that change into chromoumos-overlay/llvm. An attempt to revert the original CL failed due to a merge conflict. BUG=b:227655984 TEST=None Change-Id: Ic148a6ae577d5e4394249693ce9b09b95cb9df16 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3868978 Commit-Queue: Ryan Beltran Reviewed-by: George Burgess Tested-by: Ryan Beltran Reviewed-by: Manoj Gupta --- compiler_wrapper/config.go | 1 + 1 file changed, 1 insertion(+) (limited to 'compiler_wrapper/config.go') diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index 9f49e259..6717d503 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -130,6 +130,7 @@ func crosCommonClangPostFlags() []string { return []string{ "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", + "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", } -- cgit v1.2.3 From fdcd39d5de4bd61cee94cf1e26416838d23092b8 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 13 Sep 2022 14:19:58 -0400 Subject: Update license boilerplate text in source code files Normally we don't do this, but enough changes have accumulated that we're doing a tree-wide one-off update of the name & style. BUG=chromium:1098010 TEST=`repo upload` works Change-Id: Icb42e5012a87920c2cd13b666fb3e55e7e4fb3b8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3891080 Auto-Submit: Mike Frysinger Tested-by: Mike Frysinger Commit-Queue: George Burgess Reviewed-by: George Burgess --- compiler_wrapper/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler_wrapper/config.go') diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index 6717d503..64d77ae7 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -1,4 +1,4 @@ -// Copyright 2019 The ChromiumOS Authors. All rights reserved. +// Copyright 2019 The ChromiumOS Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -- cgit v1.2.3 From e2cce3561628cfafd411417d372cef0719f5166d Mon Sep 17 00:00:00 2001 From: Adrian Dole Date: Wed, 2 Nov 2022 21:32:50 +0000 Subject: compiler_wrapper: build with zero initialization See go/chromeos-zero-init BUG=b:234642720 TEST=CQ Change-Id: Icbcb9e9b3928b46875c78c99727b1ec9839f27c3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3999814 Reviewed-by: Adrian Dole Reviewed-by: Manoj Gupta Tested-by: Adrian Dole Auto-Submit: Adrian Dole Commit-Queue: Manoj Gupta --- compiler_wrapper/config.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'compiler_wrapper/config.go') diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index 64d77ae7..6c3fcf52 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -164,6 +164,8 @@ var crosHardenedConfig = config{ "-Wno-section", "-fno-addrsig", "-fuse-ld=lld", + "-ftrivial-auto-var-init=zero", + "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", ), clangPostFlags: crosCommonClangPostFlags(), newWarningsDir: "/tmp/fatal_clang_warnings", -- cgit v1.2.3