From e19d4b14e07f821c7502fd761dca79c85922b471 Mon Sep 17 00:00:00 2001 From: Manoj Gupta Date: Tue, 8 Nov 2022 01:10:14 +0000 Subject: llvm_tools: Validate chromeos checkout path Add support for verifying chromeos checkout path so invoking a bad path gives an error immediately. BUG=b:187794508 TEST=unit tests Change-Id: I889c2e83540e0ae23680b0480ff71905ac7723fe Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4011203 Reviewed-by: Bob Haarman Tested-by: Manoj Gupta Reviewed-by: Ryan Beltran Commit-Queue: Manoj Gupta --- llvm_tools/auto_llvm_bisection.py | 2 ++ llvm_tools/auto_llvm_bisection_unittest.py | 7 +++++++ llvm_tools/chroot.py | 14 +++++++++++++ llvm_tools/get_upstream_patch.py | 1 + llvm_tools/llvm_bisection.py | 5 +---- llvm_tools/llvm_bisection_unittest.py | 24 ++++++++++++++++++---- llvm_tools/modify_a_tryjob.py | 8 ++------ llvm_tools/update_chromeos_llvm_hash.py | 3 ++- llvm_tools/update_chromeos_llvm_hash_unittest.py | 24 +++++++++++++++++++--- llvm_tools/update_packages_and_run_tests.py | 2 ++ .../update_packages_and_run_tests_unittest.py | 4 ++++ 11 files changed, 76 insertions(+), 18 deletions(-) diff --git a/llvm_tools/auto_llvm_bisection.py b/llvm_tools/auto_llvm_bisection.py index 3640abae..c52c21b2 100755 --- a/llvm_tools/auto_llvm_bisection.py +++ b/llvm_tools/auto_llvm_bisection.py @@ -105,6 +105,8 @@ def main(): args_output = llvm_bisection.GetCommandLineArgs() + chroot.VerifyChromeOSRoot(args_output.chroot_path) + if os.path.isfile(args_output.last_tested): print("Resuming bisection for %s" % args_output.last_tested) else: diff --git a/llvm_tools/auto_llvm_bisection_unittest.py b/llvm_tools/auto_llvm_bisection_unittest.py index c70ddee5..e57637eb 100755 --- a/llvm_tools/auto_llvm_bisection_unittest.py +++ b/llvm_tools/auto_llvm_bisection_unittest.py @@ -25,6 +25,7 @@ import update_tryjob_status class AutoLLVMBisectionTest(unittest.TestCase): """Unittests for auto bisection of LLVM.""" + @mock.patch.object(chroot, "VerifyChromeOSRoot") @mock.patch.object(chroot, "VerifyOutsideChroot", return_value=True) @mock.patch.object( llvm_bisection, @@ -53,6 +54,7 @@ class AutoLLVMBisectionTest(unittest.TestCase): mock_sleep, mock_get_args, mock_outside_chroot, + mock_chromeos_root, ): mock_isfile.side_effect = [False, False, True, True] @@ -90,6 +92,7 @@ class AutoLLVMBisectionTest(unittest.TestCase): mock_traceback.assert_called_once() mock_sleep.assert_called_once() + @mock.patch.object(chroot, "VerifyChromeOSRoot") @mock.patch.object(chroot, "VerifyOutsideChroot", return_value=True) @mock.patch.object(time, "sleep") @mock.patch.object(traceback, "print_exc") @@ -108,6 +111,7 @@ class AutoLLVMBisectionTest(unittest.TestCase): mock_traceback, mock_sleep, mock_outside_chroot, + mock_chromeos_root, ): mock_isfile.return_value = False @@ -123,6 +127,7 @@ class AutoLLVMBisectionTest(unittest.TestCase): self.assertEqual(err.exception.code, "Unable to continue bisection.") + mock_chromeos_root.assert_called_once() mock_outside_chroot.assert_called_once() mock_get_args.assert_called_once() self.assertEqual(mock_isfile.call_count, 2) @@ -130,6 +135,7 @@ class AutoLLVMBisectionTest(unittest.TestCase): self.assertEqual(mock_traceback.call_count, 3) self.assertEqual(mock_sleep.call_count, 2) + @mock.patch.object(chroot, "VerifyChromeOSRoot") @mock.patch.object(chroot, "VerifyOutsideChroot", return_value=True) @mock.patch.object( llvm_bisection, @@ -153,6 +159,7 @@ class AutoLLVMBisectionTest(unittest.TestCase): mock_time, mock_get_args, mock_outside_chroot, + mock_chromeos_root, ): # Simulate behavior of `time.time()` for time passed. diff --git a/llvm_tools/chroot.py b/llvm_tools/chroot.py index 46464feb..2ec989c4 100755 --- a/llvm_tools/chroot.py +++ b/llvm_tools/chroot.py @@ -9,6 +9,7 @@ import collections import os +from pathlib import Path import subprocess @@ -30,6 +31,19 @@ def VerifyOutsideChroot(): assert not InChroot(), "Script should be run outside the chroot." +def VerifyChromeOSRoot(chromeos_root): + """Checks whether the path actually points to ChromiumOS checkout root. + + Raises: + AssertionError: The path is not ChromiumOS checkout root. + """ + + subdir = "src/third_party/chromiumos-overlay" + path = Path(chromeos_root).expanduser() / subdir + msg = f"Wrong ChromeOS path. No {subdir} directory in {chromeos_root} ." + assert path.is_dir(), msg + + def GetChrootEbuildPaths(chromeos_root, packages): """Gets the chroot path(s) of the package(s). diff --git a/llvm_tools/get_upstream_patch.py b/llvm_tools/get_upstream_patch.py index 72aa16b6..615d5b88 100755 --- a/llvm_tools/get_upstream_patch.py +++ b/llvm_tools/get_upstream_patch.py @@ -576,6 +576,7 @@ def main(): "when --differential appears exactly once.", ) args = parser.parse_args() + chroot.VerifyChromeOSRoot(args.chroot_path) if not (args.sha or args.differential): parser.error("--sha or --differential required") diff --git a/llvm_tools/llvm_bisection.py b/llvm_tools/llvm_bisection.py index 0b851ebe..6cc93aec 100755 --- a/llvm_tools/llvm_bisection.py +++ b/llvm_tools/llvm_bisection.py @@ -289,7 +289,6 @@ def Bisect( last_tested, update_packages, chroot_path, - patch_metadata_file, extra_change_lists, options, builder, @@ -304,7 +303,6 @@ def Bisect( git_hash, svn_revision, chroot_path, - patch_metadata_file, extra_change_lists, options, builder, @@ -346,7 +344,7 @@ def main(args_output): """ chroot.VerifyOutsideChroot() - patch_metadata_file = "PATCHES.json" + chroot.VerifyChromeOSRoot(args_output.chroot_path) start = args_output.start_rev end = args_output.end_rev @@ -453,7 +451,6 @@ def main(args_output): args_output.last_tested, update_chromeos_llvm_hash.DEFAULT_PACKAGES, args_output.chroot_path, - patch_metadata_file, args_output.extra_change_lists, args_output.options, args_output.builder, diff --git a/llvm_tools/llvm_bisection_unittest.py b/llvm_tools/llvm_bisection_unittest.py index 1e86a678..a2bcc90b 100755 --- a/llvm_tools/llvm_bisection_unittest.py +++ b/llvm_tools/llvm_bisection_unittest.py @@ -209,7 +209,6 @@ class LLVMBisectionTest(unittest.TestCase): _git_hash, _revision, _chroot_path, - _patch_file, _extra_cls, _options, _builder, @@ -238,7 +237,6 @@ class LLVMBisectionTest(unittest.TestCase): args_output = test_helpers.ArgsOutputTest() packages = ["sys-devel/llvm"] - patch_file = "/abs/path/to/PATCHES.json" # Create a temporary .JSON file to simulate a status file for bisection. with test_helpers.CreateTemporaryJsonFile() as temp_json_file: @@ -255,7 +253,6 @@ class LLVMBisectionTest(unittest.TestCase): temp_json_file, packages, args_output.chroot_path, - patch_file, args_output.extra_change_lists, args_output.options, args_output.builders, @@ -289,10 +286,12 @@ class LLVMBisectionTest(unittest.TestCase): @mock.patch.object(llvm_bisection, "GetCommitsBetween") @mock.patch.object(llvm_bisection, "GetRemainingRange") @mock.patch.object(llvm_bisection, "LoadStatusFile") + @mock.patch.object(chroot, "VerifyChromeOSRoot") @mock.patch.object(chroot, "VerifyOutsideChroot", return_value=True) def testMainPassed( self, mock_outside_chroot, + mock_chromeos_root, mock_load_status_file, mock_get_range, mock_get_revision_and_hash_list, @@ -337,6 +336,8 @@ class LLVMBisectionTest(unittest.TestCase): llvm_bisection.BisectionExitStatus.BISECTION_COMPLETE.value, ) + mock_chromeos_root.assert_called_once() + mock_outside_chroot.assert_called_once() mock_load_status_file.assert_called_once() @@ -362,9 +363,10 @@ class LLVMBisectionTest(unittest.TestCase): ) @mock.patch.object(llvm_bisection, "LoadStatusFile") + @mock.patch.object(chroot, "VerifyChromeOSRoot") @mock.patch.object(chroot, "VerifyOutsideChroot", return_value=True) def testMainFailedWithInvalidRange( - self, mock_outside_chroot, mock_load_status_file + self, mock_chromeos_root, mock_outside_chroot, mock_load_status_file ): start = 500 @@ -394,6 +396,8 @@ class LLVMBisectionTest(unittest.TestCase): self.assertEqual(str(err.exception), error_message) + mock_chromeos_root.assert_called_once() + mock_outside_chroot.assert_called_once() mock_load_status_file.assert_called_once() @@ -401,9 +405,11 @@ class LLVMBisectionTest(unittest.TestCase): @mock.patch.object(llvm_bisection, "GetCommitsBetween") @mock.patch.object(llvm_bisection, "GetRemainingRange") @mock.patch.object(llvm_bisection, "LoadStatusFile") + @mock.patch.object(chroot, "VerifyChromeOSRoot") @mock.patch.object(chroot, "VerifyOutsideChroot", return_value=True) def testMainFailedWithPendingBuilds( self, + mock_chromeos_root, mock_outside_chroot, mock_load_status_file, mock_get_range, @@ -451,6 +457,8 @@ class LLVMBisectionTest(unittest.TestCase): self.assertEqual(str(err.exception), error_message) + mock_chromeos_root.assert_called_once() + mock_outside_chroot.assert_called_once() mock_load_status_file.assert_called_once() @@ -462,10 +470,12 @@ class LLVMBisectionTest(unittest.TestCase): @mock.patch.object(llvm_bisection, "GetCommitsBetween") @mock.patch.object(llvm_bisection, "GetRemainingRange") @mock.patch.object(llvm_bisection, "LoadStatusFile") + @mock.patch.object(chroot, "VerifyChromeOSRoot") @mock.patch.object(chroot, "VerifyOutsideChroot", return_value=True) def testMainFailedWithDuplicateBuilds( self, mock_outside_chroot, + mock_chromeos_root, mock_load_status_file, mock_get_range, mock_get_revision_and_hash_list, @@ -508,6 +518,8 @@ class LLVMBisectionTest(unittest.TestCase): error_message = 'Revision %d exists already in "jobs"' % rev self.assertEqual(str(err.exception), error_message) + mock_chromeos_root.assert_called_once() + mock_outside_chroot.assert_called_once() mock_load_status_file.assert_called_once() @@ -523,10 +535,12 @@ class LLVMBisectionTest(unittest.TestCase): @mock.patch.object(llvm_bisection, "GetCommitsBetween") @mock.patch.object(llvm_bisection, "GetRemainingRange") @mock.patch.object(llvm_bisection, "LoadStatusFile") + @mock.patch.object(chroot, "VerifyChromeOSRoot") @mock.patch.object(chroot, "VerifyOutsideChroot", return_value=True) def testMainFailedToAbandonCL( self, mock_outside_chroot, + mock_chromeos_root, mock_load_status_file, mock_get_range, mock_get_revision_and_hash_list, @@ -574,6 +588,8 @@ class LLVMBisectionTest(unittest.TestCase): self.assertEqual(err.exception.output, error_message) + mock_chromeos_root.assert_called_once() + mock_outside_chroot.assert_called_once() mock_load_status_file.assert_called_once() diff --git a/llvm_tools/modify_a_tryjob.py b/llvm_tools/modify_a_tryjob.py index 03de606d..7b292140 100755 --- a/llvm_tools/modify_a_tryjob.py +++ b/llvm_tools/modify_a_tryjob.py @@ -134,7 +134,6 @@ def GetCLAfterUpdatingPackages( git_hash, svn_version, chroot_path, - patch_metadata_file, svn_option, ): """Updates the packages' LLVM_NEXT.""" @@ -196,7 +195,6 @@ def AddTryjob( git_hash, revision, chroot_path, - patch_metadata_file, extra_cls, options, builder, @@ -212,7 +210,6 @@ def AddTryjob( git_hash, revision, chroot_path, - patch_metadata_file, svn_option, ) @@ -322,8 +319,6 @@ def PerformTryjobModification( # bisection. elif bisect_contents["start"] < revision < bisect_contents["end"]: - patch_metadata_file = "PATCHES.json" - ( git_hash, revision, @@ -334,7 +329,6 @@ def PerformTryjobModification( git_hash, revision, chroot_path, - patch_metadata_file, extra_cls, options, builder, @@ -365,6 +359,8 @@ def main(): args_output = GetCommandLineArgs() + chroot.VerifyChromeOSRoot(args_output.chroot_path) + PerformTryjobModification( args_output.revision, ModifyTryjob(args_output.modify_tryjob), diff --git a/llvm_tools/update_chromeos_llvm_hash.py b/llvm_tools/update_chromeos_llvm_hash.py index 75c6ce6c..cf7ae473 100755 --- a/llvm_tools/update_chromeos_llvm_hash.py +++ b/llvm_tools/update_chromeos_llvm_hash.py @@ -764,6 +764,8 @@ def main(): args_output = GetCommandLineArgs() + chroot.VerifyChromeOSRoot(args_output.chroot_path) + llvm_variant = LLVMVariant.current if args_output.is_llvm_next: llvm_variant = LLVMVariant.next @@ -773,7 +775,6 @@ def main(): git_hash, svn_version = get_llvm_hash.GetLLVMHashAndVersionFromSVNOption( git_hash_source ) - # Filter out empty strings. For example "".split{",") returns [""]. packages = set(p for p in args_output.update_packages.split(",") if p) manifest_packages = set( diff --git a/llvm_tools/update_chromeos_llvm_hash_unittest.py b/llvm_tools/update_chromeos_llvm_hash_unittest.py index b758538c..f7f62470 100755 --- a/llvm_tools/update_chromeos_llvm_hash_unittest.py +++ b/llvm_tools/update_chromeos_llvm_hash_unittest.py @@ -1017,11 +1017,16 @@ class UpdateLLVMHashTest(unittest.TestCase): mock_delete_repo.assert_called_once_with(path_to_package_dir, branch) + @mock.patch.object(chroot, "VerifyChromeOSRoot") @mock.patch.object(chroot, "VerifyOutsideChroot") @mock.patch.object(get_llvm_hash, "GetLLVMHashAndVersionFromSVNOption") @mock.patch.object(update_chromeos_llvm_hash, "UpdatePackages") def testMainDefaults( - self, mock_update_packages, mock_gethash, mock_outside_chroot + self, + mock_update_packages, + mock_gethash, + mock_outside_chroot, + mock_chromeos_root, ): git_hash = "1234abcd" svn_version = 5678 @@ -1053,12 +1058,18 @@ class UpdateLLVMHashTest(unittest.TestCase): extra_commit_msg=None, ) mock_outside_chroot.assert_called() + mock_chromeos_root.assert_called() + @mock.patch.object(chroot, "VerifyChromeOSRoot") @mock.patch.object(chroot, "VerifyOutsideChroot") @mock.patch.object(get_llvm_hash, "GetLLVMHashAndVersionFromSVNOption") @mock.patch.object(update_chromeos_llvm_hash, "UpdatePackages") def testMainLlvmNext( - self, mock_update_packages, mock_gethash, mock_outside_chroot + self, + mock_update_packages, + mock_gethash, + mock_outside_chroot, + mock_chromeos_root, ): git_hash = "1234abcd" svn_version = 5678 @@ -1089,12 +1100,18 @@ class UpdateLLVMHashTest(unittest.TestCase): extra_commit_msg=None, ) mock_outside_chroot.assert_called() + mock_chromeos_root.assert_called() + @mock.patch.object(chroot, "VerifyChromeOSRoot") @mock.patch.object(chroot, "VerifyOutsideChroot") @mock.patch.object(get_llvm_hash, "GetLLVMHashAndVersionFromSVNOption") @mock.patch.object(update_chromeos_llvm_hash, "UpdatePackages") def testMainAllArgs( - self, mock_update_packages, mock_gethash, mock_outside_chroot + self, + mock_update_packages, + mock_gethash, + mock_outside_chroot, + mock_chromeos_root, ): packages_to_update = "test-packages/package1,test-libs/lib1" manifest_packages = "test-libs/lib1,test-libs/lib2" @@ -1140,6 +1157,7 @@ class UpdateLLVMHashTest(unittest.TestCase): extra_commit_msg=None, ) mock_outside_chroot.assert_called() + mock_chromeos_root.assert_called() @mock.patch.object(subprocess, "check_output", return_value=None) @mock.patch.object(get_llvm_hash, "GetLLVMMajorVersion") diff --git a/llvm_tools/update_packages_and_run_tests.py b/llvm_tools/update_packages_and_run_tests.py index dc14b6de..43c8390b 100755 --- a/llvm_tools/update_packages_and_run_tests.py +++ b/llvm_tools/update_packages_and_run_tests.py @@ -422,6 +422,8 @@ def main(): args_output = GetCommandLineArgs() + chroot.VerifyChromeOSRoot(args_output.chroot_path) + svn_option = args_output.llvm_version git_hash, svn_version = get_llvm_hash.GetLLVMHashAndVersionFromSVNOption( diff --git a/llvm_tools/update_packages_and_run_tests_unittest.py b/llvm_tools/update_packages_and_run_tests_unittest.py index fc65749f..e62ed04f 100755 --- a/llvm_tools/update_packages_and_run_tests_unittest.py +++ b/llvm_tools/update_packages_and_run_tests_unittest.py @@ -263,12 +263,14 @@ class UpdatePackagesAndRunTryjobsTest(unittest.TestCase): @mock.patch.object(update_chromeos_llvm_hash, "UpdatePackages") @mock.patch.object(update_packages_and_run_tests, "GetCommandLineArgs") @mock.patch.object(get_llvm_hash, "GetLLVMHashAndVersionFromSVNOption") + @mock.patch.object(chroot, "VerifyChromeOSRoot") @mock.patch.object(chroot, "VerifyOutsideChroot", return_value=True) @mock.patch.object(chroot, "GetChrootEbuildPaths") def testUpdatedLastTestedFileWithNewTestedRevision( self, mock_get_chroot_build_paths, mock_outside_chroot, + mock_chromeos_root, mock_get_hash_and_version, mock_get_commandline_args, mock_update_packages, @@ -336,6 +338,8 @@ class UpdatePackagesAndRunTryjobsTest(unittest.TestCase): mock_outside_chroot.assert_called_once() + mock_chromeos_root.assert_called_once() + mock_get_commandline_args.assert_called_once() mock_get_hash_and_version.assert_called_once() -- cgit v1.2.3 From d2270ed6fa833bcfd2d38917db046848df68abc7 Mon Sep 17 00:00:00 2001 From: Denis Nikitin Date: Fri, 11 Nov 2022 14:12:14 -0800 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-4.19 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: I333a681a492ecadc73b07c354dd3e45fd5f39b58 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4021519 Tested-by: Denis Nikitin Auto-Submit: Denis Nikitin Commit-Queue: Manoj Gupta Reviewed-by: Manoj Gupta --- afdo_metadata/kernel_afdo.json | 11 ++++------- afdo_metadata/kernel_arm_afdo.json | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index 98dab12e..560498c0 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -1,17 +1,14 @@ { - "chromeos-kernel-4_4": { - "name": "R108-15117.10-1664184941" - }, "chromeos-kernel-4_14": { - "name": "R109-15183.8-1666603998" + "name": "R109-15227.0-1667817311" }, "chromeos-kernel-4_19": { - "name": "R109-15183.8-1666604011" + "name": "R109-15183.28-1667817093" }, "chromeos-kernel-5_4": { - "name": "R109-15183.8-1666603918" + "name": "R109-15199.0-1667817145" }, "chromeos-kernel-5_10": { - "name": "R109-15183.8-1666604219" + "name": "R109-15227.0-1667817197" } } diff --git a/afdo_metadata/kernel_arm_afdo.json b/afdo_metadata/kernel_arm_afdo.json index e73d2eb8..f0bcb3bc 100644 --- a/afdo_metadata/kernel_arm_afdo.json +++ b/afdo_metadata/kernel_arm_afdo.json @@ -1,5 +1,5 @@ { "chromeos-kernel-5_15": { - "name": "R109-15183.8-1666604194" + "name": "R109-15227.0-1667817436" } } -- cgit v1.2.3 From 37a3e103986de18e11b17e2c81a45439b3f10cf6 Mon Sep 17 00:00:00 2001 From: Denis Nikitin Date: Fri, 11 Nov 2022 16:27:36 -0800 Subject: crosperf: Add retries to nightly loading.desktop Test results are very flaky in nightly tests. In contrast loading.desktop in telemetry_AFDOGenerate is much more stable where the test has 1 retry. Retries can significantly extend the test duration but it shouldn't be a problem since tests are running only every second day and usually take less than 12h. BUG=b:229477430 TEST=cq Change-Id: I0a7ad0cb68359a8844ba9804ad232060498a58a5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4024307 Commit-Queue: Denis Nikitin Tested-by: Denis Nikitin Reviewed-by: Jordan Abrahams-Whitehead --- buildbot_test_toolchains.py | 1 - 1 file changed, 1 deletion(-) diff --git a/buildbot_test_toolchains.py b/buildbot_test_toolchains.py index 19c31b54..e847af4e 100755 --- a/buildbot_test_toolchains.py +++ b/buildbot_test_toolchains.py @@ -178,7 +178,6 @@ class ToolchainComparator(object): test_args: --story-tag-filter=typical iterations: 3 run_local: False - retries: 0 } """ -- cgit v1.2.3 From b584da38466195204d3a8e97870094f667155989 Mon Sep 17 00:00:00 2001 From: Ryan Beltran Date: Wed, 16 Nov 2022 01:23:55 +0000 Subject: compiler_wrapper: IWYU Writes to file This CL modifies our IWYU implementation to write findings to a file instead of attempting to apply fixes. BUG=b:259303669 TEST=ran all unit tests and tested locally Change-Id: I83030a6f4899c56e9ea652d97b3e256ef970ec22 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4026510 Tested-by: Ryan Beltran Reviewed-by: Christopher Di Bella Commit-Queue: Ryan Beltran --- compiler_wrapper/compiler_wrapper.go | 5 ++++- compiler_wrapper/iwyu_flag.go | 29 +++++++++++++++-------------- compiler_wrapper/iwyu_flag_test.go | 5 +++-- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/compiler_wrapper/compiler_wrapper.go b/compiler_wrapper/compiler_wrapper.go index dcaada99..54e8b38b 100644 --- a/compiler_wrapper/compiler_wrapper.go +++ b/compiler_wrapper/compiler_wrapper.go @@ -110,6 +110,9 @@ func runAndroidClangTidy(env env, cmd *command) error { } func callCompilerInternal(env env, cfg *config, inputCmd *command) (exitCode int, err error) { + + artifactBaseDir, _ := env.getenv("CROS_ARTIFACTS_TMP_DIR") + if err := checkUnsupportedFlags(inputCmd); err != nil { return 0, err } @@ -185,7 +188,7 @@ func callCompilerInternal(env env, cfg *config, inputCmd *command) (exitCode int allowCCache = false clangCmdWithoutRemoteBuildAndCCache := mainBuilder.build() - err := runIWYU(env, clangCmdWithoutRemoteBuildAndCCache, cSrcFile, iwyuFlags) + err := runIWYU(env, clangCmdWithoutRemoteBuildAndCCache, cSrcFile, iwyuFlags, artifactBaseDir) if err != nil { return 0, err } diff --git a/compiler_wrapper/iwyu_flag.go b/compiler_wrapper/iwyu_flag.go index d13d114d..e28cc17d 100644 --- a/compiler_wrapper/iwyu_flag.go +++ b/compiler_wrapper/iwyu_flag.go @@ -8,6 +8,7 @@ import ( "bufio" "bytes" "fmt" + "os" "path/filepath" "strings" ) @@ -113,7 +114,7 @@ func calcIWYUInvocation(env env, clangCmd *command, cSrcFile string, iwyuFlags . }, nil } -func runIWYU(env env, clangCmd *command, cSrcFile string, extraIWYUFlags []string) error { +func runIWYU(env env, clangCmd *command, cSrcFile string, extraIWYUFlags []string, artifactBaseDir string) error { extraIWYUFlags = append(extraIWYUFlags, "-Xiwyu", "--mapping_file=/usr/share/include-what-you-use/libcxx.imp", "-Xiwyu", "--no_fwd_decls") iwyuCmd, err := calcIWYUInvocation(env, clangCmd, cSrcFile, extraIWYUFlags...) if err != nil { @@ -135,21 +136,21 @@ func runIWYU(env env, clangCmd *command, cSrcFile string, extraIWYUFlags []strin fmt.Fprintln(env.stderr(), "include-what-you-use failed") } - var path strings.Builder - path.WriteString(strings.TrimSuffix(iwyuCmd.Path, "include-what-you-use")) - path.WriteString("fix_includes.py") - fixIncludesCmd := &command{ - Path: path.String(), - Args: []string{"--nocomment"}, - EnvUpdates: clangCmd.EnvUpdates, + iwyuDir := filepath.Join(artifactBaseDir, "linting-output", "iwyu") + if err := os.MkdirAll(iwyuDir, 0777); err != nil { + return fmt.Errorf("creating fixes directory at %q: %v", iwyuDir, err) } - exitCode, err = wrapSubprocessErrorWithSourceLoc(fixIncludesCmd, - env.run(fixIncludesCmd, strings.NewReader(stderrMessage), env.stdout(), env.stderr())) - if err == nil && exitCode != 0 { - // Note: We continue on purpose when include-what-you-use fails - // to maintain compatibility with the previous wrapper. - fmt.Fprint(env.stderr(), "include-what-you-use failed") + f, err := os.CreateTemp(iwyuDir, "*.out") + if err != nil { + return fmt.Errorf("making output file for iwyu: %v", err) + } + if _, err := bufio.NewWriter(f).WriteString(stderrMessage); err != nil { + return fmt.Errorf("writing output file for iwyu: %v", err) + } + + if err := f.Close(); err != nil { + return fmt.Errorf("finalizing output file for iwyu: %v", err) } return err diff --git a/compiler_wrapper/iwyu_flag_test.go b/compiler_wrapper/iwyu_flag_test.go index 76135944..e2db3b48 100644 --- a/compiler_wrapper/iwyu_flag_test.go +++ b/compiler_wrapper/iwyu_flag_test.go @@ -84,7 +84,7 @@ func TestUseIWYUBasedOnFileExtension(t *testing.T) { ctx.cmdCount = 0 ctx.must(callCompiler(ctx, ctx.cfg, ctx.newCommand(clangX86_64, tt.args...))) - if ctx.cmdCount > 1 && !tt.iwyu { + if ctx.cmdCount == 2 && !tt.iwyu { t.Errorf("expected a call to iwyu but got none for args %s", tt.args) } if ctx.cmdCount == 1 && tt.iwyu { @@ -129,7 +129,8 @@ func TestIWYUFiltersIWYUFlags(t *testing.T) { func withIWYUTestContext(t *testing.T, work func(ctx *testContext)) { withTestContext(t, func(ctx *testContext) { - ctx.env = []string{"WITH_IWYU=1"} + artifactDir := t.TempDir() + ctx.env = []string{"WITH_IWYU=1", "CROS_ARTIFACTS_TMP_DIR=" + artifactDir} work(ctx) }) } -- cgit v1.2.3 From d20a15848ffae6aceffc605378d94466b1bc32b6 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Wed, 16 Nov 2022 11:34:00 -0700 Subject: compiler wrapper: update tests Looks like e2cce3561628cfafd411417d372cef0719f5166d forgot to update test files. This CL makes the tests green. BUG=b:234642720 TEST=go test Change-Id: Ia2128102bd6ff6ae66cd462fefb4b9aabfe3772d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4031909 Tested-by: George Burgess Commit-Queue: Adrian Dole Reviewed-by: Adrian Dole Auto-Submit: George Burgess --- .../testdata/cros_hardened_golden/bisect.json | 6 ++++++ .../clang_ftrapv_maincc_target_specific.json | 18 ++++++++++++++++ .../clang_maincc_target_specific.json | 18 ++++++++++++++++ .../testdata/cros_hardened_golden/clang_path.json | 24 ++++++++++++++++++++++ .../cros_hardened_golden/clang_sanitizer_args.json | 16 +++++++++++++++ .../cros_hardened_golden/clang_specific_args.json | 8 ++++++++ .../clang_sysroot_wrapper_common.json | 12 +++++++++++ .../testdata/cros_hardened_golden/clangtidy.json | 16 +++++++++++++++ .../cros_hardened_golden/force_disable_werror.json | 10 +++++++++ .../cros_hardened_golden/gcc_clang_syntax.json | 8 ++++++++ .../cros_hardened_llvmnext_golden/bisect.json | 6 ++++++ .../cros_hardened_llvmnext_golden/clang_path.json | 24 ++++++++++++++++++++++ .../cros_hardened_llvmnext_golden/clangtidy.json | 16 +++++++++++++++ .../force_disable_werror.json | 10 +++++++++ .../gcc_clang_syntax.json | 8 ++++++++ .../cros_hardened_noccache_golden/bisect.json | 6 ++++++ .../cros_hardened_noccache_golden/clang_path.json | 24 ++++++++++++++++++++++ .../cros_hardened_noccache_golden/clangtidy.json | 16 +++++++++++++++ .../force_disable_werror.json | 10 +++++++++ .../gcc_clang_syntax.json | 8 ++++++++ 20 files changed, 264 insertions(+) diff --git a/compiler_wrapper/testdata/cros_hardened_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_golden/bisect.json index 8bd823ed..ccd8c764 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/bisect.json @@ -42,6 +42,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -115,6 +117,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -191,6 +195,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json index 56f78efa..0e5f019f 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json @@ -33,6 +33,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -96,6 +98,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -159,6 +163,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -222,6 +228,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -284,6 +292,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -346,6 +356,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -408,6 +420,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -470,6 +484,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -532,6 +548,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json index db2f59aa..0f020dec 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json @@ -32,6 +32,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -93,6 +95,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -154,6 +158,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -215,6 +221,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -275,6 +283,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -335,6 +345,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -395,6 +407,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -455,6 +469,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -515,6 +531,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json index 186a16ed..1698245a 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json @@ -32,6 +32,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -96,6 +98,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -160,6 +164,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -224,6 +230,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -295,6 +303,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -371,6 +381,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -442,6 +454,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -508,6 +522,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -569,6 +585,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -630,6 +648,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -691,6 +711,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -755,6 +777,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json index 6a38e845..31bbb464 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json @@ -34,6 +34,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -97,6 +99,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -160,6 +164,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -223,6 +229,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -285,6 +293,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -348,6 +358,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -411,6 +423,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -473,6 +487,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json index ec91216d..d1e54576 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json @@ -42,6 +42,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -112,6 +114,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -175,6 +179,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -238,6 +244,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json index 0ad97b7a..3b71b3fe 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json @@ -68,6 +68,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -132,6 +134,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -189,6 +193,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -252,6 +258,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-D_FORTIFY_SOURCE=2", @@ -315,6 +323,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-D_FORTIFY_SOURCE=2", @@ -376,6 +386,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json index f7438940..31061e4b 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json @@ -47,6 +47,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -89,6 +91,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -161,6 +165,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -204,6 +210,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -278,6 +286,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -324,6 +334,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -399,6 +411,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -442,6 +456,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json index 9cd72611..1eefaf03 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json @@ -35,6 +35,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -99,6 +101,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -149,6 +153,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -217,6 +223,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -267,6 +275,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json index d9b532f0..ea70a808 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json @@ -32,6 +32,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -118,6 +120,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -199,6 +203,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -263,6 +269,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json index 8bd823ed..ccd8c764 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json @@ -42,6 +42,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -115,6 +117,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -191,6 +195,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json index 186a16ed..1698245a 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json @@ -32,6 +32,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -96,6 +98,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -160,6 +164,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -224,6 +230,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -295,6 +303,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -371,6 +381,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -442,6 +454,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -508,6 +522,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -569,6 +585,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -630,6 +648,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -691,6 +711,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -755,6 +777,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json index f7438940..31061e4b 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json @@ -47,6 +47,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -89,6 +91,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -161,6 +165,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -204,6 +210,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -278,6 +286,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -324,6 +334,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -399,6 +411,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -442,6 +456,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json index 9cd72611..1eefaf03 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json @@ -35,6 +35,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -99,6 +101,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -149,6 +153,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -217,6 +223,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -267,6 +275,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json index d9b532f0..ea70a808 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json @@ -32,6 +32,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -118,6 +120,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -199,6 +203,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -263,6 +269,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json index da522b99..7102c840 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json @@ -41,6 +41,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -110,6 +112,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -182,6 +186,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json index 287833cf..4a0bccd8 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json @@ -31,6 +31,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -89,6 +91,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -147,6 +151,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -205,6 +211,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -270,6 +278,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -341,6 +351,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -411,6 +423,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -471,6 +485,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -526,6 +542,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -581,6 +599,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -636,6 +656,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -694,6 +716,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json index f7438940..31061e4b 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json @@ -47,6 +47,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -89,6 +91,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -161,6 +165,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -204,6 +210,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -278,6 +286,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -324,6 +334,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -399,6 +411,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -442,6 +456,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json index 54943fb3..2f68a180 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json @@ -34,6 +34,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -92,6 +94,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -136,6 +140,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -198,6 +204,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -242,6 +250,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json index 1704cd17..61b4c676 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json @@ -32,6 +32,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -113,6 +115,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -194,6 +198,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -258,6 +264,8 @@ "-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", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", -- cgit v1.2.3 From 3785ee74bc95c24f7902ad27de29dc58f11ca2e3 Mon Sep 17 00:00:00 2001 From: Ryan Beltran Date: Sat, 19 Nov 2022 02:10:52 +0000 Subject: compiler_wrapper: flush output buffer for IWYU This CL adds a missing call to flush() to ensure IWYU messages are written out to the artifact file. BUG=b:259303669 TEST=ran all unit tests and tested locally Change-Id: I582f5d2432d7d040ba77eccd6d5b580cfbcf761f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4039108 Reviewed-by: Christopher Di Bella Tested-by: Ryan Beltran Commit-Queue: Christopher Di Bella Auto-Submit: Ryan Beltran --- compiler_wrapper/iwyu_flag.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/compiler_wrapper/iwyu_flag.go b/compiler_wrapper/iwyu_flag.go index e28cc17d..b0de4008 100644 --- a/compiler_wrapper/iwyu_flag.go +++ b/compiler_wrapper/iwyu_flag.go @@ -145,10 +145,13 @@ func runIWYU(env env, clangCmd *command, cSrcFile string, extraIWYUFlags []strin if err != nil { return fmt.Errorf("making output file for iwyu: %v", err) } - if _, err := bufio.NewWriter(f).WriteString(stderrMessage); err != nil { + writer := bufio.NewWriter(f) + if _, err := writer.WriteString(stderrMessage); err != nil { return fmt.Errorf("writing output file for iwyu: %v", err) } - + if err := writer.Flush(); err != nil { + return fmt.Errorf("flushing output file buffer for iwyu: %v", err) + } if err := f.Close(); err != nil { return fmt.Errorf("finalizing output file for iwyu: %v", err) } -- cgit v1.2.3 From edc7d62130e87d2ce8b781e881dce72761b02400 Mon Sep 17 00:00:00 2001 From: Denis Nikitin Date: Wed, 23 Nov 2022 09:35:44 -0800 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-4.19 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: I2554236b9fe2ea6474d4d98c3db68ac8a4b3b039 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4052420 Tested-by: Denis Nikitin Commit-Queue: Michael Benfield Reviewed-by: Michael Benfield Auto-Submit: Denis Nikitin --- afdo_metadata/kernel_afdo.json | 8 ++++---- afdo_metadata/kernel_arm_afdo.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index 560498c0..f148ed1e 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -1,14 +1,14 @@ { "chromeos-kernel-4_14": { - "name": "R109-15227.0-1667817311" + "name": "R110-15231.0-1668422211" }, "chromeos-kernel-4_19": { - "name": "R109-15183.28-1667817093" + "name": "R110-15231.0-1668421958" }, "chromeos-kernel-5_4": { - "name": "R109-15199.0-1667817145" + "name": "R110-15231.0-1668421898" }, "chromeos-kernel-5_10": { - "name": "R109-15227.0-1667817197" + "name": "R110-15231.0-1668421888" } } diff --git a/afdo_metadata/kernel_arm_afdo.json b/afdo_metadata/kernel_arm_afdo.json index f0bcb3bc..8d990283 100644 --- a/afdo_metadata/kernel_arm_afdo.json +++ b/afdo_metadata/kernel_arm_afdo.json @@ -1,5 +1,5 @@ { "chromeos-kernel-5_15": { - "name": "R109-15227.0-1667817436" + "name": "R110-15231.0-1668422117" } } -- cgit v1.2.3 From 4d46929de559d0e15b817f2fb76f2b29fc8805bc Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Mon, 21 Nov 2022 00:31:56 -0700 Subject: forcey: don't upload massive crashes Lexan's bucket has a crash that's 9GB compressed. We shouldn't be trying to work with that. BUG=b:259822772 TEST=Ran on chrotomation Change-Id: Ib4ae304aedc25da763462a11cd2e8ef8adb90118 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4041632 Reviewed-by: Ryan Beltran Commit-Queue: George Burgess Tested-by: George Burgess --- llvm_tools/upload_lexan_crashes_to_forcey.py | 30 +++++++++++++++++++++-- llvm_tools/upload_lexan_crashes_to_forcey_test.py | 22 ++++++++++++++++- 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/llvm_tools/upload_lexan_crashes_to_forcey.py b/llvm_tools/upload_lexan_crashes_to_forcey.py index 885a88f6..0090c5f8 100755 --- a/llvm_tools/upload_lexan_crashes_to_forcey.py +++ b/llvm_tools/upload_lexan_crashes_to_forcey.py @@ -3,7 +3,6 @@ # Copyright 2020 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. - """Fetches and submits the latest test-cases from Lexan's crash bucket.""" import argparse @@ -104,6 +103,22 @@ def temp_dir() -> Generator[str, None, None]: shutil.rmtree(loc) +def fetch_gs_file_size(gs_url: str) -> int: + """Returns the size of the file at gs_url, in bytes.""" + du = subprocess.run( + ["gsutil.py", "du", gs_url], + check=True, + stdout=subprocess.PIPE, + encoding="utf-8", + ).stdout + + lines = du.splitlines() + assert len(lines) == 1, f"{lines}" + # Format is `size file_name`. + num_bytes = lines[0].lstrip().split(None, 1)[0] + return int(num_bytes) + + def download_and_unpack_test_case(gs_url: str, tempdir: str) -> None: suffix = os.path.splitext(gs_url)[1] target_name = "test_case" + suffix @@ -114,7 +129,18 @@ def download_and_unpack_test_case(gs_url: str, tempdir: str) -> None: def submit_test_case(gs_url: str, cr_tool: str) -> None: - logging.info("Submitting %s", gs_url) + size_limit = 100 * 1024 + size_kb = fetch_gs_file_size(gs_url) // 1024 + if size_kb > size_limit: + logging.warning( + "Ignoring %s; it's %dKB, and the limit is %dKB", + gs_url, + size_kb, + size_limit, + ) + return + + logging.info("Submitting %s (%dKB)", gs_url, size_kb) with temp_dir() as tempdir: download_and_unpack_test_case(gs_url, tempdir) diff --git a/llvm_tools/upload_lexan_crashes_to_forcey_test.py b/llvm_tools/upload_lexan_crashes_to_forcey_test.py index 7238281a..2e5c87b2 100755 --- a/llvm_tools/upload_lexan_crashes_to_forcey_test.py +++ b/llvm_tools/upload_lexan_crashes_to_forcey_test.py @@ -139,9 +139,14 @@ class Test(unittest.TestCase): "upload_lexan_crashes_to_forcey.download_and_unpack_test_case" ) @unittest.mock.patch("subprocess.run") + @unittest.mock.patch("upload_lexan_crashes_to_forcey.fetch_gs_file_size") def test_test_case_submission_functions( - self, subprocess_run_mock, download_and_unpack_mock + self, + fetch_gs_file_size_mock, + subprocess_run_mock, + download_and_unpack_mock, ): + fetch_gs_file_size_mock.return_value = 1024 mock_gs_url = "gs://foo/bar/baz" def side_effect(gs_url: str, tempdir: str) -> None: @@ -161,6 +166,21 @@ class Test(unittest.TestCase): upload_lexan_crashes_to_forcey.submit_test_case(mock_gs_url, "4c") subprocess_run_mock.assert_not_called() + @unittest.mock.patch("subprocess.run") + def test_file_size_getting_functions(self, subprocess_run_mock): + mock_gs_url = "gs://foo/bar/baz" + + def side_effect(cmd, **_kwargs) -> None: + self.assertEqual(cmd, ["gsutil.py", "du", mock_gs_url]) + result = unittest.mock.MagicMock() + result.stdout = f"1234 {mock_gs_url}" + return result + + subprocess_run_mock.side_effect = side_effect + size = upload_lexan_crashes_to_forcey.fetch_gs_file_size(mock_gs_url) + self.assertEqual(size, 1234) + subprocess_run_mock.assert_called_once() + if __name__ == "__main__": unittest.main() -- cgit v1.2.3 From c46941d92269168bf91cebe182a48e508e566acc Mon Sep 17 00:00:00 2001 From: Bob Haarman Date: Mon, 28 Nov 2022 14:13:35 +0000 Subject: compiler_wrapper: remove -fexperimental-new-pass-manager We previously passed -fexperimental-new-pass-manager to Clang to turn on the new pass manager. The new pass manager has been made the default, and -fexperimental-new-pass-manager has become a no-op. In newer versions of LLVM, it has been removed. This means these versions of LLVM will fail when the flag is passed in. To make compiler_wrapper compatible with these versions, remove the flag. BUG=b:258854887 TEST=build new wrapper, build LLVM that doesn't have the flag, see it work Change-Id: I2bb6de0075973b0b2cdb7700306b094ec1e08de6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4061509 Commit-Queue: Bob Haarman Tested-by: Bob Haarman Reviewed-by: Ryan Beltran --- compiler_wrapper/config.go | 1 - compiler_wrapper/testdata/cros_clang_host_golden/bisect.json | 3 --- .../clang_ftrapv_maincc_target_specific.json | 9 --------- .../testdata/cros_clang_host_golden/clang_host_wrapper.json | 1 - .../cros_clang_host_golden/clang_maincc_target_specific.json | 9 --------- .../testdata/cros_clang_host_golden/clang_path.json | 12 ------------ .../cros_clang_host_golden/clang_sanitizer_args.json | 8 -------- .../testdata/cros_clang_host_golden/clang_specific_args.json | 4 ---- .../testdata/cros_clang_host_golden/clangtidy.json | 8 -------- .../cros_clang_host_golden/force_disable_werror.json | 5 ----- compiler_wrapper/testdata/cros_hardened_golden/bisect.json | 3 --- .../clang_ftrapv_maincc_target_specific.json | 9 --------- .../cros_hardened_golden/clang_maincc_target_specific.json | 9 --------- .../testdata/cros_hardened_golden/clang_path.json | 12 ------------ .../testdata/cros_hardened_golden/clang_sanitizer_args.json | 8 -------- .../testdata/cros_hardened_golden/clang_specific_args.json | 4 ---- .../cros_hardened_golden/clang_sysroot_wrapper_common.json | 6 ------ .../testdata/cros_hardened_golden/clangtidy.json | 8 -------- .../testdata/cros_hardened_golden/force_disable_werror.json | 5 ----- .../testdata/cros_hardened_golden/gcc_clang_syntax.json | 4 ---- .../testdata/cros_hardened_llvmnext_golden/bisect.json | 3 --- .../testdata/cros_hardened_llvmnext_golden/clang_path.json | 12 ------------ .../testdata/cros_hardened_llvmnext_golden/clangtidy.json | 8 -------- .../cros_hardened_llvmnext_golden/force_disable_werror.json | 5 ----- .../cros_hardened_llvmnext_golden/gcc_clang_syntax.json | 4 ---- .../testdata/cros_hardened_noccache_golden/bisect.json | 3 --- .../testdata/cros_hardened_noccache_golden/clang_path.json | 12 ------------ .../testdata/cros_hardened_noccache_golden/clangtidy.json | 8 -------- .../cros_hardened_noccache_golden/force_disable_werror.json | 5 ----- .../cros_hardened_noccache_golden/gcc_clang_syntax.json | 4 ---- .../testdata/cros_nonhardened_golden/bisect.json | 3 --- .../clang_ftrapv_maincc_target_specific.json | 9 --------- .../clang_maincc_target_specific.json | 9 --------- .../testdata/cros_nonhardened_golden/clang_path.json | 12 ------------ .../cros_nonhardened_golden/clang_sanitizer_args.json | 8 -------- .../cros_nonhardened_golden/clang_specific_args.json | 4 ---- .../clang_sysroot_wrapper_common.json | 6 ------ .../testdata/cros_nonhardened_golden/clangtidy.json | 8 -------- .../cros_nonhardened_golden/force_disable_werror.json | 5 ----- .../testdata/cros_nonhardened_golden/gcc_clang_syntax.json | 4 ---- 40 files changed, 260 deletions(-) diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index 6c3fcf52..bc61cb40 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -121,7 +121,6 @@ func crosCommonClangFlags() []string { "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", } } diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/bisect.json b/compiler_wrapper/testdata/cros_clang_host_golden/bisect.json index 6993499c..79b17486 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/bisect.json @@ -35,7 +35,6 @@ "-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", @@ -92,7 +91,6 @@ "-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", @@ -152,7 +150,6 @@ "-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", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_ftrapv_maincc_target_specific.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_ftrapv_maincc_target_specific.json index 26654033..93e1af31 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_ftrapv_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_ftrapv_maincc_target_specific.json @@ -26,7 +26,6 @@ "-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", @@ -70,7 +69,6 @@ "-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", @@ -114,7 +112,6 @@ "-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", @@ -158,7 +155,6 @@ "-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", @@ -202,7 +198,6 @@ "-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", @@ -246,7 +241,6 @@ "-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", @@ -290,7 +284,6 @@ "-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", @@ -334,7 +327,6 @@ "-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", @@ -378,7 +370,6 @@ "-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", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_host_wrapper.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_host_wrapper.json index b151051c..6546dd0c 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_host_wrapper.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_host_wrapper.json @@ -25,7 +25,6 @@ "-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", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_maincc_target_specific.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_maincc_target_specific.json index 396bb95c..807ecee8 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_maincc_target_specific.json @@ -25,7 +25,6 @@ "-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", @@ -68,7 +67,6 @@ "-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", @@ -111,7 +109,6 @@ "-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", @@ -154,7 +151,6 @@ "-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", @@ -197,7 +193,6 @@ "-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", @@ -240,7 +235,6 @@ "-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", @@ -283,7 +277,6 @@ "-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", @@ -326,7 +319,6 @@ "-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", @@ -369,7 +361,6 @@ "-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", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_path.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_path.json index f32a7045..3ba30d3a 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_path.json @@ -25,7 +25,6 @@ "-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", @@ -71,7 +70,6 @@ "-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", @@ -117,7 +115,6 @@ "-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", @@ -163,7 +160,6 @@ "-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", @@ -216,7 +212,6 @@ "-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", @@ -274,7 +269,6 @@ "-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", @@ -332,7 +326,6 @@ "-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", @@ -380,7 +373,6 @@ "-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", @@ -423,7 +415,6 @@ "-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", @@ -466,7 +457,6 @@ "-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", @@ -509,7 +499,6 @@ "-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", @@ -555,7 +544,6 @@ "-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", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_sanitizer_args.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_sanitizer_args.json index 8df51096..6e8a1d3d 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_sanitizer_args.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_sanitizer_args.json @@ -27,7 +27,6 @@ "-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", @@ -73,7 +72,6 @@ "-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", @@ -119,7 +117,6 @@ "-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", @@ -165,7 +162,6 @@ "-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", @@ -210,7 +206,6 @@ "-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", @@ -256,7 +251,6 @@ "-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", @@ -302,7 +296,6 @@ "-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", @@ -347,7 +340,6 @@ "-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", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_specific_args.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_specific_args.json index 7c296af9..19a88b9c 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_specific_args.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_specific_args.json @@ -35,7 +35,6 @@ "-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", @@ -87,7 +86,6 @@ "-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", @@ -132,7 +130,6 @@ "-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", @@ -177,7 +174,6 @@ "-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", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clangtidy.json b/compiler_wrapper/testdata/cros_clang_host_golden/clangtidy.json index c1cf0507..70c6cde5 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clangtidy.json @@ -41,7 +41,6 @@ "-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", @@ -71,7 +70,6 @@ "-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", @@ -131,7 +129,6 @@ "-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", @@ -161,7 +158,6 @@ "-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", @@ -223,7 +219,6 @@ "-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", @@ -256,7 +251,6 @@ "-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", @@ -319,7 +313,6 @@ "-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", @@ -349,7 +342,6 @@ "-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", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_clang_host_golden/force_disable_werror.json index ad290b45..4803997e 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/force_disable_werror.json @@ -28,7 +28,6 @@ "-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", @@ -74,7 +73,6 @@ "-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", @@ -106,7 +104,6 @@ "-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", @@ -156,7 +153,6 @@ "-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", @@ -188,7 +184,6 @@ "-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", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_golden/bisect.json index ccd8c764..849e7a56 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/bisect.json @@ -37,7 +37,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -112,7 +111,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -190,7 +188,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json index 0e5f019f..1b2c4336 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json @@ -28,7 +28,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -93,7 +92,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -158,7 +156,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -223,7 +220,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -287,7 +283,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -351,7 +346,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -415,7 +409,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -479,7 +472,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -543,7 +535,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json index 0f020dec..1a59e792 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json @@ -27,7 +27,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -90,7 +89,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -153,7 +151,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -216,7 +213,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -278,7 +274,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -340,7 +335,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -402,7 +396,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -464,7 +457,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -526,7 +518,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json index 1698245a..b8e4b5a4 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json @@ -27,7 +27,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -93,7 +92,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -159,7 +157,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -225,7 +222,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -298,7 +294,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -376,7 +371,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -449,7 +443,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -517,7 +510,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -580,7 +572,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -643,7 +634,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -706,7 +696,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -772,7 +761,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json index 31bbb464..e00f5eba 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json @@ -29,7 +29,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -94,7 +93,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -159,7 +157,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -224,7 +221,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -288,7 +284,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -353,7 +348,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -418,7 +412,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -482,7 +475,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json index d1e54576..4792ec72 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json @@ -37,7 +37,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -109,7 +108,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -174,7 +172,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -239,7 +236,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json index 3b71b3fe..524eea9b 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json @@ -63,7 +63,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -129,7 +128,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -188,7 +186,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -253,7 +250,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -318,7 +314,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -381,7 +376,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json index 31061e4b..dc88a02f 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json @@ -42,7 +42,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -86,7 +85,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -160,7 +158,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -205,7 +202,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -281,7 +277,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -329,7 +324,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -406,7 +400,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -451,7 +444,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json index 1eefaf03..02065bb5 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json @@ -30,7 +30,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -96,7 +95,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -148,7 +146,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -218,7 +215,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -270,7 +266,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json index ea70a808..17a4cde3 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json @@ -27,7 +27,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -115,7 +114,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -198,7 +196,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -264,7 +261,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json index ccd8c764..849e7a56 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json @@ -37,7 +37,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -112,7 +111,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -190,7 +188,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json index 1698245a..b8e4b5a4 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json @@ -27,7 +27,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -93,7 +92,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -159,7 +157,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -225,7 +222,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -298,7 +294,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -376,7 +371,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -449,7 +443,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -517,7 +510,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -580,7 +572,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -643,7 +634,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -706,7 +696,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -772,7 +761,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json index 31061e4b..dc88a02f 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json @@ -42,7 +42,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -86,7 +85,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -160,7 +158,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -205,7 +202,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -281,7 +277,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -329,7 +324,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -406,7 +400,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -451,7 +444,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json index 1eefaf03..02065bb5 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json @@ -30,7 +30,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -96,7 +95,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -148,7 +146,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -218,7 +215,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -270,7 +266,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json index ea70a808..17a4cde3 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json @@ -27,7 +27,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -115,7 +114,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -198,7 +196,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -264,7 +261,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json index 7102c840..9f60941d 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json @@ -36,7 +36,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -107,7 +106,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -181,7 +179,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json index 4a0bccd8..6015291a 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json @@ -26,7 +26,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -86,7 +85,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -146,7 +144,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -206,7 +203,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -273,7 +269,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -346,7 +341,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -418,7 +412,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -480,7 +473,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -537,7 +529,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -594,7 +585,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -651,7 +641,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -711,7 +700,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json index 31061e4b..dc88a02f 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json @@ -42,7 +42,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -86,7 +85,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -160,7 +158,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -205,7 +202,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -281,7 +277,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -329,7 +324,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -406,7 +400,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -451,7 +444,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json index 2f68a180..0d1de423 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json @@ -29,7 +29,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -89,7 +88,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -135,7 +133,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -199,7 +196,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -245,7 +241,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json index 61b4c676..691610b4 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json @@ -27,7 +27,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -110,7 +109,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -193,7 +191,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -259,7 +256,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/bisect.json b/compiler_wrapper/testdata/cros_nonhardened_golden/bisect.json index 96fd88cf..5a259386 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/bisect.json @@ -37,7 +37,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -103,7 +102,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -172,7 +170,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_ftrapv_maincc_target_specific.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_ftrapv_maincc_target_specific.json index 35f90b1e..e3b599db 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_ftrapv_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_ftrapv_maincc_target_specific.json @@ -28,7 +28,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -84,7 +83,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -140,7 +138,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -196,7 +193,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -252,7 +248,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -307,7 +302,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -363,7 +357,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -419,7 +412,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -474,7 +466,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_maincc_target_specific.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_maincc_target_specific.json index e2479e9b..51d5a357 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_maincc_target_specific.json @@ -27,7 +27,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -81,7 +80,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -135,7 +133,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -189,7 +186,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -243,7 +239,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -296,7 +291,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -350,7 +344,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -404,7 +397,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -457,7 +449,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_path.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_path.json index 11c566b6..bfa58eb9 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_path.json @@ -27,7 +27,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -84,7 +83,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -141,7 +139,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -198,7 +195,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -262,7 +258,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -331,7 +326,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -395,7 +389,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -454,7 +447,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -508,7 +500,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -562,7 +553,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -616,7 +606,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -673,7 +662,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sanitizer_args.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sanitizer_args.json index fe0df74d..3f4b52b9 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sanitizer_args.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sanitizer_args.json @@ -29,7 +29,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -86,7 +85,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -143,7 +141,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -200,7 +197,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -256,7 +252,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -313,7 +308,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -370,7 +364,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -426,7 +419,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_specific_args.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_specific_args.json index b744e8c6..be112426 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_specific_args.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_specific_args.json @@ -37,7 +37,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -100,7 +99,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -156,7 +154,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -212,7 +209,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sysroot_wrapper_common.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sysroot_wrapper_common.json index ed3a6ef1..66f74ddb 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sysroot_wrapper_common.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sysroot_wrapper_common.json @@ -60,7 +60,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -117,7 +116,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -167,7 +165,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -223,7 +220,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -280,7 +276,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -336,7 +331,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clangtidy.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clangtidy.json index 830abee6..b3d72c3d 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clangtidy.json @@ -42,7 +42,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -77,7 +76,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -142,7 +140,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -178,7 +175,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -245,7 +241,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -284,7 +279,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -352,7 +346,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -388,7 +381,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_nonhardened_golden/force_disable_werror.json index 07c20900..5672662e 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/force_disable_werror.json @@ -30,7 +30,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -87,7 +86,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -130,7 +128,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -191,7 +188,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -234,7 +230,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_nonhardened_golden/gcc_clang_syntax.json index 9dd5687b..488240e6 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/gcc_clang_syntax.json @@ -27,7 +27,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -103,7 +102,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -174,7 +172,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -231,7 +228,6 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", - "-fexperimental-new-pass-manager", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", -- cgit v1.2.3 From 562095ddc5229b3bbf8419c72c5524fabac64072 Mon Sep 17 00:00:00 2001 From: Bob Haarman Date: Mon, 28 Nov 2022 23:26:45 +0000 Subject: compiler_wrapper: update paths ~/trunk -> ~/chromiumos Using ~/trunk for paths inside the chroot is deprecated; the replacement is ~/chromiumos. Update the compiler_wrapper docs to reflect this. BUG=None TEST=ran the new commands Change-Id: I9cb0ef726dd8052aa3f7dda0bb9bbc83423a149f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4061510 Tested-by: Bob Haarman Reviewed-by: Ryan Beltran Commit-Queue: Bob Haarman --- compiler_wrapper/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler_wrapper/README.md b/compiler_wrapper/README.md index bb63798a..64fccd61 100644 --- a/compiler_wrapper/README.md +++ b/compiler_wrapper/README.md @@ -18,7 +18,7 @@ To test updates to the wrapper locally: Run `install_compiler_wrapper.sh` to install the new wrapper in the chroot: ``` -(chroot) ~/trunk/src/third_party/toolchain-utils/compiler_wrapper/install_compiler_wrapper.sh +(chroot) ~/chromiumos/src/third_party/toolchain-utils/compiler_wrapper/install_compiler_wrapper.sh ``` Then perform the tests, e.g. build with the new compiler. @@ -39,14 +39,14 @@ Rename chromiumos-overlay/sys-devel/llvm/llvm-${VERSION}.ebuild to the next revision number. For example, if the current version is 11.0_pre394483_p20200618-r2: ``` -(chroot) cd ~/trunk/src/third_party/chromiumos-overlay +(chroot) cd ~/chromiumos/src/third_party/chromiumos-overlay (chroot) git mv llvm-11.0_pre394483_p20200618-r2.ebuild llvm-11.0_pre394483_p20200618-r3.ebuild ``` Rename chromiumos-overlay/sys-devel/gcc/gcc-${VERSION}.ebuild to the next revision number. For example, if the current version is 10.2.0-r3: ``` -(chroot) cd ~/trunk/src/third_party/chromiumos-overlay +(chroot) cd ~/chromiumos/src/third_party/chromiumos-overlay (chroot) git mv sys-devel/gcc/gcc-10.2.0-r3.ebuild sys-devel/gcc/gcc-10.2.0-r4.ebuild ``` -- cgit v1.2.3 From 842c22ce9cb13950fd3f5a3fee937d2491413bdf Mon Sep 17 00:00:00 2001 From: Bob Haarman Date: Mon, 28 Nov 2022 23:27:02 +0000 Subject: compiler_wrapper: reword instructions for using crash_builds.go When reading README.md, I wasn't sure if the crash build functionality currently requires rebuilding compiler_wrapper or not (it does). Reworded that part of the documentation to hopefully make it clearer, and also linked to the instructions. BUG=None TEST=None Change-Id: Id6020f5bb33acb9baebd3a3f63a9e26a3fa93575 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4061511 Tested-by: Bob Haarman Reviewed-by: George Burgess Commit-Queue: Bob Haarman --- compiler_wrapper/README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/compiler_wrapper/README.md b/compiler_wrapper/README.md index 64fccd61..e858038e 100644 --- a/compiler_wrapper/README.md +++ b/compiler_wrapper/README.md @@ -96,8 +96,9 @@ error-prone; compile commands may rely on env vars, they may be done within rely on intermediate state, etc. Because of the usefulness of these crash reports, our wrapper supports crashing -Clang even on files that ordinarily don't cause Clang to crash. For various -reasons (b/236736327), this support currently requires rebuilding and -redeploying the wrapper in order to work. That said, this could be a valuable -tool for devs interested in creating a self-contained reproducer without having -to manually reproduce the environment in which a particular build was performed. +Clang even on files that ordinarily don't cause Clang to crash. This requires +rebuilding and redeploying the wrapper (comments on b/236736327 explain why). +That said, this could be a valuable tool for devs interested in creating a +self-contained reproducer without having to manually reproduce the environment +in which a particular build was performed. See +for instructions for how to use this functionality. -- cgit v1.2.3 From 8c033d87d6228d1cbaa54a8463e2458896e1fc1b Mon Sep 17 00:00:00 2001 From: Ryan Beltran Date: Thu, 1 Dec 2022 00:09:01 +0000 Subject: compiler_wrapper: Add Wno-int-conversion This CL adds -Wno-int-conversion to disable the warning and fix some mage problems. BUG=b:259158067 TEST=Added to failing compile command in sharutils Change-Id: I63e20ffa5ba64dd350f225d90e0de0a8554dc195 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4066865 Reviewed-by: Manoj Gupta Tested-by: Ryan Beltran Commit-Queue: Ryan Beltran --- compiler_wrapper/config.go | 1 + compiler_wrapper/testdata/cros_clang_host_golden/bisect.json | 3 +++ .../clang_ftrapv_maincc_target_specific.json | 9 +++++++++ .../testdata/cros_clang_host_golden/clang_host_wrapper.json | 1 + .../cros_clang_host_golden/clang_maincc_target_specific.json | 9 +++++++++ .../testdata/cros_clang_host_golden/clang_path.json | 12 ++++++++++++ .../cros_clang_host_golden/clang_sanitizer_args.json | 8 ++++++++ .../testdata/cros_clang_host_golden/clang_specific_args.json | 4 ++++ .../testdata/cros_clang_host_golden/clangtidy.json | 8 ++++++++ .../cros_clang_host_golden/force_disable_werror.json | 5 +++++ compiler_wrapper/testdata/cros_hardened_golden/bisect.json | 3 +++ .../clang_ftrapv_maincc_target_specific.json | 9 +++++++++ .../cros_hardened_golden/clang_maincc_target_specific.json | 9 +++++++++ .../testdata/cros_hardened_golden/clang_path.json | 12 ++++++++++++ .../testdata/cros_hardened_golden/clang_sanitizer_args.json | 8 ++++++++ .../testdata/cros_hardened_golden/clang_specific_args.json | 4 ++++ .../cros_hardened_golden/clang_sysroot_wrapper_common.json | 6 ++++++ .../testdata/cros_hardened_golden/clangtidy.json | 8 ++++++++ .../testdata/cros_hardened_golden/force_disable_werror.json | 5 +++++ .../testdata/cros_hardened_golden/gcc_clang_syntax.json | 4 ++++ .../testdata/cros_hardened_llvmnext_golden/bisect.json | 3 +++ .../testdata/cros_hardened_llvmnext_golden/clang_path.json | 12 ++++++++++++ .../testdata/cros_hardened_llvmnext_golden/clangtidy.json | 8 ++++++++ .../cros_hardened_llvmnext_golden/force_disable_werror.json | 5 +++++ .../cros_hardened_llvmnext_golden/gcc_clang_syntax.json | 4 ++++ .../testdata/cros_hardened_noccache_golden/bisect.json | 3 +++ .../testdata/cros_hardened_noccache_golden/clang_path.json | 12 ++++++++++++ .../testdata/cros_hardened_noccache_golden/clangtidy.json | 8 ++++++++ .../cros_hardened_noccache_golden/force_disable_werror.json | 5 +++++ .../cros_hardened_noccache_golden/gcc_clang_syntax.json | 4 ++++ .../testdata/cros_nonhardened_golden/bisect.json | 3 +++ .../clang_ftrapv_maincc_target_specific.json | 9 +++++++++ .../clang_maincc_target_specific.json | 9 +++++++++ .../testdata/cros_nonhardened_golden/clang_path.json | 12 ++++++++++++ .../cros_nonhardened_golden/clang_sanitizer_args.json | 8 ++++++++ .../cros_nonhardened_golden/clang_specific_args.json | 4 ++++ .../clang_sysroot_wrapper_common.json | 6 ++++++ .../testdata/cros_nonhardened_golden/clangtidy.json | 8 ++++++++ .../cros_nonhardened_golden/force_disable_werror.json | 5 +++++ .../testdata/cros_nonhardened_golden/gcc_clang_syntax.json | 4 ++++ 40 files changed, 260 insertions(+) diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index bc61cb40..18419084 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -121,6 +121,7 @@ func crosCommonClangFlags() []string { "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", } } diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/bisect.json b/compiler_wrapper/testdata/cros_clang_host_golden/bisect.json index 79b17486..9336d87e 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/bisect.json @@ -35,6 +35,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -91,6 +92,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -150,6 +152,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_ftrapv_maincc_target_specific.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_ftrapv_maincc_target_specific.json index 93e1af31..bb40c5dc 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_ftrapv_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_ftrapv_maincc_target_specific.json @@ -26,6 +26,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -69,6 +70,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -112,6 +114,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -155,6 +158,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -198,6 +202,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -241,6 +246,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -284,6 +290,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -327,6 +334,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -370,6 +378,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_host_wrapper.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_host_wrapper.json index 6546dd0c..9723c26e 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_host_wrapper.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_host_wrapper.json @@ -25,6 +25,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_maincc_target_specific.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_maincc_target_specific.json index 807ecee8..0fe64f78 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_maincc_target_specific.json @@ -25,6 +25,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -67,6 +68,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -109,6 +111,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -151,6 +154,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -193,6 +197,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -235,6 +240,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -277,6 +283,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -319,6 +326,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -361,6 +369,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_path.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_path.json index 3ba30d3a..c3e79eae 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_path.json @@ -25,6 +25,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -70,6 +71,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -115,6 +117,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -160,6 +163,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -212,6 +216,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -269,6 +274,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -326,6 +332,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -373,6 +380,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -415,6 +423,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -457,6 +466,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -499,6 +509,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -544,6 +555,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_sanitizer_args.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_sanitizer_args.json index 6e8a1d3d..8a5644b7 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_sanitizer_args.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_sanitizer_args.json @@ -27,6 +27,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -72,6 +73,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -117,6 +119,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -162,6 +165,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -206,6 +210,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -251,6 +256,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -296,6 +302,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -340,6 +347,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_specific_args.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_specific_args.json index 19a88b9c..fb075567 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_specific_args.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_specific_args.json @@ -35,6 +35,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -86,6 +87,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -130,6 +132,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -174,6 +177,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clangtidy.json b/compiler_wrapper/testdata/cros_clang_host_golden/clangtidy.json index 70c6cde5..391cda8a 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clangtidy.json @@ -41,6 +41,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -70,6 +71,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -129,6 +131,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -158,6 +161,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -219,6 +223,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -251,6 +256,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -313,6 +319,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -342,6 +349,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_clang_host_golden/force_disable_werror.json index 4803997e..653bfa45 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/force_disable_werror.json @@ -28,6 +28,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -73,6 +74,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -104,6 +106,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -153,6 +156,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -184,6 +188,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_golden/bisect.json index 849e7a56..0852d404 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/bisect.json @@ -37,6 +37,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -111,6 +112,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -188,6 +190,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json index 1b2c4336..0bdeea12 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json @@ -28,6 +28,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -92,6 +93,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -156,6 +158,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -220,6 +223,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -283,6 +287,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -346,6 +351,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -409,6 +415,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -472,6 +479,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -535,6 +543,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json index 1a59e792..08d956bf 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json @@ -27,6 +27,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -89,6 +90,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -151,6 +153,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -213,6 +216,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -274,6 +278,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -335,6 +340,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -396,6 +402,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -457,6 +464,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -518,6 +526,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json index b8e4b5a4..d1c84976 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json @@ -27,6 +27,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -92,6 +93,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -157,6 +159,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -222,6 +225,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -294,6 +298,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -371,6 +376,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -443,6 +449,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -510,6 +517,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -572,6 +580,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -634,6 +643,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -696,6 +706,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -761,6 +772,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json index e00f5eba..38323593 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json @@ -29,6 +29,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -93,6 +94,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -157,6 +159,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -221,6 +224,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -284,6 +288,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -348,6 +353,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -412,6 +418,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -475,6 +482,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json index 4792ec72..6762b132 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json @@ -37,6 +37,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -108,6 +109,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -172,6 +174,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -236,6 +239,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json index 524eea9b..9188168c 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json @@ -63,6 +63,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -128,6 +129,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -186,6 +188,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -250,6 +253,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -314,6 +318,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -376,6 +381,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json index dc88a02f..1b947d22 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json @@ -42,6 +42,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -85,6 +86,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -158,6 +160,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -202,6 +205,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -277,6 +281,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -324,6 +329,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -400,6 +406,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -444,6 +451,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json index 02065bb5..f432473c 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json @@ -30,6 +30,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -95,6 +96,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -146,6 +148,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -215,6 +218,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -266,6 +270,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json index 17a4cde3..df7b94db 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json @@ -27,6 +27,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -114,6 +115,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -196,6 +198,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -261,6 +264,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json index 849e7a56..0852d404 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json @@ -37,6 +37,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -111,6 +112,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -188,6 +190,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json index b8e4b5a4..d1c84976 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json @@ -27,6 +27,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -92,6 +93,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -157,6 +159,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -222,6 +225,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -294,6 +298,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -371,6 +376,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -443,6 +449,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -510,6 +517,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -572,6 +580,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -634,6 +643,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -696,6 +706,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -761,6 +772,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json index dc88a02f..1b947d22 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json @@ -42,6 +42,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -85,6 +86,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -158,6 +160,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -202,6 +205,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -277,6 +281,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -324,6 +329,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -400,6 +406,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -444,6 +451,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json index 02065bb5..f432473c 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json @@ -30,6 +30,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -95,6 +96,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -146,6 +148,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -215,6 +218,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -266,6 +270,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json index 17a4cde3..df7b94db 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json @@ -27,6 +27,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -114,6 +115,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -196,6 +198,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -261,6 +264,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json index 9f60941d..9e101f84 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json @@ -36,6 +36,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -106,6 +107,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -179,6 +181,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json index 6015291a..a303b4ce 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json @@ -26,6 +26,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -85,6 +86,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -144,6 +146,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -203,6 +206,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -269,6 +273,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -341,6 +346,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -412,6 +418,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -473,6 +480,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -529,6 +537,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -585,6 +594,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -641,6 +651,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -700,6 +711,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json index dc88a02f..1b947d22 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json @@ -42,6 +42,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -85,6 +86,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -158,6 +160,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -202,6 +205,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -277,6 +281,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -324,6 +329,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -400,6 +406,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -444,6 +451,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json index 0d1de423..96314ebc 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json @@ -29,6 +29,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -88,6 +89,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -133,6 +135,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -196,6 +199,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -241,6 +245,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json index 691610b4..916709e6 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json @@ -27,6 +27,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -109,6 +110,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -191,6 +193,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -256,6 +259,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/bisect.json b/compiler_wrapper/testdata/cros_nonhardened_golden/bisect.json index 5a259386..529a82f6 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/bisect.json @@ -37,6 +37,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -102,6 +103,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -170,6 +172,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_ftrapv_maincc_target_specific.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_ftrapv_maincc_target_specific.json index e3b599db..359b52ce 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_ftrapv_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_ftrapv_maincc_target_specific.json @@ -28,6 +28,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -83,6 +84,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -138,6 +140,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -193,6 +196,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -248,6 +252,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -302,6 +307,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -357,6 +363,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -412,6 +419,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -466,6 +474,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_maincc_target_specific.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_maincc_target_specific.json index 51d5a357..48febcb8 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_maincc_target_specific.json @@ -27,6 +27,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -80,6 +81,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -133,6 +135,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -186,6 +189,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -239,6 +243,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -291,6 +296,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -344,6 +350,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -397,6 +404,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -449,6 +457,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_path.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_path.json index bfa58eb9..ce3f7332 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_path.json @@ -27,6 +27,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -83,6 +84,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -139,6 +141,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -195,6 +198,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -258,6 +262,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -326,6 +331,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -389,6 +395,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -447,6 +454,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -500,6 +508,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -553,6 +562,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -606,6 +616,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -662,6 +673,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sanitizer_args.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sanitizer_args.json index 3f4b52b9..e6f76e4a 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sanitizer_args.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sanitizer_args.json @@ -29,6 +29,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -85,6 +86,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -141,6 +143,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -197,6 +200,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -252,6 +256,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -308,6 +313,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -364,6 +370,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -419,6 +426,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_specific_args.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_specific_args.json index be112426..e3a8fe22 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_specific_args.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_specific_args.json @@ -37,6 +37,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -99,6 +100,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -154,6 +156,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -209,6 +212,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sysroot_wrapper_common.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sysroot_wrapper_common.json index 66f74ddb..099b7b4d 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sysroot_wrapper_common.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sysroot_wrapper_common.json @@ -60,6 +60,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -116,6 +117,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -165,6 +167,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -220,6 +223,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -276,6 +280,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -331,6 +336,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clangtidy.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clangtidy.json index b3d72c3d..d57206fe 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clangtidy.json @@ -42,6 +42,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -76,6 +77,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -140,6 +142,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -175,6 +178,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -241,6 +245,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -279,6 +284,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -346,6 +352,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -381,6 +388,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_nonhardened_golden/force_disable_werror.json index 5672662e..2555e077 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/force_disable_werror.json @@ -30,6 +30,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -86,6 +87,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -128,6 +130,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -188,6 +191,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -230,6 +234,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_nonhardened_golden/gcc_clang_syntax.json index 488240e6..50ad07b4 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/gcc_clang_syntax.json @@ -27,6 +27,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -102,6 +103,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -172,6 +174,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -228,6 +231,7 @@ "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", "-fdebug-default-version=5", + "-Wno-int-conversion", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", -- cgit v1.2.3 From 1086e52f4b5ccfb364119c9e03d6df8eb3094596 Mon Sep 17 00:00:00 2001 From: Ryan Beltran Date: Thu, 1 Dec 2022 01:20:48 +0000 Subject: compiler_wrapper: Add -Wno-incompatible-function-pointer-types This CL adds -Wno-incompatible-function-pointer-types to disable the warning and fix some mage problems. BUG=b:260925814, b:249834910 TEST=emerge-atlas coreutils Change-Id: I48723f046994e9453d15c0df7e9dd94e320ea326 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4066867 Reviewed-by: Manoj Gupta Commit-Queue: Ryan Beltran Tested-by: Ryan Beltran --- compiler_wrapper/config.go | 1 + compiler_wrapper/testdata/cros_clang_host_golden/bisect.json | 3 +++ .../clang_ftrapv_maincc_target_specific.json | 9 +++++++++ .../testdata/cros_clang_host_golden/clang_host_wrapper.json | 1 + .../cros_clang_host_golden/clang_maincc_target_specific.json | 9 +++++++++ .../testdata/cros_clang_host_golden/clang_path.json | 12 ++++++++++++ .../cros_clang_host_golden/clang_sanitizer_args.json | 8 ++++++++ .../testdata/cros_clang_host_golden/clang_specific_args.json | 4 ++++ .../testdata/cros_clang_host_golden/clangtidy.json | 8 ++++++++ .../cros_clang_host_golden/force_disable_werror.json | 5 +++++ compiler_wrapper/testdata/cros_hardened_golden/bisect.json | 3 +++ .../clang_ftrapv_maincc_target_specific.json | 9 +++++++++ .../cros_hardened_golden/clang_maincc_target_specific.json | 9 +++++++++ .../testdata/cros_hardened_golden/clang_path.json | 12 ++++++++++++ .../testdata/cros_hardened_golden/clang_sanitizer_args.json | 8 ++++++++ .../testdata/cros_hardened_golden/clang_specific_args.json | 4 ++++ .../cros_hardened_golden/clang_sysroot_wrapper_common.json | 6 ++++++ .../testdata/cros_hardened_golden/clangtidy.json | 8 ++++++++ .../testdata/cros_hardened_golden/force_disable_werror.json | 5 +++++ .../testdata/cros_hardened_golden/gcc_clang_syntax.json | 4 ++++ .../testdata/cros_hardened_llvmnext_golden/bisect.json | 3 +++ .../testdata/cros_hardened_llvmnext_golden/clang_path.json | 12 ++++++++++++ .../testdata/cros_hardened_llvmnext_golden/clangtidy.json | 8 ++++++++ .../cros_hardened_llvmnext_golden/force_disable_werror.json | 5 +++++ .../cros_hardened_llvmnext_golden/gcc_clang_syntax.json | 4 ++++ .../testdata/cros_hardened_noccache_golden/bisect.json | 3 +++ .../testdata/cros_hardened_noccache_golden/clang_path.json | 12 ++++++++++++ .../testdata/cros_hardened_noccache_golden/clangtidy.json | 8 ++++++++ .../cros_hardened_noccache_golden/force_disable_werror.json | 5 +++++ .../cros_hardened_noccache_golden/gcc_clang_syntax.json | 4 ++++ .../testdata/cros_nonhardened_golden/bisect.json | 3 +++ .../clang_ftrapv_maincc_target_specific.json | 9 +++++++++ .../clang_maincc_target_specific.json | 9 +++++++++ .../testdata/cros_nonhardened_golden/clang_path.json | 12 ++++++++++++ .../cros_nonhardened_golden/clang_sanitizer_args.json | 8 ++++++++ .../cros_nonhardened_golden/clang_specific_args.json | 4 ++++ .../clang_sysroot_wrapper_common.json | 6 ++++++ .../testdata/cros_nonhardened_golden/clangtidy.json | 8 ++++++++ .../cros_nonhardened_golden/force_disable_werror.json | 5 +++++ .../testdata/cros_nonhardened_golden/gcc_clang_syntax.json | 4 ++++ 40 files changed, 260 insertions(+) diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index 18419084..786741a0 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -122,6 +122,7 @@ func crosCommonClangFlags() []string { "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", } } diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/bisect.json b/compiler_wrapper/testdata/cros_clang_host_golden/bisect.json index 9336d87e..22e069a7 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/bisect.json @@ -36,6 +36,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -93,6 +94,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -153,6 +155,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_ftrapv_maincc_target_specific.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_ftrapv_maincc_target_specific.json index bb40c5dc..68849607 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_ftrapv_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_ftrapv_maincc_target_specific.json @@ -27,6 +27,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -71,6 +72,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -115,6 +117,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -159,6 +162,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -203,6 +207,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -247,6 +252,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -291,6 +297,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -335,6 +342,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -379,6 +387,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_host_wrapper.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_host_wrapper.json index 9723c26e..336287d1 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_host_wrapper.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_host_wrapper.json @@ -26,6 +26,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_maincc_target_specific.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_maincc_target_specific.json index 0fe64f78..6d3dbb49 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_maincc_target_specific.json @@ -26,6 +26,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -69,6 +70,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -112,6 +114,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -155,6 +158,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -198,6 +202,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -241,6 +246,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -284,6 +290,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -327,6 +334,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -370,6 +378,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_path.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_path.json index c3e79eae..e91754bc 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_path.json @@ -26,6 +26,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -72,6 +73,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -118,6 +120,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -164,6 +167,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -217,6 +221,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -275,6 +280,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -333,6 +339,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -381,6 +388,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -424,6 +432,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -467,6 +476,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -510,6 +520,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -556,6 +567,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_sanitizer_args.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_sanitizer_args.json index 8a5644b7..b93760d7 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_sanitizer_args.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_sanitizer_args.json @@ -28,6 +28,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -74,6 +75,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -120,6 +122,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -166,6 +169,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -211,6 +215,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -257,6 +262,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -303,6 +309,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -348,6 +355,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_specific_args.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_specific_args.json index fb075567..9a258e90 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_specific_args.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_specific_args.json @@ -36,6 +36,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -88,6 +89,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -133,6 +135,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -178,6 +181,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clangtidy.json b/compiler_wrapper/testdata/cros_clang_host_golden/clangtidy.json index 391cda8a..d8ee6986 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clangtidy.json @@ -42,6 +42,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -72,6 +73,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -132,6 +134,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -162,6 +165,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -224,6 +228,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -257,6 +262,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -320,6 +326,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -350,6 +357,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_clang_host_golden/force_disable_werror.json index 653bfa45..23c74547 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/force_disable_werror.json @@ -29,6 +29,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -75,6 +76,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -107,6 +109,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -157,6 +160,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -189,6 +193,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_golden/bisect.json index 0852d404..23338911 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/bisect.json @@ -38,6 +38,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -113,6 +114,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -191,6 +193,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json index 0bdeea12..442232b0 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json @@ -29,6 +29,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -94,6 +95,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -159,6 +161,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -224,6 +227,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -288,6 +292,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -352,6 +357,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -416,6 +422,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -480,6 +487,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -544,6 +552,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json index 08d956bf..79f944aa 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json @@ -28,6 +28,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -91,6 +92,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -154,6 +156,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -217,6 +220,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -279,6 +283,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -341,6 +346,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -403,6 +409,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -465,6 +472,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -527,6 +535,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json index d1c84976..0ceddea1 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json @@ -28,6 +28,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -94,6 +95,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -160,6 +162,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -226,6 +229,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -299,6 +303,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -377,6 +382,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -450,6 +456,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -518,6 +525,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -581,6 +589,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -644,6 +653,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -707,6 +717,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -773,6 +784,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json index 38323593..08ae1ad4 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json @@ -30,6 +30,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -95,6 +96,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -160,6 +162,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -225,6 +228,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -289,6 +293,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -354,6 +359,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -419,6 +425,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -483,6 +490,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json index 6762b132..f41ccbfd 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json @@ -38,6 +38,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -110,6 +111,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -175,6 +177,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -240,6 +243,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json index 9188168c..f39b661b 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json @@ -64,6 +64,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -130,6 +131,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -189,6 +191,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -254,6 +257,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -319,6 +323,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -382,6 +387,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json index 1b947d22..1c640d1a 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json @@ -43,6 +43,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -87,6 +88,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -161,6 +163,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -206,6 +209,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -282,6 +286,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -330,6 +335,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -407,6 +413,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -452,6 +459,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json index f432473c..5adcb975 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json @@ -31,6 +31,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -97,6 +98,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -149,6 +151,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -219,6 +222,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -271,6 +275,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json index df7b94db..6e8bf3e5 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json @@ -28,6 +28,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -116,6 +117,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -199,6 +201,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -265,6 +268,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json index 0852d404..23338911 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json @@ -38,6 +38,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -113,6 +114,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -191,6 +193,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json index d1c84976..0ceddea1 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json @@ -28,6 +28,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -94,6 +95,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -160,6 +162,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -226,6 +229,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -299,6 +303,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -377,6 +382,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -450,6 +456,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -518,6 +525,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -581,6 +589,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -644,6 +653,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -707,6 +717,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -773,6 +784,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json index 1b947d22..1c640d1a 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json @@ -43,6 +43,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -87,6 +88,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -161,6 +163,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -206,6 +209,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -282,6 +286,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -330,6 +335,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -407,6 +413,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -452,6 +459,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json index f432473c..5adcb975 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json @@ -31,6 +31,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -97,6 +98,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -149,6 +151,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -219,6 +222,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -271,6 +275,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json index df7b94db..6e8bf3e5 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json @@ -28,6 +28,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -116,6 +117,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -199,6 +201,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -265,6 +268,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json index 9e101f84..6a204d19 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json @@ -37,6 +37,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -108,6 +109,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -182,6 +184,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json index a303b4ce..a04358eb 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json @@ -27,6 +27,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -87,6 +88,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -147,6 +149,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -207,6 +210,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -274,6 +278,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -347,6 +352,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -419,6 +425,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -481,6 +488,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -538,6 +546,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -595,6 +604,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -652,6 +662,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -712,6 +723,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json index 1b947d22..1c640d1a 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json @@ -43,6 +43,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -87,6 +88,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -161,6 +163,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -206,6 +209,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -282,6 +286,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -330,6 +335,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -407,6 +413,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -452,6 +459,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json index 96314ebc..c16db7e8 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json @@ -30,6 +30,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -90,6 +91,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -136,6 +138,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -200,6 +203,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -246,6 +250,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json index 916709e6..87e2cc7f 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json @@ -28,6 +28,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -111,6 +112,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -194,6 +196,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -260,6 +263,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/bisect.json b/compiler_wrapper/testdata/cros_nonhardened_golden/bisect.json index 529a82f6..c4c362b5 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/bisect.json @@ -38,6 +38,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -104,6 +105,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -173,6 +175,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_ftrapv_maincc_target_specific.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_ftrapv_maincc_target_specific.json index 359b52ce..7800d682 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_ftrapv_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_ftrapv_maincc_target_specific.json @@ -29,6 +29,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -85,6 +86,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -141,6 +143,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -197,6 +200,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -253,6 +257,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -308,6 +313,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -364,6 +370,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -420,6 +427,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -475,6 +483,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_maincc_target_specific.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_maincc_target_specific.json index 48febcb8..c05180ad 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_maincc_target_specific.json @@ -28,6 +28,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -82,6 +83,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -136,6 +138,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -190,6 +193,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -244,6 +248,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -297,6 +302,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -351,6 +357,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -405,6 +412,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -458,6 +466,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_path.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_path.json index ce3f7332..685d7d5c 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_path.json @@ -28,6 +28,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -85,6 +86,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -142,6 +144,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -199,6 +202,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -263,6 +267,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -332,6 +337,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -396,6 +402,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -455,6 +462,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -509,6 +517,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -563,6 +572,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -617,6 +627,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -674,6 +685,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sanitizer_args.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sanitizer_args.json index e6f76e4a..a4d5d696 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sanitizer_args.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sanitizer_args.json @@ -30,6 +30,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -87,6 +88,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -144,6 +146,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -201,6 +204,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -257,6 +261,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -314,6 +319,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -371,6 +377,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -427,6 +434,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_specific_args.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_specific_args.json index e3a8fe22..4ab48d3f 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_specific_args.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_specific_args.json @@ -38,6 +38,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -101,6 +102,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -157,6 +159,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -213,6 +216,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sysroot_wrapper_common.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sysroot_wrapper_common.json index 099b7b4d..d79afe07 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sysroot_wrapper_common.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sysroot_wrapper_common.json @@ -61,6 +61,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -118,6 +119,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -168,6 +170,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -224,6 +227,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -281,6 +285,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -337,6 +342,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clangtidy.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clangtidy.json index d57206fe..ef4a1d83 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clangtidy.json @@ -43,6 +43,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -78,6 +79,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -143,6 +145,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -179,6 +182,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -246,6 +250,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -285,6 +290,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -353,6 +359,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -389,6 +396,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_nonhardened_golden/force_disable_werror.json index 2555e077..f2382391 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/force_disable_werror.json @@ -31,6 +31,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -88,6 +89,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -131,6 +133,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -192,6 +195,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -235,6 +239,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_nonhardened_golden/gcc_clang_syntax.json index 50ad07b4..77fa3b12 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/gcc_clang_syntax.json @@ -28,6 +28,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -104,6 +105,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -175,6 +177,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -232,6 +235,7 @@ "-Wno-unknown-warning-option", "-fdebug-default-version=5", "-Wno-int-conversion", + "-Wno-incompatible-function-pointer-types", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", -- cgit v1.2.3 From 47e26e92039a9d46256f35eb4a6ec3fbed4cd25a Mon Sep 17 00:00:00 2001 From: Ryan Beltran Date: Fri, 2 Dec 2022 00:04:41 +0000 Subject: compiler_wrapper: Add -Wno-enum-constexpr-conversion This CL adds -Wno-enum-constexpr-conversion to disable for llvm-next to disable the new warning which is breaking boost in llvm-next. BUG=b:258282117 TEST=go test . -updategolden Change-Id: Ia3df4b663cbeb89ccfc4436508353d1dcd18c4f9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4073055 Commit-Queue: Ryan Beltran Reviewed-by: Manoj Gupta Tested-by: Ryan Beltran --- compiler_wrapper/cros_llvm_next_flags.go | 4 +++- .../testdata/cros_hardened_llvmnext_golden/bisect.json | 3 +++ .../testdata/cros_hardened_llvmnext_golden/clang_path.json | 12 ++++++++++++ .../testdata/cros_hardened_llvmnext_golden/clangtidy.json | 8 ++++++++ .../cros_hardened_llvmnext_golden/force_disable_werror.json | 5 +++++ .../cros_hardened_llvmnext_golden/gcc_clang_syntax.json | 4 ++++ 6 files changed, 35 insertions(+), 1 deletion(-) diff --git a/compiler_wrapper/cros_llvm_next_flags.go b/compiler_wrapper/cros_llvm_next_flags.go index 4b21ad3d..40b28e42 100644 --- a/compiler_wrapper/cros_llvm_next_flags.go +++ b/compiler_wrapper/cros_llvm_next_flags.go @@ -14,6 +14,8 @@ package main // tag is set. // TODO: Enable test in config_test.go, once we have new llvm-next flags. -var llvmNextFlags = []string{} +var llvmNextFlags = []string{ + "-Wno-enum-constexpr-conversion", +} var llvmNextPostFlags = []string{} diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json index 23338911..75a27fa6 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json @@ -45,6 +45,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -121,6 +122,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -200,6 +202,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json index 0ceddea1..2d33f710 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json @@ -35,6 +35,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -102,6 +103,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -169,6 +171,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -236,6 +239,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -310,6 +314,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -389,6 +394,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -463,6 +469,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -532,6 +539,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -596,6 +604,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -660,6 +669,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -724,6 +734,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -791,6 +802,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json index 1c640d1a..eaac46ef 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json @@ -50,6 +50,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -95,6 +96,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -170,6 +172,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -216,6 +219,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -293,6 +297,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -342,6 +347,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -420,6 +426,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -466,6 +473,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json index 5adcb975..9b34d0e3 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json @@ -38,6 +38,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -105,6 +106,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -158,6 +160,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -229,6 +232,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -282,6 +286,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json index 6e8bf3e5..7b805969 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json @@ -35,6 +35,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -124,6 +125,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -208,6 +210,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -275,6 +278,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", + "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", -- cgit v1.2.3 From 5a7bf2474c08bfa600374894d063cee191937029 Mon Sep 17 00:00:00 2001 From: Ryan Beltran Date: Sat, 3 Dec 2022 19:55:16 +0000 Subject: compiler_wrapper: remove unneeded flag for zero init Zero init used to require: -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang In order to use: -ftrivial-auto-var-init=zero This is no longer the case, so we are removing the unneeded flag. BUG=b:261237360 TEST=go test . -updategolden TET=CQ+1 with bundled change Change-Id: I3a5f0fb172aa0951de5a6dbab58e54b452f510fb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4077549 Reviewed-by: Manoj Gupta Commit-Queue: Ryan Beltran Tested-by: Ryan Beltran --- compiler_wrapper/config.go | 1 - compiler_wrapper/testdata/cros_hardened_golden/bisect.json | 3 --- .../clang_ftrapv_maincc_target_specific.json | 9 --------- .../cros_hardened_golden/clang_maincc_target_specific.json | 9 --------- .../testdata/cros_hardened_golden/clang_path.json | 12 ------------ .../testdata/cros_hardened_golden/clang_sanitizer_args.json | 8 -------- .../testdata/cros_hardened_golden/clang_specific_args.json | 4 ---- .../cros_hardened_golden/clang_sysroot_wrapper_common.json | 6 ------ .../testdata/cros_hardened_golden/clangtidy.json | 8 -------- .../testdata/cros_hardened_golden/force_disable_werror.json | 5 ----- .../testdata/cros_hardened_golden/gcc_clang_syntax.json | 4 ---- .../testdata/cros_hardened_llvmnext_golden/bisect.json | 3 --- .../testdata/cros_hardened_llvmnext_golden/clang_path.json | 12 ------------ .../testdata/cros_hardened_llvmnext_golden/clangtidy.json | 8 -------- .../cros_hardened_llvmnext_golden/force_disable_werror.json | 5 ----- .../cros_hardened_llvmnext_golden/gcc_clang_syntax.json | 4 ---- .../testdata/cros_hardened_noccache_golden/bisect.json | 3 --- .../testdata/cros_hardened_noccache_golden/clang_path.json | 12 ------------ .../testdata/cros_hardened_noccache_golden/clangtidy.json | 8 -------- .../cros_hardened_noccache_golden/force_disable_werror.json | 5 ----- .../cros_hardened_noccache_golden/gcc_clang_syntax.json | 4 ---- 21 files changed, 133 deletions(-) diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index 786741a0..84486a9f 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -166,7 +166,6 @@ var crosHardenedConfig = config{ "-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", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_golden/bisect.json index 23338911..d61b4dd7 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/bisect.json @@ -44,7 +44,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -120,7 +119,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -199,7 +197,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json index 442232b0..e9dc50a1 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json @@ -35,7 +35,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -101,7 +100,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -167,7 +165,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -233,7 +230,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -298,7 +294,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -363,7 +358,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -428,7 +422,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -493,7 +486,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -558,7 +550,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json index 79f944aa..8d350035 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json @@ -34,7 +34,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -98,7 +97,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -162,7 +160,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -226,7 +223,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -289,7 +285,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -352,7 +347,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -415,7 +409,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -478,7 +471,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -541,7 +533,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json index 0ceddea1..f1c1e247 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json @@ -34,7 +34,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -101,7 +100,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -168,7 +166,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -235,7 +232,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -309,7 +305,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -388,7 +383,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -462,7 +456,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -531,7 +524,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -595,7 +587,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -659,7 +650,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -723,7 +713,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -790,7 +779,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json index 08ae1ad4..c56f4d96 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json @@ -36,7 +36,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -102,7 +101,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -168,7 +166,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -234,7 +231,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -299,7 +295,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -365,7 +360,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -431,7 +425,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -496,7 +489,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json index f41ccbfd..c75ff45b 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json @@ -44,7 +44,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -117,7 +116,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -183,7 +181,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -249,7 +246,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json index f39b661b..1babba3d 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json @@ -70,7 +70,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -137,7 +136,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -197,7 +195,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -263,7 +260,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-D_FORTIFY_SOURCE=2", @@ -329,7 +325,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-D_FORTIFY_SOURCE=2", @@ -393,7 +388,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json index 1c640d1a..09f2683d 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json @@ -49,7 +49,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -94,7 +93,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -169,7 +167,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -215,7 +212,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -292,7 +288,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -341,7 +336,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -419,7 +413,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -465,7 +458,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json index 5adcb975..cc549713 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json @@ -37,7 +37,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -104,7 +103,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -157,7 +155,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -228,7 +225,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -281,7 +277,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json index 6e8bf3e5..0e98f493 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json @@ -34,7 +34,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -123,7 +122,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -207,7 +205,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -274,7 +271,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json index 75a27fa6..a5f8be70 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json @@ -44,7 +44,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", @@ -121,7 +120,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", @@ -201,7 +199,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json index 2d33f710..c18aafde 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json @@ -34,7 +34,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", @@ -102,7 +101,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", @@ -170,7 +168,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", @@ -238,7 +235,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", @@ -313,7 +309,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", @@ -393,7 +388,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", @@ -468,7 +462,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", @@ -538,7 +531,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", @@ -603,7 +595,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", @@ -668,7 +659,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", @@ -733,7 +723,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", @@ -801,7 +790,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json index eaac46ef..86e8b6b1 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json @@ -49,7 +49,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", @@ -95,7 +94,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", @@ -171,7 +169,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", @@ -218,7 +215,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", @@ -296,7 +292,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", @@ -346,7 +341,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", @@ -425,7 +419,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", @@ -472,7 +465,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json index 9b34d0e3..afb44b31 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json @@ -37,7 +37,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", @@ -105,7 +104,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", @@ -159,7 +157,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", @@ -231,7 +228,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", @@ -285,7 +281,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json index 7b805969..5cdca94f 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json @@ -34,7 +34,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", @@ -124,7 +123,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", @@ -209,7 +207,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", @@ -277,7 +274,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-enum-constexpr-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json index 6a204d19..3523e8a3 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json @@ -43,7 +43,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -115,7 +114,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -190,7 +188,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json index a04358eb..ff33fb02 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json @@ -33,7 +33,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -94,7 +93,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -155,7 +153,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -216,7 +213,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -284,7 +280,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -358,7 +353,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -431,7 +425,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -494,7 +487,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -552,7 +544,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -610,7 +601,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -668,7 +658,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -729,7 +718,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json index 1c640d1a..09f2683d 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json @@ -49,7 +49,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -94,7 +93,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -169,7 +167,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -215,7 +212,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -292,7 +288,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -341,7 +336,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -419,7 +413,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -465,7 +458,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json index c16db7e8..794f9c45 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json @@ -36,7 +36,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -97,7 +96,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -144,7 +142,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -209,7 +206,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -256,7 +252,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json index 87e2cc7f..e29c6201 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json @@ -34,7 +34,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -118,7 +117,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -202,7 +200,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -269,7 +266,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", -- cgit v1.2.3 From 0f10c3f3b697228ccb9da87366128be3118922bb Mon Sep 17 00:00:00 2001 From: Ryan Beltran Date: Mon, 5 Dec 2022 20:05:56 +0000 Subject: compiler_wrapper: add -std=gnu++14 flag This CL adds the -std=gnu++14 flag to the compiler wrapper. Packages can override it individually if needed, but it will prevent packages from failing in the meantime for the LLVM uprev due to c++17 changes. BUG=b:261472345, b:249834716 TEST=go test . -updategolden TEST=CQ dryrun of bundle CL Change-Id: I3d5eb79aad52bc37d8330d3c8d9bd9ce3a379fe4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4081686 Tested-by: Ryan Beltran Reviewed-by: Manoj Gupta Commit-Queue: Ryan Beltran --- compiler_wrapper/clang_flags.go | 1 + compiler_wrapper/clang_flags_test.go | 16 ++++++++++++++++ compiler_wrapper/config.go | 12 ++++++++++++ .../testdata/cros_clang_host_golden/clang_path.json | 1 + .../testdata/cros_hardened_golden/clang_path.json | 1 + .../cros_hardened_llvmnext_golden/clang_path.json | 1 + .../cros_hardened_noccache_golden/clang_path.json | 1 + .../testdata/cros_nonhardened_golden/clang_path.json | 1 + 8 files changed, 34 insertions(+) diff --git a/compiler_wrapper/clang_flags.go b/compiler_wrapper/clang_flags.go index 1c45935e..6b09606d 100644 --- a/compiler_wrapper/clang_flags.go +++ b/compiler_wrapper/clang_flags.go @@ -39,6 +39,7 @@ func processClangFlags(builder *commandBuilder) error { clangBasename := "clang" if strings.HasSuffix(builder.target.compiler, "++") { clangBasename = "clang++" + builder.addPreUserArgs(builder.cfg.cppFlags...) } // GCC flags to remove from the clang command line. diff --git a/compiler_wrapper/clang_flags_test.go b/compiler_wrapper/clang_flags_test.go index 08e8a8dc..b3d32210 100644 --- a/compiler_wrapper/clang_flags_test.go +++ b/compiler_wrapper/clang_flags_test.go @@ -33,6 +33,22 @@ func TestClangBasename(t *testing.T) { }) } +func TestAppendCppFlags(t *testing.T) { + withTestContext(t, func(ctx *testContext) { + ctx.cfg.cppFlags = append(ctx.cfg.cppFlags, "cppOnlyFlag") + clangCmd := ctx.must(callCompiler(ctx, ctx.cfg, + ctx.newCommand("./x86_64-cros-linux-gnu-clang", mainCc))) + if err := verifyArgCount(clangCmd, 0, "cppOnlyFlag"); err != nil { + t.Error(err) + } + clangPlusPlusCmd := ctx.must(callCompiler(ctx, ctx.cfg, + ctx.newCommand("./x86_64-cros-linux-gnu-clang++", mainCc))) + if err := verifyArgCount(clangPlusPlusCmd, 1, "cppOnlyFlag"); err != nil { + t.Error(err) + } + }) +} + func TestClangPathGivenClangEnv(t *testing.T) { withTestContext(t, func(ctx *testContext) { ctx.env = []string{"CLANG=/a/b/clang"} diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index 84486a9f..b1ef943d 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -25,6 +25,8 @@ type config struct { // Flags to add to clang only, AFTER user flags (cannot be overridden // by the user). clangPostFlags []string + // Flags to be used only for C++ (not used to compile C code) + cppFlags []string // Toolchain root path relative to the wrapper binary. clangRootRelPath string gccRootRelPath string @@ -126,6 +128,12 @@ func crosCommonClangFlags() []string { } } +func crosCommonCppFlags() []string { + return []string{ + "-std=gnu++14", + } +} + func crosCommonClangPostFlags() []string { // Temporarily disable Wdeprecated-copy. b/191479033 return []string{ @@ -168,6 +176,7 @@ var crosHardenedConfig = config{ "-ftrivial-auto-var-init=zero", ), clangPostFlags: crosCommonClangPostFlags(), + cppFlags: crosCommonCppFlags(), newWarningsDir: "/tmp/fatal_clang_warnings", triciumNitsDir: "/tmp/linting_output/clang-tidy", crashArtifactsDir: "/tmp/clang_crash_diagnostics", @@ -190,6 +199,7 @@ var crosNonHardenedConfig = config{ "-Wno-section", ), clangPostFlags: crosCommonClangPostFlags(), + cppFlags: crosCommonCppFlags(), newWarningsDir: "/tmp/fatal_clang_warnings", triciumNitsDir: "/tmp/linting_output/clang-tidy", crashArtifactsDir: "/tmp/clang_crash_diagnostics", @@ -220,6 +230,7 @@ var crosHostConfig = config{ ), // Temporarily disable Wdeprecated-copy. b/191479033 clangPostFlags: crosCommonClangPostFlags(), + cppFlags: crosCommonCppFlags(), newWarningsDir: "/tmp/fatal_clang_warnings", triciumNitsDir: "/tmp/linting_output/clang-tidy", crashArtifactsDir: "/tmp/clang_crash_diagnostics", @@ -234,6 +245,7 @@ var androidConfig = config{ gccFlags: []string{}, clangFlags: []string{}, clangPostFlags: []string{}, + cppFlags: []string{}, newWarningsDir: "", triciumNitsDir: "", crashArtifactsDir: "", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_path.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_path.json index e91754bc..61c22d66 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_path.json @@ -126,6 +126,7 @@ "-fuse-ld=lld", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", + "-std=gnu++14", "main.cc", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json index f1c1e247..c8d425e9 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json @@ -172,6 +172,7 @@ "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", + "-std=gnu++14", "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json index c18aafde..c4f050ea 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json @@ -175,6 +175,7 @@ "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", + "-std=gnu++14", "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json index ff33fb02..b123363b 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json @@ -159,6 +159,7 @@ "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", + "-std=gnu++14", "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_path.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_path.json index 685d7d5c..8e193805 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_path.json @@ -148,6 +148,7 @@ "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", + "-std=gnu++14", "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", -- cgit v1.2.3 From 2d3d8b5854002d45071918ba9e48d8aff5f2e3c1 Mon Sep 17 00:00:00 2001 From: Ryan Beltran Date: Tue, 6 Dec 2022 20:22:35 +0000 Subject: compiler wrapper: Disable c++ only flags with -x c This CL modifies recent logic for -x adding C++ only flags to disable it if -x is specified. There were some unforseen failures due to clang++ being triggered with `-x c`. BUG=b:261472345, b:249834716 TEST=go test . Change-Id: I9ef32056942ffd8073f105c950b7f62b5072ba7c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4083961 Reviewed-by: Manoj Gupta Commit-Queue: Ryan Beltran Tested-by: Ryan Beltran --- compiler_wrapper/clang_flags.go | 12 +++++++++++- compiler_wrapper/clang_flags_test.go | 8 ++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/compiler_wrapper/clang_flags.go b/compiler_wrapper/clang_flags.go index 6b09606d..b73e28c1 100644 --- a/compiler_wrapper/clang_flags.go +++ b/compiler_wrapper/clang_flags.go @@ -36,10 +36,20 @@ func processClangFlags(builder *commandBuilder) error { clangDir = filepath.Dir(clangDir) } + var languageOverriden = false + for _, arg := range builder.args { + if arg.value == "-x" { + languageOverriden = true + } + } + clangBasename := "clang" if strings.HasSuffix(builder.target.compiler, "++") { clangBasename = "clang++" - builder.addPreUserArgs(builder.cfg.cppFlags...) + // If a package wants to specify the language then it can set the standard too. + if !languageOverriden { + builder.addPreUserArgs(builder.cfg.cppFlags...) + } } // GCC flags to remove from the clang command line. diff --git a/compiler_wrapper/clang_flags_test.go b/compiler_wrapper/clang_flags_test.go index b3d32210..ae407059 100644 --- a/compiler_wrapper/clang_flags_test.go +++ b/compiler_wrapper/clang_flags_test.go @@ -36,16 +36,24 @@ func TestClangBasename(t *testing.T) { func TestAppendCppFlags(t *testing.T) { withTestContext(t, func(ctx *testContext) { ctx.cfg.cppFlags = append(ctx.cfg.cppFlags, "cppOnlyFlag") + // C++ only flags are disabled on clang. clangCmd := ctx.must(callCompiler(ctx, ctx.cfg, ctx.newCommand("./x86_64-cros-linux-gnu-clang", mainCc))) if err := verifyArgCount(clangCmd, 0, "cppOnlyFlag"); err != nil { t.Error(err) } + // C++ only flags are enabled on clang++. clangPlusPlusCmd := ctx.must(callCompiler(ctx, ctx.cfg, ctx.newCommand("./x86_64-cros-linux-gnu-clang++", mainCc))) if err := verifyArgCount(clangPlusPlusCmd, 1, "cppOnlyFlag"); err != nil { t.Error(err) } + // C++ only flags are disabled with -x. + clangPlusPlusWithXCmd := ctx.must(callCompiler(ctx, ctx.cfg, + ctx.newCommand("./x86_64-cros-linux-gnu-clang++", "-x", "c", mainCc))) + if err := verifyArgCount(clangPlusPlusWithXCmd, 0, "cppOnlyFlag"); err != nil { + t.Error(err) + } }) } -- cgit v1.2.3 From b438e1f25bc99378ca97d3f71b3302c08c22a40f Mon Sep 17 00:00:00 2001 From: Ryan Beltran Date: Wed, 7 Dec 2022 23:43:23 +0000 Subject: compiler_wrapper: Treat invocations with "-" as C It turns out 'clang++ -E -' is interpretted as C. This CL handles that case is our "C++ only" flags logic. BUG=b:261472345, b:249834716 TEST=go test . TEST=emerge-atlas jsoncpp (which was previously broken) Change-Id: I05d4871741c7d7813679f445112b5beba54a612e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4087393 Tested-by: Ryan Beltran Reviewed-by: Manoj Gupta Auto-Submit: Ryan Beltran Commit-Queue: Manoj Gupta --- compiler_wrapper/clang_flags.go | 3 ++- compiler_wrapper/clang_flags_test.go | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/compiler_wrapper/clang_flags.go b/compiler_wrapper/clang_flags.go index b73e28c1..e12f1a0a 100644 --- a/compiler_wrapper/clang_flags.go +++ b/compiler_wrapper/clang_flags.go @@ -38,7 +38,8 @@ func processClangFlags(builder *commandBuilder) error { var languageOverriden = false for _, arg := range builder.args { - if arg.value == "-x" { + // Reading stdin with "-" requires either -E (which defaults to C) or -x + if arg.value == "-x" || arg.value == "-" { languageOverriden = true } } diff --git a/compiler_wrapper/clang_flags_test.go b/compiler_wrapper/clang_flags_test.go index ae407059..029594dd 100644 --- a/compiler_wrapper/clang_flags_test.go +++ b/compiler_wrapper/clang_flags_test.go @@ -54,6 +54,12 @@ func TestAppendCppFlags(t *testing.T) { if err := verifyArgCount(clangPlusPlusWithXCmd, 0, "cppOnlyFlag"); err != nil { t.Error(err) } + // C++ only flags are disabled with " - " . + clangPlusPlusWithStdin := ctx.must(callCompiler(ctx, ctx.cfg, + ctx.newCommand("./x86_64-cros-linux-gnu-clang++", "-", mainCc))) + if err := verifyArgCount(clangPlusPlusWithStdin, 0, "cppOnlyFlag"); err != nil { + t.Error(err) + } }) } -- cgit v1.2.3 From f66f3783a392885fe1a31d497f7d033b67377325 Mon Sep 17 00:00:00 2001 From: Denis Nikitin Date: Wed, 7 Dec 2022 23:00:19 -0800 Subject: crosperf: Fix format and lints BUG=None TEST=cros format && cros lint Change-Id: Ie6f5ffbd1ed26f6e974a24cae7d3220023380886 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4087995 Reviewed-by: Manoj Gupta Commit-Queue: Denis Nikitin Tested-by: Denis Nikitin --- crosperf/results_cache_unittest.py | 349 +++++++++++++++++++------------------ 1 file changed, 175 insertions(+), 174 deletions(-) diff --git a/crosperf/results_cache_unittest.py b/crosperf/results_cache_unittest.py index cad149e0..704cd509 100755 --- a/crosperf/results_cache_unittest.py +++ b/crosperf/results_cache_unittest.py @@ -614,118 +614,118 @@ class ResultTest(unittest.TestCase): self.assertEqual( kv_dict2, { - u"Box2D__Box2D": 4775, - u"Mandreel__Mandreel": 6620, - u"Gameboy__Gameboy": 9901, - u"Crypto__Crypto": 8737, - u"telemetry_page_measurement_results__num_errored": 0, - u"telemetry_page_measurement_results__num_failed": 0, - u"PdfJS__PdfJS": 6455, - u"Total__Score": 7918, - u"EarleyBoyer__EarleyBoyer": 14340, - u"MandreelLatency__MandreelLatency": 5188, - u"CodeLoad__CodeLoad": 6271, - u"DeltaBlue__DeltaBlue": 14401, - u"Typescript__Typescript": 9815, - u"SplayLatency__SplayLatency": 7653, - u"zlib__zlib": 16094, - u"Richards__Richards": 10358, - u"RegExp__RegExp": 1765, - u"NavierStokes__NavierStokes": 9815, - u"Splay__Splay": 4425, - u"RayTrace__RayTrace": 16600, + "Box2D__Box2D": 4775, + "Mandreel__Mandreel": 6620, + "Gameboy__Gameboy": 9901, + "Crypto__Crypto": 8737, + "telemetry_page_measurement_results__num_errored": 0, + "telemetry_page_measurement_results__num_failed": 0, + "PdfJS__PdfJS": 6455, + "Total__Score": 7918, + "EarleyBoyer__EarleyBoyer": 14340, + "MandreelLatency__MandreelLatency": 5188, + "CodeLoad__CodeLoad": 6271, + "DeltaBlue__DeltaBlue": 14401, + "Typescript__Typescript": 9815, + "SplayLatency__SplayLatency": 7653, + "zlib__zlib": 16094, + "Richards__Richards": 10358, + "RegExp__RegExp": 1765, + "NavierStokes__NavierStokes": 9815, + "Splay__Splay": 4425, + "RayTrace__RayTrace": 16600, }, ) self.assertEqual( udict, { - u"Box2D__Box2D": u"score", - u"Mandreel__Mandreel": u"score", - u"Gameboy__Gameboy": u"score", - u"Crypto__Crypto": u"score", - u"telemetry_page_measurement_results__num_errored": u"count", - u"telemetry_page_measurement_results__num_failed": u"count", - u"PdfJS__PdfJS": u"score", - u"Total__Score": u"score", - u"EarleyBoyer__EarleyBoyer": u"score", - u"MandreelLatency__MandreelLatency": u"score", - u"CodeLoad__CodeLoad": u"score", - u"DeltaBlue__DeltaBlue": u"score", - u"Typescript__Typescript": u"score", - u"SplayLatency__SplayLatency": u"score", - u"zlib__zlib": u"score", - u"Richards__Richards": u"score", - u"RegExp__RegExp": u"score", - u"NavierStokes__NavierStokes": u"score", - u"Splay__Splay": u"score", - u"RayTrace__RayTrace": u"score", + "Box2D__Box2D": "score", + "Mandreel__Mandreel": "score", + "Gameboy__Gameboy": "score", + "Crypto__Crypto": "score", + "telemetry_page_measurement_results__num_errored": "count", + "telemetry_page_measurement_results__num_failed": "count", + "PdfJS__PdfJS": "score", + "Total__Score": "score", + "EarleyBoyer__EarleyBoyer": "score", + "MandreelLatency__MandreelLatency": "score", + "CodeLoad__CodeLoad": "score", + "DeltaBlue__DeltaBlue": "score", + "Typescript__Typescript": "score", + "SplayLatency__SplayLatency": "score", + "zlib__zlib": "score", + "Richards__Richards": "score", + "RegExp__RegExp": "score", + "NavierStokes__NavierStokes": "score", + "Splay__Splay": "score", + "RayTrace__RayTrace": "score", }, ) def test_append_telemetry_units(self): kv_dict = { - u"Box2D__Box2D": 4775, - u"Mandreel__Mandreel": 6620, - u"Gameboy__Gameboy": 9901, - u"Crypto__Crypto": 8737, - u"PdfJS__PdfJS": 6455, - u"Total__Score": 7918, - u"EarleyBoyer__EarleyBoyer": 14340, - u"MandreelLatency__MandreelLatency": 5188, - u"CodeLoad__CodeLoad": 6271, - u"DeltaBlue__DeltaBlue": 14401, - u"Typescript__Typescript": 9815, - u"SplayLatency__SplayLatency": 7653, - u"zlib__zlib": 16094, - u"Richards__Richards": 10358, - u"RegExp__RegExp": 1765, - u"NavierStokes__NavierStokes": 9815, - u"Splay__Splay": 4425, - u"RayTrace__RayTrace": 16600, + "Box2D__Box2D": 4775, + "Mandreel__Mandreel": 6620, + "Gameboy__Gameboy": 9901, + "Crypto__Crypto": 8737, + "PdfJS__PdfJS": 6455, + "Total__Score": 7918, + "EarleyBoyer__EarleyBoyer": 14340, + "MandreelLatency__MandreelLatency": 5188, + "CodeLoad__CodeLoad": 6271, + "DeltaBlue__DeltaBlue": 14401, + "Typescript__Typescript": 9815, + "SplayLatency__SplayLatency": 7653, + "zlib__zlib": 16094, + "Richards__Richards": 10358, + "RegExp__RegExp": 1765, + "NavierStokes__NavierStokes": 9815, + "Splay__Splay": 4425, + "RayTrace__RayTrace": 16600, } units_dict = { - u"Box2D__Box2D": u"score", - u"Mandreel__Mandreel": u"score", - u"Gameboy__Gameboy": u"score", - u"Crypto__Crypto": u"score", - u"PdfJS__PdfJS": u"score", - u"Total__Score": u"score", - u"EarleyBoyer__EarleyBoyer": u"score", - u"MandreelLatency__MandreelLatency": u"score", - u"CodeLoad__CodeLoad": u"score", - u"DeltaBlue__DeltaBlue": u"score", - u"Typescript__Typescript": u"score", - u"SplayLatency__SplayLatency": u"score", - u"zlib__zlib": u"score", - u"Richards__Richards": u"score", - u"RegExp__RegExp": u"score", - u"NavierStokes__NavierStokes": u"score", - u"Splay__Splay": u"score", - u"RayTrace__RayTrace": u"score", + "Box2D__Box2D": "score", + "Mandreel__Mandreel": "score", + "Gameboy__Gameboy": "score", + "Crypto__Crypto": "score", + "PdfJS__PdfJS": "score", + "Total__Score": "score", + "EarleyBoyer__EarleyBoyer": "score", + "MandreelLatency__MandreelLatency": "score", + "CodeLoad__CodeLoad": "score", + "DeltaBlue__DeltaBlue": "score", + "Typescript__Typescript": "score", + "SplayLatency__SplayLatency": "score", + "zlib__zlib": "score", + "Richards__Richards": "score", + "RegExp__RegExp": "score", + "NavierStokes__NavierStokes": "score", + "Splay__Splay": "score", + "RayTrace__RayTrace": "score", } results_dict = self.result.AppendTelemetryUnits(kv_dict, units_dict) self.assertEqual( results_dict, { - u"Box2D__Box2D": [4775, u"score"], - u"Splay__Splay": [4425, u"score"], - u"Gameboy__Gameboy": [9901, u"score"], - u"Crypto__Crypto": [8737, u"score"], - u"PdfJS__PdfJS": [6455, u"score"], - u"Total__Score": [7918, u"score"], - u"EarleyBoyer__EarleyBoyer": [14340, u"score"], - u"MandreelLatency__MandreelLatency": [5188, u"score"], - u"DeltaBlue__DeltaBlue": [14401, u"score"], - u"SplayLatency__SplayLatency": [7653, u"score"], - u"Mandreel__Mandreel": [6620, u"score"], - u"Richards__Richards": [10358, u"score"], - u"zlib__zlib": [16094, u"score"], - u"CodeLoad__CodeLoad": [6271, u"score"], - u"Typescript__Typescript": [9815, u"score"], - u"RegExp__RegExp": [1765, u"score"], - u"RayTrace__RayTrace": [16600, u"score"], - u"NavierStokes__NavierStokes": [9815, u"score"], + "Box2D__Box2D": [4775, "score"], + "Splay__Splay": [4425, "score"], + "Gameboy__Gameboy": [9901, "score"], + "Crypto__Crypto": [8737, "score"], + "PdfJS__PdfJS": [6455, "score"], + "Total__Score": [7918, "score"], + "EarleyBoyer__EarleyBoyer": [14340, "score"], + "MandreelLatency__MandreelLatency": [5188, "score"], + "DeltaBlue__DeltaBlue": [14401, "score"], + "SplayLatency__SplayLatency": [7653, "score"], + "Mandreel__Mandreel": [6620, "score"], + "Richards__Richards": [10358, "score"], + "zlib__zlib": [16094, "score"], + "CodeLoad__CodeLoad": [6271, "score"], + "Typescript__Typescript": [9815, "score"], + "RegExp__RegExp": [1765, "score"], + "RayTrace__RayTrace": [16600, "score"], + "NavierStokes__NavierStokes": [9815, "score"], }, ) @@ -821,9 +821,9 @@ class ResultTest(unittest.TestCase): # Test 3. suite != telemetry_Crosperf. Normally this would be for # running non-Telemetry autotests, such as BootPerfServer. In this test - # case, the keyvals we have set up were returned from a Telemetry test run; - # so this pass is basically testing that we don't append the units to the - # test results (which we do for Telemetry autotest runs). + # case, the keyvals we have set up were returned from a Telemetry test + # run; so this pass is basically testing that we don't append the units + # to the test results (which we do for Telemetry autotest runs). reset() self.result.suite = "" res = self.result.GetKeyvals() @@ -855,7 +855,7 @@ class ResultTest(unittest.TestCase): with mock.patch("builtins.open", return_value=io.StringIO(content)): samples = self.result.GetSamples() - self.assertEqual(samples, [237210 - 60, u"samples"]) + self.assertEqual(samples, [237210 - 60, "samples"]) def test_get_results_dir(self): @@ -1162,8 +1162,8 @@ class ResultTest(unittest.TestCase): self.result.turbostat_log_file = "/tmp/emptylogfile.log" with mock.patch("builtins.open", mock.mock_open(read_data="")) as mo: cpustats = self.result.ProcessTurbostatResults() - # Check that the log got opened and parsed successfully and empty data - # returned. + # Check that the log got opened and parsed successfully and empty + # data returned. calls = [mock.call("/tmp/emptylogfile.log")] mo.assert_has_calls(calls) self.assertEqual(cpustats, {}) @@ -1220,8 +1220,8 @@ class ResultTest(unittest.TestCase): self.result.cpustats_log_file = "/tmp/emptylogfile.log" with mock.patch("builtins.open", mock.mock_open(read_data="")) as mo: cpustats = self.result.ProcessCpustatsResults() - # Check that the log got opened and parsed successfully and empty data - # returned. + # Check that the log got opened and parsed successfully and empty + # data returned. calls = [mock.call("/tmp/emptylogfile.log")] mo.assert_has_calls(calls) self.assertEqual(cpustats, {}) @@ -1244,8 +1244,8 @@ class ResultTest(unittest.TestCase): self.result.top_log_file = "/tmp/emptylogfile.log" with mock.patch("builtins.open", mock.mock_open(read_data="")) as mo: topcalls = self.result.ProcessTopResults() - # Check that the log got opened and parsed successfully and empty data - # returned. + # Check that the log got opened and parsed successfully and empty + # data returned. calls = [mock.call("/tmp/emptylogfile.log")] mo.assert_has_calls(calls) self.assertEqual(topcalls, []) @@ -1528,20 +1528,20 @@ class ResultTest(unittest.TestCase): # Verify the summary for the story is correct self.assertEqual( self.result.keyvals["timeToFirstContentfulPaint__typical"], - [880.000, u"ms_smallerIsBetter"], + [880.000, "ms_smallerIsBetter"], ) # Veirfy the summary for a certain stroy tag is correct self.assertEqual( self.result.keyvals[ "timeToFirstContentfulPaint__cache_temperature:cold" ], - [1000.000, u"ms_smallerIsBetter"], + [1000.000, "ms_smallerIsBetter"], ) self.assertEqual( self.result.keyvals[ "timeToFirstContentfulPaint__cache_temperature:warm" ], - [800.000, u"ms_smallerIsBetter"], + [800.000, "ms_smallerIsBetter"], ) @mock.patch.object(Result, "ProcessCpustatsResults") @@ -1672,7 +1672,7 @@ class ResultTest(unittest.TestCase): return self.tmpdir def FakeGetSamples(): - return [1, u"samples"] + return [1, "samples"] current_path = os.getcwd() cache_dir = os.path.join(current_path, "test_cache/test_input") @@ -1696,46 +1696,46 @@ class ResultTest(unittest.TestCase): self.assertEqual( self.result.keyvals, { - u"Total__Total": [444.0, u"ms"], - u"regexp-dna__regexp-dna": [16.2, u"ms"], - u"telemetry_page_measurement_results__num_failed": [ + "Total__Total": [444.0, "ms"], + "regexp-dna__regexp-dna": [16.2, "ms"], + "telemetry_page_measurement_results__num_failed": [ 0, - u"count", + "count", ], - u"telemetry_page_measurement_results__num_errored": [ + "telemetry_page_measurement_results__num_errored": [ 0, - u"count", + "count", ], - u"string-fasta__string-fasta": [23.2, u"ms"], - u"crypto-sha1__crypto-sha1": [11.6, u"ms"], - u"bitops-3bit-bits-in-byte__bitops-3bit-bits-in-byte": [ + "string-fasta__string-fasta": [23.2, "ms"], + "crypto-sha1__crypto-sha1": [11.6, "ms"], + "bitops-3bit-bits-in-byte__bitops-3bit-bits-in-byte": [ 3.2, - u"ms", + "ms", ], - u"access-nsieve__access-nsieve": [7.9, u"ms"], - u"bitops-nsieve-bits__bitops-nsieve-bits": [9.4, u"ms"], - u"string-validate-input__string-validate-input": [19.3, u"ms"], - u"3d-raytrace__3d-raytrace": [24.7, u"ms"], - u"3d-cube__3d-cube": [28.0, u"ms"], - u"string-unpack-code__string-unpack-code": [46.7, u"ms"], - u"date-format-tofte__date-format-tofte": [26.3, u"ms"], - u"math-partial-sums__math-partial-sums": [22.0, u"ms"], + "access-nsieve__access-nsieve": [7.9, "ms"], + "bitops-nsieve-bits__bitops-nsieve-bits": [9.4, "ms"], + "string-validate-input__string-validate-input": [19.3, "ms"], + "3d-raytrace__3d-raytrace": [24.7, "ms"], + "3d-cube__3d-cube": [28.0, "ms"], + "string-unpack-code__string-unpack-code": [46.7, "ms"], + "date-format-tofte__date-format-tofte": [26.3, "ms"], + "math-partial-sums__math-partial-sums": [22.0, "ms"], "\telemetry_Crosperf": ["PASS", ""], - u"crypto-aes__crypto-aes": [15.2, u"ms"], - u"bitops-bitwise-and__bitops-bitwise-and": [8.4, u"ms"], - u"crypto-md5__crypto-md5": [10.5, u"ms"], - u"string-tagcloud__string-tagcloud": [52.8, u"ms"], - u"access-nbody__access-nbody": [8.5, u"ms"], + "crypto-aes__crypto-aes": [15.2, "ms"], + "bitops-bitwise-and__bitops-bitwise-and": [8.4, "ms"], + "crypto-md5__crypto-md5": [10.5, "ms"], + "string-tagcloud__string-tagcloud": [52.8, "ms"], + "access-nbody__access-nbody": [8.5, "ms"], "retval": 0, - u"math-spectral-norm__math-spectral-norm": [6.6, u"ms"], - u"math-cordic__math-cordic": [8.7, u"ms"], - u"access-binary-trees__access-binary-trees": [4.5, u"ms"], - u"controlflow-recursive__controlflow-recursive": [4.4, u"ms"], - u"access-fannkuch__access-fannkuch": [17.8, u"ms"], - u"string-base64__string-base64": [16.0, u"ms"], - u"date-format-xparb__date-format-xparb": [20.9, u"ms"], - u"3d-morph__3d-morph": [22.1, u"ms"], - u"bitops-bits-in-byte__bitops-bits-in-byte": [9.1, u"ms"], + "math-spectral-norm__math-spectral-norm": [6.6, "ms"], + "math-cordic__math-cordic": [8.7, "ms"], + "access-binary-trees__access-binary-trees": [4.5, "ms"], + "controlflow-recursive__controlflow-recursive": [4.4, "ms"], + "access-fannkuch__access-fannkuch": [17.8, "ms"], + "string-base64__string-base64": [16.0, "ms"], + "date-format-xparb__date-format-xparb": [20.9, "ms"], + "3d-morph__3d-morph": [22.1, "ms"], + "bitops-bits-in-byte__bitops-bits-in-byte": [9.1, "ms"], }, ) @@ -1746,47 +1746,47 @@ class ResultTest(unittest.TestCase): self.assertEqual( self.result.keyvals, { - u"Total__Total": [444.0, u"ms"], - u"regexp-dna__regexp-dna": [16.2, u"ms"], - u"telemetry_page_measurement_results__num_failed": [ + "Total__Total": [444.0, "ms"], + "regexp-dna__regexp-dna": [16.2, "ms"], + "telemetry_page_measurement_results__num_failed": [ 0, - u"count", + "count", ], - u"telemetry_page_measurement_results__num_errored": [ + "telemetry_page_measurement_results__num_errored": [ 0, - u"count", + "count", ], - u"string-fasta__string-fasta": [23.2, u"ms"], - u"crypto-sha1__crypto-sha1": [11.6, u"ms"], - u"bitops-3bit-bits-in-byte__bitops-3bit-bits-in-byte": [ + "string-fasta__string-fasta": [23.2, "ms"], + "crypto-sha1__crypto-sha1": [11.6, "ms"], + "bitops-3bit-bits-in-byte__bitops-3bit-bits-in-byte": [ 3.2, - u"ms", + "ms", ], - u"access-nsieve__access-nsieve": [7.9, u"ms"], - u"bitops-nsieve-bits__bitops-nsieve-bits": [9.4, u"ms"], - u"string-validate-input__string-validate-input": [19.3, u"ms"], - u"3d-raytrace__3d-raytrace": [24.7, u"ms"], - u"3d-cube__3d-cube": [28.0, u"ms"], - u"string-unpack-code__string-unpack-code": [46.7, u"ms"], - u"date-format-tofte__date-format-tofte": [26.3, u"ms"], - u"math-partial-sums__math-partial-sums": [22.0, u"ms"], + "access-nsieve__access-nsieve": [7.9, "ms"], + "bitops-nsieve-bits__bitops-nsieve-bits": [9.4, "ms"], + "string-validate-input__string-validate-input": [19.3, "ms"], + "3d-raytrace__3d-raytrace": [24.7, "ms"], + "3d-cube__3d-cube": [28.0, "ms"], + "string-unpack-code__string-unpack-code": [46.7, "ms"], + "date-format-tofte__date-format-tofte": [26.3, "ms"], + "math-partial-sums__math-partial-sums": [22.0, "ms"], "\telemetry_Crosperf": ["PASS", ""], - u"crypto-aes__crypto-aes": [15.2, u"ms"], - u"bitops-bitwise-and__bitops-bitwise-and": [8.4, u"ms"], - u"crypto-md5__crypto-md5": [10.5, u"ms"], - u"string-tagcloud__string-tagcloud": [52.8, u"ms"], - u"access-nbody__access-nbody": [8.5, u"ms"], + "crypto-aes__crypto-aes": [15.2, "ms"], + "bitops-bitwise-and__bitops-bitwise-and": [8.4, "ms"], + "crypto-md5__crypto-md5": [10.5, "ms"], + "string-tagcloud__string-tagcloud": [52.8, "ms"], + "access-nbody__access-nbody": [8.5, "ms"], "retval": 0, - u"math-spectral-norm__math-spectral-norm": [6.6, u"ms"], - u"math-cordic__math-cordic": [8.7, u"ms"], - u"access-binary-trees__access-binary-trees": [4.5, u"ms"], - u"controlflow-recursive__controlflow-recursive": [4.4, u"ms"], - u"access-fannkuch__access-fannkuch": [17.8, u"ms"], - u"string-base64__string-base64": [16.0, u"ms"], - u"date-format-xparb__date-format-xparb": [20.9, u"ms"], - u"3d-morph__3d-morph": [22.1, u"ms"], - u"bitops-bits-in-byte__bitops-bits-in-byte": [9.1, u"ms"], - u"samples": [1, u"samples"], + "math-spectral-norm__math-spectral-norm": [6.6, "ms"], + "math-cordic__math-cordic": [8.7, "ms"], + "access-binary-trees__access-binary-trees": [4.5, "ms"], + "controlflow-recursive__controlflow-recursive": [4.4, "ms"], + "access-fannkuch__access-fannkuch": [17.8, "ms"], + "string-base64__string-base64": [16.0, "ms"], + "date-format-xparb__date-format-xparb": [20.9, "ms"], + "3d-morph__3d-morph": [22.1, "ms"], + "bitops-bits-in-byte__bitops-bits-in-byte": [9.1, "ms"], + "samples": [1, "samples"], }, ) @@ -2303,7 +2303,8 @@ class ResultsCacheTest(unittest.TestCase): self.assertIsNone(res) # Test 5. os.path.isdir returns true, but mock_create now returns None - # (the call to CreateFromCacheHit returns None), so overal result is None. + # (the call to CreateFromCacheHit returns None), so overal result is + # None. mock_isdir.return_value = True mock_create.return_value = None res = self.results_cache.ReadResult() -- cgit v1.2.3 From 4836fbaa58c32ed3bd70729b245de193fd1fbf34 Mon Sep 17 00:00:00 2001 From: Denis Nikitin Date: Tue, 6 Dec 2022 21:57:58 -0800 Subject: crosperf: Fix results in dso mode Samples filtered by the DSO were calculated incorrectly which led to results of A/B test always showing close to zero improvement. - Fixed dso filtering. - Added "cpuidle_enter_state" (which shows up on top) to the kernel idle functions. - Fixed the bug which caused removal of /tmp in chroot when caching was hit. BUG=b:257494031 TEST=./crosperf and unittests Change-Id: I473be8efc8435a8f6003b9a9d95f734d22008b36 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4087996 Reviewed-by: Manoj Gupta Tested-by: Denis Nikitin Commit-Queue: Denis Nikitin --- crosperf/experiment_runner.py | 2 ++ crosperf/results_cache.py | 24 +++++++++++++++--------- crosperf/results_cache_unittest.py | 9 +++++++-- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/crosperf/experiment_runner.py b/crosperf/experiment_runner.py index 1f78dcc0..cb518843 100644 --- a/crosperf/experiment_runner.py +++ b/crosperf/experiment_runner.py @@ -339,8 +339,10 @@ class ExperimentRunner(object): benchmark_run.result.CompressResultsTo(benchmark_run_path) else: benchmark_run.result.CopyResultsTo(benchmark_run_path) + # Don't remove benchmark tmp if it was a cache hit. benchmark_run.result.CleanUp( benchmark_run.benchmark.rm_chroot_tmp + and not benchmark_run.cache_hit ) self.l.LogOutput("Storing results report in %s." % results_directory) diff --git a/crosperf/results_cache.py b/crosperf/results_cache.py index 043da990..c4cdc454 100644 --- a/crosperf/results_cache.py +++ b/crosperf/results_cache.py @@ -308,20 +308,19 @@ class Result(object): # We specify exact match for known DSO type, and every sample for `all`. exact_match = "" if self.cwp_dso == "all": - exact_match = '""' + exact_match = "" elif self.cwp_dso == "chrome": - exact_match = '" chrome "' + exact_match = "chrome" elif self.cwp_dso == "kallsyms": - exact_match = '"[kernel.kallsyms]"' + exact_match = "[kernel.kallsyms]" else: # This will need to be updated once there are more DSO types supported, # if user want an exact match for the field they want. - exact_match = '"%s"' % self.cwp_dso + exact_match = self.cwp_dso - command = "%s report -n -s dso -i %s 2> /dev/null | grep %s" % ( - perf_file, - chroot_perf_data_file, - exact_match, + command = ( + f"{perf_file} report -n -s dso -i " + f"{chroot_perf_data_file} 2> /dev/null" ) _, result, _ = self.ce.ChrootRunCommandWOutput( self.chromeos_root, command @@ -335,6 +334,8 @@ class Result(object): for line in result.split("\n"): attr = line.split() if len(attr) == 3 and "%" in attr[0]: + if exact_match and exact_match != attr[2]: + continue samples += int(attr[1]) except: raise RuntimeError("Cannot parse perf dso result") @@ -357,6 +358,7 @@ class Result(object): "default_idle", "cpu_idle_loop", "do_idle", + "cpuidle_enter_state", ), } idle_samples = 0 @@ -1202,7 +1204,11 @@ class Result(object): self.ProcessResults(use_cache=True) def CleanUp(self, rm_chroot_tmp): - if rm_chroot_tmp and self.results_dir: + if ( + rm_chroot_tmp + and self.results_dir + and self.results_dir != self.temp_dir + ): dirname, basename = misc.GetRoot(self.results_dir) if basename.find("test_that_results_") != -1: command = "rm -rf %s" % self.results_dir diff --git a/crosperf/results_cache_unittest.py b/crosperf/results_cache_unittest.py index 704cd509..bc90c5a9 100755 --- a/crosperf/results_cache_unittest.py +++ b/crosperf/results_cache_unittest.py @@ -839,10 +839,15 @@ class ResultTest(unittest.TestCase): ): self.result.perf_data_files = ["/tmp/results/perf.data"] self.result.board = "samus" + self.result.cwp_dso = "kallsyms" mock_getpath.return_value = "/usr/chromeos/chroot/tmp/results/perf.data" mock_get_total_samples.return_value = [ "", - "45.42% 237210 chrome ", + ( + "45.42% 53721 chrome \n" + "10.01% 12345 [kernel.kallsyms] \n" + "1.42% 1234 ssh " + ), "", ] mock_exists.return_value = True @@ -855,7 +860,7 @@ class ResultTest(unittest.TestCase): with mock.patch("builtins.open", return_value=io.StringIO(content)): samples = self.result.GetSamples() - self.assertEqual(samples, [237210 - 60, "samples"]) + self.assertEqual(samples, [12345 - 60, "samples"]) def test_get_results_dir(self): -- cgit v1.2.3 From bb6edbb81171c4a1752d86f344e3c46661dc451b Mon Sep 17 00:00:00 2001 From: Ryan Beltran Date: Thu, 8 Dec 2022 21:43:17 +0000 Subject: compiler wrapper: tidy lints don't go to /tmp This CL moves linter results from clang tidy out of /tmp and into the new artifacts directory for emerged packages. BUG=b:229769929 TEST=go test TEST=installed the compiler wrapper and ran lint_package Change-Id: I46e3f37977d5c7f0ff8d971065707e562ca0dd12 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4090587 Reviewed-by: George Burgess Commit-Queue: Ryan Beltran Tested-by: Ryan Beltran --- compiler_wrapper/clang_tidy_flag.go | 3 ++- compiler_wrapper/clang_tidy_flag_test.go | 40 +++++++++++++++++++++----------- compiler_wrapper/compiler_wrapper.go | 9 ++----- compiler_wrapper/config.go | 6 ----- compiler_wrapper/env.go | 12 ++++++++++ compiler_wrapper/iwyu_flag.go | 4 ++-- compiler_wrapper/testutil_test.go | 1 - 7 files changed, 45 insertions(+), 30 deletions(-) diff --git a/compiler_wrapper/clang_tidy_flag.go b/compiler_wrapper/clang_tidy_flag.go index b19976d2..e3940825 100644 --- a/compiler_wrapper/clang_tidy_flag.go +++ b/compiler_wrapper/clang_tidy_flag.go @@ -98,7 +98,8 @@ func calcClangTidyInvocation(env env, clangCmd *command, cSrcFile string, tidyFl }, nil } -func runClangTidyForTricium(env env, clangCmd *command, cSrcFile, fixesDir string, extraTidyFlags []string, crashArtifactsDir string) error { +func runClangTidyForTricium(env env, clangCmd *command, cSrcFile string, extraTidyFlags []string, crashArtifactsDir string) error { + fixesDir := filepath.Join(getCompilerArtifactsDir(env), "linting-output", "clang-tidy") if err := os.MkdirAll(fixesDir, 0777); err != nil { return fmt.Errorf("creating fixes directory at %q: %v", fixesDir, err) } diff --git a/compiler_wrapper/clang_tidy_flag_test.go b/compiler_wrapper/clang_tidy_flag_test.go index 73dec25f..b32d0d63 100644 --- a/compiler_wrapper/clang_tidy_flag_test.go +++ b/compiler_wrapper/clang_tidy_flag_test.go @@ -274,8 +274,9 @@ func TestPartiallyOmitGomaWithClangTidy(t *testing.T) { } func TestTriciumClangTidyIsProperlyDetectedFromEnv(t *testing.T) { - withClangTidyTestContext(t, func(ctx *testContext) { - ctx.env = []string{"WITH_TIDY=tricium"} + withClangTidyTriciumTestContext(t, func(ctx *testContext) { + artifactsBase := strings.Split(ctx.env[0], "=")[1] + outputDir := artifactsBase + "/linting-output/clang-tidy" ctx.cmdMock = func(cmd *command, stdin io.Reader, stdout io.Writer, stderr io.Writer) error { switch ctx.cmdCount { case 1: @@ -292,8 +293,9 @@ func TestTriciumClangTidyIsProperlyDetectedFromEnv(t *testing.T) { for _, arg := range cmd.Args { if path := strings.TrimPrefix(arg, "--export-fixes="); path != arg { hasFixesFile = true - if !strings.HasPrefix(path, ctx.cfg.triciumNitsDir+"/") { - t.Errorf("fixes file was %q; expected it to be in %q", path, ctx.cfg.triciumNitsDir) + + if !strings.HasPrefix(path, outputDir) { + t.Errorf("fixes file was %q; expected it to be in %q", path, outputDir) } break } @@ -320,8 +322,7 @@ func TestTriciumClangTidyIsProperlyDetectedFromEnv(t *testing.T) { } func TestTriciumClangTidySkipsProtobufFiles(t *testing.T) { - withClangTidyTestContext(t, func(ctx *testContext) { - ctx.env = []string{"WITH_TIDY=tricium"} + withClangTidyTriciumTestContext(t, func(ctx *testContext) { cmd := ctx.must(callCompiler(ctx, ctx.cfg, ctx.newCommand(clangX86_64, mainCc+".pb.cc"))) if ctx.cmdCount != 1 { @@ -365,8 +366,7 @@ func testClangTidyFiltersClangTidySpecificFlagsWithPresetEnv(t *testing.T, ctx * } func TestClangTidyFiltersClangTidySpecificFlagsForTricium(t *testing.T) { - withClangTidyTestContext(t, func(ctx *testContext) { - ctx.env = []string{"WITH_TIDY=tricium"} + withClangTidyTriciumTestContext(t, func(ctx *testContext) { testClangTidyFiltersClangTidySpecificFlagsWithPresetEnv(t, ctx) }) } @@ -378,7 +378,7 @@ func TestClangTidyFiltersClangTidySpecificFlags(t *testing.T) { } func TestClangTidyFlagsAreFilteredFromGccInvocations(t *testing.T) { - withTestContext(t, func(ctx *testContext) { + withClangTidyTestContext(t, func(ctx *testContext) { cmd := ctx.must(callCompiler(ctx, ctx.cfg, ctx.newCommand(gccX86_64, mainCc, "-clang-tidy-flag=--foo"))) if err := verifyArgCount(cmd, 0, ".*--foo.*"); err != nil { t.Error(err) @@ -387,8 +387,7 @@ func TestClangTidyFlagsAreFilteredFromGccInvocations(t *testing.T) { } func TestTriciumReportsClangTidyCrashesGracefully(t *testing.T) { - withClangTidyTestContext(t, func(ctx *testContext) { - ctx.env = []string{"WITH_TIDY=tricium"} + withClangTidyTriciumTestContext(t, func(ctx *testContext) { ctx.cmdMock = func(cmd *command, stdin io.Reader, stdout io.Writer, stderr io.Writer) error { switch ctx.cmdCount { case 1: @@ -443,9 +442,24 @@ func TestTriciumReportsClangTidyCrashesGracefully(t *testing.T) { }) } -func withClangTidyTestContext(t *testing.T, work func(ctx *testContext)) { +func withClangTidyTestContextBaseDir(t *testing.T, work func(ctx *testContext)) { withTestContext(t, func(ctx *testContext) { - ctx.env = []string{"WITH_TIDY=1"} + artifactDir := t.TempDir() + ctx.env = []string{"CROS_ARTIFACTS_TMP_DIR=" + artifactDir} + work(ctx) + }) +} + +func withClangTidyTestContext(t *testing.T, work func(ctx *testContext)) { + withClangTidyTestContextBaseDir(t, func(ctx *testContext) { + ctx.env = append(ctx.env, "WITH_TIDY=1") + work(ctx) + }) +} + +func withClangTidyTriciumTestContext(t *testing.T, work func(ctx *testContext)) { + withClangTidyTestContextBaseDir(t, func(ctx *testContext) { + ctx.env = append(ctx.env, "WITH_TIDY=tricium") work(ctx) }) } diff --git a/compiler_wrapper/compiler_wrapper.go b/compiler_wrapper/compiler_wrapper.go index 54e8b38b..2a1ddcb7 100644 --- a/compiler_wrapper/compiler_wrapper.go +++ b/compiler_wrapper/compiler_wrapper.go @@ -111,8 +111,6 @@ func runAndroidClangTidy(env env, cmd *command) error { func callCompilerInternal(env env, cfg *config, inputCmd *command) (exitCode int, err error) { - artifactBaseDir, _ := env.getenv("CROS_ARTIFACTS_TMP_DIR") - if err := checkUnsupportedFlags(inputCmd); err != nil { return 0, err } @@ -166,10 +164,7 @@ func callCompilerInternal(env env, cfg *config, inputCmd *command) (exitCode int var err error switch tidyMode { case tidyModeTricium: - if cfg.triciumNitsDir == "" { - return 0, newErrorwithSourceLocf("tricium linting was requested, but no nits directory is configured") - } - err = runClangTidyForTricium(env, clangCmdWithoutRemoteBuildAndCCache, cSrcFile, cfg.triciumNitsDir, tidyFlags, cfg.crashArtifactsDir) + err = runClangTidyForTricium(env, clangCmdWithoutRemoteBuildAndCCache, cSrcFile, tidyFlags, cfg.crashArtifactsDir) case tidyModeAll: err = runClangTidy(env, clangCmdWithoutRemoteBuildAndCCache, cSrcFile, tidyFlags) default: @@ -188,7 +183,7 @@ func callCompilerInternal(env env, cfg *config, inputCmd *command) (exitCode int allowCCache = false clangCmdWithoutRemoteBuildAndCCache := mainBuilder.build() - err := runIWYU(env, clangCmdWithoutRemoteBuildAndCCache, cSrcFile, iwyuFlags, artifactBaseDir) + err := runIWYU(env, clangCmdWithoutRemoteBuildAndCCache, cSrcFile, iwyuFlags) if err != nil { return 0, err } diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index b1ef943d..86398c7b 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -32,8 +32,6 @@ type config struct { gccRootRelPath string // Directory to store errors that were prevented with -Wno-error. newWarningsDir string - // Directory to store nits in when using `WITH_TIDY=tricium`. - triciumNitsDir string // Directory to store crash artifacts in. crashArtifactsDir string // Version. Only exposed via -print-config. @@ -178,7 +176,6 @@ var crosHardenedConfig = config{ clangPostFlags: crosCommonClangPostFlags(), cppFlags: crosCommonCppFlags(), newWarningsDir: "/tmp/fatal_clang_warnings", - triciumNitsDir: "/tmp/linting_output/clang-tidy", crashArtifactsDir: "/tmp/clang_crash_diagnostics", } @@ -201,7 +198,6 @@ var crosNonHardenedConfig = config{ clangPostFlags: crosCommonClangPostFlags(), cppFlags: crosCommonCppFlags(), newWarningsDir: "/tmp/fatal_clang_warnings", - triciumNitsDir: "/tmp/linting_output/clang-tidy", crashArtifactsDir: "/tmp/clang_crash_diagnostics", } @@ -232,7 +228,6 @@ var crosHostConfig = config{ clangPostFlags: crosCommonClangPostFlags(), cppFlags: crosCommonCppFlags(), newWarningsDir: "/tmp/fatal_clang_warnings", - triciumNitsDir: "/tmp/linting_output/clang-tidy", crashArtifactsDir: "/tmp/clang_crash_diagnostics", } @@ -247,6 +242,5 @@ var androidConfig = config{ clangPostFlags: []string{}, cppFlags: []string{}, newWarningsDir: "", - triciumNitsDir: "", crashArtifactsDir: "", } diff --git a/compiler_wrapper/env.go b/compiler_wrapper/env.go index 6b25d960..393b7276 100644 --- a/compiler_wrapper/env.go +++ b/compiler_wrapper/env.go @@ -171,3 +171,15 @@ func printCmd(env env, cmd *command) { } io.WriteString(env.stderr(), "\n") } + +func getCompilerArtifactsDir(env env) string { + const artifactsTmpDirEnvName = "CROS_ARTIFACTS_TMP_DIR" + const defaultArtifactDir = "/tmp" + value, _ := env.getenv(artifactsTmpDirEnvName) + if value == "" { + fmt.Fprintf(env.stdout(), "$%s is not set, artifacts will be written to %s", artifactsTmpDirEnvName, defaultArtifactDir) + return defaultArtifactDir + } + return value + +} diff --git a/compiler_wrapper/iwyu_flag.go b/compiler_wrapper/iwyu_flag.go index b0de4008..6194bf40 100644 --- a/compiler_wrapper/iwyu_flag.go +++ b/compiler_wrapper/iwyu_flag.go @@ -114,7 +114,7 @@ func calcIWYUInvocation(env env, clangCmd *command, cSrcFile string, iwyuFlags . }, nil } -func runIWYU(env env, clangCmd *command, cSrcFile string, extraIWYUFlags []string, artifactBaseDir string) error { +func runIWYU(env env, clangCmd *command, cSrcFile string, extraIWYUFlags []string) error { extraIWYUFlags = append(extraIWYUFlags, "-Xiwyu", "--mapping_file=/usr/share/include-what-you-use/libcxx.imp", "-Xiwyu", "--no_fwd_decls") iwyuCmd, err := calcIWYUInvocation(env, clangCmd, cSrcFile, extraIWYUFlags...) if err != nil { @@ -136,7 +136,7 @@ func runIWYU(env env, clangCmd *command, cSrcFile string, extraIWYUFlags []strin fmt.Fprintln(env.stderr(), "include-what-you-use failed") } - iwyuDir := filepath.Join(artifactBaseDir, "linting-output", "iwyu") + iwyuDir := filepath.Join(getCompilerArtifactsDir(env), "linting-output", "iwyu") if err := os.MkdirAll(iwyuDir, 0777); err != nil { return fmt.Errorf("creating fixes directory at %q: %v", iwyuDir, err) } diff --git a/compiler_wrapper/testutil_test.go b/compiler_wrapper/testutil_test.go index 463e34ac..407619d1 100644 --- a/compiler_wrapper/testutil_test.go +++ b/compiler_wrapper/testutil_test.go @@ -192,7 +192,6 @@ func (ctx *testContext) mustFail(exitCode int) string { func (ctx *testContext) updateConfig(cfg *config) { *ctx.cfg = *cfg ctx.cfg.newWarningsDir = filepath.Join(ctx.tempDir, "fatal_clang_warnings") - ctx.cfg.triciumNitsDir = filepath.Join(ctx.tempDir, "tricium_nits") ctx.cfg.crashArtifactsDir = filepath.Join(ctx.tempDir, "clang_crash_diagnostics") } -- cgit v1.2.3 From 9e5c82ea7c2e5159dfa7ddfe11d733ffc81db280 Mon Sep 17 00:00:00 2001 From: Denis Nikitin Date: Tue, 13 Dec 2022 09:49:46 -0800 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-4.19 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: I0a9c0e3c8c356767614a4abd085081ae2d410bbc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4102501 Auto-Submit: Denis Nikitin Reviewed-by: Adrian Dole Tested-by: Denis Nikitin Commit-Queue: Adrian Dole --- afdo_metadata/kernel_afdo.json | 8 ++++---- afdo_metadata/kernel_arm_afdo.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index f148ed1e..c8816e6e 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -1,14 +1,14 @@ { "chromeos-kernel-4_14": { - "name": "R110-15231.0-1668422211" + "name": "R110-15263.0-1670841389" }, "chromeos-kernel-4_19": { - "name": "R110-15231.0-1668421958" + "name": "R110-15269.0-1670841194" }, "chromeos-kernel-5_4": { - "name": "R110-15231.0-1668421898" + "name": "R110-15263.0-1670841252" }, "chromeos-kernel-5_10": { - "name": "R110-15231.0-1668421888" + "name": "R110-15269.0-1670841138" } } diff --git a/afdo_metadata/kernel_arm_afdo.json b/afdo_metadata/kernel_arm_afdo.json index 8d990283..bb1a4aff 100644 --- a/afdo_metadata/kernel_arm_afdo.json +++ b/afdo_metadata/kernel_arm_afdo.json @@ -1,5 +1,5 @@ { "chromeos-kernel-5_15": { - "name": "R110-15231.0-1668422117" + "name": "R110-15263.0-1670236325" } } -- cgit v1.2.3 From e46ccc898db2bed7fbc75b27b6af353a10455873 Mon Sep 17 00:00:00 2001 From: Ryan Beltran Date: Thu, 8 Dec 2022 18:30:11 +0000 Subject: compiler wrapper: disable new warning This CL disables the deprecated-builtins warning for LLVM Next since it is causing failures in the LLVM Next roll. BUG=b:261867301 TEST=go test . -updategolden Change-Id: Ic236fa71fdc414d82f663f002329daae5d61175c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4087999 Reviewed-by: Manoj Gupta Commit-Queue: Ryan Beltran Tested-by: Ryan Beltran --- compiler_wrapper/cros_llvm_next_flags.go | 1 + .../testdata/cros_hardened_llvmnext_golden/bisect.json | 3 +++ .../testdata/cros_hardened_llvmnext_golden/clang_path.json | 12 ++++++++++++ .../testdata/cros_hardened_llvmnext_golden/clangtidy.json | 8 ++++++++ .../cros_hardened_llvmnext_golden/force_disable_werror.json | 5 +++++ .../cros_hardened_llvmnext_golden/gcc_clang_syntax.json | 4 ++++ 6 files changed, 33 insertions(+) diff --git a/compiler_wrapper/cros_llvm_next_flags.go b/compiler_wrapper/cros_llvm_next_flags.go index 40b28e42..e1c01561 100644 --- a/compiler_wrapper/cros_llvm_next_flags.go +++ b/compiler_wrapper/cros_llvm_next_flags.go @@ -16,6 +16,7 @@ package main // TODO: Enable test in config_test.go, once we have new llvm-next flags. var llvmNextFlags = []string{ "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", } var llvmNextPostFlags = []string{} diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json index a5f8be70..db5038c2 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json @@ -45,6 +45,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -121,6 +122,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -200,6 +202,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json index c4f050ea..8b01b79b 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json @@ -35,6 +35,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -102,6 +103,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -169,6 +171,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -237,6 +240,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -311,6 +315,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -390,6 +395,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -464,6 +470,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -533,6 +540,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -597,6 +605,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -661,6 +670,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -725,6 +735,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -792,6 +803,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json index 86e8b6b1..961ff159 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json @@ -50,6 +50,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -95,6 +96,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -170,6 +172,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -216,6 +219,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -293,6 +297,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -342,6 +347,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -420,6 +426,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -466,6 +473,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json index afb44b31..139fb55b 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json @@ -38,6 +38,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -105,6 +106,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -158,6 +160,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -229,6 +232,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -282,6 +286,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json index 5cdca94f..80640bf0 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json @@ -35,6 +35,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -124,6 +125,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -208,6 +210,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -275,6 +278,7 @@ "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", + "-Wno-deprecated-builtins", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", -- cgit v1.2.3 From 813ea1a51776bb34ede90ebc3c54a6a2b8c30748 Mon Sep 17 00:00:00 2001 From: Ryan Beltran Date: Tue, 13 Dec 2022 21:23:25 +0000 Subject: compiler_wrapper: add new LLVM flag for LLVM Next This CL adds -Wno-single-bit-bitfield-constant-conversion to the compier wrapper for LLVM Next. This flag exists in LLVM Next, but does not yet exist in LLVM Current. This new warning was causing a breakage when testing the LLVM uprev. BUG=b:262409607 TEST=go test -updategolden TEST=verified flag exists only in llvm next Change-Id: Ia1017529bfe286ae365721acd79c11ca06090fda Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4104561 Reviewed-by: Manoj Gupta Tested-by: Ryan Beltran Commit-Queue: Ryan Beltran --- compiler_wrapper/cros_llvm_next_flags.go | 1 + .../testdata/cros_hardened_llvmnext_golden/bisect.json | 3 +++ .../testdata/cros_hardened_llvmnext_golden/clang_path.json | 12 ++++++++++++ .../testdata/cros_hardened_llvmnext_golden/clangtidy.json | 8 ++++++++ .../cros_hardened_llvmnext_golden/force_disable_werror.json | 5 +++++ .../cros_hardened_llvmnext_golden/gcc_clang_syntax.json | 4 ++++ 6 files changed, 33 insertions(+) diff --git a/compiler_wrapper/cros_llvm_next_flags.go b/compiler_wrapper/cros_llvm_next_flags.go index e1c01561..d25c7c6d 100644 --- a/compiler_wrapper/cros_llvm_next_flags.go +++ b/compiler_wrapper/cros_llvm_next_flags.go @@ -17,6 +17,7 @@ package main var llvmNextFlags = []string{ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", } var llvmNextPostFlags = []string{} diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json index db5038c2..ff9368f5 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json @@ -46,6 +46,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -123,6 +124,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -203,6 +205,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json index 8b01b79b..fc5be426 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json @@ -36,6 +36,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -104,6 +105,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -172,6 +174,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -241,6 +244,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -316,6 +320,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -396,6 +401,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -471,6 +477,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -541,6 +548,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -606,6 +614,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -671,6 +680,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -736,6 +746,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -804,6 +815,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json index 961ff159..73ca1c20 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json @@ -51,6 +51,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -97,6 +98,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -173,6 +175,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -220,6 +223,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -298,6 +302,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -348,6 +353,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -427,6 +433,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -474,6 +481,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json index 139fb55b..903cbab3 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json @@ -39,6 +39,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -107,6 +108,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -161,6 +163,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -233,6 +236,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -287,6 +291,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json index 80640bf0..fbbda29f 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json @@ -36,6 +36,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -126,6 +127,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -211,6 +213,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -279,6 +282,7 @@ "-ftrivial-auto-var-init=zero", "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", + "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", -- cgit v1.2.3 From bc3d4f8e30a78faf09e53c98a8c7b2cbb2ca6a9e Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Wed, 16 Nov 2022 13:16:38 -0700 Subject: werror reports: don't use /tmp in ebuilds We should be writing to CROS_ARTIFACTS_TMP_DIR instead. BUG=b:250041245 TEST=`go test` Change-Id: I9b860274a0152b6c29860daf7c5681d0d7b26b90 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3932870 Commit-Queue: George Burgess Tested-by: George Burgess Reviewed-by: Ryan Beltran --- compiler_wrapper/config.go | 6 +++--- compiler_wrapper/disable_werror_flag.go | 13 +++++++++---- compiler_wrapper/disable_werror_flag_test.go | 17 ++++++++++++----- compiler_wrapper/env.go | 3 ++- .../cros_clang_host_golden/force_disable_werror.json | 3 ++- .../cros_hardened_golden/force_disable_werror.json | 3 ++- .../force_disable_werror.json | 3 ++- .../force_disable_werror.json | 3 ++- .../cros_nonhardened_golden/force_disable_werror.json | 3 ++- compiler_wrapper/testutil_test.go | 4 ++++ 10 files changed, 40 insertions(+), 18 deletions(-) diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index 86398c7b..1e3f1ad8 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -175,7 +175,7 @@ var crosHardenedConfig = config{ ), clangPostFlags: crosCommonClangPostFlags(), cppFlags: crosCommonCppFlags(), - newWarningsDir: "/tmp/fatal_clang_warnings", + newWarningsDir: "fatal_clang_warnings", crashArtifactsDir: "/tmp/clang_crash_diagnostics", } @@ -197,7 +197,7 @@ var crosNonHardenedConfig = config{ ), clangPostFlags: crosCommonClangPostFlags(), cppFlags: crosCommonCppFlags(), - newWarningsDir: "/tmp/fatal_clang_warnings", + newWarningsDir: "fatal_clang_warnings", crashArtifactsDir: "/tmp/clang_crash_diagnostics", } @@ -227,7 +227,7 @@ var crosHostConfig = config{ // Temporarily disable Wdeprecated-copy. b/191479033 clangPostFlags: crosCommonClangPostFlags(), cppFlags: crosCommonCppFlags(), - newWarningsDir: "/tmp/fatal_clang_warnings", + newWarningsDir: "fatal_clang_warnings", crashArtifactsDir: "/tmp/clang_crash_diagnostics", } diff --git a/compiler_wrapper/disable_werror_flag.go b/compiler_wrapper/disable_werror_flag.go index 17077671..91bc5845 100644 --- a/compiler_wrapper/disable_werror_flag.go +++ b/compiler_wrapper/disable_werror_flag.go @@ -18,6 +18,10 @@ import ( const numWErrorEstimate = 30 +func getForceDisableWerrorDir(env env, cfg *config) string { + return path.Join(getCompilerArtifactsDir(env), cfg.newWarningsDir) +} + func shouldForceDisableWerror(env env, cfg *config, ty compilerType) bool { if cfg.isAndroidWrapper { return cfg.useLlvmNext @@ -178,20 +182,21 @@ func doubleBuildWithWNoError(env env, cfg *config, originalCmd *command) (exitCo oldMask := env.umask(0) defer env.umask(oldMask) + warningsDir := getForceDisableWerrorDir(env, cfg) // Allow root and regular users to write to this without issue. - if err := os.MkdirAll(cfg.newWarningsDir, 0777); err != nil { - return 0, wrapErrorwithSourceLocf(err, "error creating warnings directory %s", cfg.newWarningsDir) + if err := os.MkdirAll(warningsDir, 0777); err != nil { + return 0, wrapErrorwithSourceLocf(err, "error creating warnings directory %s", warningsDir) } // Have some tag to show that files aren't fully written. It would be sad if // an interrupted build (or out of disk space, or similar) caused tools to // have to be overly-defensive. - incompleteSuffix := ".incomplete" + const incompleteSuffix = ".incomplete" // Coming up with a consistent name for this is difficult (compiler command's // SHA can clash in the case of identically named files in different // directories, or similar); let's use a random one. - tmpFile, err := ioutil.TempFile(cfg.newWarningsDir, "warnings_report*.json"+incompleteSuffix) + tmpFile, err := ioutil.TempFile(warningsDir, "warnings_report*.json"+incompleteSuffix) if err != nil { return 0, wrapErrorwithSourceLocf(err, "error creating warnings file") } diff --git a/compiler_wrapper/disable_werror_flag_test.go b/compiler_wrapper/disable_werror_flag_test.go index d3be921d..9d3b4aba 100644 --- a/compiler_wrapper/disable_werror_flag_test.go +++ b/compiler_wrapper/disable_werror_flag_test.go @@ -11,6 +11,7 @@ import ( "io" "io/ioutil" "os" + "path" "path/filepath" "strings" "testing" @@ -320,13 +321,18 @@ func withForceDisableWErrorTestContext(t *testing.T, work func(ctx *testContext) withTestContext(t, func(ctx *testContext) { ctx.NoteTestWritesToUmask() - ctx.env = []string{"FORCE_DISABLE_WERROR=1"} + ctx.cfg.newWarningsDir = "new_warnings" + ctx.env = []string{ + "FORCE_DISABLE_WERROR=1", + artifactsTmpDirEnvName + "=" + path.Join(ctx.tempDir, "artifacts"), + } work(ctx) }) } func readLoggedWarnings(ctx *testContext) *warningsJSONData { - files, err := ioutil.ReadDir(ctx.cfg.newWarningsDir) + warningsDir := getForceDisableWerrorDir(ctx, ctx.cfg) + files, err := ioutil.ReadDir(warningsDir) if err != nil { if _, ok := err.(*os.PathError); ok { return nil @@ -336,7 +342,7 @@ func readLoggedWarnings(ctx *testContext) *warningsJSONData { if len(files) != 1 { ctx.t.Fatalf("expected 1 warning log file. Got: %s", files) } - data, err := ioutil.ReadFile(filepath.Join(ctx.cfg.newWarningsDir, files[0].Name())) + data, err := ioutil.ReadFile(filepath.Join(warningsDir, files[0].Name())) if err != nil { ctx.t.Fatal(err) } @@ -373,8 +379,9 @@ func TestDoubleBuildWerrorChmodsThingsAppropriately(t *testing.T) { t.Fatalf("expected 2 calls. Got: %d", ctx.cmdCount) } - t.Logf("Warnings dir is at %q", ctx.cfg.newWarningsDir) - warningsDir, err := os.Open(ctx.cfg.newWarningsDir) + warningsDirPath := getForceDisableWerrorDir(ctx, ctx.cfg) + t.Logf("Warnings dir is at %q", warningsDirPath) + warningsDir, err := os.Open(warningsDirPath) if err != nil { t.Fatalf("failed to open the new warnings dir: %v", err) } diff --git a/compiler_wrapper/env.go b/compiler_wrapper/env.go index 393b7276..2dad6115 100644 --- a/compiler_wrapper/env.go +++ b/compiler_wrapper/env.go @@ -14,6 +14,8 @@ import ( "time" ) +const artifactsTmpDirEnvName = "CROS_ARTIFACTS_TMP_DIR" + type env interface { umask(int) int getenv(key string) (string, bool) @@ -173,7 +175,6 @@ func printCmd(env env, cmd *command) { } func getCompilerArtifactsDir(env env) string { - const artifactsTmpDirEnvName = "CROS_ARTIFACTS_TMP_DIR" const defaultArtifactDir = "/tmp" value, _ := env.getenv(artifactsTmpDirEnvName) if value == "" { diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_clang_host_golden/force_disable_werror.json index 23c74547..d1df5b94 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/force_disable_werror.json @@ -57,7 +57,8 @@ "args": [ "main.cc" ] - } + }, + "stdout": "$CROS_ARTIFACTS_TMP_DIR is not set, artifacts will be written to /tmp" }, "cmds": [ { diff --git a/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json index cc549713..cd976284 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json @@ -76,7 +76,8 @@ "args": [ "main.cc" ] - } + }, + "stdout": "$CROS_ARTIFACTS_TMP_DIR is not set, artifacts will be written to /tmp" }, "cmds": [ { diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json index 903cbab3..a85913e1 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json @@ -79,7 +79,8 @@ "args": [ "main.cc" ] - } + }, + "stdout": "$CROS_ARTIFACTS_TMP_DIR is not set, artifacts will be written to /tmp" }, "cmds": [ { diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json index 794f9c45..f93e53bf 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json @@ -70,7 +70,8 @@ "args": [ "main.cc" ] - } + }, + "stdout": "$CROS_ARTIFACTS_TMP_DIR is not set, artifacts will be written to /tmp" }, "cmds": [ { diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_nonhardened_golden/force_disable_werror.json index f2382391..5c122cdc 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/force_disable_werror.json @@ -68,7 +68,8 @@ "args": [ "main.cc" ] - } + }, + "stdout": "$CROS_ARTIFACTS_TMP_DIR is not set, artifacts will be written to /tmp" }, "cmds": [ { diff --git a/compiler_wrapper/testutil_test.go b/compiler_wrapper/testutil_test.go index 407619d1..74e05a63 100644 --- a/compiler_wrapper/testutil_test.go +++ b/compiler_wrapper/testutil_test.go @@ -193,6 +193,10 @@ func (ctx *testContext) updateConfig(cfg *config) { *ctx.cfg = *cfg ctx.cfg.newWarningsDir = filepath.Join(ctx.tempDir, "fatal_clang_warnings") ctx.cfg.crashArtifactsDir = filepath.Join(ctx.tempDir, "clang_crash_diagnostics") + + // Ensure this is always empty, so any test that depends on it will see no output unless + // it's properly set up. + ctx.cfg.newWarningsDir = "" } func (ctx *testContext) newCommand(path string, args ...string) *command { -- cgit v1.2.3 From 3cd0f8fdbacd63cd4c0b376b022263755a345408 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Fri, 16 Dec 2022 09:20:07 -0700 Subject: presubmits: add USE_PYTHON3 tag Apparently some of the py2 detection being done doesn't account for #!s. Add this line so the tooling realizes this is python3. BUG=chromium:1401441 TEST=None Change-Id: I1931f7518e02a1b2bc401525007b6051e5994269 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4114320 Commit-Queue: George Burgess Reviewed-by: Manoj Gupta Tested-by: George Burgess Commit-Queue: Manoj Gupta Auto-Submit: George Burgess --- toolchain_utils_githooks/check-presubmit.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/toolchain_utils_githooks/check-presubmit.py b/toolchain_utils_githooks/check-presubmit.py index 485737d5..ebbc6c3f 100755 --- a/toolchain_utils_githooks/check-presubmit.py +++ b/toolchain_utils_githooks/check-presubmit.py @@ -23,6 +23,11 @@ import traceback import typing as t +# TODO(crbug.com/1401441): remove this after Feb 2023. It's here so that +# external tooling realizes that this script is Py3. +USE_PYTHON3 = True + + def run_command_unchecked( command: t.List[str], cwd: str, env: t.Dict[str, str] = None ) -> t.Tuple[int, str]: -- cgit v1.2.3 From ba2461524c2f03145a8cc68a2403c328e5faef00 Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Tue, 20 Dec 2022 21:49:23 +0000 Subject: llvm_tools: Escape package category in log file Currently, if using llvm_local_bisection.sh, if the pkg in build_pkg contains a forward slash (like if using an atom with the package category), it will error out complaining the parent directory of the log file won't exist. This isn't intended behaviour, and is a quick fix with a global variable substring substitution. BUG=None TEST=Bisecting media-libs/${internal arc package} Change-Id: Ifa9a7dccaf3091eebc6e0b975ec0f6f7d37a18c2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4116246 Reviewed-by: Ryan Beltran Tested-by: Jordan Abrahams-Whitehead Commit-Queue: Jordan Abrahams-Whitehead --- llvm_tools/llvm_local_bisection.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm_tools/llvm_local_bisection.sh b/llvm_tools/llvm_local_bisection.sh index e319080c..0dde49d7 100755 --- a/llvm_tools/llvm_local_bisection.sh +++ b/llvm_tools/llvm_local_bisection.sh @@ -92,7 +92,7 @@ build_llvm () { build_pkg () { local pkg="${1}" - local logfile="/tmp/build-${pkg}.${CURRENT}.out" + local logfile="/tmp/build-${pkg//\//_}.${CURRENT}.out" log "Writing logs to ${logfile}" log "sudo emerge ${pkg}" logdo sudo emerge "${pkg}" \ -- cgit v1.2.3 From 121fd29eea4154dafcd7f1b171e197dbb188997d Mon Sep 17 00:00:00 2001 From: Ryan Beltran Date: Wed, 14 Dec 2022 18:40:05 +0000 Subject: compiler wrapper: disable -Warray-parameter This CL adds -Wno-array-parameter for LLVM Next in order to disable the new warning temporarily while some packages are still causing problem which block the next uprev. Once those problems are resolved we can reenable the warning. BUG=b:262076232 TEST=go test . -updategolden Change-Id: I95072cb7f6f08726d7758d6095c86f86bc8fa0b6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4122446 Commit-Queue: Ryan Beltran Tested-by: Ryan Beltran Reviewed-by: Manoj Gupta --- compiler_wrapper/cros_llvm_next_flags.go | 1 + .../testdata/cros_hardened_llvmnext_golden/bisect.json | 3 +++ .../testdata/cros_hardened_llvmnext_golden/clang_path.json | 12 ++++++++++++ .../testdata/cros_hardened_llvmnext_golden/clangtidy.json | 8 ++++++++ .../cros_hardened_llvmnext_golden/force_disable_werror.json | 5 +++++ .../cros_hardened_llvmnext_golden/gcc_clang_syntax.json | 4 ++++ 6 files changed, 33 insertions(+) diff --git a/compiler_wrapper/cros_llvm_next_flags.go b/compiler_wrapper/cros_llvm_next_flags.go index d25c7c6d..e972fb41 100644 --- a/compiler_wrapper/cros_llvm_next_flags.go +++ b/compiler_wrapper/cros_llvm_next_flags.go @@ -18,6 +18,7 @@ var llvmNextFlags = []string{ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", } var llvmNextPostFlags = []string{} diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json index ff9368f5..09eb881e 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json @@ -47,6 +47,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -125,6 +126,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -206,6 +208,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json index fc5be426..70004de8 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json @@ -37,6 +37,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -106,6 +107,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -175,6 +177,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -245,6 +248,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -321,6 +325,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -402,6 +407,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -478,6 +484,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -549,6 +556,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -615,6 +623,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -681,6 +690,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -747,6 +757,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -816,6 +827,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json index 73ca1c20..7d590dea 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json @@ -52,6 +52,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -99,6 +100,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -176,6 +178,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -224,6 +227,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -303,6 +307,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -354,6 +359,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -434,6 +440,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -482,6 +489,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json index a85913e1..09391f5f 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json @@ -40,6 +40,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -110,6 +111,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -165,6 +167,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -238,6 +241,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -293,6 +297,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json index fbbda29f..110cade0 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json @@ -37,6 +37,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -128,6 +129,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -214,6 +216,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -283,6 +286,7 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", + "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", -- cgit v1.2.3 From da72f932dc86f7050b62122c34cce123edcd836d Mon Sep 17 00:00:00 2001 From: Ryan Beltran Date: Thu, 22 Dec 2022 19:55:50 +0000 Subject: compiler_wrapper: temporarily reenable removed c++ features This CL adds -D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES in the compiler wrapper to reenable some removed C++ features for C++17. This should be removed once we can get rid of all offending usages but is necessary for now to unblock the next LLVM uprev. BUG=b:263380440 TEST=go test . -update golden TEST=CQ in the associated llvm CL TEST=Verified works as intended in a repro with Compiler Explorer Change-Id: I5ab45867432eef672aef8202667bc5ede39b86a6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4122447 Reviewed-by: Manoj Gupta Commit-Queue: Ryan Beltran Tested-by: Ryan Beltran --- compiler_wrapper/config.go | 1 + compiler_wrapper/testdata/cros_clang_host_golden/bisect.json | 3 +++ .../clang_ftrapv_maincc_target_specific.json | 9 +++++++++ .../testdata/cros_clang_host_golden/clang_host_wrapper.json | 1 + .../cros_clang_host_golden/clang_maincc_target_specific.json | 9 +++++++++ .../testdata/cros_clang_host_golden/clang_path.json | 12 ++++++++++++ .../cros_clang_host_golden/clang_sanitizer_args.json | 8 ++++++++ .../testdata/cros_clang_host_golden/clang_specific_args.json | 4 ++++ .../testdata/cros_clang_host_golden/clangtidy.json | 8 ++++++++ .../cros_clang_host_golden/force_disable_werror.json | 5 +++++ compiler_wrapper/testdata/cros_hardened_golden/bisect.json | 3 +++ .../clang_ftrapv_maincc_target_specific.json | 9 +++++++++ .../cros_hardened_golden/clang_maincc_target_specific.json | 9 +++++++++ .../testdata/cros_hardened_golden/clang_path.json | 12 ++++++++++++ .../testdata/cros_hardened_golden/clang_sanitizer_args.json | 8 ++++++++ .../testdata/cros_hardened_golden/clang_specific_args.json | 4 ++++ .../cros_hardened_golden/clang_sysroot_wrapper_common.json | 6 ++++++ .../testdata/cros_hardened_golden/clangtidy.json | 8 ++++++++ .../testdata/cros_hardened_golden/force_disable_werror.json | 5 +++++ .../testdata/cros_hardened_golden/gcc_clang_syntax.json | 4 ++++ .../testdata/cros_hardened_llvmnext_golden/bisect.json | 3 +++ .../testdata/cros_hardened_llvmnext_golden/clang_path.json | 12 ++++++++++++ .../testdata/cros_hardened_llvmnext_golden/clangtidy.json | 8 ++++++++ .../cros_hardened_llvmnext_golden/force_disable_werror.json | 5 +++++ .../cros_hardened_llvmnext_golden/gcc_clang_syntax.json | 4 ++++ .../testdata/cros_hardened_noccache_golden/bisect.json | 3 +++ .../testdata/cros_hardened_noccache_golden/clang_path.json | 12 ++++++++++++ .../testdata/cros_hardened_noccache_golden/clangtidy.json | 8 ++++++++ .../cros_hardened_noccache_golden/force_disable_werror.json | 5 +++++ .../cros_hardened_noccache_golden/gcc_clang_syntax.json | 4 ++++ .../testdata/cros_nonhardened_golden/bisect.json | 3 +++ .../clang_ftrapv_maincc_target_specific.json | 9 +++++++++ .../clang_maincc_target_specific.json | 9 +++++++++ .../testdata/cros_nonhardened_golden/clang_path.json | 12 ++++++++++++ .../cros_nonhardened_golden/clang_sanitizer_args.json | 8 ++++++++ .../cros_nonhardened_golden/clang_specific_args.json | 4 ++++ .../clang_sysroot_wrapper_common.json | 6 ++++++ .../testdata/cros_nonhardened_golden/clangtidy.json | 8 ++++++++ .../cros_nonhardened_golden/force_disable_werror.json | 5 +++++ .../testdata/cros_nonhardened_golden/gcc_clang_syntax.json | 4 ++++ 40 files changed, 260 insertions(+) diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index 1e3f1ad8..871a12b0 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -123,6 +123,7 @@ func crosCommonClangFlags() []string { "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", } } diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/bisect.json b/compiler_wrapper/testdata/cros_clang_host_golden/bisect.json index 22e069a7..96e319ad 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/bisect.json @@ -37,6 +37,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -95,6 +96,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -156,6 +158,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_ftrapv_maincc_target_specific.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_ftrapv_maincc_target_specific.json index 68849607..58a3c9fd 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_ftrapv_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_ftrapv_maincc_target_specific.json @@ -28,6 +28,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -73,6 +74,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -118,6 +120,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -163,6 +166,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -208,6 +212,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -253,6 +258,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -298,6 +304,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -343,6 +350,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -388,6 +396,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_host_wrapper.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_host_wrapper.json index 336287d1..02cc09c1 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_host_wrapper.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_host_wrapper.json @@ -27,6 +27,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_maincc_target_specific.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_maincc_target_specific.json index 6d3dbb49..d4f9192c 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_maincc_target_specific.json @@ -27,6 +27,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -71,6 +72,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -115,6 +117,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -159,6 +162,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -203,6 +207,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -247,6 +252,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -291,6 +297,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -335,6 +342,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -379,6 +387,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_path.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_path.json index 61c22d66..72e05db9 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_path.json @@ -27,6 +27,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -74,6 +75,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -121,6 +123,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -169,6 +172,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -223,6 +227,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -282,6 +287,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -341,6 +347,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -390,6 +397,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -434,6 +442,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -478,6 +487,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -522,6 +532,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -569,6 +580,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_sanitizer_args.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_sanitizer_args.json index b93760d7..99d21df3 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_sanitizer_args.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_sanitizer_args.json @@ -29,6 +29,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -76,6 +77,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -123,6 +125,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -170,6 +173,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -216,6 +220,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -263,6 +268,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -310,6 +316,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -356,6 +363,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_specific_args.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_specific_args.json index 9a258e90..900390dc 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_specific_args.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_specific_args.json @@ -37,6 +37,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -90,6 +91,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -136,6 +138,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -182,6 +185,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clangtidy.json b/compiler_wrapper/testdata/cros_clang_host_golden/clangtidy.json index d8ee6986..8c6f17a6 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clangtidy.json @@ -43,6 +43,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -74,6 +75,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -135,6 +137,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -166,6 +169,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -229,6 +233,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -263,6 +268,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -327,6 +333,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -358,6 +365,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_clang_host_golden/force_disable_werror.json index d1df5b94..cbb42de8 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/force_disable_werror.json @@ -30,6 +30,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -78,6 +79,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -111,6 +113,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -162,6 +165,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", @@ -195,6 +199,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-unused-local-typedefs", "-fno-addrsig", "-fuse-ld=lld", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_golden/bisect.json index d61b4dd7..e01a3b4e 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/bisect.json @@ -39,6 +39,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -114,6 +115,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -192,6 +194,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json index e9dc50a1..3c3e6a14 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json @@ -30,6 +30,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -95,6 +96,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -160,6 +162,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -225,6 +228,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -289,6 +293,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -353,6 +358,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -417,6 +423,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -481,6 +488,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -545,6 +553,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json index 8d350035..0242636a 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json @@ -29,6 +29,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -92,6 +93,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -155,6 +157,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -218,6 +221,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -280,6 +284,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -342,6 +347,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -404,6 +410,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -466,6 +473,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -528,6 +536,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json index c8d425e9..75722471 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json @@ -29,6 +29,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -95,6 +96,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -161,6 +163,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -228,6 +231,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -301,6 +305,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -379,6 +384,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -452,6 +458,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -520,6 +527,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -583,6 +591,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -646,6 +655,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -709,6 +719,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -775,6 +786,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json index c56f4d96..d3a3cf2e 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json @@ -31,6 +31,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -96,6 +97,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -161,6 +163,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -226,6 +229,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -290,6 +294,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -355,6 +360,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -420,6 +426,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -484,6 +491,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json index c75ff45b..3463f688 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json @@ -39,6 +39,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -111,6 +112,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -176,6 +178,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -241,6 +244,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json index 1babba3d..3830a750 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json @@ -65,6 +65,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -131,6 +132,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -190,6 +192,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -255,6 +258,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -320,6 +324,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -383,6 +388,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json index 09f2683d..685d8218 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json @@ -44,6 +44,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -88,6 +89,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -162,6 +164,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -207,6 +210,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -283,6 +287,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -331,6 +336,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -408,6 +414,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -453,6 +460,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json index cd976284..c168124d 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json @@ -32,6 +32,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -99,6 +100,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -151,6 +153,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -221,6 +224,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -273,6 +277,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json index 0e98f493..3e4f02cb 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json @@ -29,6 +29,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -117,6 +118,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -200,6 +202,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -266,6 +269,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json index 09eb881e..c5a5998d 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json @@ -39,6 +39,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -118,6 +119,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -200,6 +202,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json index 70004de8..ed97bb59 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json @@ -29,6 +29,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -99,6 +100,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -169,6 +171,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -240,6 +243,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -317,6 +321,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -399,6 +404,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -476,6 +482,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -548,6 +555,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -615,6 +623,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -682,6 +691,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -749,6 +759,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -819,6 +830,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json index 7d590dea..d6a2b8b2 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json @@ -44,6 +44,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -92,6 +93,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -170,6 +172,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -219,6 +222,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -299,6 +303,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -351,6 +356,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -432,6 +438,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -481,6 +488,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json index 09391f5f..025e7d23 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json @@ -32,6 +32,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -103,6 +104,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -159,6 +161,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -233,6 +236,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -289,6 +293,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json index 110cade0..bde71e4b 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json @@ -29,6 +29,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -121,6 +122,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -208,6 +210,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -278,6 +281,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json index 3523e8a3..6502532f 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json @@ -38,6 +38,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -109,6 +110,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -183,6 +185,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json index b123363b..a7c8db67 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json @@ -28,6 +28,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -88,6 +89,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -148,6 +150,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -209,6 +212,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -276,6 +280,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -349,6 +354,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -421,6 +427,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -483,6 +490,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -540,6 +548,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -597,6 +606,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -654,6 +664,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -714,6 +725,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json index 09f2683d..685d8218 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json @@ -44,6 +44,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -88,6 +89,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -162,6 +164,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -207,6 +210,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -283,6 +287,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -331,6 +336,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -408,6 +414,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -453,6 +460,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json index f93e53bf..26fa8a69 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json @@ -31,6 +31,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -92,6 +93,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -138,6 +140,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -202,6 +205,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -248,6 +252,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json index e29c6201..90c03c70 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json @@ -29,6 +29,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -112,6 +113,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -195,6 +197,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", @@ -261,6 +264,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "--unwindlib=libunwind", "-Wno-section", "-fno-addrsig", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/bisect.json b/compiler_wrapper/testdata/cros_nonhardened_golden/bisect.json index c4c362b5..e1c638c9 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/bisect.json @@ -39,6 +39,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -106,6 +107,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -176,6 +178,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_ftrapv_maincc_target_specific.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_ftrapv_maincc_target_specific.json index 7800d682..65b9fab8 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_ftrapv_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_ftrapv_maincc_target_specific.json @@ -30,6 +30,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -87,6 +88,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -144,6 +146,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -201,6 +204,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -258,6 +262,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -314,6 +319,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -371,6 +377,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -428,6 +435,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -484,6 +492,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_maincc_target_specific.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_maincc_target_specific.json index c05180ad..e715c251 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_maincc_target_specific.json @@ -29,6 +29,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -84,6 +85,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -139,6 +141,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -194,6 +197,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -249,6 +253,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -303,6 +308,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -358,6 +364,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -413,6 +420,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -467,6 +475,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_path.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_path.json index 8e193805..19f2e90d 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_path.json @@ -29,6 +29,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -87,6 +88,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -145,6 +147,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -204,6 +207,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -269,6 +273,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -339,6 +344,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -404,6 +410,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -464,6 +471,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -519,6 +527,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -574,6 +583,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -629,6 +639,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -687,6 +698,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sanitizer_args.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sanitizer_args.json index a4d5d696..2cd603e9 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sanitizer_args.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sanitizer_args.json @@ -31,6 +31,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -89,6 +90,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -147,6 +149,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -205,6 +208,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -262,6 +266,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -320,6 +325,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -378,6 +384,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -435,6 +442,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_specific_args.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_specific_args.json index 4ab48d3f..3d60fd21 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_specific_args.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_specific_args.json @@ -39,6 +39,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -103,6 +104,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -160,6 +162,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -217,6 +220,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sysroot_wrapper_common.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sysroot_wrapper_common.json index d79afe07..c15e623f 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sysroot_wrapper_common.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sysroot_wrapper_common.json @@ -62,6 +62,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -120,6 +121,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -171,6 +173,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -228,6 +231,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -286,6 +290,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -343,6 +348,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clangtidy.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clangtidy.json index ef4a1d83..248ee07b 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clangtidy.json @@ -44,6 +44,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -80,6 +81,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -146,6 +148,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -183,6 +186,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -251,6 +255,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -291,6 +296,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -360,6 +366,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -397,6 +404,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_nonhardened_golden/force_disable_werror.json index 5c122cdc..4ff09857 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/force_disable_werror.json @@ -32,6 +32,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -91,6 +92,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -135,6 +137,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -197,6 +200,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -241,6 +245,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_nonhardened_golden/gcc_clang_syntax.json index 77fa3b12..3cda7403 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/gcc_clang_syntax.json @@ -29,6 +29,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -106,6 +107,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -178,6 +180,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", @@ -236,6 +239,7 @@ "-fdebug-default-version=5", "-Wno-int-conversion", "-Wno-incompatible-function-pointer-types", + "-D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES", "-Wno-section", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-static-libgcc", -- cgit v1.2.3 From 6e806d249bc8dacb4ce883066d8f381e23297f80 Mon Sep 17 00:00:00 2001 From: Ryan Beltran Date: Thu, 29 Dec 2022 16:29:37 +0000 Subject: compiler wrapper: Move array param to post flags This CL moves -Wno-array-parameter for LLVM Next from llvmNextFlags to llvmNextPostFlags since there are some instances of -Wall causing issues. BUG=b:262076232 TEST=go test . -updategolden Change-Id: I90f6110b6ec91a7833c305957885bb908656a751 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4128689 Reviewed-by: Manoj Gupta Tested-by: Ryan Beltran Commit-Queue: Ryan Beltran --- compiler_wrapper/cros_llvm_next_flags.go | 5 +++-- .../cros_hardened_llvmnext_golden/bisect.json | 6 +++--- .../cros_hardened_llvmnext_golden/clang_path.json | 24 +++++++++++----------- .../cros_hardened_llvmnext_golden/clangtidy.json | 16 +++++++-------- .../force_disable_werror.json | 10 ++++----- .../gcc_clang_syntax.json | 8 ++++---- 6 files changed, 35 insertions(+), 34 deletions(-) diff --git a/compiler_wrapper/cros_llvm_next_flags.go b/compiler_wrapper/cros_llvm_next_flags.go index e972fb41..c0f85fb7 100644 --- a/compiler_wrapper/cros_llvm_next_flags.go +++ b/compiler_wrapper/cros_llvm_next_flags.go @@ -18,7 +18,8 @@ var llvmNextFlags = []string{ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", } -var llvmNextPostFlags = []string{} +var llvmNextPostFlags = []string{ + "-Wno-array-parameter", +} diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json index c5a5998d..e1a4817b 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json @@ -48,7 +48,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -63,6 +62,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -128,7 +128,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -143,6 +142,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -211,7 +211,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -226,6 +225,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json index ed97bb59..3faaacb8 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json @@ -38,7 +38,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -53,6 +52,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -109,7 +109,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -124,6 +123,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -180,7 +180,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -196,6 +195,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -252,7 +252,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -267,6 +266,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -330,7 +330,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -347,6 +346,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -413,7 +413,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -430,6 +429,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -491,7 +491,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -508,6 +507,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -564,7 +564,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -579,6 +578,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -632,7 +632,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -647,6 +646,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-Ba/b/c/d/e/bin", "-target", @@ -700,7 +700,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -715,6 +714,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-Ba/b/c/d/e/bin", "-target", @@ -768,7 +768,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -783,6 +782,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../bin", "-target", @@ -839,7 +839,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -854,6 +853,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json index d6a2b8b2..36de9ec6 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json @@ -53,7 +53,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -68,6 +67,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -102,7 +102,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -117,6 +116,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -181,7 +181,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -196,6 +195,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -231,7 +231,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -246,6 +245,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -312,7 +312,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -327,6 +326,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -365,7 +365,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -380,6 +379,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -447,7 +447,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -462,6 +461,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -497,7 +497,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -512,6 +511,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json index 025e7d23..8aff0962 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json @@ -41,7 +41,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -56,6 +55,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -113,7 +113,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -128,6 +127,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -170,7 +170,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -185,6 +184,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -245,7 +245,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -260,6 +259,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -302,7 +302,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -317,6 +316,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json index bde71e4b..a3c2b0ed 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json @@ -38,7 +38,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -53,6 +52,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -131,7 +131,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -146,6 +145,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -219,7 +219,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -234,6 +233,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -290,7 +290,6 @@ "-Wno-enum-constexpr-conversion", "-Wno-deprecated-builtins", "-Wno-single-bit-bitfield-constant-conversion", - "-Wno-array-parameter", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -305,6 +304,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", -- cgit v1.2.3 From 2a80a099721588eb7225135a7a3989b66bbdc5b7 Mon Sep 17 00:00:00 2001 From: Manoj Gupta Date: Thu, 29 Dec 2022 23:08:04 +0000 Subject: compiler_wrapper: Filter "-z,defs" from linker thoroughly Remove "-z,defs" from linker options even when it is part of a longer "-Wl,bar,-z,defs,foo". BUG=b:261897667 TEST=libsepol and libselinux build Change-Id: I993e3efada14dbff653894fc36af168a9cc372b1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4129877 Reviewed-by: Ryan Beltran Auto-Submit: Manoj Gupta Commit-Queue: Ryan Beltran Tested-by: Manoj Gupta --- compiler_wrapper/sanitizer_flags.go | 10 +++++++--- compiler_wrapper/sanitizer_flags_test.go | 6 ++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/compiler_wrapper/sanitizer_flags.go b/compiler_wrapper/sanitizer_flags.go index 58312cc4..3bf4434f 100644 --- a/compiler_wrapper/sanitizer_flags.go +++ b/compiler_wrapper/sanitizer_flags.go @@ -73,9 +73,13 @@ func processSanitizerFlags(builder *commandBuilder) { builder.transformArgs(func(arg builderArg) string { // TODO: This is a bug in the old wrapper to not filter // non user args for gcc. Fix this once we don't compare to the old wrapper anymore. - if (builder.target.compilerType != gccType || arg.fromUser) && - unsupportedSanitizerFlags[arg.value] { - return "" + linkerDefinedFlag := ",-z,defs" + if builder.target.compilerType != gccType || arg.fromUser { + if unsupportedSanitizerFlags[arg.value] { + return "" + } else if strings.Contains(arg.value, linkerDefinedFlag) { + return strings.ReplaceAll(arg.value, linkerDefinedFlag, "") + } } return arg.value }) diff --git a/compiler_wrapper/sanitizer_flags_test.go b/compiler_wrapper/sanitizer_flags_test.go index b4b1fd83..8fb3e9f4 100644 --- a/compiler_wrapper/sanitizer_flags_test.go +++ b/compiler_wrapper/sanitizer_flags_test.go @@ -44,6 +44,12 @@ func TestFilterUnsupportedSanitizerFlagsIfSanitizeGiven(t *testing.T) { t.Error(err) } + cmd = ctx.must(callCompiler(ctx, ctx.cfg, + ctx.newCommand(gccX86_64, "-fsanitize=kernel-address", "-Wl,-z,defs,relro", mainCc))) + if err := verifyArgCount(cmd, 1, "-Wl,relro"); err != nil { + t.Error(err) + } + cmd = ctx.must(callCompiler(ctx, ctx.cfg, ctx.newCommand(gccX86_64, "-fsanitize=kernel-address", "-Wl,-z -Wl,defs", mainCc))) if err := verifyArgCount(cmd, 0, "-Wl,-z"); err != nil { -- cgit v1.2.3 From 78bb46800e1f97c826ff7571e6c958e785a424ef Mon Sep 17 00:00:00 2001 From: Manoj Gupta Date: Tue, 3 Jan 2023 18:18:27 +0000 Subject: compiler_wrapper: Filter -Xcompiler from clang Upstream has started warning on use of -Xcompiler. Since some ChromeOS builds are using it, ignore this flag in the compiler wrapper. BUG=b:262763787 TEST=go test Change-Id: I3a092e2da5768b20d4427f8dda07a6a35e14c54c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4131128 Commit-Queue: Manoj Gupta Auto-Submit: Manoj Gupta Reviewed-by: Ryan Beltran Tested-by: Manoj Gupta Commit-Queue: Ryan Beltran --- compiler_wrapper/clang_flags.go | 7 ++----- compiler_wrapper/clang_flags_test.go | 10 ++++++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/compiler_wrapper/clang_flags.go b/compiler_wrapper/clang_flags.go index e12f1a0a..11f248db 100644 --- a/compiler_wrapper/clang_flags.go +++ b/compiler_wrapper/clang_flags.go @@ -53,13 +53,10 @@ func processClangFlags(builder *commandBuilder) error { } } - // GCC flags to remove from the clang command line. - // TODO: Once clang supports GCC compatibility mode, remove - // these checks. - // + // Unsupported flags to remove from the clang command line. // Use of -Qunused-arguments allows this set to be small, just those // that clang still warns about. - unsupported := make(map[string]bool) + unsupported := map[string]bool{"-Xcompiler": true} unsupportedPrefixes := []string{"-Wstrict-aliasing=", "-finline-limit="} diff --git a/compiler_wrapper/clang_flags_test.go b/compiler_wrapper/clang_flags_test.go index 029594dd..fccef25e 100644 --- a/compiler_wrapper/clang_flags_test.go +++ b/compiler_wrapper/clang_flags_test.go @@ -340,3 +340,13 @@ func TestClangLinkerPathRelativeToRootDir(t *testing.T) { } }) } + +func TestFilterUnsupportedFlags(t *testing.T) { + withTestContext(t, func(ctx *testContext) { + cmd := ctx.must(callCompiler(ctx, ctx.cfg, + ctx.newCommand(clangX86_64, "-Xcompiler", mainCc))) + if err := verifyArgCount(cmd, 0, "-Xcompiler"); err != nil { + t.Error(err) + } + }) +} -- cgit v1.2.3 From 502da18e85e66a955c9f82ce3f33ff1722236665 Mon Sep 17 00:00:00 2001 From: Ryan Beltran Date: Thu, 5 Jan 2023 20:37:30 +0000 Subject: compiler_wrapper: ignore -avoid-version clang flag This CL causes the compiler wrapper to filter out -avoid-version which was ignored in clang 15 but causes errors on clang-16. BUG=b:264563512 TEST=go test Change-Id: Icab3f235dcf48073592fef9d3c9a24e4fb328560 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4133840 Reviewed-by: Manoj Gupta Commit-Queue: Ryan Beltran Tested-by: Ryan Beltran --- compiler_wrapper/clang_flags.go | 5 ++++- compiler_wrapper/clang_flags_test.go | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/compiler_wrapper/clang_flags.go b/compiler_wrapper/clang_flags.go index 11f248db..a38e597a 100644 --- a/compiler_wrapper/clang_flags.go +++ b/compiler_wrapper/clang_flags.go @@ -56,7 +56,10 @@ func processClangFlags(builder *commandBuilder) error { // Unsupported flags to remove from the clang command line. // Use of -Qunused-arguments allows this set to be small, just those // that clang still warns about. - unsupported := map[string]bool{"-Xcompiler": true} + unsupported := map[string]bool{ + "-Xcompiler": true, + "-avoid-version": true, + } unsupportedPrefixes := []string{"-Wstrict-aliasing=", "-finline-limit="} diff --git a/compiler_wrapper/clang_flags_test.go b/compiler_wrapper/clang_flags_test.go index fccef25e..8b3f5a24 100644 --- a/compiler_wrapper/clang_flags_test.go +++ b/compiler_wrapper/clang_flags_test.go @@ -348,5 +348,10 @@ func TestFilterUnsupportedFlags(t *testing.T) { if err := verifyArgCount(cmd, 0, "-Xcompiler"); err != nil { t.Error(err) } + cmd = ctx.must(callCompiler(ctx, ctx.cfg, + ctx.newCommand(clangX86_64, "-avoid-version", mainCc))) + if err := verifyArgCount(cmd, 0, "-avoid-version"); err != nil { + t.Error(err) + } }) } -- cgit v1.2.3 From 4b619ca37a35ed9e7c8fd6ffc349c3a6431db727 Mon Sep 17 00:00:00 2001 From: Denis Nikitin Date: Thu, 5 Jan 2023 21:18:51 -0800 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-4.19 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: I3378f6711bba3b37429432f3c8264f76784f22ce Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4141818 Commit-Queue: Manoj Gupta Auto-Submit: Denis Nikitin Tested-by: Denis Nikitin Reviewed-by: Manoj Gupta --- afdo_metadata/kernel_afdo.json | 8 ++++---- afdo_metadata/kernel_arm_afdo.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index c8816e6e..32167be8 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -1,14 +1,14 @@ { "chromeos-kernel-4_14": { - "name": "R110-15263.0-1670841389" + "name": "R111-15278.0-1672655615" }, "chromeos-kernel-4_19": { - "name": "R110-15269.0-1670841194" + "name": "R111-15278.0-1672655497" }, "chromeos-kernel-5_4": { - "name": "R110-15263.0-1670841252" + "name": "R111-15278.0-1672655559" }, "chromeos-kernel-5_10": { - "name": "R110-15269.0-1670841138" + "name": "R111-15278.0-1672655622" } } diff --git a/afdo_metadata/kernel_arm_afdo.json b/afdo_metadata/kernel_arm_afdo.json index bb1a4aff..da21f408 100644 --- a/afdo_metadata/kernel_arm_afdo.json +++ b/afdo_metadata/kernel_arm_afdo.json @@ -1,5 +1,5 @@ { "chromeos-kernel-5_15": { - "name": "R110-15263.0-1670236325" + "name": "R111-15278.0-1672655867" } } -- cgit v1.2.3 From 0342e4b17dc721eb5d9fabfcf68f5da27f2b83e1 Mon Sep 17 00:00:00 2001 From: Ryan Beltran Date: Fri, 6 Jan 2023 01:49:39 +0000 Subject: llvm_tools: git add manifest changes to upload CL This CL modifies the update_manifest command to call git add for the generated changes. BUG=b:264602006 TEST=generated crrev.com/c/4140252 TEST=ran new unit tests Change-Id: I1e463223a5712d732518900a70e58fceafc47591 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4140878 Reviewed-by: Denis Nikitin Commit-Queue: Ryan Beltran Tested-by: Ryan Beltran --- llvm_tools/update_chromeos_llvm_hash.py | 4 +++ llvm_tools/update_chromeos_llvm_hash_unittest.py | 34 +++++++++++++++++------- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/llvm_tools/update_chromeos_llvm_hash.py b/llvm_tools/update_chromeos_llvm_hash.py index cf7ae473..db443baa 100755 --- a/llvm_tools/update_chromeos_llvm_hash.py +++ b/llvm_tools/update_chromeos_llvm_hash.py @@ -518,9 +518,13 @@ def UpdateManifests(packages: Iterable[str], chroot_path: Path): """ manifest_ebuilds = chroot.GetChrootEbuildPaths(chroot_path, packages) for ebuild_path in manifest_ebuilds: + ebuild_dir = os.path.dirname(ebuild_path) subprocess_helpers.ChrootRunCommand( chroot_path, ["ebuild", ebuild_path, "manifest"] ) + subprocess_helpers.ChrootRunCommand( + chroot_path, ["git", "-C", ebuild_dir, "add", "Manifest"] + ) def UpdatePackages( diff --git a/llvm_tools/update_chromeos_llvm_hash_unittest.py b/llvm_tools/update_chromeos_llvm_hash_unittest.py index f7f62470..91fc645d 100755 --- a/llvm_tools/update_chromeos_llvm_hash_unittest.py +++ b/llvm_tools/update_chromeos_llvm_hash_unittest.py @@ -378,15 +378,31 @@ class UpdateLLVMHashTest(unittest.TestCase): manifest_packages, chroot_path ) - args = mock_subprocess.call_args[0][-1] - manifest_cmd = [ - "cros_sdk", - "--", - "ebuild", - "/chroot/path/test.ebuild", - "manifest", - ] - self.assertEqual(args, manifest_cmd) + args = mock_subprocess.call_args_list[0] + manifest_cmd = ( + [ + "cros_sdk", + "--", + "ebuild", + "/chroot/path/test.ebuild", + "manifest", + ], + ) + self.assertEqual(args[0], manifest_cmd) + + args = mock_subprocess.call_args_list[1] + git_add_cmd = ( + [ + "cros_sdk", + "--", + "git", + "-C", + "/chroot/path", + "add", + "Manifest", + ], + ) + self.assertEqual(args[0], git_add_cmd) mock_ebuild_paths.assert_called_once() @mock.patch.object(get_llvm_hash, "GetLLVMMajorVersion") -- cgit v1.2.3 From b2253a55922c18aae9ab2e61433711e8f57cbcd2 Mon Sep 17 00:00:00 2001 From: Ryan Beltran Date: Tue, 3 Jan 2023 20:00:06 +0000 Subject: compiler wrapper: Move LLVM Next Flags to Current When we land the llvm uprev we will need to move these flags over to the current LLVM flags. BUG=b:254289728 TEST=go test Cq-Depend: chromium:4133805 Change-Id: I6a20b3695983be194e2ccddc3d35e80f052e87bc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4133825 Commit-Queue: Ryan Beltran Reviewed-by: Manoj Gupta Tested-by: Ryan Beltran --- compiler_wrapper/config.go | 5 ++ compiler_wrapper/cros_llvm_next_flags.go | 10 +-- .../testdata/cros_clang_host_golden/bisect.json | 12 +++ .../clang_ftrapv_maincc_target_specific.json | 36 ++++++++ .../cros_clang_host_golden/clang_host_wrapper.json | 4 + .../clang_maincc_target_specific.json | 36 ++++++++ .../cros_clang_host_golden/clang_path.json | 48 +++++++++++ .../clang_sanitizer_args.json | 32 ++++++++ .../clang_specific_args.json | 16 ++++ .../testdata/cros_clang_host_golden/clangtidy.json | 32 ++++++++ .../force_disable_werror.json | 20 +++++ .../testdata/cros_hardened_golden/bisect.json | 12 +++ .../clang_ftrapv_maincc_target_specific.json | 36 ++++++++ .../clang_maincc_target_specific.json | 36 ++++++++ .../testdata/cros_hardened_golden/clang_path.json | 48 +++++++++++ .../cros_hardened_golden/clang_sanitizer_args.json | 32 ++++++++ .../cros_hardened_golden/clang_specific_args.json | 16 ++++ .../clang_sysroot_wrapper_common.json | 24 ++++++ .../testdata/cros_hardened_golden/clangtidy.json | 32 ++++++++ .../cros_hardened_golden/force_disable_werror.json | 20 +++++ .../cros_hardened_golden/gcc_clang_syntax.json | 16 ++++ .../cros_hardened_llvmnext_golden/bisect.json | 24 +++--- .../cros_hardened_llvmnext_golden/clang_path.json | 96 +++++++++++----------- .../cros_hardened_llvmnext_golden/clangtidy.json | 64 +++++++-------- .../force_disable_werror.json | 40 ++++----- .../gcc_clang_syntax.json | 32 ++++---- .../cros_hardened_noccache_golden/bisect.json | 12 +++ .../cros_hardened_noccache_golden/clang_path.json | 48 +++++++++++ .../cros_hardened_noccache_golden/clangtidy.json | 32 ++++++++ .../force_disable_werror.json | 20 +++++ .../gcc_clang_syntax.json | 16 ++++ .../testdata/cros_nonhardened_golden/bisect.json | 12 +++ .../clang_ftrapv_maincc_target_specific.json | 36 ++++++++ .../clang_maincc_target_specific.json | 36 ++++++++ .../cros_nonhardened_golden/clang_path.json | 48 +++++++++++ .../clang_sanitizer_args.json | 32 ++++++++ .../clang_specific_args.json | 16 ++++ .../clang_sysroot_wrapper_common.json | 24 ++++++ .../cros_nonhardened_golden/clangtidy.json | 32 ++++++++ .../force_disable_werror.json | 20 +++++ .../cros_nonhardened_golden/gcc_clang_syntax.json | 16 ++++ 41 files changed, 1043 insertions(+), 136 deletions(-) diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index 871a12b0..d5f24c1f 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -113,10 +113,13 @@ func crosCommonClangFlags() []string { "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -135,7 +138,9 @@ func crosCommonCppFlags() []string { func crosCommonClangPostFlags() []string { // Temporarily disable Wdeprecated-copy. b/191479033 + // Temporarily disabled Wno-array-parameter. b/262076232 return []string{ + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/cros_llvm_next_flags.go b/compiler_wrapper/cros_llvm_next_flags.go index c0f85fb7..4b21ad3d 100644 --- a/compiler_wrapper/cros_llvm_next_flags.go +++ b/compiler_wrapper/cros_llvm_next_flags.go @@ -14,12 +14,6 @@ package main // tag is set. // TODO: Enable test in config_test.go, once we have new llvm-next flags. -var llvmNextFlags = []string{ - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", -} +var llvmNextFlags = []string{} -var llvmNextPostFlags = []string{ - "-Wno-array-parameter", -} +var llvmNextPostFlags = []string{} diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/bisect.json b/compiler_wrapper/testdata/cros_clang_host_golden/bisect.json index 96e319ad..0fd109c1 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/bisect.json @@ -27,10 +27,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -44,6 +47,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -86,10 +90,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -103,6 +110,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -148,10 +156,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -165,6 +176,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_ftrapv_maincc_target_specific.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_ftrapv_maincc_target_specific.json index 58a3c9fd..a713330f 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_ftrapv_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_ftrapv_maincc_target_specific.json @@ -18,10 +18,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -35,6 +38,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -64,10 +68,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -81,6 +88,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -110,10 +118,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -127,6 +138,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -156,10 +168,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -173,6 +188,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -202,10 +218,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -219,6 +238,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -248,10 +268,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -265,6 +288,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -294,10 +318,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -311,6 +338,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -340,10 +368,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -357,6 +388,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -386,10 +418,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -403,6 +438,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_host_wrapper.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_host_wrapper.json index 02cc09c1..50eafc5e 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_host_wrapper.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_host_wrapper.json @@ -17,10 +17,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -34,6 +37,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_maincc_target_specific.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_maincc_target_specific.json index d4f9192c..afb06d32 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_maincc_target_specific.json @@ -17,10 +17,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -34,6 +37,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -62,10 +66,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -79,6 +86,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -107,10 +115,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -124,6 +135,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -152,10 +164,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -169,6 +184,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -197,10 +213,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -214,6 +233,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -242,10 +262,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -259,6 +282,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -287,10 +311,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -304,6 +331,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -332,10 +360,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -349,6 +380,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -377,10 +409,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -394,6 +429,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_path.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_path.json index 72e05db9..d4a21339 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_path.json @@ -17,10 +17,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -34,6 +37,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -65,10 +69,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -82,6 +89,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -113,10 +121,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -131,6 +142,7 @@ "-fcommon", "-std=gnu++14", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -162,10 +174,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -179,6 +194,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -217,10 +233,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -236,6 +255,7 @@ "-resource-dir=someResourceDir", "--gcc-toolchain=/usr", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -277,10 +297,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -296,6 +319,7 @@ "-resource-dir=someResourceDir", "--gcc-toolchain=/usr", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -337,10 +361,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -356,6 +383,7 @@ "-resource-dir=someResourceDir", "--gcc-toolchain=/usr", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -387,10 +415,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -404,6 +435,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -432,10 +464,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -449,6 +484,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -477,10 +513,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -494,6 +533,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -522,10 +562,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -539,6 +582,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -570,10 +614,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -587,6 +634,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_sanitizer_args.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_sanitizer_args.json index 99d21df3..b2fd7550 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_sanitizer_args.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_sanitizer_args.json @@ -19,10 +19,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -37,6 +40,7 @@ "-fcommon", "-fsanitize=kernel-address", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -67,10 +71,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -85,6 +92,7 @@ "-fcommon", "-fsanitize=kernel-address", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -115,10 +123,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -133,6 +144,7 @@ "-fcommon", "-fsanitize=kernel-address", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -163,10 +175,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -181,6 +196,7 @@ "-fcommon", "-fsanitize=kernel-address", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -210,10 +226,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -228,6 +247,7 @@ "-fcommon", "-fsanitize=fuzzer", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -258,10 +278,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -277,6 +300,7 @@ "-fsanitize=address", "-fprofile-instr-generate", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -306,10 +330,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -324,6 +351,7 @@ "-fcommon", "-fsanitize=address", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -353,10 +381,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -371,6 +402,7 @@ "-fcommon", "-fprofile-instr-generate", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_specific_args.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_specific_args.json index 900390dc..41452944 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_specific_args.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_specific_args.json @@ -27,10 +27,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -52,6 +55,7 @@ "-Woverride-init", "-Wunsafe-loop-optimizations", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -81,10 +85,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -99,6 +106,7 @@ "-fcommon", "-Wno-#warnings", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -128,10 +136,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -146,6 +157,7 @@ "-fcommon", "-Wno-error=uninitialized", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -175,10 +187,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -193,6 +208,7 @@ "-fcommon", "-someflag", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clangtidy.json b/compiler_wrapper/testdata/cros_clang_host_golden/clangtidy.json index 8c6f17a6..51980427 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clangtidy.json @@ -33,10 +33,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -50,6 +53,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -65,10 +69,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -82,6 +89,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -127,10 +135,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -144,6 +155,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -159,10 +171,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -176,6 +191,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -223,10 +239,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -240,6 +259,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -258,10 +278,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -275,6 +298,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -323,10 +347,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -340,6 +367,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -355,10 +383,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -372,6 +403,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_clang_host_golden/force_disable_werror.json index cbb42de8..c4de4246 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/force_disable_werror.json @@ -20,10 +20,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -37,6 +40,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -69,10 +73,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -86,6 +93,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -103,10 +111,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -120,6 +131,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -155,10 +167,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -172,6 +187,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -189,10 +205,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -206,6 +225,7 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "main.cc", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_golden/bisect.json index e01a3b4e..976fa12c 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/bisect.json @@ -29,10 +29,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -54,6 +57,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -105,10 +109,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -130,6 +137,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -184,10 +192,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -209,6 +220,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json index 3c3e6a14..932efe27 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json @@ -20,10 +20,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -46,6 +49,7 @@ "-ftrapv", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -86,10 +90,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -112,6 +119,7 @@ "-ftrapv", "main.cc", "-L/usr/x86_64-cros-eabi/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -152,10 +160,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -178,6 +189,7 @@ "-ftrapv", "main.cc", "-L/usr/x86_64-cros-win-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -218,10 +230,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -244,6 +259,7 @@ "-ftrapv", "main.cc", "-L/usr/armv7m-cros-linux-gnu/usr/lib", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -283,10 +299,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -309,6 +328,7 @@ "-ftrapv", "main.cc", "-L/usr/armv7m-cros-eabi/usr/lib", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -348,10 +368,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -374,6 +397,7 @@ "-ftrapv", "main.cc", "-L/usr/armv7m-cros-win-gnu/usr/lib", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -413,10 +437,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -439,6 +466,7 @@ "-ftrapv", "main.cc", "-L/usr/armv8m-cros-linux-gnu/usr/lib", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -478,10 +506,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -504,6 +535,7 @@ "-ftrapv", "main.cc", "-L/usr/armv8m-cros-eabi/usr/lib", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -543,10 +575,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -569,6 +604,7 @@ "-ftrapv", "main.cc", "-L/usr/armv8m-cros-win-gnu/usr/lib", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json index 0242636a..d421febc 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json @@ -19,10 +19,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -44,6 +47,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -83,10 +87,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -108,6 +115,7 @@ "--prefix=../../bin/x86_64-cros-eabi-", "main.cc", "-L/usr/x86_64-cros-eabi/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -147,10 +155,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -172,6 +183,7 @@ "--prefix=../../bin/x86_64-cros-win-gnu-", "main.cc", "-L/usr/x86_64-cros-win-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -211,10 +223,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -236,6 +251,7 @@ "--prefix=../../bin/armv7m-cros-linux-gnu-", "main.cc", "-L/usr/armv7m-cros-linux-gnu/usr/lib", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -274,10 +290,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -299,6 +318,7 @@ "--prefix=../../bin/armv7m-cros-eabi-", "main.cc", "-L/usr/armv7m-cros-eabi/usr/lib", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -337,10 +357,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -362,6 +385,7 @@ "--prefix=../../bin/armv7m-cros-win-gnu-", "main.cc", "-L/usr/armv7m-cros-win-gnu/usr/lib", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -400,10 +424,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -425,6 +452,7 @@ "--prefix=../../bin/armv8m-cros-linux-gnu-", "main.cc", "-L/usr/armv8m-cros-linux-gnu/usr/lib", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -463,10 +491,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -488,6 +519,7 @@ "--prefix=../../bin/armv8m-cros-eabi-", "main.cc", "-L/usr/armv8m-cros-eabi/usr/lib", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -526,10 +558,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -551,6 +586,7 @@ "--prefix=../../bin/armv8m-cros-win-gnu-", "main.cc", "-L/usr/armv8m-cros-win-gnu/usr/lib", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json index 75722471..be05b215 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json @@ -19,10 +19,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -44,6 +47,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -86,10 +90,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -111,6 +118,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -153,10 +161,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -179,6 +190,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -221,10 +233,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -246,6 +261,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -295,10 +311,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -322,6 +341,7 @@ "--gcc-toolchain=/usr", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -374,10 +394,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -401,6 +424,7 @@ "--gcc-toolchain=/usr", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -448,10 +472,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -475,6 +502,7 @@ "--gcc-toolchain=/usr", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -517,10 +545,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -542,6 +573,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -581,10 +613,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -606,6 +641,7 @@ "--prefix=a/b/c/d/e/bin/x86_64-cros-linux-gnu-", "main.cc", "-L/tmp/stable/a/b/c/d/e/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -645,10 +681,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -670,6 +709,7 @@ "--prefix=a/b/c/d/e/bin/x86_64-cros-linux-gnu-", "main.cc", "-L/tmp/stable/a/b/c/d/e/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -709,10 +749,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -734,6 +777,7 @@ "--prefix=../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/tmp/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -776,10 +820,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -801,6 +848,7 @@ "--prefix=../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/tmp/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json index d3a3cf2e..3ac18b54 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json @@ -21,10 +21,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -46,6 +49,7 @@ "-fsanitize=kernel-address", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -87,10 +91,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -112,6 +119,7 @@ "-fsanitize=kernel-address", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -153,10 +161,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -178,6 +189,7 @@ "-fsanitize=kernel-address", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -219,10 +231,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -244,6 +259,7 @@ "-fsanitize=kernel-address", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -284,10 +300,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -309,6 +328,7 @@ "-fsanitize=fuzzer", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -350,10 +370,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -376,6 +399,7 @@ "-fprofile-instr-generate", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -416,10 +440,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -441,6 +468,7 @@ "-fsanitize=address", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -481,10 +509,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -507,6 +538,7 @@ "-fprofile-instr-generate", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json index 3463f688..73e0f1d3 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json @@ -29,10 +29,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -62,6 +65,7 @@ "-Wunsafe-loop-optimizations", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -102,10 +106,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -128,6 +135,7 @@ "-Wno-#warnings", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -168,10 +176,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -194,6 +205,7 @@ "-Wno-error=uninitialized", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -234,10 +246,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -260,6 +275,7 @@ "-someflag", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json index 3830a750..57df3b7d 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json @@ -55,10 +55,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -80,6 +83,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -122,10 +126,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -147,6 +154,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -182,10 +190,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -208,6 +219,7 @@ "-nopie", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -248,10 +260,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -274,6 +289,7 @@ "-D__KERNEL__", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -314,10 +330,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -340,6 +359,7 @@ "-D__KERNEL__", "main.cc", "-L/usr/armv7a-cros-linux-gnueabihf/usr/lib", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -378,10 +398,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -404,6 +427,7 @@ "--sysroot=xyz", "main.cc", "-Lxyz/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json index 685d8218..35004155 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json @@ -34,10 +34,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -59,6 +62,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -79,10 +83,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -104,6 +111,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -154,10 +162,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -179,6 +190,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -200,10 +212,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -225,6 +240,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -277,10 +293,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -302,6 +321,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -326,10 +346,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -351,6 +374,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -404,10 +428,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -429,6 +456,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -450,10 +478,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -475,6 +506,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json index c168124d..14215269 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json @@ -22,10 +22,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -47,6 +50,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -90,10 +94,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -115,6 +122,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -143,10 +151,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -168,6 +179,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -214,10 +226,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -239,6 +254,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -267,10 +283,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -292,6 +311,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json index 3e4f02cb..e3145db2 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json @@ -19,10 +19,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -44,6 +47,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -108,10 +112,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -133,6 +140,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -192,10 +200,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -217,6 +228,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -259,10 +271,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -284,6 +299,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json index e1a4817b..976fa12c 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json @@ -29,10 +29,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -45,9 +48,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -57,12 +57,12 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -109,10 +109,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -125,9 +128,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -137,12 +137,12 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -192,10 +192,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -208,9 +211,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -220,12 +220,12 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json index 3faaacb8..be05b215 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json @@ -19,10 +19,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -35,9 +38,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -47,12 +47,12 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -90,10 +90,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -106,9 +109,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -118,12 +118,12 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -161,10 +161,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -177,9 +180,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -190,12 +190,12 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -233,10 +233,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -249,9 +252,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -261,12 +261,12 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -311,10 +311,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -327,9 +330,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -341,12 +341,12 @@ "--gcc-toolchain=/usr", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -394,10 +394,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -410,9 +413,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -424,12 +424,12 @@ "--gcc-toolchain=/usr", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -472,10 +472,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -488,9 +491,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -502,12 +502,12 @@ "--gcc-toolchain=/usr", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -545,10 +545,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -561,9 +564,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -573,12 +573,12 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -613,10 +613,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -629,9 +632,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -641,12 +641,12 @@ "--prefix=a/b/c/d/e/bin/x86_64-cros-linux-gnu-", "main.cc", "-L/tmp/stable/a/b/c/d/e/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-Ba/b/c/d/e/bin", "-target", @@ -681,10 +681,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -697,9 +700,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -709,12 +709,12 @@ "--prefix=a/b/c/d/e/bin/x86_64-cros-linux-gnu-", "main.cc", "-L/tmp/stable/a/b/c/d/e/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-Ba/b/c/d/e/bin", "-target", @@ -749,10 +749,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -765,9 +768,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -777,12 +777,12 @@ "--prefix=../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/tmp/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../bin", "-target", @@ -820,10 +820,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -836,9 +839,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -848,12 +848,12 @@ "--prefix=../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/tmp/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json index 36de9ec6..35004155 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json @@ -34,10 +34,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -50,9 +53,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -62,12 +62,12 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -83,10 +83,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -99,9 +102,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -111,12 +111,12 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -162,10 +162,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -178,9 +181,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -190,12 +190,12 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -212,10 +212,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -228,9 +231,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -240,12 +240,12 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -293,10 +293,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -309,9 +312,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -321,12 +321,12 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -346,10 +346,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -362,9 +365,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -374,12 +374,12 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -428,10 +428,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -444,9 +447,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -456,12 +456,12 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -478,10 +478,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -494,9 +497,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -506,12 +506,12 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json index 8aff0962..14215269 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json @@ -22,10 +22,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -38,9 +41,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -50,12 +50,12 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -94,10 +94,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -110,9 +113,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -122,12 +122,12 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -151,10 +151,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -167,9 +170,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -179,12 +179,12 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -226,10 +226,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -242,9 +245,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -254,12 +254,12 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -283,10 +283,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -299,9 +302,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -311,12 +311,12 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json index a3c2b0ed..e3145db2 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json @@ -19,10 +19,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -35,9 +38,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -47,12 +47,12 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -112,10 +112,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -128,9 +131,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -140,12 +140,12 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -200,10 +200,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -216,9 +219,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -228,12 +228,12 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", @@ -271,10 +271,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -287,9 +290,6 @@ "-fno-addrsig", "-fuse-ld=lld", "-ftrivial-auto-var-init=zero", - "-Wno-enum-constexpr-conversion", - "-Wno-deprecated-builtins", - "-Wno-single-bit-bitfield-constant-conversion", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", @@ -299,12 +299,12 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", - "-Wno-array-parameter", "-mno-movbe", "-B../../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json index 6502532f..92c70fa9 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json @@ -28,10 +28,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -53,6 +56,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -100,10 +104,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -125,6 +132,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -175,10 +183,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -200,6 +211,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json index a7c8db67..b779e258 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json @@ -18,10 +18,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -43,6 +46,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -79,10 +83,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -104,6 +111,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -140,10 +148,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -166,6 +177,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -202,10 +214,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -227,6 +242,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -270,10 +286,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -297,6 +316,7 @@ "--gcc-toolchain=/usr", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -344,10 +364,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -371,6 +394,7 @@ "--gcc-toolchain=/usr", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -417,10 +441,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -444,6 +471,7 @@ "--gcc-toolchain=/usr", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -480,10 +508,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -505,6 +536,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -538,10 +570,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -563,6 +598,7 @@ "--prefix=a/b/c/d/e/bin/x86_64-cros-linux-gnu-", "main.cc", "-L/tmp/stable/a/b/c/d/e/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -596,10 +632,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -621,6 +660,7 @@ "--prefix=a/b/c/d/e/bin/x86_64-cros-linux-gnu-", "main.cc", "-L/tmp/stable/a/b/c/d/e/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -654,10 +694,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -679,6 +722,7 @@ "--prefix=../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/tmp/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -715,10 +759,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -740,6 +787,7 @@ "--prefix=../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/tmp/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json index 685d8218..35004155 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json @@ -34,10 +34,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -59,6 +62,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -79,10 +83,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -104,6 +111,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -154,10 +162,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -179,6 +190,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -200,10 +212,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -225,6 +240,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -277,10 +293,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -302,6 +321,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -326,10 +346,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -351,6 +374,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -404,10 +428,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -429,6 +456,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -450,10 +478,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -475,6 +506,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json index 26fa8a69..d091968b 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json @@ -21,10 +21,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -46,6 +49,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -83,10 +87,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -108,6 +115,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -130,10 +138,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -155,6 +166,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -195,10 +207,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -220,6 +235,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -242,10 +258,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -267,6 +286,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json index 90c03c70..15c98982 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json @@ -19,10 +19,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -44,6 +47,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -103,10 +107,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -128,6 +135,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -187,10 +195,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -212,6 +223,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -254,10 +266,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -279,6 +294,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/bisect.json b/compiler_wrapper/testdata/cros_nonhardened_golden/bisect.json index e1c638c9..2d00f949 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/bisect.json @@ -29,10 +29,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -46,6 +49,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -97,10 +101,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -114,6 +121,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -168,10 +176,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -185,6 +196,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_ftrapv_maincc_target_specific.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_ftrapv_maincc_target_specific.json index 65b9fab8..393239e8 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_ftrapv_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_ftrapv_maincc_target_specific.json @@ -20,10 +20,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -38,6 +41,7 @@ "-ftrapv", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -78,10 +82,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -96,6 +103,7 @@ "-ftrapv", "main.cc", "-L/usr/x86_64-cros-eabi/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -136,10 +144,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -154,6 +165,7 @@ "-ftrapv", "main.cc", "-L/usr/x86_64-cros-win-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -194,10 +206,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -213,6 +228,7 @@ "-ftrapv", "main.cc", "-L/usr/armv7m-cros-linux-gnu/usr/lib", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -252,10 +268,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -270,6 +289,7 @@ "-ftrapv", "main.cc", "-L/usr/armv7m-cros-eabi/usr/lib", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -309,10 +329,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -328,6 +351,7 @@ "-ftrapv", "main.cc", "-L/usr/armv7m-cros-win-gnu/usr/lib", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -367,10 +391,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -386,6 +413,7 @@ "-ftrapv", "main.cc", "-L/usr/armv8m-cros-linux-gnu/usr/lib", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -425,10 +453,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -443,6 +474,7 @@ "-ftrapv", "main.cc", "-L/usr/armv8m-cros-eabi/usr/lib", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -482,10 +514,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -501,6 +536,7 @@ "-ftrapv", "main.cc", "-L/usr/armv8m-cros-win-gnu/usr/lib", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_maincc_target_specific.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_maincc_target_specific.json index e715c251..479510bb 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_maincc_target_specific.json @@ -19,10 +19,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -36,6 +39,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -75,10 +79,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -92,6 +99,7 @@ "--prefix=../../bin/x86_64-cros-eabi-", "main.cc", "-L/usr/x86_64-cros-eabi/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -131,10 +139,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -148,6 +159,7 @@ "--prefix=../../bin/x86_64-cros-win-gnu-", "main.cc", "-L/usr/x86_64-cros-win-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -187,10 +199,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -205,6 +220,7 @@ "--prefix=../../bin/armv7m-cros-linux-gnu-", "main.cc", "-L/usr/armv7m-cros-linux-gnu/usr/lib", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -243,10 +259,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -260,6 +279,7 @@ "--prefix=../../bin/armv7m-cros-eabi-", "main.cc", "-L/usr/armv7m-cros-eabi/usr/lib", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -298,10 +318,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -316,6 +339,7 @@ "--prefix=../../bin/armv7m-cros-win-gnu-", "main.cc", "-L/usr/armv7m-cros-win-gnu/usr/lib", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -354,10 +378,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -372,6 +399,7 @@ "--prefix=../../bin/armv8m-cros-linux-gnu-", "main.cc", "-L/usr/armv8m-cros-linux-gnu/usr/lib", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -410,10 +438,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -427,6 +458,7 @@ "--prefix=../../bin/armv8m-cros-eabi-", "main.cc", "-L/usr/armv8m-cros-eabi/usr/lib", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -465,10 +497,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -483,6 +518,7 @@ "--prefix=../../bin/armv8m-cros-win-gnu-", "main.cc", "-L/usr/armv8m-cros-win-gnu/usr/lib", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_path.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_path.json index 19f2e90d..0027b077 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_path.json @@ -19,10 +19,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -36,6 +39,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -78,10 +82,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -95,6 +102,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -137,10 +145,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -155,6 +166,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -197,10 +209,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -214,6 +229,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -263,10 +279,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -282,6 +301,7 @@ "--gcc-toolchain=/usr", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -334,10 +354,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -353,6 +376,7 @@ "--gcc-toolchain=/usr", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -400,10 +424,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -419,6 +446,7 @@ "--gcc-toolchain=/usr", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -461,10 +489,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -478,6 +509,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -517,10 +549,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -534,6 +569,7 @@ "--prefix=a/b/c/d/e/bin/x86_64-cros-linux-gnu-", "main.cc", "-L/tmp/stable/a/b/c/d/e/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -573,10 +609,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -590,6 +629,7 @@ "--prefix=a/b/c/d/e/bin/x86_64-cros-linux-gnu-", "main.cc", "-L/tmp/stable/a/b/c/d/e/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -629,10 +669,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -646,6 +689,7 @@ "--prefix=../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/tmp/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -688,10 +732,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -705,6 +752,7 @@ "--prefix=../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/tmp/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sanitizer_args.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sanitizer_args.json index 2cd603e9..1d7c8bbb 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sanitizer_args.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sanitizer_args.json @@ -21,10 +21,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -39,6 +42,7 @@ "-fsanitize=kernel-address", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -80,10 +84,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -98,6 +105,7 @@ "-fsanitize=kernel-address", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -139,10 +147,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -157,6 +168,7 @@ "-fsanitize=kernel-address", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -198,10 +210,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -216,6 +231,7 @@ "-fsanitize=kernel-address", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -256,10 +272,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -274,6 +293,7 @@ "-fsanitize=fuzzer", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -315,10 +335,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -334,6 +357,7 @@ "-fprofile-instr-generate", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -374,10 +398,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -392,6 +419,7 @@ "-fsanitize=address", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -432,10 +460,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -450,6 +481,7 @@ "-fprofile-instr-generate", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_specific_args.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_specific_args.json index 3d60fd21..f37fc0ec 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_specific_args.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_specific_args.json @@ -29,10 +29,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -54,6 +57,7 @@ "-Wunsafe-loop-optimizations", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -94,10 +98,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -112,6 +119,7 @@ "-Wno-#warnings", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -152,10 +160,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -170,6 +181,7 @@ "-Wno-error=uninitialized", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -210,10 +222,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -228,6 +243,7 @@ "-someflag", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sysroot_wrapper_common.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sysroot_wrapper_common.json index c15e623f..7a2e9cfc 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sysroot_wrapper_common.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sysroot_wrapper_common.json @@ -52,10 +52,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -69,6 +72,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -111,10 +115,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -128,6 +135,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -163,10 +171,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -181,6 +192,7 @@ "-nopie", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -221,10 +233,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -240,6 +255,7 @@ "-D__KERNEL__", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -280,10 +296,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -300,6 +319,7 @@ "-D__KERNEL__", "main.cc", "-L/usr/armv7a-cros-linux-gnueabihf/usr/lib", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -338,10 +358,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -356,6 +379,7 @@ "--sysroot=xyz", "main.cc", "-Lxyz/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clangtidy.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clangtidy.json index 248ee07b..b04e39fc 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clangtidy.json @@ -34,10 +34,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -51,6 +54,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -71,10 +75,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -88,6 +95,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -138,10 +146,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -155,6 +166,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -176,10 +188,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -193,6 +208,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -245,10 +261,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -262,6 +281,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -286,10 +306,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -303,6 +326,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -356,10 +380,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -373,6 +400,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -394,10 +422,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -411,6 +442,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_nonhardened_golden/force_disable_werror.json index 4ff09857..9b85fe14 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/force_disable_werror.json @@ -22,10 +22,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -39,6 +42,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -82,10 +86,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -99,6 +106,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -127,10 +135,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -144,6 +155,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -190,10 +202,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -207,6 +222,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -235,10 +251,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -252,6 +271,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_nonhardened_golden/gcc_clang_syntax.json index 3cda7403..b2434351 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/gcc_clang_syntax.json @@ -19,10 +19,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -36,6 +39,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -97,10 +101,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -114,6 +121,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -170,10 +178,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -187,6 +198,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", @@ -229,10 +241,13 @@ "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", + "-Wno-deprecated-builtins", "-Wno-deprecated-declarations", + "-Wno-enum-constexpr-conversion", "-Wno-error=implicit-function-declaration", "-Wno-error=implicit-int", "-Wno-final-dtor-non-final-class", + "-Wno-single-bit-bitfield-constant-conversion", "-Wno-tautological-constant-compare", "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-unknown-warning-option", @@ -246,6 +261,7 @@ "--prefix=../../bin/x86_64-cros-linux-gnu-", "main.cc", "-L/usr/x86_64-cros-linux-gnu/usr/lib64", + "-Wno-array-parameter", "-Wno-compound-token-split-by-space", "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", -- cgit v1.2.3 From 1a020aa6408b42cf9787c0743fb75cdea16c817b Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Tue, 10 Jan 2023 09:07:22 -0700 Subject: forcey: skip uploading linker test-cases Lexan is uploading tarballs to represent linker crashes. We don't want to upload those to forcey, since it won't know what to do with them. BUG=b:264972548 TEST=Ran unittests Change-Id: Ia48364072447613e1ede44bc7e24390d65c147de Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4149730 Tested-by: George Burgess Reviewed-by: Michael Benfield Commit-Queue: George Burgess --- llvm_tools/upload_lexan_crashes_to_forcey.py | 7 +++++- llvm_tools/upload_lexan_crashes_to_forcey_test.py | 29 +++++++++++++++++++---- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/llvm_tools/upload_lexan_crashes_to_forcey.py b/llvm_tools/upload_lexan_crashes_to_forcey.py index 0090c5f8..30dc7fc8 100755 --- a/llvm_tools/upload_lexan_crashes_to_forcey.py +++ b/llvm_tools/upload_lexan_crashes_to_forcey.py @@ -140,7 +140,7 @@ def submit_test_case(gs_url: str, cr_tool: str) -> None: ) return - logging.info("Submitting %s (%dKB)", gs_url, size_kb) + logging.info("Downloading %s (%dKB)", gs_url, size_kb) with temp_dir() as tempdir: download_and_unpack_test_case(gs_url, tempdir) @@ -153,6 +153,10 @@ def submit_test_case(gs_url: str, cr_tool: str) -> None: for x in os.listdir(tempdir) if not x.endswith(".crash") ] + if len(repro_files) == 1 and repro_files[0].endswith(".tar"): + logging.info("Skipping submission of %s; it's a linker crash") + return + assert len(repro_files) == 2, repro_files if repro_files[0].endswith(".sh"): sh_file, src_file = repro_files @@ -170,6 +174,7 @@ def submit_test_case(gs_url: str, cr_tool: str) -> None: ) return + logging.info("Submitting %s", gs_url) subprocess.run( [ cr_tool, diff --git a/llvm_tools/upload_lexan_crashes_to_forcey_test.py b/llvm_tools/upload_lexan_crashes_to_forcey_test.py index 2e5c87b2..76e90e08 100755 --- a/llvm_tools/upload_lexan_crashes_to_forcey_test.py +++ b/llvm_tools/upload_lexan_crashes_to_forcey_test.py @@ -152,10 +152,8 @@ class Test(unittest.TestCase): def side_effect(gs_url: str, tempdir: str) -> None: self.assertEqual(gs_url, mock_gs_url) - with open(os.path.join(tempdir, "test_case.c"), "w") as f: - # All we need is an empty file here. - pass - + # All we need is an empty file here. + open(os.path.join(tempdir, "test_case.c"), "w").close() with open( os.path.join(tempdir, "test_case.sh"), "w", encoding="utf-8" ) as f: @@ -181,6 +179,29 @@ class Test(unittest.TestCase): self.assertEqual(size, 1234) subprocess_run_mock.assert_called_once() + @unittest.mock.patch( + "upload_lexan_crashes_to_forcey.download_and_unpack_test_case" + ) + @unittest.mock.patch("subprocess.run") + @unittest.mock.patch("upload_lexan_crashes_to_forcey.fetch_gs_file_size") + def test_linker_tarballs_are_skipped( + self, + fetch_gs_file_size_mock, + subprocess_run_mock, + download_and_unpack_mock, + ): + fetch_gs_file_size_mock.return_value = 1024 + mock_gs_url = "gs://foo/bar/baz" + + def side_effect(gs_url: str, tempdir: str) -> None: + self.assertEqual(gs_url, mock_gs_url) + # All we need is an empty file here. + open(os.path.join(tempdir, "test_case.tar"), "w").close() + + download_and_unpack_mock.side_effect = side_effect + upload_lexan_crashes_to_forcey.submit_test_case(mock_gs_url, "4c") + subprocess_run_mock.assert_not_called() + if __name__ == "__main__": unittest.main() -- cgit v1.2.3 From 6b694735fa4b947367c211b616886ccae6e15480 Mon Sep 17 00:00:00 2001 From: Michael Benfield Date: Tue, 10 Jan 2023 23:11:56 +0000 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-4.19 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: Ib79236ab2dc83f63774b01cd59d4d010ae3257ec Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4150963 Reviewed-by: Denis Nikitin Commit-Queue: Denis Nikitin Auto-Submit: Michael Benfield Tested-by: Michael Benfield --- afdo_metadata/kernel_afdo.json | 8 ++++---- afdo_metadata/kernel_arm_afdo.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index 32167be8..4c04b3f7 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -1,14 +1,14 @@ { "chromeos-kernel-4_14": { - "name": "R111-15278.0-1672655615" + "name": "R111-15278.21-1673260710" }, "chromeos-kernel-4_19": { - "name": "R111-15278.0-1672655497" + "name": "R111-15278.21-1673260798" }, "chromeos-kernel-5_4": { - "name": "R111-15278.0-1672655559" + "name": "R111-15278.21-1673260656" }, "chromeos-kernel-5_10": { - "name": "R111-15278.0-1672655622" + "name": "R111-15278.21-1673260561" } } diff --git a/afdo_metadata/kernel_arm_afdo.json b/afdo_metadata/kernel_arm_afdo.json index da21f408..38a76b37 100644 --- a/afdo_metadata/kernel_arm_afdo.json +++ b/afdo_metadata/kernel_arm_afdo.json @@ -1,5 +1,5 @@ { "chromeos-kernel-5_15": { - "name": "R111-15278.0-1672655867" + "name": "R111-15278.21-1673260848" } } -- cgit v1.2.3 From 53d0d30494cd175cab5c4aa54a3f6e91c813b249 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Wed, 11 Jan 2023 09:48:15 -0700 Subject: upload_lexan_crashes_to_forcey: add log argument Forgot this - oops. :) BUG=b:264972548 TEST=None Change-Id: I7a2fd2cd1fbc599312fcfafd2bccd312d11db2ff Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4157211 Auto-Submit: George Burgess Reviewed-by: Michael Benfield Tested-by: George Burgess Commit-Queue: Michael Benfield --- llvm_tools/upload_lexan_crashes_to_forcey.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm_tools/upload_lexan_crashes_to_forcey.py b/llvm_tools/upload_lexan_crashes_to_forcey.py index 30dc7fc8..f52a27f4 100755 --- a/llvm_tools/upload_lexan_crashes_to_forcey.py +++ b/llvm_tools/upload_lexan_crashes_to_forcey.py @@ -154,7 +154,9 @@ def submit_test_case(gs_url: str, cr_tool: str) -> None: if not x.endswith(".crash") ] if len(repro_files) == 1 and repro_files[0].endswith(".tar"): - logging.info("Skipping submission of %s; it's a linker crash") + logging.info( + "Skipping submission of %s; it's a linker crash", gs_url + ) return assert len(repro_files) == 2, repro_files -- cgit v1.2.3 From 0fc8bde4fd9ea4b7d22c7b4b61ced7ef4ed901a8 Mon Sep 17 00:00:00 2001 From: Ryan Beltran Date: Mon, 9 Jan 2023 23:30:18 +0000 Subject: llvm_tools: add allow_failures to get_upstream_patch This CL adds an --allow_failures flag to get_upstream_patch that causes it to skip failing patches and log them as warnings instead of crashing with a backtrace. BUG=b:264933847 TEST=manually tested with a series of patches that includes failures Change-Id: I3b5a2f0731b4d363160fc5d4c4914331fd62af01 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4144646 Commit-Queue: Ryan Beltran Tested-by: Ryan Beltran Reviewed-by: Manoj Gupta --- llvm_tools/get_upstream_patch.py | 54 ++++++++++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 11 deletions(-) diff --git a/llvm_tools/get_upstream_patch.py b/llvm_tools/get_upstream_patch.py index 615d5b88..b90fbbe5 100755 --- a/llvm_tools/get_upstream_patch.py +++ b/llvm_tools/get_upstream_patch.py @@ -59,7 +59,7 @@ def validate_patch_application( if predecessor_apply_results.failed_patches: logging.error("Failed to apply patches from PATCHES.json:") for p in predecessor_apply_results.failed_patches: - logging.error(f"Patch title: {p.title()}") + logging.error("Patch title: %s", p.title()) raise PatchApplicationError("Failed to apply patch from PATCHES.json") patch_entry = patch_utils.PatchEntry.from_dict( @@ -327,6 +327,7 @@ def find_patches_and_make_cl( start_rev: git_llvm_rev.Rev, llvm_config: git_llvm_rev.LLVMConfig, llvm_symlink_dir: str, + allow_failures: bool, create_cl: bool, skip_dependencies: bool, reviewers: t.Optional[t.List[str]], @@ -354,6 +355,8 @@ def find_patches_and_make_cl( if create_cl: git.CreateBranch(llvm_symlink_dir, branch) + successes = [] + failures = [] for parsed_patch in converted_patches: # Find out the llvm projects changed in this commit packages = get_package_names(parsed_patch.sha, llvm_config.dir) @@ -369,15 +372,25 @@ def find_patches_and_make_cl( chroot_path, symlinks ) # Create a local patch for all the affected llvm projects - create_patch_for_packages( - packages, - symlinks, - start_rev, - parsed_patch.rev, - parsed_patch.sha, - llvm_config.dir, - platforms=platforms, - ) + try: + create_patch_for_packages( + packages, + symlinks, + start_rev, + parsed_patch.rev, + parsed_patch.sha, + llvm_config.dir, + platforms=platforms, + ) + except PatchApplicationError as e: + if allow_failures: + logging.warning(e) + failures.append(parsed_patch.sha) + continue + else: + raise e + successes.append(parsed_patch.sha) + if create_cl: symlinks_to_uprev.extend(symlinks) @@ -397,7 +410,17 @@ def find_patches_and_make_cl( ["git", "reset", "--hard", "HEAD^"], cwd=llvm_config.dir ) - if create_cl: + if allow_failures: + success_list = (":\n\t" + "\n\t".join(successes)) if successes else "." + logging.info( + "Successfully applied %d patches%s", len(successes), success_list + ) + failure_list = (":\n\t" + "\n\t".join(failures)) if failures else "." + logging.info( + "Failed to apply %d patches%s", len(failures), failure_list + ) + + if successes and create_cl: make_cl( symlinks_to_uprev, llvm_symlink_dir, @@ -478,6 +501,7 @@ def get_from_upstream( start_sha: str, patches: t.List[str], platforms: t.List[str], + allow_failures: bool, skip_dependencies: bool = False, reviewers: t.List[str] = None, cc: t.List[str] = None, @@ -515,7 +539,9 @@ def get_from_upstream( skip_dependencies=skip_dependencies, reviewers=reviewers, cc=cc, + allow_failures=allow_failures, ) + logging.info("Complete.") @@ -564,6 +590,11 @@ def main(): '"chromiumos" and "android". Can be specified multiple times to ' "apply to multiple platforms", ) + parser.add_argument( + "--allow_failures", + action="store_true", + help="Skip patches that fail to apply and continue.", + ) parser.add_argument( "--create_cl", action="store_true", @@ -589,6 +620,7 @@ def main(): get_from_upstream( chroot_path=args.chroot_path, + allow_failures=args.allow_failures, create_cl=args.create_cl, start_sha=args.start_sha, patches=args.sha + args.differential, -- cgit v1.2.3 From 166ed9b034af662e5abcf714d60bbc3102d27ef5 Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Thu, 12 Jan 2023 23:04:36 +0000 Subject: patch_sync: Retain indent level of PATCHES.json Given cros format now complains if json files don't have the right indentation style, we need to have patch_sync keep whatever indentation style is necessary to get past the format checks. BUG=b:265348099 TEST=cargo test Change-Id: I56a1a9d9c4cf10faa3f095f02b2ba291bef46e59 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4160479 Commit-Queue: Jordan Abrahams-Whitehead Reviewed-by: George Burgess Tested-by: Jordan Abrahams-Whitehead --- llvm_tools/patch_sync/src/patch_parsing.rs | 84 +++++++++++++++++++++++++++--- 1 file changed, 77 insertions(+), 7 deletions(-) diff --git a/llvm_tools/patch_sync/src/patch_parsing.rs b/llvm_tools/patch_sync/src/patch_parsing.rs index 00153834..ecf2259f 100644 --- a/llvm_tools/patch_sync/src/patch_parsing.rs +++ b/llvm_tools/patch_sync/src/patch_parsing.rs @@ -3,7 +3,7 @@ // found in the LICENSE file. use std::collections::{BTreeMap, BTreeSet}; -use std::fs::{copy, File}; +use std::fs::{copy, read_to_string, File}; use std::io::{BufRead, BufReader, Read, Write}; use std::path::{Path, PathBuf}; @@ -45,18 +45,22 @@ impl PatchDictSchema { pub struct PatchCollection { pub patches: Vec, pub workdir: PathBuf, + pub indent_len: usize, } impl PatchCollection { /// Create a `PatchCollection` from a PATCHES. pub fn parse_from_file(json_file: &Path) -> Result { - Ok(Self { - patches: serde_json::from_reader(File::open(json_file)?)?, - workdir: json_file + // We can't just use a file reader because we + // need to know what the original indent_len is. + let contents = read_to_string(json_file)?; + Self::parse_from_str( + json_file .parent() .ok_or_else(|| anyhow!("failed to get json_file parent"))? .to_path_buf(), - }) + &contents, + ) } /// Create a `PatchCollection` from a string literal and a workdir. @@ -64,6 +68,7 @@ impl PatchCollection { Ok(Self { patches: serde_json::from_str(contents).context("parsing from str")?, workdir, + indent_len: predict_indent(contents), }) } @@ -72,6 +77,7 @@ impl PatchCollection { Self { patches: self.patches.iter().cloned().filter(f).collect(), workdir: self.workdir.clone(), + indent_len: self.indent_len, } } @@ -80,6 +86,7 @@ impl PatchCollection { Self { patches: self.patches.iter().map(f).collect(), workdir: self.workdir.clone(), + indent_len: self.indent_len, } } @@ -89,7 +96,7 @@ impl PatchCollection { } /// Compute the set-set subtraction, returning a new `PatchCollection` which - /// keeps the minuend's workdir. + /// keeps the minuend's workdir and indent level. pub fn subtract(&self, subtrahend: &Self) -> Result { let mut new_patches = Vec::new(); // This is O(n^2) when it could be much faster, but n is always going to be less @@ -111,6 +118,7 @@ impl PatchCollection { Ok(Self { patches: new_patches, workdir: self.workdir.clone(), + indent_len: self.indent_len, }) } @@ -173,6 +181,7 @@ impl PatchCollection { .collect(); Self { workdir: self.workdir.clone(), + indent_len: self.indent_len, patches: cloned_patches, } } @@ -236,6 +245,7 @@ impl PatchCollection { Ok(Self { workdir: self.workdir.clone(), + indent_len: self.indent_len, patches: combined_patches, }) } @@ -262,11 +272,12 @@ impl PatchCollection { } pub fn serialize_patches(&self) -> Result { + let indent_str = " ".repeat(self.indent_len); let mut serialization_buffer = Vec::::new(); // Four spaces to indent json serialization. let mut serializer = serde_json::Serializer::with_formatter( &mut serialization_buffer, - serde_json::ser::PrettyFormatter::with_indent(b" "), + serde_json::ser::PrettyFormatter::with_indent(indent_str.as_bytes()), ); self.patches .serialize(&mut serializer) @@ -413,6 +424,24 @@ fn copy_create_parents(from: &Path, to: &Path) -> Result<()> { Ok(()) } +/// Given a json string, predict and return the maximum indentation unit the json string uses. +pub fn predict_indent(json: &str) -> usize { + let indents = json + .split('\n') + .map(|line| line.len() - line.trim_start_matches(' ').len()) + .collect::>(); + if indents.iter().all(|x| x % 4 == 0) { + return 4; + } + if indents.iter().all(|x| x % 2 == 0) { + return 2; + } + if indents.iter().all(|x| *x == 0) { + return 0; + } + 1 +} + #[cfg(test)] mod test { @@ -443,6 +472,40 @@ mod test { ); } + #[test] + fn test_keep_indent2() { + let example_json = "\ +[ + { + \"rel_patch_path\": \"some_patch.\", + \"metadata\": null, + \"platforms\": [] + } +] +"; + let collection1 = PatchCollection::parse_from_str(PathBuf::new(), example_json) + .expect("could not parse example_json"); + assert_eq!(collection1.indent_len, 2); + let collection2 = PatchCollection::parse_from_str( + PathBuf::new(), + &collection1 + .serialize_patches() + .expect("expected to serialize patches"), + ) + .expect("could not parse from serialization"); + assert_eq!(collection2.indent_len, 2); + let mut collection3 = collection1; + collection3.indent_len = 4; + let collection4 = PatchCollection::parse_from_str( + PathBuf::new(), + &collection3 + .serialize_patches() + .expect("expected to serialize patches"), + ) + .expect("could not parse from serialization"); + assert_eq!(collection4.indent_len, 4) + } + #[test] fn test_union() { let patch1 = PatchDictSchema { @@ -466,10 +529,12 @@ mod test { let collection1 = PatchCollection { workdir: PathBuf::new(), patches: vec![patch1, patch2], + indent_len: 0, }; let collection2 = PatchCollection { workdir: PathBuf::new(), patches: vec![patch3], + indent_len: 0, }; let union = collection1 .union_helper( @@ -503,10 +568,12 @@ mod test { let collection1 = PatchCollection { workdir: PathBuf::new(), patches: vec![patch1.clone()], + indent_len: 4, }; let collection2 = PatchCollection { workdir: PathBuf::new(), patches: vec![patch1], + indent_len: 4, }; let union = collection1 .union_helper( @@ -577,14 +644,17 @@ mod test { let collection1 = PatchCollection { workdir: PathBuf::new(), patches: vec![patch1, patch2.clone()], + indent_len: 0, }; let collection2 = PatchCollection { workdir: PathBuf::new(), patches: vec![patch1_updated, patch2.clone()], + indent_len: 0, }; let collection3 = PatchCollection { workdir: PathBuf::new(), patches: vec![patch2], + indent_len: 0, }; vec![collection1, collection2, collection3] } -- cgit v1.2.3 From 52dedf0a73c8eee143293db6420a929cded7fa3d Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Fri, 13 Jan 2023 00:20:47 +0000 Subject: llvm_tools: Retain indent style for PATCHES.json At present, patch_utils.py and get_upstream_patch.py enforce a spacing style of 4 spaces per indentation level. However, cros format requires an indentation style of 2 spaces per indentation level. This alters the tooling so that they preserve the indentation level of the existing file. The implementation here isn't as clean as in patch_sync, but it achieves reliable results. Existing patch_utils testing covers this new function already. BUG=b:265348099 TEST=./patch_utils_unittest; ./patch_manager_unittest.py TEST=Ran get_upstream_patch.py before/after cros format TEST=build llvm Change-Id: I2058fddefbf01837907ce891acfc0f2c318f51b4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4160480 Reviewed-by: George Burgess Tested-by: Jordan Abrahams-Whitehead Commit-Queue: Jordan Abrahams-Whitehead --- llvm_tools/get_upstream_patch.py | 10 ++++++-- llvm_tools/patch_utils.py | 52 ++++++++++++++++++++++++++++++-------- llvm_tools/patch_utils_unittest.py | 21 +++++++++++++++ 3 files changed, 70 insertions(+), 13 deletions(-) diff --git a/llvm_tools/get_upstream_patch.py b/llvm_tools/get_upstream_patch.py index b90fbbe5..415faaa7 100755 --- a/llvm_tools/get_upstream_patch.py +++ b/llvm_tools/get_upstream_patch.py @@ -126,7 +126,9 @@ def add_patch( ) with open(patches_json_path, encoding="utf-8") as f: - patches_json = json.load(f) + contents = f.read() + indent_len = patch_utils.predict_indent(contents.splitlines()) + patches_json = json.loads(contents) for p in patches_json: rel_path = p["rel_patch_path"] @@ -182,7 +184,11 @@ def add_patch( temp_file = patches_json_path + ".tmp" with open(temp_file, "w", encoding="utf-8") as f: json.dump( - patches_json, f, indent=4, separators=(",", ": "), sort_keys=True + patches_json, + f, + indent=indent_len, + separators=(",", ": "), + sort_keys=True, ) f.write("\n") os.rename(temp_file, patches_json_path) diff --git a/llvm_tools/patch_utils.py b/llvm_tools/patch_utils.py index affb3d0d..84f9adff 100644 --- a/llvm_tools/patch_utils.py +++ b/llvm_tools/patch_utils.py @@ -324,6 +324,16 @@ def json_to_patch_entries(workdir: Path, json_fd: IO[str]) -> List[PatchEntry]: return [PatchEntry.from_dict(workdir, d) for d in json.load(json_fd)] +def json_str_to_patch_entries(workdir: Path, json_str: str) -> List[PatchEntry]: + """Convert a json IO object to List[PatchEntry]. + + Examples: + >>> f = open('PATCHES.json').read() + >>> patch_entries = json_str_to_patch_entries(Path(), f) + """ + return [PatchEntry.from_dict(workdir, d) for d in json.loads(json_str)] + + def _print_failed_patch(pe: PatchEntry, failed_hunks: Dict[str, List[Hunk]]): """Print information about a single failing PatchEntry. @@ -462,13 +472,27 @@ def git_clean_context(git_root_dir: Path): clean_src_tree(git_root_dir) -def _write_json_changes(patches: List[Dict[str, Any]], file_io: IO[str]): +def _write_json_changes( + patches: List[Dict[str, Any]], file_io: IO[str], indent_len=2 +): """Write JSON changes to file, does not acquire new file lock.""" - json.dump(patches, file_io, indent=4, separators=(",", ": ")) + json.dump(patches, file_io, indent=indent_len, separators=(",", ": ")) # Need to add a newline as json.dump omits it. file_io.write("\n") +def predict_indent(patches_lines: List[str]) -> int: + """Given file lines, predict and return the max indentation unit.""" + indents = [len(x) - len(x.lstrip(" ")) for x in patches_lines] + if all(x % 4 == 0 for x in indents): + return 4 + if all(x % 2 == 0 for x in indents): + return 2 + if all(x == 0 for x in indents): + return 0 + return 1 + + def update_version_ranges( svn_version: int, llvm_src_dir: Path, patches_json_fp: Path ) -> PatchInfo: @@ -488,15 +512,19 @@ def update_version_ranges( PatchInfo for applied and disabled patches. """ with patches_json_fp.open(encoding="utf-8") as f: - patch_entries = json_to_patch_entries( - patches_json_fp.parent, - f, - ) + contents = f.read() + indent_len = predict_indent(contents.splitlines()) + patch_entries = json_str_to_patch_entries( + patches_json_fp.parent, + contents, + ) modified_entries, applied_patches = update_version_ranges_with_entries( svn_version, llvm_src_dir, patch_entries ) with atomic_write(patches_json_fp, encoding="utf-8") as f: - _write_json_changes([p.to_dict() for p in patch_entries], f) + _write_json_changes( + [p.to_dict() for p in patch_entries], f, indent_len=indent_len + ) for entry in modified_entries: print( f"Stopped applying {entry.rel_patch_path} ({entry.title()}) " @@ -570,14 +598,16 @@ def remove_old_patches( PatchInfo for modified patches. """ with patches_json_fp.open(encoding="utf-8") as f: - patches_list = json.load(f) - patch_entries = ( - PatchEntry.from_dict(llvm_src_dir, elem) for elem in patches_list + contents = f.read() + indent_len = predict_indent(contents.splitlines()) + patch_entries = json_str_to_patch_entries( + llvm_src_dir, + contents, ) oldness = [(entry, entry.is_old(svn_version)) for entry in patch_entries] filtered_entries = [entry.to_dict() for entry, old in oldness if not old] with atomic_write(patches_json_fp, encoding="utf-8") as f: - _write_json_changes(filtered_entries, f) + _write_json_changes(filtered_entries, f, indent_len=indent_len) removed_entries = [entry for entry, old in oldness if old] plural_patches = "patch" if len(removed_entries) == 1 else "patches" print(f"Removed {len(removed_entries)} old {plural_patches}:") diff --git a/llvm_tools/patch_utils_unittest.py b/llvm_tools/patch_utils_unittest.py index b8c21390..603ba74e 100755 --- a/llvm_tools/patch_utils_unittest.py +++ b/llvm_tools/patch_utils_unittest.py @@ -47,6 +47,24 @@ class TestPatchUtils(unittest.TestCase): lines = f.readlines() self.assertEqual(lines[0], new_contents) + def test_predict_indent(self): + test_str1 = """ +a + a + a + a +a +""" + self.assertEqual(pu.predict_indent(test_str1.splitlines()), 2) + test_str2 = """ +a + a + a + a +a +""" + self.assertEqual(pu.predict_indent(test_str2.splitlines()), 4) + def test_from_to_dict(self): """Test to and from dict conversion.""" d = TestPatchUtils._default_json_dict() @@ -123,6 +141,9 @@ class TestPatchUtils(unittest.TestCase): } ] """ + result = pu.json_str_to_patch_entries(Path(), patches_json) + self.assertEqual(len(result), 4) + result = pu.json_to_patch_entries(Path(), io.StringIO(patches_json)) self.assertEqual(len(result), 4) -- cgit v1.2.3 From bdfc6c23183409a05f17d60ae021c5d33a02456d Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Mon, 23 Jan 2023 13:09:46 -0700 Subject: OWNERS.toolchain: clean up These folks were impacted by Friday's event. BUG=None TEST=None Change-Id: I4485076eca10f514d0bf94e4f0d9e8081a40208b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4190017 Tested-by: George Burgess Commit-Queue: George Burgess Reviewed-by: Ryan Beltran --- OWNERS.toolchain | 2 -- 1 file changed, 2 deletions(-) diff --git a/OWNERS.toolchain b/OWNERS.toolchain index e8cdbf98..967440e3 100644 --- a/OWNERS.toolchain +++ b/OWNERS.toolchain @@ -1,9 +1,7 @@ -adriandole@google.com ajordanr@google.com cjdb@google.com denik@chromium.org gbiv@chromium.org inglorion@chromium.org manojgupta@chromium.org -mbenfield@google.com ryanbeltran@chromium.org -- cgit v1.2.3 From b4f76a2ac07ed44dcd2c738a45cbc43019ebc9ca Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Thu, 26 Jan 2023 13:28:47 -0700 Subject: copy_rust_bootstrap: format Somehow this avoided the swap from `yapf` to `black`. Format it. This also fixes a copyright preupload check. BUG=b:266817148 TEST=None Change-Id: Ic34a7ba5b8aa2d5a8c745bc237051bab0aaed8cb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4195524 Commit-Queue: George Burgess Reviewed-by: Jordan Abrahams-Whitehead Tested-by: George Burgess --- rust_tools/copy_rust_bootstrap.py | 291 ++++++++++++++++++++------------------ 1 file changed, 151 insertions(+), 140 deletions(-) diff --git a/rust_tools/copy_rust_bootstrap.py b/rust_tools/copy_rust_bootstrap.py index 5da8007f..a61375ab 100755 --- a/rust_tools/copy_rust_bootstrap.py +++ b/rust_tools/copy_rust_bootstrap.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2022 The ChromiumOS Authors. +# Copyright 2022 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -21,172 +21,183 @@ import tempfile from typing import List -_LOCALMIRROR_ROOT = 'gs://chromeos-localmirror/distfiles/' +_LOCALMIRROR_ROOT = "gs://chromeos-localmirror/distfiles/" def _is_in_chroot() -> bool: - return Path('/etc/cros_chroot_version').exists() + return Path("/etc/cros_chroot_version").exists() def _ensure_pbzip2_is_installed(): - if shutil.which('pbzip2'): - return + if shutil.which("pbzip2"): + return - logging.info('Auto-installing pbzip2...') - subprocess.run(['sudo', 'emerge', '-G', 'pbzip2'], check=True) + logging.info("Auto-installing pbzip2...") + subprocess.run(["sudo", "emerge", "-G", "pbzip2"], check=True) def _determine_target_path(sdk_path: str) -> str: - """Determine where `sdk_path` should sit in localmirror.""" - gs_prefix = 'gs://' - if not sdk_path.startswith(gs_prefix): - raise ValueError(f'Invalid GS path: {sdk_path!r}') + """Determine where `sdk_path` should sit in localmirror.""" + gs_prefix = "gs://" + if not sdk_path.startswith(gs_prefix): + raise ValueError(f"Invalid GS path: {sdk_path!r}") - file_name = Path(sdk_path[len(gs_prefix):]).name - return _LOCALMIRROR_ROOT + file_name + file_name = Path(sdk_path[len(gs_prefix) :]).name + return _LOCALMIRROR_ROOT + file_name def _download(remote_path: str, local_file: Path): - """Downloads the given gs:// path to the given local file.""" - logging.info('Downloading %s -> %s', remote_path, local_file) - subprocess.run( - ['gsutil.py', 'cp', remote_path, - str(local_file)], - check=True, - ) - - -def _debinpkgify(binpkg_file: Path) -> Path: - """Converts a binpkg into the files it installs. - - Note that this function makes temporary files in the same directory as - `binpkg_file`. It makes no attempt to clean them up. - """ - logging.info('Converting %s from a binpkg...', binpkg_file) - - # The SDK builder produces binary packages: - # https://wiki.gentoo.org/wiki/Binary_package_guide - # - # Which means that `binpkg_file` is in the XPAK format. We want to split - # that out, and recompress it from zstd (which is the compression format - # that CrOS uses) to bzip2 (which is what we've historically used, and - # which is what our ebuild expects). - tmpdir = binpkg_file.parent - - def _mkstemp(suffix=None) -> str: - fd, file_path = tempfile.mkstemp(dir=tmpdir, suffix=suffix) - os.close(fd) - return Path(file_path) - - # First, split the actual artifacts that land in the chroot out to - # `temp_file`. - artifacts_file = _mkstemp() - logging.info('Extracting artifacts from %s into %s...', binpkg_file, - artifacts_file) - with artifacts_file.open('wb') as f: + """Downloads the given gs:// path to the given local file.""" + logging.info("Downloading %s -> %s", remote_path, local_file) subprocess.run( - [ - 'qtbz2', - '-s', - '-t', - '-O', - str(binpkg_file), - ], + ["gsutil.py", "cp", remote_path, str(local_file)], check=True, - stdout=f, ) - decompressed_artifacts_file = _mkstemp() - decompressed_artifacts_file.unlink() - logging.info('Decompressing artifacts from %s to %s...', artifacts_file, - decompressed_artifacts_file) - subprocess.run( - [ - 'zstd', - '-d', - str(artifacts_file), - '-o', - str(decompressed_artifacts_file), - ], - check=True, - ) - - # Finally, recompress it as a tbz2. - tbz2_file = _mkstemp('.tbz2') - logging.info( - 'Recompressing artifacts from %s to %s (this may take a while)...', - decompressed_artifacts_file, tbz2_file) - with tbz2_file.open('wb') as f: + +def _debinpkgify(binpkg_file: Path) -> Path: + """Converts a binpkg into the files it installs. + + Note that this function makes temporary files in the same directory as + `binpkg_file`. It makes no attempt to clean them up. + """ + logging.info("Converting %s from a binpkg...", binpkg_file) + + # The SDK builder produces binary packages: + # https://wiki.gentoo.org/wiki/Binary_package_guide + # + # Which means that `binpkg_file` is in the XPAK format. We want to split + # that out, and recompress it from zstd (which is the compression format + # that CrOS uses) to bzip2 (which is what we've historically used, and + # which is what our ebuild expects). + tmpdir = binpkg_file.parent + + def _mkstemp(suffix=None) -> str: + fd, file_path = tempfile.mkstemp(dir=tmpdir, suffix=suffix) + os.close(fd) + return Path(file_path) + + # First, split the actual artifacts that land in the chroot out to + # `temp_file`. + artifacts_file = _mkstemp() + logging.info( + "Extracting artifacts from %s into %s...", binpkg_file, artifacts_file + ) + with artifacts_file.open("wb") as f: + subprocess.run( + [ + "qtbz2", + "-s", + "-t", + "-O", + str(binpkg_file), + ], + check=True, + stdout=f, + ) + + decompressed_artifacts_file = _mkstemp() + decompressed_artifacts_file.unlink() + logging.info( + "Decompressing artifacts from %s to %s...", + artifacts_file, + decompressed_artifacts_file, + ) subprocess.run( [ - 'pbzip2', - '-9', - '-c', + "zstd", + "-d", + str(artifacts_file), + "-o", str(decompressed_artifacts_file), ], check=True, - stdout=f, ) - return tbz2_file + + # Finally, recompress it as a tbz2. + tbz2_file = _mkstemp(".tbz2") + logging.info( + "Recompressing artifacts from %s to %s (this may take a while)...", + decompressed_artifacts_file, + tbz2_file, + ) + with tbz2_file.open("wb") as f: + subprocess.run( + [ + "pbzip2", + "-9", + "-c", + str(decompressed_artifacts_file), + ], + check=True, + stdout=f, + ) + return tbz2_file def _upload(local_file: Path, remote_path: str, force: bool): - """Uploads the local file to the given gs:// path.""" - logging.info('Uploading %s -> %s', local_file, remote_path) - cmd_base = ['gsutil.py', 'cp', '-a', 'public-read'] - if not force: - cmd_base.append('-n') - subprocess.run( - cmd_base + [str(local_file), remote_path], - check=True, - stdin=subprocess.DEVNULL, - ) + """Uploads the local file to the given gs:// path.""" + logging.info("Uploading %s -> %s", local_file, remote_path) + cmd_base = ["gsutil.py", "cp", "-a", "public-read"] + if not force: + cmd_base.append("-n") + subprocess.run( + cmd_base + [str(local_file), remote_path], + check=True, + stdin=subprocess.DEVNULL, + ) def main(argv: List[str]): - logging.basicConfig( - format='>> %(asctime)s: %(levelname)s: %(filename)s:%(lineno)d: ' - '%(message)s', - level=logging.INFO, - ) - - parser = argparse.ArgumentParser( - description=__doc__, - formatter_class=argparse.RawDescriptionHelpFormatter, - ) - - parser.add_argument( - 'sdk_artifact', - help='Path to the SDK rust-bootstrap artifact to copy. e.g., ' - 'gs://chromeos-prebuilt/host/amd64/amd64-host/' - 'chroot-2022.07.12.134334/packages/dev-lang/' - 'rust-bootstrap-1.59.0.tbz2.') - parser.add_argument( - '-n', - '--dry-run', - action='store_true', - help='Do everything except actually uploading the artifact.') - parser.add_argument( - '--force', - action='store_true', - help='Upload the artifact even if one exists in localmirror already.') - opts = parser.parse_args(argv) - - if not _is_in_chroot(): - parser.error('Run me from within the chroot.') - _ensure_pbzip2_is_installed() - - target_path = _determine_target_path(opts.sdk_artifact) - with tempfile.TemporaryDirectory() as tempdir: - download_path = Path(tempdir) / 'sdk_artifact' - _download(opts.sdk_artifact, download_path) - file_to_upload = _debinpkgify(download_path) - if opts.dry_run: - logging.info('--dry-run specified; skipping upload of %s to %s', - file_to_upload, target_path) - else: - _upload(file_to_upload, target_path, opts.force) - - -if __name__ == '__main__': - main(sys.argv[1:]) + logging.basicConfig( + format=">> %(asctime)s: %(levelname)s: %(filename)s:%(lineno)d: " + "%(message)s", + level=logging.INFO, + ) + + parser = argparse.ArgumentParser( + description=__doc__, + formatter_class=argparse.RawDescriptionHelpFormatter, + ) + + parser.add_argument( + "sdk_artifact", + help="Path to the SDK rust-bootstrap artifact to copy. e.g., " + "gs://chromeos-prebuilt/host/amd64/amd64-host/" + "chroot-2022.07.12.134334/packages/dev-lang/" + "rust-bootstrap-1.59.0.tbz2.", + ) + parser.add_argument( + "-n", + "--dry-run", + action="store_true", + help="Do everything except actually uploading the artifact.", + ) + parser.add_argument( + "--force", + action="store_true", + help="Upload the artifact even if one exists in localmirror already.", + ) + opts = parser.parse_args(argv) + + if not _is_in_chroot(): + parser.error("Run me from within the chroot.") + _ensure_pbzip2_is_installed() + + target_path = _determine_target_path(opts.sdk_artifact) + with tempfile.TemporaryDirectory() as tempdir: + download_path = Path(tempdir) / "sdk_artifact" + _download(opts.sdk_artifact, download_path) + file_to_upload = _debinpkgify(download_path) + if opts.dry_run: + logging.info( + "--dry-run specified; skipping upload of %s to %s", + file_to_upload, + target_path, + ) + else: + _upload(file_to_upload, target_path, opts.force) + + +if __name__ == "__main__": + main(sys.argv[1:]) -- cgit v1.2.3 From d80508178eec342b209faa70d9fca007898197fc Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Thu, 26 Jan 2023 13:23:30 -0700 Subject: copy_rust_bootstrap: don't require pbzip2 binary packages pbzip2 may or may not have a readily-accessible binary package available. Just ask for a binary package, rather than requiring one. BUG=b:266817148 TEST=Ran the script to upload rust-bootstrap. Change-Id: I888df257701d824fc4937a9d3695ce830d936107 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4195525 Tested-by: George Burgess Reviewed-by: Jordan Abrahams-Whitehead Commit-Queue: George Burgess --- rust_tools/copy_rust_bootstrap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust_tools/copy_rust_bootstrap.py b/rust_tools/copy_rust_bootstrap.py index a61375ab..f62fc78c 100755 --- a/rust_tools/copy_rust_bootstrap.py +++ b/rust_tools/copy_rust_bootstrap.py @@ -33,7 +33,7 @@ def _ensure_pbzip2_is_installed(): return logging.info("Auto-installing pbzip2...") - subprocess.run(["sudo", "emerge", "-G", "pbzip2"], check=True) + subprocess.run(["sudo", "emerge", "-g", "pbzip2"], check=True) def _determine_target_path(sdk_path: str) -> str: -- cgit v1.2.3 From 709c4ad6e613d1365c0cfc62b8ab079667109869 Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Fri, 27 Jan 2023 22:13:34 +0000 Subject: toolchain_utils: chrome_src flag for buildbot_test_toolchains At present, buildbot_test_toolchains always uses the chroot's chrome checkout for running telemetry tests. This CL allows callers to change that behaviour with the --chrome_src flag. BUG=b:255191595 TEST=./run_tests.py TEST=Ran on chrotomation with --chrome_src=doesntexist Change-Id: I7099b13882b72aabf0a4988fec20b90ee80a873f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4201149 Tested-by: Jordan Abrahams-Whitehead Reviewed-by: George Burgess Commit-Queue: Jordan Abrahams-Whitehead --- buildbot_test_toolchains.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/buildbot_test_toolchains.py b/buildbot_test_toolchains.py index e847af4e..e67a151b 100755 --- a/buildbot_test_toolchains.py +++ b/buildbot_test_toolchains.py @@ -84,10 +84,12 @@ class ToolchainComparator(object): recipe=False, test=False, noschedv2=False, + chrome_src="", ): self._board = board self._remotes = remotes self._chromeos_root = chromeos_root + self._chrome_src = chrome_src self._base_dir = os.getcwd() self._ce = command_executer.GetCommandExecuter() self._l = logger.GetLogger() @@ -189,11 +191,13 @@ class ToolchainComparator(object): official_image = """ vanilla_image { chromeos_root: %s + chrome_src: %s build: %s compiler: llvm } """ % ( self._chromeos_root, + self._chrome_src, vanilla_image, ) f.write(official_image) @@ -207,6 +211,7 @@ class ToolchainComparator(object): experiment_image = """ %s { chromeos_root: %s + chrome_src: %s build: %s autotest_path: %s compiler: %s @@ -214,6 +219,7 @@ class ToolchainComparator(object): """ % ( label_string, self._chromeos_root, + self._chrome_src, trybot_image, autotest_files, compiler_string, @@ -336,6 +342,14 @@ def Main(argv): dest="chromeos_root", help="The chromeos root from which to run tests.", ) + parser.add_argument( + "--chrome_src", + dest="chrome_src", + default="", + help="The path to the source of chrome. " + "This is used to run telemetry benchmarks. " + "The default one is the src inside chroot.", + ) parser.add_argument( "--weekday", default="", @@ -397,6 +411,7 @@ def Main(argv): options.recipe, options.test, options.noschedv2, + chrome_src=options.chrome_src, ) return fc.DoAll() -- cgit v1.2.3 From 677eb0d0ad8e9e1944904e57d0968d524cc6e6f6 Mon Sep 17 00:00:00 2001 From: mobiletc-prebuild Date: Fri, 27 Jan 2023 14:39:36 -0800 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-4.19 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: I76ea287a808379af2f3b8440910279613e0a1f5e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4201150 Commit-Queue: Denis Nikitin Tested-by: Denis Nikitin Reviewed-by: Denis Nikitin --- afdo_metadata/kernel_afdo.json | 8 ++++---- afdo_metadata/kernel_arm_afdo.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index 4c04b3f7..4b365ec6 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -1,14 +1,14 @@ { "chromeos-kernel-4_14": { - "name": "R111-15278.21-1673260710" + "name": "R111-15278.36-1674470326" }, "chromeos-kernel-4_19": { - "name": "R111-15278.21-1673260798" + "name": "R111-15278.36-1674469885" }, "chromeos-kernel-5_4": { - "name": "R111-15278.21-1673260656" + "name": "R111-15278.36-1674469988" }, "chromeos-kernel-5_10": { - "name": "R111-15278.21-1673260561" + "name": "R111-15278.36-1674469892" } } diff --git a/afdo_metadata/kernel_arm_afdo.json b/afdo_metadata/kernel_arm_afdo.json index 38a76b37..8b48f95b 100644 --- a/afdo_metadata/kernel_arm_afdo.json +++ b/afdo_metadata/kernel_arm_afdo.json @@ -1,5 +1,5 @@ { "chromeos-kernel-5_15": { - "name": "R111-15278.21-1673260848" + "name": "R111-15278.36-1674470009" } } -- cgit v1.2.3 From 7febf5f0fb53cc5b64b672c5c273eda821d4d0ab Mon Sep 17 00:00:00 2001 From: denik Date: Fri, 27 Jan 2023 13:58:28 -0800 Subject: update_kernel_afdo: Add auto-upload with reviewers Add --nointeractive mode to run the script by automation. Add reviewers, cc and replace `git push` with `repo upload`. BUG=b:266976673 TEST=tested on chrotomation. Change-Id: I034d38a51b62ba0a37588aff82da82a872662143 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4201148 Tested-by: Denis Nikitin Reviewed-by: George Burgess Reviewed-by: Manoj Gupta Commit-Queue: Denis Nikitin --- afdo_tools/update_kernel_afdo | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/afdo_tools/update_kernel_afdo b/afdo_tools/update_kernel_afdo index 9e4d645d..0c4fb96d 100755 --- a/afdo_tools/update_kernel_afdo +++ b/afdo_tools/update_kernel_afdo @@ -9,14 +9,17 @@ # USAGE=" -Usage: $(basename "$0") [--noupload|-upload] [main|beta|stable|all] [--help] +Usage: $(basename "$0") [--help] [--(no)upload] [--nointeractive] + [main|beta|stable|all] Description: The script takes one optional argument which is the channel where we want to update the kernel afdo and creates a commit (or commits with \"all\" channels) in the corresponding branch. No arguments defaults to \"all\". - Follow the prompt to upload the changes. + Follow the prompt to upload the changes with --noupload. Otherwise + the script will automatically create CL and send to the detective + for review. NO CLEAN-UP NEEDED. The script ignores any local changes and keeps the current branch unchanged. @@ -24,6 +27,7 @@ the current branch unchanged. --help Show this help. --upload Upload CLs when the update succeeded (default). --noupload Do not upload CLs. Instead, print the upload commands. + --nointeractive Runs the script without user interaction. main|beta|stable Update metadata only on the specified channel. " @@ -37,6 +41,9 @@ ARM_KVERS="5.15" failed_channels="" # Add skipped chrome branches in ascending order here. SKIPPED_BRANCHES="95" +# CL reviewers and cc. +reviewers="c-compiler-chrome@google.com" +cc="denik@google.com" # NOTE: We enable/disable kernel AFDO starting from a particular branch. # For example if we want to enable kernel AFDO in 5.15, first, we do it @@ -68,6 +75,8 @@ abs_tc_utils_dir="$(realpath "${tc_utils_dir}")" expected_time=$(date +%s -d "week ago") # Upload CLs on success. upload_cl=true +# Interactive mode. +interactive=true ARCHS="amd arm" declare -A arch_gsbase arch_kvers arch_outfile @@ -124,6 +133,9 @@ do --upload) upload_cl=true ;; + --nointeractive) + interactive=false + ;; --help | help | -h ) echo "${USAGE}" exit 0 @@ -155,7 +167,8 @@ echo "-> Working in ${worktree_dir}" # This way we don't need to clean-up and sync toolchain_utils before the # change. Neither we should care about clean-up after the submit. git -C "${tc_utils_dir}" worktree add --detach "${worktree_dir}" -trap 'git -C "${abs_tc_utils_dir}" worktree remove -f "${worktree_dir}"' EXIT +trap 'git -C "${abs_tc_utils_dir}" worktree remove -f "${worktree_dir}" \ + && git -C "${abs_tc_utils_dir}" branch -D ${channels}' EXIT pushd "${worktree_dir}" for channel in ${channels} @@ -178,7 +191,7 @@ do echo "branch_number=${curr_branch_number} branch=${curr_branch}" git reset --hard HEAD - git checkout "${remote_repo}/${curr_branch}" + git checkout -b "${channel}" "${remote_repo}/${curr_branch}" for arch in ${ARCHS} do @@ -312,7 +325,12 @@ TEST=Verified in kernel-release-afdo-verify-orchestrator" exit 2 esac - git commit -v -e -m "${commit_contents}" + if ${interactive} + then + git commit -v -e -m "${commit_contents}" + else + git commit -m "${commit_contents}" + fi commit[${channel}]=$(git -C "${worktree_dir}" rev-parse HEAD) done @@ -329,8 +347,15 @@ then then for channel in "${!commit[@]}" do - git -C "${tc_utils_dir}" push "${remote_repo}" \ - "${commit[${channel}]}:refs/for/${branch[${channel}]}" + if ${interactive} + then + (cd "${tc_utils_dir}" && \ + repo upload --br="${channel}" --re="${reviewers}" --cc="${cc}" .) + else + (cd "${tc_utils_dir}" && \ + repo upload --br="${channel}" --no-verify -y --re="${reviewers}" \ + --cc="${cc}" .) + fi done else echo "Run these commands to upload the change:" -- cgit v1.2.3 From 5e4b9bde55dcc22b1ff5bcfa486602f1c58133ed Mon Sep 17 00:00:00 2001 From: mobiletc-prebuild Date: Wed, 1 Feb 2023 10:06:14 -0800 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-4.19 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: I740e855d7e995b85e08d41d6d3de7a227cd444f5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4210753 Tested-by: Manoj Gupta Reviewed-by: Manoj Gupta Commit-Queue: Manoj Gupta --- afdo_metadata/kernel_afdo.json | 8 ++++---- afdo_metadata/kernel_arm_afdo.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index 4b365ec6..4cdff183 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -1,14 +1,14 @@ { "chromeos-kernel-4_14": { - "name": "R111-15278.36-1674470326" + "name": "R111-15324.0-1675074990" }, "chromeos-kernel-4_19": { - "name": "R111-15278.36-1674469885" + "name": "R111-15278.41-1675074684" }, "chromeos-kernel-5_4": { - "name": "R111-15278.36-1674469988" + "name": "R111-15324.0-1675075224" }, "chromeos-kernel-5_10": { - "name": "R111-15278.36-1674469892" + "name": "R111-15324.0-1675074791" } } diff --git a/afdo_metadata/kernel_arm_afdo.json b/afdo_metadata/kernel_arm_afdo.json index 8b48f95b..7d2ec60c 100644 --- a/afdo_metadata/kernel_arm_afdo.json +++ b/afdo_metadata/kernel_arm_afdo.json @@ -1,5 +1,5 @@ { "chromeos-kernel-5_15": { - "name": "R111-15278.36-1674470009" + "name": "R111-15324.0-1675074726" } } -- cgit v1.2.3 From 463b80e7028741ca70598977254075893e027f69 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Mon, 30 Jan 2023 13:58:10 -0700 Subject: compiler_wrapper: add size checking to build.py This adds correctness checking while we try to reason about what causes the flakes in b/203821449. BUG=b:203821449 TEST=CQ Cq-Depend: chromium:4206349 Change-Id: I93a9dff0ca45bb303ed5302b1c238f6cdee88bcc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4205829 Tested-by: George Burgess Reviewed-by: Jordan Abrahams-Whitehead Commit-Queue: George Burgess --- compiler_wrapper/build.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/compiler_wrapper/build.py b/compiler_wrapper/build.py index 930c2cfb..58822880 100755 --- a/compiler_wrapper/build.py +++ b/compiler_wrapper/build.py @@ -49,7 +49,7 @@ def parse_args(): return args -def calc_go_args(args, version, build_dir): +def calc_go_args(args, version, build_dir, output_file): # These seem unnecessary, and might lead to breakages with Go's ldflag # parsing. Don't allow them. if "'" in version: @@ -89,7 +89,7 @@ def calc_go_args(args, version, build_dir): "go", "build", "-o", - os.path.abspath(args.output_file), + output_file, "-ldflags", " ".join(ldFlags), ] + extra_args @@ -119,10 +119,23 @@ def main(): version += args.version_suffix # Note: Go does not support using absolute package names. # So we run go inside the directory of the the build file. - sys.exit( - subprocess.call(calc_go_args(args, version, build_dir), cwd=build_dir) + output_file = os.path.abspath(args.output_file) + subprocess.check_call( + calc_go_args(args, version, build_dir, output_file), cwd=build_dir ) + # b/203821449: we're occasionally seeing very small (and non-functional) + # compiler-wrapper binaries on SDK builds. To help narrow down why, add a + # size check here. Locally, the wrapper is 1.9MB, so warning on <1MB + # shouldn't flag false-positives. + size = os.path.getsize(output_file) + min_size_bytes = 1024 * 1024 + if size < min_size_bytes: + raise ValueError( + f"Compiler wrapper is {size:,} bytes; expected at " + f"least {min_size_bytes:,}" + ) + if __name__ == "__main__": main() -- cgit v1.2.3 From 028ba04b7d1aadae0dac3919d14f4555408b565d Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Wed, 1 Feb 2023 19:15:55 -0700 Subject: rust_watch: add a note about the stable-to-stable upstream bug tag This is potentially helpful when trying to figure out why a new version of Rust is breaking. BUG=b:267548169 TEST=unittests Change-Id: I710bfb0b8a1dc9821110f5d2ca56aa9b44f09e2f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4215318 Tested-by: George Burgess Reviewed-by: Bob Haarman Commit-Queue: George Burgess --- rust_tools/rust_watch.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rust_tools/rust_watch.py b/rust_tools/rust_watch.py index dff239f3..953017b4 100755 --- a/rust_tools/rust_watch.py +++ b/rust_tools/rust_watch.py @@ -257,7 +257,11 @@ def maybe_compose_bug( title = f"[Rust] Update to {newest_release}" body = ( "A new release has been detected; we should probably roll to it. " - "Please see go/crostc-rust-rotation for who's turn it is." + "Please see go/crostc-rust-rotation for who's turn it is.\n" + "\n" + "The regression-from-stable-to-stable tag might be interesting to " + "keep an eye on: https://github.com/rust-lang/rust/labels/" + "regression-from-stable-to-stable" ) return title, body -- cgit v1.2.3 From 0be0ba564cc676c1ac8735d755b75e1d760de14c Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Wed, 1 Feb 2023 19:24:26 -0700 Subject: add android component to cros_utils; use it in rust_watch This makes rust_watch's bug filing bits a bit more generic and more easily attributed to us, since Android would like these bugs, as well. cl/506479306 adds this well-known component to the internal bug filer. BUG=b:267548169 TEST=unittests Change-Id: Id9da9061e196c4a7df00a425b408e9b948d98544 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4215319 Commit-Queue: George Burgess Tested-by: George Burgess Reviewed-by: Bob Haarman --- cros_utils/bugs.py | 3 +++ rust_tools/rust_watch.py | 23 +++++++++++++---------- rust_tools/rust_watch_test.py | 7 ++++--- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/cros_utils/bugs.py b/cros_utils/bugs.py index 43e0e553..9a84ac40 100755 --- a/cros_utils/bugs.py +++ b/cros_utils/bugs.py @@ -16,11 +16,14 @@ from typing import Any, Dict, List, Optional X20_PATH = "/google/data/rw/teams/c-compiler-chrome/prod_bugs" +# These constants are sourced from +# //google3/googleclient/chrome/chromeos_toolchain/bug_manager/bugs.go class WellKnownComponents(enum.IntEnum): """A listing of "well-known" components recognized by our infra.""" CrOSToolchainPublic = -1 CrOSToolchainPrivate = -2 + AndroidRustToolchain = -3 def _WriteBugJSONFile(object_type: str, json_object: Dict[str, Any]): diff --git a/rust_tools/rust_watch.py b/rust_tools/rust_watch.py index 953017b4..f0ce8a03 100755 --- a/rust_tools/rust_watch.py +++ b/rust_tools/rust_watch.py @@ -236,14 +236,14 @@ def atomically_write_state(state_file: pathlib.Path, state: State) -> None: def file_bug(title: str, body: str) -> None: - """Files a bug against gbiv@ with the given title/body.""" - bugs.CreateNewBug( - bugs.WellKnownComponents.CrOSToolchainPublic, - title, - body, - # To either take or reassign depending on the rotation. - assignee="gbiv@google.com", + """Files update bugs with the given title/body.""" + # (component, optional_assignee) + targets = ( + (bugs.WellKnownComponents.CrOSToolchainPublic, "gbiv@google.com"), + (bugs.WellKnownComponents.AndroidRustToolchain, None), ) + for component, assignee in targets: + bugs.CreateNewBug(component, title, body, assignee) def maybe_compose_bug( @@ -256,12 +256,15 @@ def maybe_compose_bug( title = f"[Rust] Update to {newest_release}" body = ( - "A new release has been detected; we should probably roll to it. " - "Please see go/crostc-rust-rotation for who's turn it is.\n" + "A new Rust stable release has been detected; we should probably roll " + "to it.\n" "\n" "The regression-from-stable-to-stable tag might be interesting to " "keep an eye on: https://github.com/rust-lang/rust/labels/" - "regression-from-stable-to-stable" + "regression-from-stable-to-stable\n" + "\n" + "For questions about this bot, please contact chromeos-toolchain@ and " + "CC gbiv@." ) return title, body diff --git a/rust_tools/rust_watch_test.py b/rust_tools/rust_watch_test.py index 1e6aec51..79006f35 100755 --- a/rust_tools/rust_watch_test.py +++ b/rust_tools/rust_watch_test.py @@ -139,6 +139,7 @@ class Test(unittest.TestCase): self.assertIsNone(rust_watch.maybe_compose_email(new_gentoo_commits=())) def test_compose_bug_creates_bugs_on_new_versions(self): + bug_body_start = "A new Rust stable release has been detected;" title, body = rust_watch.maybe_compose_bug( old_state=rust_watch.State( last_seen_release=rust_watch.RustReleaseVersion(1, 0, 0), @@ -147,7 +148,7 @@ class Test(unittest.TestCase): newest_release=rust_watch.RustReleaseVersion(1, 0, 1), ) self.assertEqual(title, "[Rust] Update to 1.0.1") - self.assertTrue(body.startswith("A new release has been detected;")) + self.assertTrue(body.startswith(bug_body_start)) title, body = rust_watch.maybe_compose_bug( old_state=rust_watch.State( @@ -157,7 +158,7 @@ class Test(unittest.TestCase): newest_release=rust_watch.RustReleaseVersion(1, 1, 0), ) self.assertEqual(title, "[Rust] Update to 1.1.0") - self.assertTrue(body.startswith("A new release has been detected;")) + self.assertTrue(body.startswith(bug_body_start)) title, body = rust_watch.maybe_compose_bug( old_state=rust_watch.State( @@ -167,7 +168,7 @@ class Test(unittest.TestCase): newest_release=rust_watch.RustReleaseVersion(2, 0, 0), ) self.assertEqual(title, "[Rust] Update to 2.0.0") - self.assertTrue(body.startswith("A new release has been detected;")) + self.assertTrue(body.startswith(bug_body_start)) def test_compose_bug_does_nothing_when_no_new_updates_exist(self): self.assertIsNone( -- cgit v1.2.3 From d6fefce0d8288cc60ccb2b48060b0a9a09fbfe3a Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Sun, 5 Feb 2023 12:47:13 +1100 Subject: image_chromeos.py: Drop gbb_flags.sh script usage The script is now obsolete. BUG=b:260531154 TEST=none Change-Id: Ib7238932b670d00ac966c1e50d206b4060506a63 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4223151 Auto-Submit: Edward O'Callaghan Commit-Queue: Denis Nikitin Reviewed-by: Denis Nikitin Tested-by: Edward O'Callaghan Reviewed-by: Michael "Misha" Pishchagin --- image_chromeos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/image_chromeos.py b/image_chromeos.py index 36965d05..36384e88 100755 --- a/image_chromeos.py +++ b/image_chromeos.py @@ -63,7 +63,7 @@ def DisableCrosBeeps(chromeos_root, remote, log_level): """Disable annoying chromebooks beeps after reboots.""" cmd_executer = command_executer.GetCommandExecuter(log_level=log_level) - command = "/usr/share/vboot/bin/set_gbb_flags.sh 0x1" + command = "/usr/bin/futility gbb --set --flash --flags=0x1" logger.GetLogger().LogOutput("Trying to disable beeping.") ret, o, _ = cmd_executer.CrosRunCommandWOutput( -- cgit v1.2.3 From bbb092195b26b8c515b45fdba5ffc3c75e843536 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Wed, 8 Feb 2023 14:09:55 -0700 Subject: bugs: emit reports in an order that bug_manager will respect cl/508145633 has our bug_manager always iterate through new JSON reports in sorted order (where "sorted" means "sorted by their file names"). This change has us emit reports from a process in a consistent order. BUG=b:268368949 TEST=unittests Fixed: b:268368949 Change-Id: I61d02079338e85b0b1e68749c51dafe1866d98e7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4234617 Commit-Queue: George Burgess Reviewed-by: Jordan Abrahams-Whitehead Tested-by: George Burgess --- cros_utils/bugs.py | 57 +++++++++++++++++++++++++++++++++++++++---------- cros_utils/bugs_test.py | 42 ++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 11 deletions(-) diff --git a/cros_utils/bugs.py b/cros_utils/bugs.py index 9a84ac40..25da130d 100755 --- a/cros_utils/bugs.py +++ b/cros_utils/bugs.py @@ -5,17 +5,16 @@ """Utilities to file bugs.""" -import base64 import datetime import enum import json import os +import threading from typing import Any, Dict, List, Optional X20_PATH = "/google/data/rw/teams/c-compiler-chrome/prod_bugs" - # These constants are sourced from # //google3/googleclient/chrome/chromeos_toolchain/bug_manager/bugs.go class WellKnownComponents(enum.IntEnum): @@ -26,6 +25,47 @@ class WellKnownComponents(enum.IntEnum): AndroidRustToolchain = -3 +class _FileNameGenerator: + """Generates unique file names. This container is thread-safe. + + The names generated have the following properties: + - successive, sequenced calls to `get_json_file_name()` will produce + names that sort later in lists over time (e.g., + [generator.generate_json_file_name() for _ in range(10)] will be in + sorted order). + - file names cannot collide with file names generated on the same + machine (ignoring machines with unreasonable PID reuse). + - file names are incredibly unlikely to collide when generated on + multiple machines, as they have 8 bytes of entropy in them. + """ + + _RANDOM_BYTES = 8 + _MAX_OS_ENTROPY_VALUE = 1 << _RANDOM_BYTES * 8 + # The intent of this is "the maximum possible size of our entropy string, + # so we can zfill properly below." Double the value the OS hands us, since + # we add to it in `generate_json_file_name`. + _ENTROPY_STR_SIZE = len(str(2 * _MAX_OS_ENTROPY_VALUE)) + + def __init__(self): + self._lock = threading.Lock() + self._entropy = int.from_bytes( + os.getrandom(self._RANDOM_BYTES), byteorder="little", signed=False + ) + + def generate_json_file_name(self, now: datetime.datetime): + with self._lock: + my_entropy = self._entropy + self._entropy += 1 + + now = now.isoformat("T", "seconds") + "Z" + entropy_str = str(my_entropy).zfill(self._ENTROPY_STR_SIZE) + pid = os.getpid() + return f"{now}_{entropy_str}_{pid}.json" + + +_GLOBAL_NAME_GENERATOR = _FileNameGenerator() + + def _WriteBugJSONFile(object_type: str, json_object: Dict[str, Any]): """Writes a JSON file to X20_PATH with the given bug-ish object.""" final_object = { @@ -33,15 +73,10 @@ def _WriteBugJSONFile(object_type: str, json_object: Dict[str, Any]): "value": json_object, } - # The name of this has two parts: - # - An easily sortable time, to provide uniqueness and let our service send - # things in the order they were put into the outbox. - # - 64 bits of entropy, so two racing bug writes don't clobber the same file. - now = datetime.datetime.utcnow().isoformat("T", "seconds") + "Z" - entropy = base64.urlsafe_b64encode(os.getrandom(8)) - entropy_str = entropy.rstrip(b"=").decode("utf-8") - file_path = os.path.join(X20_PATH, f"{now}_{entropy_str}.json") - + now = datetime.datetime.now(tz=datetime.timezone.utc) + file_path = os.path.join( + X20_PATH, _GLOBAL_NAME_GENERATOR.generate_json_file_name(now) + ) temp_path = file_path + ".in_progress" try: with open(temp_path, "w") as f: diff --git a/cros_utils/bugs_test.py b/cros_utils/bugs_test.py index 5a07dbd8..53525b30 100755 --- a/cros_utils/bugs_test.py +++ b/cros_utils/bugs_test.py @@ -8,6 +8,7 @@ """Tests bug filing bits.""" +import datetime import json import tempfile import unittest @@ -16,6 +17,9 @@ from unittest.mock import patch import bugs +_ARBITRARY_DATETIME = datetime.datetime(2020, 1, 1, 23, 0, 0, 0) + + class Tests(unittest.TestCase): """Tests for the bugs module.""" @@ -126,6 +130,44 @@ class Tests(unittest.TestCase): }, ) + def testFileNameGenerationProducesFileNamesInSortedOrder(self): + """Tests that _FileNameGenerator gives us sorted file names.""" + gen = bugs._FileNameGenerator() + first = gen.generate_json_file_name(_ARBITRARY_DATETIME) + second = gen.generate_json_file_name(_ARBITRARY_DATETIME) + self.assertLess(first, second) + + def testFileNameGenerationProtectsAgainstRipplingAdds(self): + """Tests that _FileNameGenerator gives us sorted file names.""" + gen = bugs._FileNameGenerator() + gen._entropy = 9 + first = gen.generate_json_file_name(_ARBITRARY_DATETIME) + second = gen.generate_json_file_name(_ARBITRARY_DATETIME) + self.assertLess(first, second) + + gen = bugs._FileNameGenerator() + all_9s = "9" * (gen._ENTROPY_STR_SIZE - 1) + gen._entropy = int(all_9s) + third = gen.generate_json_file_name(_ARBITRARY_DATETIME) + self.assertLess(second, third) + + fourth = gen.generate_json_file_name(_ARBITRARY_DATETIME) + self.assertLess(third, fourth) + + @patch("os.getpid") + def testForkingProducesADifferentReport(self, mock_getpid): + """Tests that _FileNameGenerator gives us sorted file names.""" + gen = bugs._FileNameGenerator() + + mock_getpid.return_value = 1 + gen._entropy = 0 + parent_file = gen.generate_json_file_name(_ARBITRARY_DATETIME) + + mock_getpid.return_value = 2 + gen._entropy = 0 + child_file = gen.generate_json_file_name(_ARBITRARY_DATETIME) + self.assertNotEqual(parent_file, child_file) + if __name__ == "__main__": unittest.main() -- cgit v1.2.3 From 832e940b6536f94f9acb0324ce3a282fe51b0ba0 Mon Sep 17 00:00:00 2001 From: mobiletc-prebuild Date: Wed, 8 Feb 2023 10:05:59 -0800 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-4.19 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: Ide40303ed6015bf7322684124d507b11b1aaa48b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4231217 Commit-Queue: Denis Nikitin Tested-by: Denis Nikitin Reviewed-by: Denis Nikitin --- afdo_metadata/kernel_afdo.json | 8 ++++---- afdo_metadata/kernel_arm_afdo.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index 4cdff183..98673562 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -1,14 +1,14 @@ { "chromeos-kernel-4_14": { - "name": "R111-15324.0-1675074990" + "name": "R112-15329.8-1675679904" }, "chromeos-kernel-4_19": { - "name": "R111-15278.41-1675074684" + "name": "R112-15324.0-1675679720" }, "chromeos-kernel-5_4": { - "name": "R111-15324.0-1675075224" + "name": "R112-15329.8-1675679717" }, "chromeos-kernel-5_10": { - "name": "R111-15324.0-1675074791" + "name": "R112-15329.8-1675679624" } } diff --git a/afdo_metadata/kernel_arm_afdo.json b/afdo_metadata/kernel_arm_afdo.json index 7d2ec60c..27e3b7b7 100644 --- a/afdo_metadata/kernel_arm_afdo.json +++ b/afdo_metadata/kernel_arm_afdo.json @@ -1,5 +1,5 @@ { "chromeos-kernel-5_15": { - "name": "R111-15324.0-1675074726" + "name": "R112-15335.0-1675679803" } } -- cgit v1.2.3 From 62173b0a9cb6237a76812fd2e433e0f2c76333a5 Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Fri, 10 Feb 2023 20:33:43 +0000 Subject: patch_sync: Validate patches during parsing At present, patch_sync will just ignore invalid patches when trying to find new values during transposing. This has worked fine for a while, but if someone accidentally puts an incorrect platform type or omits the patch file, we really should report an error. This CL adds the error reporting functionality. Example error: mobiletc-prebuild@chrotomation:~/$ /tmp/patch_sync_wrapper.sh Error: finding new patches for chromiumos Caused by: Patch cherry/f1764d5b594ff6edbf8d17d196eb0b7a653ac0fc.patch did not apply to platform chromiumos BUG=b:268657960 TEST=cargo test TEST=Tested on chrotomation Change-Id: I3d386d930da5b61b3d887e479b3d133100d236f6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4240721 Reviewed-by: Manoj Gupta Tested-by: Jordan Abrahams-Whitehead Reviewed-by: George Burgess Commit-Queue: Jordan Abrahams-Whitehead --- llvm_tools/patch_sync/src/patch_parsing.rs | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/llvm_tools/patch_sync/src/patch_parsing.rs b/llvm_tools/patch_sync/src/patch_parsing.rs index ecf2259f..7f545e5b 100644 --- a/llvm_tools/patch_sync/src/patch_parsing.rs +++ b/llvm_tools/patch_sync/src/patch_parsing.rs @@ -7,7 +7,7 @@ use std::fs::{copy, read_to_string, File}; use std::io::{BufRead, BufReader, Read, Write}; use std::path::{Path, PathBuf}; -use anyhow::{anyhow, Context, Result}; +use anyhow::{anyhow, bail, Context, Result}; use serde::{Deserialize, Serialize}; use sha2::{Digest, Sha256}; @@ -340,8 +340,7 @@ pub fn new_patches( // Set up the current patch collection. let cur_collection = PatchCollection::parse_from_file(patches_path) .with_context(|| format!("parsing {} PATCHES.json", platform))?; - let cur_collection = filter_patches_by_platform(&cur_collection, platform); - let cur_collection = cur_collection.filter_patches(|p| cur_collection.patch_exists(p)); + validate_patches(&cur_collection, platform)?; // Set up the old patch collection. let old_collection = PatchCollection::parse_from_str( @@ -378,6 +377,25 @@ pub fn filter_patches_by_platform(collection: &PatchCollection, platform: &str) }) } +/// Verify the patches all exist and apply to the given platform. +/// +/// If all good, return Unit. Otherwise, return an Err. +pub fn validate_patches(collection: &PatchCollection, platform: &str) -> Result<()> { + for p in &collection.patches { + if !collection.patch_exists(p) { + bail!("Patch {} does not exist", p.rel_patch_path); + } + if !p.platforms.is_empty() && !p.platforms.contains(platform) { + bail!( + "Patch {} did not apply to platform {}", + p.rel_patch_path, + platform + ); + } + } + Ok(()) +} + /// Get the hash from the patch file contents. /// /// Not every patch file actually contains its own hash, -- cgit v1.2.3 From 7e2979a5a48d77ac5e929ebf84c113faae8f98af Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Thu, 9 Feb 2023 09:03:40 -0700 Subject: auto_delete_nightly_test_data: clean our new Chrome directory In b/267097908, we moved to a new Chromium directory. Clean that up now instead. BUG=b:268442596 TEST=None Change-Id: I2be6a1ff385e84b1b33d0b9f1d77d4a2df1ba9d9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4234635 Tested-by: George Burgess Auto-Submit: George Burgess Commit-Queue: Denis Nikitin Reviewed-by: Denis Nikitin --- auto_delete_nightly_test_data.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/auto_delete_nightly_test_data.py b/auto_delete_nightly_test_data.py index 0dd2dba8..e666d23a 100755 --- a/auto_delete_nightly_test_data.py +++ b/auto_delete_nightly_test_data.py @@ -305,15 +305,7 @@ def CleanOldCLs(days_to_preserve="1", dry_run=False): def CleanChromeTelemetryTmpFiles(dry_run: bool) -> int: - tmp_dir = ( - Path(constants.CROSTC_WORKSPACE) - / "chromeos" - / ".cache" - / "distfiles" - / "chrome-src-internal" - / "src" - / "tmp" - ) + tmp_dir = Path(constants.CROSTC_WORKSPACE) / "chrome" / "src" / "tmp" return RemoveAllSubdirsMatchingPredicate( tmp_dir, days_to_preserve=0, -- cgit v1.2.3 From ab9c0d42e35373949fc8e191d727231d98ddd0ee Mon Sep 17 00:00:00 2001 From: Denis Nikitin Date: Thu, 9 Feb 2023 15:12:52 -0800 Subject: update_kernel_afdo: Update amd64 gs location BUG=b:257319393 TEST=passed locally Change-Id: I74ac1c33925b6ca4ccc5fd9078b58a958f40da44 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4237343 Tested-by: Denis Nikitin Reviewed-by: George Burgess Commit-Queue: Denis Nikitin --- afdo_tools/update_kernel_afdo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afdo_tools/update_kernel_afdo b/afdo_tools/update_kernel_afdo index 0c4fb96d..feccb7f3 100755 --- a/afdo_tools/update_kernel_afdo +++ b/afdo_tools/update_kernel_afdo @@ -34,7 +34,7 @@ the current branch unchanged. set -eu set -o pipefail -AMD_GS_BASE=gs://chromeos-prebuilt/afdo-job/vetted/kernel +AMD_GS_BASE=gs://chromeos-prebuilt/afdo-job/vetted/kernel/amd64 ARM_GS_BASE=gs://chromeos-prebuilt/afdo-job/vetted/kernel/arm AMD_KVERS="4.14 4.19 5.4 5.10" ARM_KVERS="5.15" -- cgit v1.2.3 From ea74c93a15a842d2a73792f63d548c45f93b729a Mon Sep 17 00:00:00 2001 From: Denis Nikitin Date: Thu, 9 Feb 2023 22:18:43 -0800 Subject: update_kernel_afdo: Fix "no updates" Exit early if no profiles were updated. BUG=None TEST=./update_kernel_afdo --noupload Change-Id: I1b247379b39b613bd2bc30df3f74cbbc744b2318 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4237344 Reviewed-by: George Burgess Tested-by: Denis Nikitin Commit-Queue: Denis Nikitin --- afdo_tools/update_kernel_afdo | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/afdo_tools/update_kernel_afdo b/afdo_tools/update_kernel_afdo index feccb7f3..d411a6eb 100755 --- a/afdo_tools/update_kernel_afdo +++ b/afdo_tools/update_kernel_afdo @@ -193,6 +193,7 @@ do git reset --hard HEAD git checkout -b "${channel}" "${remote_repo}/${curr_branch}" + new_changes=false for arch in ${ARCHS} do json="{" @@ -295,8 +296,15 @@ EOT fi git add "${arch_outfile[${arch}]}" + new_changes=true done # ARCHS loop + if ! ${new_changes} + then + echo "Skipping \"${channel}\" - all profiles are up to date" + continue + fi + case "${channel}" in canary ) commit_contents=$'afdo_metadata: Publish the new kernel profiles\n\n' -- cgit v1.2.3 From 8c0ec43fcc1494d0408e4fdec3a32653a60fddb1 Mon Sep 17 00:00:00 2001 From: mobiletc-prebuild Date: Wed, 15 Feb 2023 12:52:33 -0800 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-4.19 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: Ic6d3f0f065dd922716e474c47834fa6ad0bb0a7e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4256090 Reviewed-by: Denis Nikitin Commit-Queue: Denis Nikitin Tested-by: Denis Nikitin --- afdo_metadata/kernel_afdo.json | 8 ++++---- afdo_metadata/kernel_arm_afdo.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index 98673562..7b564d23 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -1,14 +1,14 @@ { "chromeos-kernel-4_14": { - "name": "R112-15329.8-1675679904" + "name": "R112-15329.13-1676284659" }, "chromeos-kernel-4_19": { - "name": "R112-15324.0-1675679720" + "name": "R112-15329.8-1676284405" }, "chromeos-kernel-5_4": { - "name": "R112-15329.8-1675679717" + "name": "R112-15329.8-1676284471" }, "chromeos-kernel-5_10": { - "name": "R112-15329.8-1675679624" + "name": "R112-15329.8-1676284343" } } diff --git a/afdo_metadata/kernel_arm_afdo.json b/afdo_metadata/kernel_arm_afdo.json index 27e3b7b7..47786ee6 100644 --- a/afdo_metadata/kernel_arm_afdo.json +++ b/afdo_metadata/kernel_arm_afdo.json @@ -1,5 +1,5 @@ { "chromeos-kernel-5_15": { - "name": "R112-15335.0-1675679803" + "name": "R112-15335.0-1676284509" } } -- cgit v1.2.3 From 61992c86d712f0a71f6494ff44744c580a8426ad Mon Sep 17 00:00:00 2001 From: Denis Nikitin Date: Thu, 23 Feb 2023 11:23:40 -0800 Subject: cros_utils: Rename ChrotomationCronjobUpdate BUG=b:270576202 TEST=unittests Change-Id: Ica1588fe32e65fbffdecec894f36b8a5669fd149 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4288228 Commit-Queue: Denis Nikitin Reviewed-by: George Burgess Tested-by: Denis Nikitin --- cros_utils/bugs.py | 2 +- cros_utils/bugs_test.py | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/cros_utils/bugs.py b/cros_utils/bugs.py index 25da130d..73248b60 100755 --- a/cros_utils/bugs.py +++ b/cros_utils/bugs.py @@ -143,7 +143,7 @@ def SendCronjobLog(cronjob_name: str, failed: bool, message: str): the cronjob infra deems it worthy. """ _WriteBugJSONFile( - "ChrotomationCronjobUpdate", + "CronjobUpdate", { "name": cronjob_name, "message": message, diff --git a/cros_utils/bugs_test.py b/cros_utils/bugs_test.py index 53525b30..a029dc52 100755 --- a/cros_utils/bugs_test.py +++ b/cros_utils/bugs_test.py @@ -10,11 +10,12 @@ import datetime import json +import os import tempfile import unittest from unittest.mock import patch -import bugs +from cros_utils import bugs _ARBITRARY_DATETIME = datetime.datetime(2020, 1, 1, 23, 0, 0, 0) @@ -61,7 +62,7 @@ class Tests(unittest.TestCase): }, ) - @patch("bugs._WriteBugJSONFile") + @patch.object(bugs, "_WriteBugJSONFile") def testAppendingToBugsSeemsToWork(self, mock_write_json_file): """Tests AppendToExistingBug.""" bugs.AppendToExistingBug(1234, "hello, world!") @@ -73,7 +74,7 @@ class Tests(unittest.TestCase): }, ) - @patch("bugs._WriteBugJSONFile") + @patch.object(bugs, "_WriteBugJSONFile") def testBugCreationSeemsToWork(self, mock_write_json_file): """Tests CreateNewBug.""" test_case_additions = ( @@ -117,12 +118,12 @@ class Tests(unittest.TestCase): ) mock_write_json_file.reset_mock() - @patch("bugs._WriteBugJSONFile") + @patch.object(bugs, "_WriteBugJSONFile") def testCronjobLogSendingSeemsToWork(self, mock_write_json_file): """Tests SendCronjobLog.""" bugs.SendCronjobLog("my_name", False, "hello, world!") mock_write_json_file.assert_called_once_with( - "ChrotomationCronjobUpdate", + "CronjobUpdate", { "name": "my_name", "message": "hello, world!", @@ -154,7 +155,7 @@ class Tests(unittest.TestCase): fourth = gen.generate_json_file_name(_ARBITRARY_DATETIME) self.assertLess(third, fourth) - @patch("os.getpid") + @patch.object(os, "getpid") def testForkingProducesADifferentReport(self, mock_getpid): """Tests that _FileNameGenerator gives us sorted file names.""" gen = bugs._FileNameGenerator() -- cgit v1.2.3 From abfc4c9d84fa1704ee415a9f27821dfa4e847f65 Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Mon, 27 Feb 2023 18:38:45 +0000 Subject: toolchain-utils: Add DIR_METADATA Provide information about who owns this directory. BUG=b:270617831 TEST=dirmd parse, CQ Change-Id: I7a128fe29dad3af3dcdfb52d9347ce58b730e632 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4295515 Tested-by: Jordan Abrahams-Whitehead Commit-Queue: Jordan Abrahams-Whitehead Reviewed-by: Manoj Gupta --- DIR_METADATA | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 DIR_METADATA diff --git a/DIR_METADATA b/DIR_METADATA new file mode 100644 index 00000000..fe952b8e --- /dev/null +++ b/DIR_METADATA @@ -0,0 +1,21 @@ +# Metadata information for this directory. +# +# For more information on DIR_METADATA files, see: +# https://source.chromium.org/chromium/infra/infra/+/HEAD:go/src/infra/tools/dirmd/README.md +# +# For the schema of this file, see Metadata message: +# https://source.chromium.org/chromium/infra/infra/+/HEAD:go/src/infra/tools/dirmd/proto/dir_metadata.proto + +team_email: "chromeos-toolchain@google.com" + +buganizer { + # https://b.corp.google.com/issues?q=status:open%20componentid:1034879 + # ChromeOS > Infra > Toolchain + component_id: 1034879 +} + +buganizer_public { + # https://b.corp.google.com/issues?q=status:open%20componentid:1038090 + # ChromeOS Public Tracker > Services > Infra > Toolchain + component_id: 1038090 +} -- cgit v1.2.3 From c2ec013e371c773e00a9ec6bc58950ec91607125 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Mon, 27 Feb 2023 12:32:44 -0700 Subject: bugs: add turndown support This adds support for the newly-added automatic turndown feature in the bug_manager: cl/512676209 BUG=b:270702665 TEST=Unittests Change-Id: I36ba8b860b605ea35422f5e27bf49e33dcf5b7ce Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4295518 Reviewed-by: Jordan Abrahams-Whitehead Tested-by: George Burgess Commit-Queue: George Burgess --- cros_utils/bugs.py | 24 +++++++++++++++--------- cros_utils/bugs_test.py | 18 ++++++++++++++++++ 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/cros_utils/bugs.py b/cros_utils/bugs.py index 73248b60..98c85ecd 100755 --- a/cros_utils/bugs.py +++ b/cros_utils/bugs.py @@ -133,7 +133,9 @@ def CreateNewBug( _WriteBugJSONFile("FileNewBugRequest", obj) -def SendCronjobLog(cronjob_name: str, failed: bool, message: str): +def SendCronjobLog( + cronjob_name: str, failed: bool, message: str, turndown_time_hours: int = 0 +): """Sends the record of a cronjob to our bug infra. cronjob_name: The name of the cronjob. Expected to remain consistent over @@ -141,12 +143,16 @@ def SendCronjobLog(cronjob_name: str, failed: bool, message: str): failed: Whether the job failed or not. message: Any seemingly relevant context. This is pasted verbatim in a bug, if the cronjob infra deems it worthy. + turndown_time_hours: If nonzero, this cronjob will be considered + turned down if more than `turndown_time_hours` pass without a report of + success or failure. If zero, this job will not automatically be turned + down. """ - _WriteBugJSONFile( - "CronjobUpdate", - { - "name": cronjob_name, - "message": message, - "failed": failed, - }, - ) + json_object = { + "name": cronjob_name, + "message": message, + "failed": failed, + } + if turndown_time_hours: + json_object["cronjob_turndown_time_hours"] = turndown_time_hours + _WriteBugJSONFile("CronjobUpdate", json_object) diff --git a/cros_utils/bugs_test.py b/cros_utils/bugs_test.py index a029dc52..2c3213fa 100755 --- a/cros_utils/bugs_test.py +++ b/cros_utils/bugs_test.py @@ -131,6 +131,24 @@ class Tests(unittest.TestCase): }, ) + @patch.object(bugs, "_WriteBugJSONFile") + def testCronjobLogSendingSeemsToWorkWithTurndown( + self, mock_write_json_file + ): + """Tests SendCronjobLog.""" + bugs.SendCronjobLog( + "my_name", False, "hello, world!", turndown_time_hours=42 + ) + mock_write_json_file.assert_called_once_with( + "CronjobUpdate", + { + "name": "my_name", + "message": "hello, world!", + "failed": False, + "cronjob_turndown_time_hours": 42, + }, + ) + def testFileNameGenerationProducesFileNamesInSortedOrder(self): """Tests that _FileNameGenerator gives us sorted file names.""" gen = bugs._FileNameGenerator() -- cgit v1.2.3 From 32e2616808b32ab2034a1d5648852f493892cdaf Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Wed, 1 Mar 2023 10:17:26 -0700 Subject: pgo_rust: preserve USE rather than overwriting it I tried using `USE=foo ./pgo_rust.py` to generate a profile, but `USE=foo` was overwritten by this other USE flag logic. Appending the flags we want to `USE` would support this flow while also having the side-effects the script wants to have. BUG=b:271013631 TEST=./rust_pgo.py generate prints out user-supplied USE vars. Change-Id: If026dacafc518f81bf248d3161fcbf23fdd8b0c1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4300690 Tested-by: George Burgess Reviewed-by: Bob Haarman Commit-Queue: George Burgess --- pgo_tools_rust/pgo_rust.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pgo_tools_rust/pgo_rust.py b/pgo_tools_rust/pgo_rust.py index 298c343f..22fadbd2 100755 --- a/pgo_tools_rust/pgo_rust.py +++ b/pgo_tools_rust/pgo_rust.py @@ -293,7 +293,9 @@ def build_rust( if use_llvm_profile: use += "rust_profile_llvm_use_local " - # -E to preserve our USE environment variable. + env_use = os.getenv("USE", "").rstrip() + use = (env_use + " " + use).strip() + # -E to preserve environment variables like USE, FEATURES, etc. run( ["sudo", "-E", "emerge", "dev-lang/rust", "dev-lang/rust-host"], env={"USE": use}, -- cgit v1.2.3 From 331c0475a38639798af06f20200636faa31ec804 Mon Sep 17 00:00:00 2001 From: mobiletc-prebuild Date: Wed, 1 Mar 2023 10:05:20 -0800 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-4.19 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: Ieb4897c3741ddafa16d717036290ad506c4b2c4c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4300694 Reviewed-by: Manoj Gupta Commit-Queue: Manoj Gupta Tested-by: Manoj Gupta --- afdo_metadata/kernel_afdo.json | 8 ++++---- afdo_metadata/kernel_arm_afdo.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index 7b564d23..846b4558 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -1,14 +1,14 @@ { "chromeos-kernel-4_14": { - "name": "R112-15329.13-1676284659" + "name": "R113-15357.0-1677494183" }, "chromeos-kernel-4_19": { - "name": "R112-15329.8-1676284405" + "name": "R113-15350.0-1677493915" }, "chromeos-kernel-5_4": { - "name": "R112-15329.8-1676284471" + "name": "R113-15357.0-1677494068" }, "chromeos-kernel-5_10": { - "name": "R112-15329.8-1676284343" + "name": "R113-15357.0-1677493988" } } diff --git a/afdo_metadata/kernel_arm_afdo.json b/afdo_metadata/kernel_arm_afdo.json index 47786ee6..3c0bcbff 100644 --- a/afdo_metadata/kernel_arm_afdo.json +++ b/afdo_metadata/kernel_arm_afdo.json @@ -1,5 +1,5 @@ { "chromeos-kernel-5_15": { - "name": "R112-15335.0-1676284509" + "name": "R113-15357.0-1677494405" } } -- cgit v1.2.3 From ca8d11c7c270cd579de996d8086073297653cadd Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Mon, 27 Feb 2023 15:52:06 -0700 Subject: rust_uprev: remove the `copy patches` step Patches no longer have rust's version in them, so we can safely skip this step now. BUG=b:266817148 TEST=Unittests Change-Id: Ib54b2607f25eed5808cd6c544acc5ca3ce3a12f4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4295527 Tested-by: George Burgess Commit-Queue: George Burgess Reviewed-by: Bob Haarman --- rust_tools/rust_uprev.py | 25 ----------------------- rust_tools/rust_uprev_test.py | 46 ------------------------------------------- 2 files changed, 71 deletions(-) diff --git a/rust_tools/rust_uprev.py b/rust_tools/rust_uprev.py index 382d991a..5bcb527d 100755 --- a/rust_tools/rust_uprev.py +++ b/rust_tools/rust_uprev.py @@ -332,27 +332,6 @@ def prepare_uprev( return template_version, ebuild_path, bootstrap_version -def copy_patches( - directory: Path, template_version: RustVersion, new_version: RustVersion -) -> None: - patch_path = directory / "files" - prefix = "%s-%s-" % (directory.name, template_version) - new_prefix = "%s-%s-" % (directory.name, new_version) - for f in os.listdir(patch_path): - if not f.startswith(prefix): - continue - logging.info("Copy patch %s to new version", f) - new_name = f.replace(str(template_version), str(new_version)) - shutil.copyfile( - os.path.join(patch_path, f), - os.path.join(patch_path, new_name), - ) - - subprocess.check_call( - ["git", "add", f"{new_prefix}*.patch"], cwd=patch_path - ) - - def create_ebuild( template_ebuild: str, pkgatom: str, new_version: RustVersion ) -> str: @@ -648,10 +627,6 @@ def create_rust_uprev( EBUILD_PREFIX.joinpath("eclass/cros-rustc.eclass"), template_version ), ) - run_step( - "copy patches", - lambda: copy_patches(RUST_PATH, template_version, rust_version), - ) template_host_ebuild = EBUILD_PREFIX.joinpath( f"dev-lang/rust-host/rust-host-{template_version}.ebuild" ) diff --git a/rust_tools/rust_uprev_test.py b/rust_tools/rust_uprev_test.py index 0c4c91ed..c8ceeb7d 100755 --- a/rust_tools/rust_uprev_test.py +++ b/rust_tools/rust_uprev_test.py @@ -470,52 +470,6 @@ class RustUprevOtherStagesTests(unittest.TestCase): rust_uprev.RUST_PATH, "rust-{self.new_version}.ebuild" ) - @mock.patch.object(shutil, "copyfile") - @mock.patch.object(os, "listdir") - @mock.patch.object(subprocess, "check_call") - def test_copy_patches(self, mock_call, mock_ls, mock_copy): - mock_ls.return_value = [ - f"rust-{self.old_version}-patch-1.patch", - f"rust-{self.old_version}-patch-2-old.patch", - f"rust-{self.current_version}-patch-1.patch", - f"rust-{self.current_version}-patch-2-new.patch", - ] - rust_uprev.copy_patches( - rust_uprev.RUST_PATH, self.current_version, self.new_version - ) - mock_copy.assert_has_calls( - [ - mock.call( - os.path.join( - rust_uprev.RUST_PATH, - "files", - f"rust-{self.current_version}-patch-1.patch", - ), - os.path.join( - rust_uprev.RUST_PATH, - "files", - f"rust-{self.new_version}-patch-1.patch", - ), - ), - mock.call( - os.path.join( - rust_uprev.RUST_PATH, - "files", - f"rust-{self.current_version}-patch-2-new.patch", - ), - os.path.join( - rust_uprev.RUST_PATH, - "files", - f"rust-{self.new_version}-patch-2-new.patch", - ), - ), - ] - ) - mock_call.assert_called_once_with( - ["git", "add", f"rust-{self.new_version}-*.patch"], - cwd=rust_uprev.RUST_PATH.joinpath("files"), - ) - @mock.patch.object(shutil, "copyfile") @mock.patch.object(subprocess, "check_call") def test_create_rust_ebuild(self, mock_call, mock_copy): -- cgit v1.2.3 From 58b47158fed9b7c6c8c7226fc85d944cd97ecb3b Mon Sep 17 00:00:00 2001 From: Denis Nikitin Date: Mon, 6 Mar 2023 15:57:32 -0800 Subject: update_kernel_afdo: Add 5.15 amd profile BUG=b:270225672 TEST=./update_kernel_afdo main Change-Id: I14976df6d3c3eca09e2657f0aee346d24db27f62 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4312784 Tested-by: Denis Nikitin Reviewed-by: Manoj Gupta Commit-Queue: Denis Nikitin --- afdo_tools/update_kernel_afdo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afdo_tools/update_kernel_afdo b/afdo_tools/update_kernel_afdo index d411a6eb..2401b1c5 100755 --- a/afdo_tools/update_kernel_afdo +++ b/afdo_tools/update_kernel_afdo @@ -36,7 +36,7 @@ set -o pipefail AMD_GS_BASE=gs://chromeos-prebuilt/afdo-job/vetted/kernel/amd64 ARM_GS_BASE=gs://chromeos-prebuilt/afdo-job/vetted/kernel/arm -AMD_KVERS="4.14 4.19 5.4 5.10" +AMD_KVERS="4.14 4.19 5.4 5.10 5.15" ARM_KVERS="5.15" failed_channels="" # Add skipped chrome branches in ascending order here. -- cgit v1.2.3 From c7fa84fafa1367e581b18af12e3cce08cf6fc3f7 Mon Sep 17 00:00:00 2001 From: Manoj Gupta Date: Tue, 7 Mar 2023 13:27:16 -0800 Subject: cros_utils: Fix ssh keys path ssh keys are stored under chromite, not under src/scripts. BUG=b:272068712 TEST=ran ReportDiskUsage Change-Id: I138122c6c2a3e6be133316dfbc2244e17fb120ec Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4315194 Auto-Submit: Manoj Gupta Commit-Queue: Manoj Gupta Commit-Queue: Jordan Abrahams-Whitehead Reviewed-by: Jordan Abrahams-Whitehead Tested-by: Manoj Gupta --- cros_utils/misc.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cros_utils/misc.py b/cros_utils/misc.py index aabb5ad7..5ce6447c 100644 --- a/cros_utils/misc.py +++ b/cros_utils/misc.py @@ -90,9 +90,7 @@ def GetRoot(scr_name): def GetChromeOSKeyFile(chromeos_root): return os.path.join( chromeos_root, - "src", - "scripts", - "mod_for_test_scripts", + "chromite", "ssh_keys", "testing_rsa", ) -- cgit v1.2.3 From 9052c5e905b5e476a7f2ae6f18f53a3d20706a92 Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Tue, 7 Mar 2023 22:51:40 +0000 Subject: llvm_tools: Add sys-libs/scudo to default packages This ensures that by default, scudo is tracking the same LLVM version as the other packages. Also fixes utf-8 preupload lints. BUG=b:272107407 TEST=run_tests_for.py llvm_tools/* TEST=http://crrev.com/c/4317312 Change-Id: I3536f82f92c2f6dfc719e19a0a398a087dbdc2db Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4315195 Tested-by: Jordan Abrahams-Whitehead Reviewed-by: Manoj Gupta Commit-Queue: Jordan Abrahams-Whitehead --- llvm_tools/update_chromeos_llvm_hash.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/llvm_tools/update_chromeos_llvm_hash.py b/llvm_tools/update_chromeos_llvm_hash.py index db443baa..c8595e64 100755 --- a/llvm_tools/update_chromeos_llvm_hash.py +++ b/llvm_tools/update_chromeos_llvm_hash.py @@ -33,6 +33,7 @@ DEFAULT_PACKAGES = [ "sys-libs/compiler-rt", "sys-libs/libcxx", "sys-libs/llvm-libunwind", + "sys-libs/scudo", ] DEFAULT_MANIFEST_PACKAGES = ["sys-devel/llvm"] @@ -231,9 +232,9 @@ def UpdateEbuildLLVMHash(ebuild_path, llvm_variant, git_hash, svn_version): temp_ebuild_file = f"{ebuild_path}.temp" - with open(ebuild_path) as ebuild_file: + with open(ebuild_path, encoding="utf-8") as ebuild_file: # write updates to a temporary file in case of interrupts - with open(temp_ebuild_file, "w") as temp_file: + with open(temp_ebuild_file, "w", encoding="utf-8") as temp_file: for cur_line in ReplaceLLVMHash( ebuild_file, llvm_variant, git_hash, svn_version ): @@ -664,7 +665,7 @@ def EnsurePackageMaskContains(chroot_path, git_hash): mask_path = os.path.join( overlay_dir, "profiles/targets/chromeos/package.mask" ) - with open(mask_path, "r+") as mask_file: + with open(mask_path, "r+", encoding="utf-8") as mask_file: mask_contents = mask_file.read() expected_line = f"=sys-devel/llvm-{llvm_major_version}.0_pre*\n" if expected_line not in mask_contents: -- cgit v1.2.3 From 0ef863dd1ec9220e9086c953a08f819647d8dc55 Mon Sep 17 00:00:00 2001 From: mobiletc-prebuild Date: Wed, 8 Mar 2023 10:05:30 -0800 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-4.19 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update amd profile on chromeos-kernel-5.15 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: Ic83a6c2e9cabdd982bbfa3e43f2457fcc510320c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4321425 Reviewed-by: Manoj Gupta Commit-Queue: Manoj Gupta Tested-by: Manoj Gupta --- afdo_metadata/kernel_afdo.json | 11 +++++++---- afdo_metadata/kernel_arm_afdo.json | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index 846b4558..e577929c 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -1,14 +1,17 @@ { "chromeos-kernel-4_14": { - "name": "R113-15357.0-1677494183" + "name": "R113-15359.7-1678098947" }, "chromeos-kernel-4_19": { - "name": "R113-15350.0-1677493915" + "name": "R113-15357.0-1678098738" }, "chromeos-kernel-5_4": { - "name": "R113-15357.0-1677494068" + "name": "R113-15357.0-1678098852" }, "chromeos-kernel-5_10": { - "name": "R113-15357.0-1677493988" + "name": "R113-15359.7-1678098699" + }, + "chromeos-kernel-5_15": { + "name": "R113-15357.0-1678099114" } } diff --git a/afdo_metadata/kernel_arm_afdo.json b/afdo_metadata/kernel_arm_afdo.json index 3c0bcbff..a8db0577 100644 --- a/afdo_metadata/kernel_arm_afdo.json +++ b/afdo_metadata/kernel_arm_afdo.json @@ -1,5 +1,5 @@ { "chromeos-kernel-5_15": { - "name": "R113-15357.0-1677494405" + "name": "R113-15359.7-1678099128" } } -- cgit v1.2.3 From 3a3322a556fd1e4ac5cb56827bea3ad7eed4dff8 Mon Sep 17 00:00:00 2001 From: Denis Nikitin Date: Wed, 8 Mar 2023 10:20:13 -0800 Subject: orderfile: Filter out $-symbols in orderfile Orderfile generated from the Arm Chrome contains $x.NNN symbols. This causes linker to silently drop the orderfile. BUG=b:270758741 TEST=unit test Change-Id: If93b8d3fa71e9a1b8e120e51524033b2ebc0f581 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4321427 Reviewed-by: George Burgess Commit-Queue: Denis Nikitin Tested-by: Denis Nikitin --- orderfile/post_process_orderfile.py | 8 +++++++- orderfile/post_process_orderfile_test.py | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/orderfile/post_process_orderfile.py b/orderfile/post_process_orderfile.py index 5f52aa6f..d90c1af7 100755 --- a/orderfile/post_process_orderfile.py +++ b/orderfile/post_process_orderfile.py @@ -59,7 +59,13 @@ def run(c3_ordered_stream, chrome_nm_stream, output_stream): head_marker = "chrome_begin_ordered_code" tail_marker = "chrome_end_ordered_code" - c3_ordered_syms = [x.strip() for x in c3_ordered_stream.readlines()] + # Filter out $symbols which can come up in the orderfile as well. + # Linker ignores the whole orderfile if it finds $symb. + c3_ordered_syms = [ + x.strip() + for x in c3_ordered_stream.readlines() + if not x.strip().startswith("$") + ] all_chrome_syms = set(_parse_nm_output(chrome_nm_stream)) # Sort by name, so it's predictable. Otherwise, these should all land in the # same hugepage anyway, so order doesn't matter as much. diff --git a/orderfile/post_process_orderfile_test.py b/orderfile/post_process_orderfile_test.py index 60716d87..9dd574a8 100755 --- a/orderfile/post_process_orderfile_test.py +++ b/orderfile/post_process_orderfile_test.py @@ -29,6 +29,7 @@ def _write_nm_file(name): def _write_orderfile(name): with open(name, "w") as out: out.write("SymbolOrdered1\n") + out.write("$toignore.123\n") out.write("SymbolOrdered2\n") -- cgit v1.2.3 From 986da277421a7a0da3c0dbd6817c8a05b07fda6c Mon Sep 17 00:00:00 2001 From: Denis Nikitin Date: Wed, 8 Mar 2023 15:45:35 -0800 Subject: update_kernel_afdo: Move away branch dependent configurations When we add a new kernel version to afdo pipeline we don't want to update it in the branches since it's likely that afdo was enabled in the same milestone. In the current design configuration changes affected all branches and to skip the update in branches we had to use "skip branches" tricks. The better solution which is added here is to move away branch dependent configurations from the script and read it from remote refs. BUG=b:272295936 TEST=tested locally Change-Id: I7856b15c50182f4897859022906e1263e76ec54e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4321430 Reviewed-by: George Burgess Tested-by: Denis Nikitin Commit-Queue: Denis Nikitin --- afdo_tools/update_kernel_afdo | 71 +++++++++++++++++++++++---------------- afdo_tools/update_kernel_afdo.cfg | 8 +++++ 2 files changed, 50 insertions(+), 29 deletions(-) create mode 100644 afdo_tools/update_kernel_afdo.cfg diff --git a/afdo_tools/update_kernel_afdo b/afdo_tools/update_kernel_afdo index 2401b1c5..3a5fd084 100755 --- a/afdo_tools/update_kernel_afdo +++ b/afdo_tools/update_kernel_afdo @@ -34,17 +34,18 @@ the current branch unchanged. set -eu set -o pipefail +# Branch independent constants. +# Changes here will affect kernel afdo update in cros branches. +# ------------------- +ARCHS="amd arm" AMD_GS_BASE=gs://chromeos-prebuilt/afdo-job/vetted/kernel/amd64 ARM_GS_BASE=gs://chromeos-prebuilt/afdo-job/vetted/kernel/arm -AMD_KVERS="4.14 4.19 5.4 5.10 5.15" -ARM_KVERS="5.15" -failed_channels="" +UPDATE_CONFIG_FILE="afdo_tools/update_kernel_afdo.cfg" +# CL reviewers and cc. +REVIEWERS="c-compiler-chrome@google.com" +CC="denik@google.com" # Add skipped chrome branches in ascending order here. SKIPPED_BRANCHES="95" -# CL reviewers and cc. -reviewers="c-compiler-chrome@google.com" -cc="denik@google.com" - # NOTE: We enable/disable kernel AFDO starting from a particular branch. # For example if we want to enable kernel AFDO in 5.15, first, we do it # in main. In this case we want to disable it in beta and stable branches. @@ -56,18 +57,21 @@ declare -A SKIPPED_KVERS_IN_BRANCHES # - key is a branch number string; # - value is the list of kernels separated by space. # Example: SKIPPED_KVERS_IN_BRANCHES["105"]="4.4 4.14" - -# b/223115767. In M-100 there are no new profiles in 5.10. And AFDO is not -# enabled on any 5.10 board in M-100 either. -SKIPPED_KVERS_IN_BRANCHES["100"]="5.10" +# ------------------- + +# Branch dependent constants were moved to UPDATE_CONFIG_FILE. +# IMPORTANT: Starting from M-113 update_kernel_afdo reads branch-dependent +# constants from UPDATE_CONFIG_FILE from remote refs. +# DON'T UPDATE THESE CONSTANTS HERE, THEY WILL BE OVERWRITTEN. +# ------------------- +AMD_KVERS="4.14 4.19 5.4 5.10" +ARM_KVERS="5.15" +AMD_METADATA_FILE="afdo_metadata/kernel_afdo.json" +ARM_METADATA_FILE="afdo_metadata/kernel_arm_afdo.json" +# ------------------- script_dir=$(dirname "$0") tc_utils_dir="${script_dir}/.." -metadata_dir="${tc_utils_dir}/afdo_metadata" -amd_outfile="$(realpath --relative-to="${tc_utils_dir}" \ - "${metadata_dir}"/kernel_afdo.json)" -arm_outfile="$(realpath --relative-to="${tc_utils_dir}" \ - "${metadata_dir}"/kernel_arm_afdo.json)" # Convert toolchain_utils into the absolute path. abs_tc_utils_dir="$(realpath "${tc_utils_dir}")" @@ -77,16 +81,11 @@ expected_time=$(date +%s -d "week ago") upload_cl=true # Interactive mode. interactive=true +# Without arguments the script updates all branches. +channels="" +failed_channels="" -ARCHS="amd arm" declare -A arch_gsbase arch_kvers arch_outfile -arch_gsbase["amd"]="${AMD_GS_BASE}" -arch_gsbase["arm"]="${ARM_GS_BASE}" -arch_kvers["amd"]="${AMD_KVERS}" -arch_kvers["arm"]="${ARM_KVERS}" -arch_outfile["amd"]="${amd_outfile}" -arch_outfile["arm"]="${arm_outfile}" - declare -A branch branch_number commit remote_repo=$(git -C "${tc_utils_dir}" remote) canary_ref="refs/heads/main" @@ -112,9 +111,8 @@ for skipped_branch in ${SKIPPED_BRANCHES} ; do ((branch_number[canary]++)) fi done +config_file="${tc_utils_dir}/${UPDATE_CONFIG_FILE}" -# Without arguments the script updates all branches. -channels="" for arg in "$@" do case "${arg}" in @@ -193,6 +191,21 @@ do git reset --hard HEAD git checkout -b "${channel}" "${remote_repo}/${curr_branch}" + # Read branch-dependent constants from $remote_repo. + # shellcheck source=afdo_tools/update_kernel_afdo.cfg + [[ -e "${config_file}" ]] && source "${config_file}" + + amd_outfile="$(realpath --relative-to="${tc_utils_dir}" \ + "${tc_utils_dir}/${AMD_METADATA_FILE}")" + arm_outfile="$(realpath --relative-to="${tc_utils_dir}" \ + "${tc_utils_dir}/${ARM_METADATA_FILE}")" + arch_gsbase["amd"]="${AMD_GS_BASE}" + arch_gsbase["arm"]="${ARM_GS_BASE}" + arch_kvers["amd"]="${AMD_KVERS}" + arch_kvers["arm"]="${ARM_KVERS}" + arch_outfile["amd"]="${amd_outfile}" + arch_outfile["arm"]="${arm_outfile}" + new_changes=false for arch in ${ARCHS} do @@ -358,11 +371,11 @@ then if ${interactive} then (cd "${tc_utils_dir}" && \ - repo upload --br="${channel}" --re="${reviewers}" --cc="${cc}" .) + repo upload --br="${channel}" --re="${REVIEWERS}" --cc="${CC}" .) else (cd "${tc_utils_dir}" && \ - repo upload --br="${channel}" --no-verify -y --re="${reviewers}" \ - --cc="${cc}" .) + repo upload --br="${channel}" --no-verify -y --re="${REVIEWERS}" \ + --cc="${CC}" .) fi done else diff --git a/afdo_tools/update_kernel_afdo.cfg b/afdo_tools/update_kernel_afdo.cfg new file mode 100644 index 00000000..66a6fd18 --- /dev/null +++ b/afdo_tools/update_kernel_afdo.cfg @@ -0,0 +1,8 @@ +# Add a new supported kernel version in this file. +# All changes here won't affect kernel afdo update in branches. +# WARNING: Changes must be submitted to have effect. + +AMD_KVERS="4.14 4.19 5.4 5.10 5.15" +ARM_KVERS="5.15" +AMD_METADATA_FILE="afdo_metadata/kernel_afdo.json" +ARM_METADATA_FILE="afdo_metadata/kernel_arm_afdo.json" -- cgit v1.2.3 From 869e979a9b163b195d30d6dc3b2c3e646490b9cc Mon Sep 17 00:00:00 2001 From: Manoj Gupta Date: Mon, 13 Mar 2023 19:48:07 +0000 Subject: crosperf: Error out when all iterations of a benchmark fail Instead of marking failure when any iteration fail, return error only ahen all iterations fail i.e. if a single iteration of a benchmark passes, crosperf does not exit with error. BUG=b:273290665 TEST=unit tests Change-Id: I02d81c8d1933759f875161c76b31d7ad13892709 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4334919 Reviewed-by: George Burgess Reviewed-by: Denis Nikitin Tested-by: Manoj Gupta Commit-Queue: Manoj Gupta --- crosperf/experiment_runner.py | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/crosperf/experiment_runner.py b/crosperf/experiment_runner.py index cb518843..c41459a1 100644 --- a/crosperf/experiment_runner.py +++ b/crosperf/experiment_runner.py @@ -298,7 +298,6 @@ class ExperimentRunner(object): experiment_file_path = os.path.join(results_directory, "experiment.exp") FileUtils().WriteFile(experiment_file_path, experiment.experiment_file) - has_failure = False all_failed = True topstats_file = os.path.join(results_directory, "topstats.log") @@ -306,17 +305,21 @@ class ExperimentRunner(object): "Storing top statistics of each benchmark run into %s." % topstats_file ) + # Track if any iterations for a given benchmark has passed for each + # label. + benchmarks_passes = {} with open(topstats_file, "w") as top_fd: for benchmark_run in experiment.benchmark_runs: + benchmarks_passes.setdefault( + benchmark_run.label.name, + {benchmark_run.benchmark.name: False}, + ) if benchmark_run.result: - # FIXME: Pylint has a bug suggesting the following change, which - # should be fixed in pylint 2.0. Resolve this after pylint >= 2.0. - # Bug: https://github.com/PyCQA/pylint/issues/1984 - # pylint: disable=simplifiable-if-statement - if benchmark_run.result.retval: - has_failure = True - else: + if not benchmark_run.result.retval: all_failed = False + benchmarks_passes[benchmark_run.label.name][ + benchmark_run.benchmark.name + ] = True # Header with benchmark run name. top_fd.write("%s\n" % str(benchmark_run)) # Formatted string with top statistics. @@ -325,6 +328,11 @@ class ExperimentRunner(object): if all_failed: return self.ALL_FAILED + # Set has_passes if atleast one iteration of all benchmarks has passed + # for every label. + has_passes = True + for benchmarks in benchmarks_passes.values(): + has_passes = has_passes and all(benchmarks.values()) self.l.LogOutput("Storing results of each benchmark run.") for benchmark_run in experiment.benchmark_runs: @@ -369,7 +377,7 @@ class ExperimentRunner(object): msg_body = "
%s
" % text_report FileUtils().WriteFile(msg_file_path, msg_body) - return self.SUCCEEDED if not has_failure else self.HAS_FAILURE + return self.SUCCEEDED if has_passes else self.HAS_FAILURE def Run(self): try: -- cgit v1.2.3 From f7b59c2a053c89170ab3e29a5e7959b60d00134c Mon Sep 17 00:00:00 2001 From: denik Date: Thu, 16 Mar 2023 11:39:14 -0700 Subject: update_kernel_afdo: Fix configuration reading MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the script is running with the absolute path it has to read the relative path of the config file. If the script is running for multiple channels reset branch dependent vars on every channel. BUG=b:272295936 TEST=tested on chrotomation with command line from cronjob invocation Change-Id: Iab2c83a1a5773a5c2462e35d8ad12732187bd7fa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4344954 Reviewed-by: George Burgess Commit-Queue: Denis Nikitin Bot-Commit: Lint 🤖 --- afdo_tools/update_kernel_afdo | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/afdo_tools/update_kernel_afdo b/afdo_tools/update_kernel_afdo index 3a5fd084..5695e1a7 100755 --- a/afdo_tools/update_kernel_afdo +++ b/afdo_tools/update_kernel_afdo @@ -59,17 +59,6 @@ declare -A SKIPPED_KVERS_IN_BRANCHES # Example: SKIPPED_KVERS_IN_BRANCHES["105"]="4.4 4.14" # ------------------- -# Branch dependent constants were moved to UPDATE_CONFIG_FILE. -# IMPORTANT: Starting from M-113 update_kernel_afdo reads branch-dependent -# constants from UPDATE_CONFIG_FILE from remote refs. -# DON'T UPDATE THESE CONSTANTS HERE, THEY WILL BE OVERWRITTEN. -# ------------------- -AMD_KVERS="4.14 4.19 5.4 5.10" -ARM_KVERS="5.15" -AMD_METADATA_FILE="afdo_metadata/kernel_afdo.json" -ARM_METADATA_FILE="afdo_metadata/kernel_arm_afdo.json" -# ------------------- - script_dir=$(dirname "$0") tc_utils_dir="${script_dir}/.." # Convert toolchain_utils into the absolute path. @@ -111,7 +100,8 @@ for skipped_branch in ${SKIPPED_BRANCHES} ; do ((branch_number[canary]++)) fi done -config_file="${tc_utils_dir}/${UPDATE_CONFIG_FILE}" +config_file="$(realpath --relative-to="${tc_utils_dir}" \ + "${tc_utils_dir}/${UPDATE_CONFIG_FILE}")" for arg in "$@" do @@ -193,7 +183,20 @@ do # Read branch-dependent constants from $remote_repo. # shellcheck source=afdo_tools/update_kernel_afdo.cfg - [[ -e "${config_file}" ]] && source "${config_file}" + if [[ -e "${config_file}" ]] + then + # Branch dependent constants were moved to config_file. + # IMPORTANT: Starting from M-113 update_kernel_afdo reads branch-dependent + # constants from config_file from remote refs. + source "${config_file}" + else + # DON'T UPDATE THESE CONSTANTS HERE! + # Update config_file instead. + AMD_KVERS="4.14 4.19 5.4 5.10" + ARM_KVERS="5.15" + AMD_METADATA_FILE="afdo_metadata/kernel_afdo.json" + ARM_METADATA_FILE="afdo_metadata/kernel_arm_afdo.json" + fi amd_outfile="$(realpath --relative-to="${tc_utils_dir}" \ "${tc_utils_dir}/${AMD_METADATA_FILE}")" -- cgit v1.2.3 From 2b9ae4eb27d20d8f02f233e730ddeb5410f1add0 Mon Sep 17 00:00:00 2001 From: mobiletc-prebuild Date: Wed, 15 Mar 2023 10:05:27 -0700 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-4.19 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update amd profile on chromeos-kernel-5.15 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: I6523b91108176f6eec6e2cac75a4f3decd65f568 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4342429 Tested-by: Ryan Beltran Reviewed-by: Ryan Beltran Commit-Queue: Ryan Beltran --- afdo_metadata/kernel_afdo.json | 10 +++++----- afdo_metadata/kernel_arm_afdo.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index e577929c..64cf49c4 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -1,17 +1,17 @@ { "chromeos-kernel-4_14": { - "name": "R113-15359.7-1678098947" + "name": "R113-15373.0-1678700245" }, "chromeos-kernel-4_19": { - "name": "R113-15357.0-1678098738" + "name": "R113-15357.0-1678700107" }, "chromeos-kernel-5_4": { - "name": "R113-15357.0-1678098852" + "name": "R113-15373.0-1678700214" }, "chromeos-kernel-5_10": { - "name": "R113-15359.7-1678098699" + "name": "R113-15374.0-1678699991" }, "chromeos-kernel-5_15": { - "name": "R113-15357.0-1678099114" + "name": "R113-15373.0-1678699931" } } diff --git a/afdo_metadata/kernel_arm_afdo.json b/afdo_metadata/kernel_arm_afdo.json index a8db0577..b737d60d 100644 --- a/afdo_metadata/kernel_arm_afdo.json +++ b/afdo_metadata/kernel_arm_afdo.json @@ -1,5 +1,5 @@ { "chromeos-kernel-5_15": { - "name": "R113-15359.7-1678099128" + "name": "R113-15373.0-1678700422" } } -- cgit v1.2.3 From f169bfbc9f8a8e20585f36ead79b16f99ac2c4b1 Mon Sep 17 00:00:00 2001 From: mobiletc-prebuild Date: Wed, 22 Mar 2023 10:05:22 -0700 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-4.19 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update amd profile on chromeos-kernel-5.15 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: Id732c4e6900fb63865e6529480b69dfbf1d14a24 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4361760 Reviewed-by: Christopher Di Bella Commit-Queue: Christopher Di Bella Tested-by: Christopher Di Bella --- afdo_metadata/kernel_afdo.json | 10 +++++----- afdo_metadata/kernel_arm_afdo.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index 64cf49c4..fe52af16 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -1,17 +1,17 @@ { "chromeos-kernel-4_14": { - "name": "R113-15373.0-1678700245" + "name": "R113-15378.0-1679305057" }, "chromeos-kernel-4_19": { - "name": "R113-15357.0-1678700107" + "name": "R113-15359.15-1679304747" }, "chromeos-kernel-5_4": { - "name": "R113-15373.0-1678700214" + "name": "R113-15378.0-1679304781" }, "chromeos-kernel-5_10": { - "name": "R113-15374.0-1678699991" + "name": "R113-15378.0-1679304965" }, "chromeos-kernel-5_15": { - "name": "R113-15373.0-1678699931" + "name": "R113-15378.0-1679304953" } } diff --git a/afdo_metadata/kernel_arm_afdo.json b/afdo_metadata/kernel_arm_afdo.json index b737d60d..b3925794 100644 --- a/afdo_metadata/kernel_arm_afdo.json +++ b/afdo_metadata/kernel_arm_afdo.json @@ -1,5 +1,5 @@ { "chromeos-kernel-5_15": { - "name": "R113-15373.0-1678700422" + "name": "R113-15378.0-1679304876" } } -- cgit v1.2.3 From 264ca8d88f1fca3445d04a1a9015c54a0f72ae84 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Mon, 27 Mar 2023 14:04:12 -0600 Subject: rust_watch: stop notifying Android about new Rust releases for now BUG=b:269170429 TEST=None Change-Id: I04dcb32d7ce081d969bafd5fc99eff86fc98ede3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4373920 Tested-by: George Burgess Reviewed-by: Jordan Abrahams-Whitehead Commit-Queue: George Burgess --- rust_tools/rust_watch.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rust_tools/rust_watch.py b/rust_tools/rust_watch.py index f0ce8a03..2795f122 100755 --- a/rust_tools/rust_watch.py +++ b/rust_tools/rust_watch.py @@ -240,7 +240,11 @@ def file_bug(title: str, body: str) -> None: # (component, optional_assignee) targets = ( (bugs.WellKnownComponents.CrOSToolchainPublic, "gbiv@google.com"), - (bugs.WellKnownComponents.AndroidRustToolchain, None), + # b/269170429: Some Android folks said they wanted this before, and + # figuring out the correct way to apply permissions has been a pain. No + # one seems to be missing these notifications & the Android Rust folks + # are keeping on top of their toolchain, so ignore this for now. + # (bugs.WellKnownComponents.AndroidRustToolchain, None), ) for component, assignee in targets: bugs.CreateNewBug(component, title, body, assignee) -- cgit v1.2.3 From 49d20bb488e183b2b909f79b166cbaeca606c148 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Mon, 27 Mar 2023 16:17:23 -0600 Subject: rust_watch: add link to chiw@'s update doc As discussed in the meeting with Android earlier. BUG=None TEST=None Change-Id: I3cc4de81d17072fea798b76d5f2e06fbbdcb6c19 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4373921 Commit-Queue: George Burgess Commit-Queue: Jordan Abrahams-Whitehead Auto-Submit: George Burgess Reviewed-by: Jordan Abrahams-Whitehead Tested-by: George Burgess --- rust_tools/rust_watch.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rust_tools/rust_watch.py b/rust_tools/rust_watch.py index 2795f122..9eb28dca 100755 --- a/rust_tools/rust_watch.py +++ b/rust_tools/rust_watch.py @@ -267,6 +267,9 @@ def maybe_compose_bug( "keep an eye on: https://github.com/rust-lang/rust/labels/" "regression-from-stable-to-stable\n" "\n" + "If you notice any bugs or issues you'd like to share, please " + "also note them on go/shared-rust-update-notes.\n" + "\n" "For questions about this bot, please contact chromeos-toolchain@ and " "CC gbiv@." ) -- cgit v1.2.3 From 5b2e1a8789e2b62e99685c6762c42a6dd2ee6d1f Mon Sep 17 00:00:00 2001 From: mobiletc-prebuild Date: Wed, 29 Mar 2023 10:05:27 -0700 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-4.19 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update amd profile on chromeos-kernel-5.15 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: Ifdcc38f4e31a497e446c567214199d39e19b3e7b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4382434 Commit-Queue: Denis Nikitin Tested-by: Denis Nikitin Reviewed-by: Denis Nikitin --- afdo_metadata/kernel_afdo.json | 10 +++++----- afdo_metadata/kernel_arm_afdo.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index fe52af16..fce7fd8a 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -1,17 +1,17 @@ { "chromeos-kernel-4_14": { - "name": "R113-15378.0-1679305057" + "name": "R114-15389.0-1679909864" }, "chromeos-kernel-4_19": { - "name": "R113-15359.15-1679304747" + "name": "R114-15359.24-1679909722" }, "chromeos-kernel-5_4": { - "name": "R113-15378.0-1679304781" + "name": "R114-15378.0-1679909526" }, "chromeos-kernel-5_10": { - "name": "R113-15378.0-1679304965" + "name": "R114-15389.0-1679909654" }, "chromeos-kernel-5_15": { - "name": "R113-15378.0-1679304953" + "name": "R114-15378.0-1679909526" } } diff --git a/afdo_metadata/kernel_arm_afdo.json b/afdo_metadata/kernel_arm_afdo.json index b3925794..20c3eed1 100644 --- a/afdo_metadata/kernel_arm_afdo.json +++ b/afdo_metadata/kernel_arm_afdo.json @@ -1,5 +1,5 @@ { "chromeos-kernel-5_15": { - "name": "R113-15378.0-1679304876" + "name": "R114-15389.0-1679909797" } } -- cgit v1.2.3 From 613b5005fa93aa29aafe291c27b0df73604d6ee3 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Wed, 29 Mar 2023 13:59:25 -0600 Subject: bugs: fix cros-lint errors I forgot to pass `encoding` here way back when - oops. BUG=b:275742850 TEST=cros lint Change-Id: I05a221dbdb32865b96e086d29bf251311297e6fe Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4382437 Commit-Queue: George Burgess Reviewed-by: Jordan Abrahams-Whitehead Tested-by: George Burgess --- cros_utils/bugs.py | 2 +- cros_utils/bugs_test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cros_utils/bugs.py b/cros_utils/bugs.py index 98c85ecd..c2c6ca22 100755 --- a/cros_utils/bugs.py +++ b/cros_utils/bugs.py @@ -79,7 +79,7 @@ def _WriteBugJSONFile(object_type: str, json_object: Dict[str, Any]): ) temp_path = file_path + ".in_progress" try: - with open(temp_path, "w") as f: + with open(temp_path, "w", encoding="utf-8") as f: json.dump(final_object, f) os.rename(temp_path, file_path) except: diff --git a/cros_utils/bugs_test.py b/cros_utils/bugs_test.py index 2c3213fa..1b58e984 100755 --- a/cros_utils/bugs_test.py +++ b/cros_utils/bugs_test.py @@ -48,7 +48,7 @@ class Tests(unittest.TestCase): f"Expected {file_path} to start with {tempdir}", ) - with open(file_path) as f: + with open(file_path, encoding="utf-8") as f: self.assertEqual( json.load(f), { -- cgit v1.2.3 From faf98c21eafd89bd036a9d9072bc4c01549ed47b Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Wed, 29 Mar 2023 13:09:01 -0600 Subject: bugs: allow users to set directories for bug reports This allows easily overriding the default of X20_PATH. BUG=b:275742850 TEST=Unittests Change-Id: Ia102e7b6abc2cf738c26c06cd88394efa73e88cc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4382438 Reviewed-by: Jordan Abrahams-Whitehead Tested-by: George Burgess Commit-Queue: George Burgess --- cros_utils/bugs.py | 28 +++++++++++++++++++++------- cros_utils/bugs_test.py | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 7 deletions(-) diff --git a/cros_utils/bugs.py b/cros_utils/bugs.py index c2c6ca22..cfec3a6b 100755 --- a/cros_utils/bugs.py +++ b/cros_utils/bugs.py @@ -2,7 +2,6 @@ # Copyright 2021 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. - """Utilities to file bugs.""" import datetime @@ -15,6 +14,7 @@ from typing import Any, Dict, List, Optional X20_PATH = "/google/data/rw/teams/c-compiler-chrome/prod_bugs" + # These constants are sourced from # //google3/googleclient/chrome/chromeos_toolchain/bug_manager/bugs.go class WellKnownComponents(enum.IntEnum): @@ -66,7 +66,9 @@ class _FileNameGenerator: _GLOBAL_NAME_GENERATOR = _FileNameGenerator() -def _WriteBugJSONFile(object_type: str, json_object: Dict[str, Any]): +def _WriteBugJSONFile( + object_type: str, json_object: Dict[str, Any], directory: os.PathLike +): """Writes a JSON file to X20_PATH with the given bug-ish object.""" final_object = { "type": object_type, @@ -75,7 +77,7 @@ def _WriteBugJSONFile(object_type: str, json_object: Dict[str, Any]): now = datetime.datetime.now(tz=datetime.timezone.utc) file_path = os.path.join( - X20_PATH, _GLOBAL_NAME_GENERATOR.generate_json_file_name(now) + directory, _GLOBAL_NAME_GENERATOR.generate_json_file_name(now) ) temp_path = file_path + ".in_progress" try: @@ -88,7 +90,9 @@ def _WriteBugJSONFile(object_type: str, json_object: Dict[str, Any]): return file_path -def AppendToExistingBug(bug_id: int, body: str): +def AppendToExistingBug( + bug_id: int, body: str, directory: os.PathLike = X20_PATH +): """Sends a reply to an existing bug.""" _WriteBugJSONFile( "AppendToExistingBugRequest", @@ -96,6 +100,7 @@ def AppendToExistingBug(bug_id: int, body: str): "body": body, "bug_id": bug_id, }, + directory, ) @@ -105,6 +110,7 @@ def CreateNewBug( body: str, assignee: Optional[str] = None, cc: Optional[List[str]] = None, + directory: os.PathLike = X20_PATH, ): """Sends a request to create a new bug. @@ -117,6 +123,8 @@ def CreateNewBug( "well-known" assignee (detective, mage). cc: A list of emails to add to the CC list. Must either be an email address, or a "well-known" individual (detective, mage). + directory: The directory to write the report to. Defaults to our x20 bugs + directory. """ obj = { "component_id": component_id, @@ -130,11 +138,15 @@ def CreateNewBug( if cc: obj["cc"] = cc - _WriteBugJSONFile("FileNewBugRequest", obj) + _WriteBugJSONFile("FileNewBugRequest", obj, directory) def SendCronjobLog( - cronjob_name: str, failed: bool, message: str, turndown_time_hours: int = 0 + cronjob_name: str, + failed: bool, + message: str, + turndown_time_hours: int = 0, + directory: os.PathLike = X20_PATH, ): """Sends the record of a cronjob to our bug infra. @@ -147,6 +159,8 @@ def SendCronjobLog( turned down if more than `turndown_time_hours` pass without a report of success or failure. If zero, this job will not automatically be turned down. + directory: The directory to write the report to. Defaults to our x20 bugs + directory. """ json_object = { "name": cronjob_name, @@ -155,4 +169,4 @@ def SendCronjobLog( } if turndown_time_hours: json_object["cronjob_turndown_time_hours"] = turndown_time_hours - _WriteBugJSONFile("CronjobUpdate", json_object) + _WriteBugJSONFile("CronjobUpdate", json_object, directory) diff --git a/cros_utils/bugs_test.py b/cros_utils/bugs_test.py index 1b58e984..226d1fef 100755 --- a/cros_utils/bugs_test.py +++ b/cros_utils/bugs_test.py @@ -11,8 +11,10 @@ import datetime import json import os +from pathlib import Path import tempfile import unittest +from unittest import mock from unittest.mock import patch from cros_utils import bugs @@ -41,6 +43,7 @@ class Tests(unittest.TestCase): "foo": "bar", "baz": bugs.WellKnownComponents.CrOSToolchainPublic, }, + bugs.X20_PATH, ) self.assertTrue( @@ -72,6 +75,7 @@ class Tests(unittest.TestCase): "body": "hello, world!", "bug_id": 1234, }, + bugs.X20_PATH, ) @patch.object(bugs, "_WriteBugJSONFile") @@ -115,6 +119,7 @@ class Tests(unittest.TestCase): mock_write_json_file.assert_called_once_with( "FileNewBugRequest", expected_output, + bugs.X20_PATH, ) mock_write_json_file.reset_mock() @@ -129,6 +134,7 @@ class Tests(unittest.TestCase): "message": "hello, world!", "failed": False, }, + bugs.X20_PATH, ) @patch.object(bugs, "_WriteBugJSONFile") @@ -147,6 +153,7 @@ class Tests(unittest.TestCase): "failed": False, "cronjob_turndown_time_hours": 42, }, + bugs.X20_PATH, ) def testFileNameGenerationProducesFileNamesInSortedOrder(self): @@ -187,6 +194,32 @@ class Tests(unittest.TestCase): child_file = gen.generate_json_file_name(_ARBITRARY_DATETIME) self.assertNotEqual(parent_file, child_file) + @patch.object(bugs, "_WriteBugJSONFile") + def testCustomDirectoriesArePassedThrough(self, mock_write_json_file): + directory = "/path/to/somewhere/interesting" + bugs.AppendToExistingBug(1, "foo", directory=directory) + mock_write_json_file.assert_called_once_with( + mock.ANY, mock.ANY, directory + ) + mock_write_json_file.reset_mock() + + bugs.CreateNewBug(1, "title", "body", directory=directory) + mock_write_json_file.assert_called_once_with( + mock.ANY, mock.ANY, directory + ) + mock_write_json_file.reset_mock() + + bugs.SendCronjobLog("cronjob", False, "message", directory=directory) + mock_write_json_file.assert_called_once_with( + mock.ANY, mock.ANY, directory + ) + + def testWriteBugJSONFileWritesToGivenDirectory(self): + with tempfile.TemporaryDirectory() as tmpdir: + bugs.AppendToExistingBug(1, "body", directory=tmpdir) + json_files = list(Path(tmpdir).glob("*.json")) + self.assertEqual(len(json_files), 1, json_files) + if __name__ == "__main__": unittest.main() -- cgit v1.2.3 From ac060800af0d667f07771de95b7cf50a713c7888 Mon Sep 17 00:00:00 2001 From: Bob Haarman Date: Thu, 30 Mar 2023 17:24:13 +0000 Subject: git_llvm_rev: Use context manager for subprocess as suggested by cros lint Making changes to git_llvm_rev.py would cause cros lint to complain, because subp in translate_prebase_rev_to_sha was not wrapped in a context manager. This change wraps it in a context manager as suggested. BUG=None TEST=git_llvm_rev_test.py, also modified it to trigger the error paths Change-Id: Ic2f4d9e4d9bb7986b2f59bc77a6c2de048a23b68 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4386393 Commit-Queue: Bob Haarman Reviewed-by: George Burgess Reviewed-by: Jordan Abrahams-Whitehead Tested-by: Bob Haarman --- llvm_tools/git_llvm_rev.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/llvm_tools/git_llvm_rev.py b/llvm_tools/git_llvm_rev.py index 3dc34fce..233c73d2 100755 --- a/llvm_tools/git_llvm_rev.py +++ b/llvm_tools/git_llvm_rev.py @@ -263,23 +263,21 @@ def translate_prebase_rev_to_sha(llvm_config: LLVMConfig, rev: Rev) -> str: base_llvm_sha, ] - subp = subprocess.Popen( + with subprocess.Popen( git_command, cwd=llvm_config.dir, stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, encoding="utf-8", - ) - - with subp: + ) as subp: for sha, message in parse_git_commit_messages(subp.stdout, separator): last_line = message.splitlines()[-1] if last_line.strip() == looking_for: subp.terminate() return sha + if subp.wait() != 0: + raise subprocess.CalledProcessError(subp.returncode, git_command) - if subp.returncode: - raise subprocess.CalledProcessError(subp.returncode, git_command) raise ValueError(f"No commit with revision {rev} found") -- cgit v1.2.3 From bedeb689249eab64e10817b416c47ec511103d30 Mon Sep 17 00:00:00 2001 From: Bob Haarman Date: Thu, 30 Mar 2023 16:30:50 +0000 Subject: git_llvm_rev: Pass "--" to git to avoid "ambiguous argument" complaints Some git comments can take revisions or paths in the same position, with the same syntax. In such cases, if the command fails, git likes to complain that the argument was ambiguous, and suggests disambiguating it using "--". This is often not the most helpful error message - for example, if an expected revision does not exist in the repository, it would be more helpful to say that, rather than complain about ambiguity. To make git's diagnostics more helpful, add "--" in a few commands. BUG=None TEST=Ran git_llvm_rev.py in a few cases to see it work. Change-Id: I06a457b74319fec16ddffc72f64679bd39a282e3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4386394 Commit-Queue: Bob Haarman Tested-by: Bob Haarman Reviewed-by: George Burgess Reviewed-by: Jordan Abrahams-Whitehead --- llvm_tools/git_llvm_rev.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/llvm_tools/git_llvm_rev.py b/llvm_tools/git_llvm_rev.py index 233c73d2..1db94461 100755 --- a/llvm_tools/git_llvm_rev.py +++ b/llvm_tools/git_llvm_rev.py @@ -104,7 +104,7 @@ def translate_prebase_sha_to_rev_number( This function assumes that the given SHA is an ancestor of |base_llvm_sha|. """ commit_message = check_output( - ["git", "log", "-n1", "--format=%B", sha], + ["git", "log", "-n1", "--format=%B", sha, "--"], cwd=llvm_config.dir, ) last_line = commit_message.strip().splitlines()[-1] @@ -125,13 +125,13 @@ def translate_sha_to_rev(llvm_config: LLVMConfig, sha_or_ref: str) -> Rev: sha = sha_or_ref else: sha = check_output( - ["git", "rev-parse", sha_or_ref], + ["git", "rev-parse", "--revs-only", sha_or_ref, "--"], cwd=llvm_config.dir, ) sha = sha.strip() merge_base = check_output( - ["git", "merge-base", base_llvm_sha, sha], + ["git", "merge-base", base_llvm_sha, sha, "--"], cwd=llvm_config.dir, ) merge_base = merge_base.strip() @@ -144,6 +144,7 @@ def translate_sha_to_rev(llvm_config: LLVMConfig, sha_or_ref: str) -> Rev: "--count", "--first-parent", f"{base_llvm_sha}..{sha}", + "--", ], cwd=llvm_config.dir, ) @@ -167,6 +168,7 @@ def translate_sha_to_rev(llvm_config: LLVMConfig, sha_or_ref: str) -> Rev: "--count", "--first-parent", f"{merge_base}..{sha}", + "--", ], cwd=llvm_config.dir, ) @@ -315,7 +317,13 @@ def translate_rev_to_sha(llvm_config: LLVMConfig, rev: Rev) -> str: # about rev walking/counting locally compared to long |log|s, so we walk back # twice. head = check_output( - ["git", "rev-parse", f"{llvm_config.remote}/{branch}"], + [ + "git", + "rev-parse", + "--revs-only", + f"{llvm_config.remote}/{branch}", + "--", + ], cwd=llvm_config.dir, ) branch_head_sha = head.strip() @@ -328,6 +336,7 @@ def translate_rev_to_sha(llvm_config: LLVMConfig, rev: Rev) -> str: "--count", "--first-parent", f"{base_sha}..{branch_head_sha}", + "--", ], cwd=llvm_config.dir, ) -- cgit v1.2.3 From 9f125d9463ab52214b9a88aeba168859eff08057 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Thu, 30 Mar 2023 17:45:03 -0600 Subject: bugs.py: use None as a default arg Setting X20_PATH here makes 'mocking' X20_PATH from tests harder. BUG=b:275742850 TEST=Unittests in another CL Change-Id: I33652b798b9f06b07798fff002434942a36f3f37 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4385918 Commit-Queue: George Burgess Tested-by: George Burgess Reviewed-by: Jordan Abrahams-Whitehead --- cros_utils/bugs.py | 21 ++++++++++++++++----- cros_utils/bugs_test.py | 10 +++++----- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/cros_utils/bugs.py b/cros_utils/bugs.py index cfec3a6b..ac1202ae 100755 --- a/cros_utils/bugs.py +++ b/cros_utils/bugs.py @@ -67,14 +67,25 @@ _GLOBAL_NAME_GENERATOR = _FileNameGenerator() def _WriteBugJSONFile( - object_type: str, json_object: Dict[str, Any], directory: os.PathLike + object_type: str, + json_object: Dict[str, Any], + directory: Optional[os.PathLike], ): - """Writes a JSON file to X20_PATH with the given bug-ish object.""" + """Writes a JSON file to `directory` with the given bug-ish object. + + Args: + object_type: name of the object we're writing. + json_object: object to write. + directory: the directory to write to. Uses X20_PATH if None. + """ final_object = { "type": object_type, "value": json_object, } + if directory is None: + directory = X20_PATH + now = datetime.datetime.now(tz=datetime.timezone.utc) file_path = os.path.join( directory, _GLOBAL_NAME_GENERATOR.generate_json_file_name(now) @@ -91,7 +102,7 @@ def _WriteBugJSONFile( def AppendToExistingBug( - bug_id: int, body: str, directory: os.PathLike = X20_PATH + bug_id: int, body: str, directory: Optional[os.PathLike] = None ): """Sends a reply to an existing bug.""" _WriteBugJSONFile( @@ -110,7 +121,7 @@ def CreateNewBug( body: str, assignee: Optional[str] = None, cc: Optional[List[str]] = None, - directory: os.PathLike = X20_PATH, + directory: Optional[os.PathLike] = None, ): """Sends a request to create a new bug. @@ -146,7 +157,7 @@ def SendCronjobLog( failed: bool, message: str, turndown_time_hours: int = 0, - directory: os.PathLike = X20_PATH, + directory: Optional[os.PathLike] = None, ): """Sends the record of a cronjob to our bug infra. diff --git a/cros_utils/bugs_test.py b/cros_utils/bugs_test.py index 226d1fef..1ee6bfe4 100755 --- a/cros_utils/bugs_test.py +++ b/cros_utils/bugs_test.py @@ -43,7 +43,7 @@ class Tests(unittest.TestCase): "foo": "bar", "baz": bugs.WellKnownComponents.CrOSToolchainPublic, }, - bugs.X20_PATH, + None, ) self.assertTrue( @@ -75,7 +75,7 @@ class Tests(unittest.TestCase): "body": "hello, world!", "bug_id": 1234, }, - bugs.X20_PATH, + None, ) @patch.object(bugs, "_WriteBugJSONFile") @@ -119,7 +119,7 @@ class Tests(unittest.TestCase): mock_write_json_file.assert_called_once_with( "FileNewBugRequest", expected_output, - bugs.X20_PATH, + None, ) mock_write_json_file.reset_mock() @@ -134,7 +134,7 @@ class Tests(unittest.TestCase): "message": "hello, world!", "failed": False, }, - bugs.X20_PATH, + None, ) @patch.object(bugs, "_WriteBugJSONFile") @@ -153,7 +153,7 @@ class Tests(unittest.TestCase): "failed": False, "cronjob_turndown_time_hours": 42, }, - bugs.X20_PATH, + None, ) def testFileNameGenerationProducesFileNamesInSortedOrder(self): -- cgit v1.2.3 From a7a76fdb51ea69a825b222a71327d87b21a31869 Mon Sep 17 00:00:00 2001 From: Denis Nikitin Date: Mon, 3 Apr 2023 11:00:33 -0700 Subject: crosperf: Updated chell boards BUG=b:276484692,b:276485695 TEST=None Change-Id: Ic84994b2b2d818879b5d1a6327aff82726a8711e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4391000 Commit-Queue: Denis Nikitin Tested-by: Denis Nikitin Reviewed-by: Manoj Gupta --- crosperf/default_remotes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crosperf/default_remotes b/crosperf/default_remotes index 714385e7..80563664 100644 --- a/crosperf/default_remotes +++ b/crosperf/default_remotes @@ -1,5 +1,5 @@ bob : chromeos8-row12-rack16-host2 -chell : chromeos2-row1-rack10-host2 chromeos2-row1-rack10-host4 +chell : chromeos6-row16-rack5-host6 chromeos6-row16-rack5-host7 coral : chromeos6-row5-rack6-host1 chromeos6-row5-rack6-host3 chromeos6-row5-rack6-host5 elm : chromeos6-row14-rack15-host21 nautilus : chromeos6-row5-rack10-host1 chromeos6-row5-rack10-host3 -- cgit v1.2.3 From 2c96c0ca9e69808cb6c8a23855ae532de1536a41 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Fri, 31 Mar 2023 16:16:58 -0700 Subject: crosperf: Update doc website BUG=none TEST=none Change-Id: I8ee80e551f993f7946b1db653f6c0dadf0bb7f77 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4391116 Tested-by: Brian Norris Reviewed-by: Manoj Gupta Commit-Queue: Manoj Gupta Auto-Submit: Brian Norris --- crosperf/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crosperf/README.md b/crosperf/README.md index 18601b67..f1429513 100644 --- a/crosperf/README.md +++ b/crosperf/README.md @@ -3,8 +3,7 @@ To use these experiment files, replace the board, remote and images placeholders and run crosperf on them. -Further information about crosperf: -https://sites.google.com/a/google.com/chromeos-toolchain-team-home2/home/team-tools-and-scripts/crosperf-cros-image-performance-comparison-tool +Further information about crosperf: https://goto.google.com/crostc-crosperf The final experiment file should look something like the following (but with different actual values for the fields): -- cgit v1.2.3 From 5461c3927e98355095a7209be770a71ac33f76af Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Mon, 3 Apr 2023 17:03:08 -0700 Subject: image_chromeos: Leverage chromite for path translation chromite's path_util does all of this better and is more resilient to SDK updates. Let's use it. While it's ugly, the path is pulled dynamically from 'chromeos_root', because this might be run standalone, and not part of a CrOS manifest layout. BUG=b:275442353 TEST=run it Change-Id: Ia3a06fa5c1b3049b827e1bce33da0daadbbdd734 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4397062 Commit-Queue: Brian Norris Reviewed-by: Jordan Abrahams-Whitehead Tested-by: Brian Norris Reviewed-by: Manoj Gupta --- image_chromeos.py | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/image_chromeos.py b/image_chromeos.py index 36384e88..5d222691 100755 --- a/image_chromeos.py +++ b/image_chromeos.py @@ -15,7 +15,6 @@ __author__ = "asharif@google.com (Ahmad Sharif)" import argparse import filecmp -import getpass import glob import os import re @@ -81,37 +80,21 @@ def FindChromeOSImage(image_file, chromeos_root): or outside the chroot. In either case the path needs to be translated to an real/absolute path inside the chroot. Example input paths: - /usr/local/google/home/uname/chromeos/chroot/tmp/my-test-images/image - ~/trunk/src/build/images/board/latest/image + /usr/local/google/home/uname/chromeos/out/tmp/my-test-images/image + ~/chromiumos/src/build/images/board/latest/image /tmp/peppy-release/R67-1235.0.0/image Corresponding example output paths: /tmp/my-test-images/image - /home/uname/trunk/src/build/images/board/latest/image + /mnt/host/source/src/build/images/board/latest/image /tmp/peppy-release/R67-1235.0,0/image """ - # Get the name of the user, for "/home/" part of the path. - whoami = getpass.getuser() - # Get the full path for the chroot dir, including 'chroot' - real_chroot_dir = os.path.join(os.path.realpath(chromeos_root), "chroot") - # Get the full path for the chromeos root, excluding 'chroot' - real_chromeos_root = os.path.realpath(chromeos_root) - - # If path name starts with real_chroot_dir, remove that piece, but assume - # the rest of the path is correct. - if image_file.find(real_chroot_dir) != -1: - chroot_image = image_file[len(real_chroot_dir) :] - # If path name starts with chromeos_root, excluding 'chroot', replace the - # chromeos_root with the prefix: '/home//trunk'. - elif image_file.find(real_chromeos_root) != -1: - chroot_image = image_file[len(real_chromeos_root) :] - chroot_image = "/home/%s/trunk%s" % (whoami, chroot_image) - # Else assume the path is already internal, so leave it alone. - else: - chroot_image = image_file + sys.path.insert(0, chromeos_root) + + from chromite.lib import path_util - return chroot_image + return path_util.ToChrootPath(image_file, source_path=chromeos_root) def DoImage(argv): -- cgit v1.2.3 From 9e882c1bd501a0c4573a9d1aa602e22250f971d3 Mon Sep 17 00:00:00 2001 From: Denis Nikitin Date: Thu, 6 Apr 2023 16:37:20 -0700 Subject: crosperf: Add ignore_cache alias for rerun BUG=None TEST=unit tests Change-Id: Ib595fbbc76f1cd94cdfeb47eece5fae4903b9212 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4406698 Reviewed-by: Jordan Abrahams-Whitehead Tested-by: Denis Nikitin Commit-Queue: Denis Nikitin --- crosperf/crosperf_unittest.py | 2 +- crosperf/experiment_factory.py | 12 +++++---- crosperf/experiment_factory_unittest.py | 44 +++++++++++++++++++++++++++++++-- crosperf/settings_factory.py | 11 +++++++-- crosperf/settings_factory_unittest.py | 5 ++-- 5 files changed, 62 insertions(+), 12 deletions(-) diff --git a/crosperf/crosperf_unittest.py b/crosperf/crosperf_unittest.py index 7b52f2e0..9f5cb0d0 100755 --- a/crosperf/crosperf_unittest.py +++ b/crosperf/crosperf_unittest.py @@ -67,7 +67,7 @@ class CrosperfTest(unittest.TestCase): settings = crosperf.ConvertOptionsToSettings(options) self.assertIsNotNone(settings) self.assertIsInstance(settings, settings_factory.GlobalSettings) - self.assertEqual(len(settings.fields), 40) + self.assertEqual(len(settings.fields), 41) self.assertTrue(settings.GetField("rerun")) argv = ["crosperf/crosperf.py", "temp.exp"] options, _ = parser.parse_known_args(argv) diff --git a/crosperf/experiment_factory.py b/crosperf/experiment_factory.py index c71981ab..e3a82f77 100644 --- a/crosperf/experiment_factory.py +++ b/crosperf/experiment_factory.py @@ -220,7 +220,9 @@ class ExperimentFactory(object): ] if global_settings.GetField("rerun_if_failed"): cache_conditions.append(CacheConditions.RUN_SUCCEEDED) - if global_settings.GetField("rerun"): + if global_settings.GetField("rerun") or global_settings.GetField( + "ignore_cache" + ): cache_conditions.append(CacheConditions.FALSE) if global_settings.GetField("same_machine"): cache_conditions.append(CacheConditions.SAME_MACHINE_MATCH) @@ -623,7 +625,7 @@ class ExperimentFactory(object): os.path.dirname(__file__), "default_remotes" ) try: - with open(default_remotes_file) as f: + with open(default_remotes_file, encoding="utf-8") as f: for line in f: key, v = line.split(":") if key.strip() == board: @@ -632,15 +634,15 @@ class ExperimentFactory(object): return remotes else: raise RuntimeError( - "There is no remote for {0}".format(board) + f"There is no remote for {board}" ) except IOError: # TODO: rethrow instead of throwing different exception. raise RuntimeError( - "IOError while reading file {0}".format(default_remotes_file) + f"IOError while reading file {default_remotes_file}" ) else: - raise RuntimeError("There is no remote for {0}".format(board)) + raise RuntimeError(f"There is no remote for {board}") def CheckRemotesInCrosfleet(self, remote): # TODO: (AI:zhizhouy) need to check whether a remote is a local or lab diff --git a/crosperf/experiment_factory_unittest.py b/crosperf/experiment_factory_unittest.py index 0541bb9b..8050ebdc 100755 --- a/crosperf/experiment_factory_unittest.py +++ b/crosperf/experiment_factory_unittest.py @@ -20,6 +20,7 @@ from cros_utils.file_utils import FileUtils import experiment_factory from experiment_factory import ExperimentFactory from experiment_file import ExperimentFile +from results_cache import CacheConditions import settings_factory import test_flag @@ -318,7 +319,6 @@ class ExperimentFactoryTest(unittest.TestCase): @mock.patch.object(socket, "gethostname") def test_get_experiment(self, mock_socket): - test_flag.SetTestMode(False) self.append_benchmark_call_args = [] @@ -450,7 +450,47 @@ class ExperimentFactoryTest(unittest.TestCase): label_settings.SetField("remote", "") global_settings.SetField("remote", "123.45.67.89") exp = ef.GetExperiment(mock_experiment_file, "", "") - self.assertEqual(exp.cache_conditions, [0, 2, 3, 4, 6, 1]) + self.assertEqual( + exp.cache_conditions, + [ + CacheConditions.CACHE_FILE_EXISTS, + CacheConditions.CHECKSUMS_MATCH, + CacheConditions.RUN_SUCCEEDED, + CacheConditions.FALSE, + CacheConditions.SAME_MACHINE_MATCH, + CacheConditions.MACHINES_MATCH, + ], + ) + + # Check the alias option to ignore cache. + global_settings.SetField("rerun", "false") + global_settings.SetField("ignore_cache", "true") + exp = ef.GetExperiment(mock_experiment_file, "", "") + self.assertEqual( + exp.cache_conditions, + [ + CacheConditions.CACHE_FILE_EXISTS, + CacheConditions.CHECKSUMS_MATCH, + CacheConditions.RUN_SUCCEEDED, + CacheConditions.FALSE, + CacheConditions.SAME_MACHINE_MATCH, + CacheConditions.MACHINES_MATCH, + ], + ) + # Check without cache use. + global_settings.SetField("rerun", "false") + global_settings.SetField("ignore_cache", "false") + exp = ef.GetExperiment(mock_experiment_file, "", "") + self.assertEqual( + exp.cache_conditions, + [ + CacheConditions.CACHE_FILE_EXISTS, + CacheConditions.CHECKSUMS_MATCH, + CacheConditions.RUN_SUCCEEDED, + CacheConditions.SAME_MACHINE_MATCH, + CacheConditions.MACHINES_MATCH, + ], + ) # Fifth Test: Adding a second label; calling GetXbuddyPath; omitting all # remotes (Call GetDefaultRemotes). diff --git a/crosperf/settings_factory.py b/crosperf/settings_factory.py index 6382bba7..2bf4119a 100644 --- a/crosperf/settings_factory.py +++ b/crosperf/settings_factory.py @@ -206,7 +206,7 @@ class GlobalSettings(Settings): self.AddField( BooleanField( "rerun_if_failed", - description="Whether to re-run failed test runs " "or not.", + description="Whether to re-run failed test runs or not.", default=False, ) ) @@ -233,6 +233,13 @@ class GlobalSettings(Settings): default=False, ) ) + self.AddField( + BooleanField( + "ignore_cache", + description='Alias of "rerun" to ignore cache.', + default=False, + ) + ) self.AddField( BooleanField( "same_specs", @@ -246,7 +253,7 @@ class GlobalSettings(Settings): BooleanField( "same_machine", default=False, - description="Ensure cached runs are run on the " "same remote.", + description="Ensure cached runs are run on the same remote.", ) ) self.AddField( diff --git a/crosperf/settings_factory_unittest.py b/crosperf/settings_factory_unittest.py index 93d3bd6d..4b7c725e 100755 --- a/crosperf/settings_factory_unittest.py +++ b/crosperf/settings_factory_unittest.py @@ -49,7 +49,7 @@ class GlobalSettingsTest(unittest.TestCase): def test_init(self): res = settings_factory.GlobalSettings("g_settings") self.assertIsNotNone(res) - self.assertEqual(len(res.fields), 40) + self.assertEqual(len(res.fields), 41) self.assertEqual(res.GetField("name"), "") self.assertEqual(res.GetField("board"), "") self.assertEqual(res.GetField("crosfleet"), False) @@ -58,6 +58,7 @@ class GlobalSettingsTest(unittest.TestCase): self.assertEqual(res.GetField("rm_chroot_tmp"), False) self.assertEqual(res.GetField("email"), None) self.assertEqual(res.GetField("rerun"), False) + self.assertEqual(res.GetField("ignore_cache"), False) self.assertEqual(res.GetField("same_specs"), True) self.assertEqual(res.GetField("same_machine"), False) self.assertEqual(res.GetField("iterations"), 0) @@ -114,7 +115,7 @@ class SettingsFactoryTest(unittest.TestCase): "global", "global" ) self.assertIsInstance(g_settings, settings_factory.GlobalSettings) - self.assertEqual(len(g_settings.fields), 40) + self.assertEqual(len(g_settings.fields), 41) if __name__ == "__main__": -- cgit v1.2.3 From a152ab4433a44d07fdca86d25e87227a27ee7d4e Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Thu, 13 Apr 2023 12:46:29 -0600 Subject: pgo_rust: use gsutil gsutil.py was removed from our $PATH a while ago. We're meant to use gsutil now. BUG=b:215615637 TEST=./pgo_rust.py generate Change-Id: I862484d3f8ad64f1b8908222d1b3c81960960e8e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4422323 Reviewed-by: Bob Haarman Tested-by: George Burgess Commit-Queue: George Burgess --- pgo_tools_rust/pgo_rust.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pgo_tools_rust/pgo_rust.py b/pgo_tools_rust/pgo_rust.py index 22fadbd2..3b56cd77 100755 --- a/pgo_tools_rust/pgo_rust.py +++ b/pgo_tools_rust/pgo_rust.py @@ -214,7 +214,7 @@ def download_unpack_crate(*, crate_name: str, crate_version: str): local_path / f"{crate_name}-{crate_version}", ignore_errors=True ) with chdir(local_path): - run(["gsutil.py", "cp", f"gs:/{gs_path}", "."]) + run(["gsutil", "cp", f"gs:/{gs_path}", "."]) run(["xz", "-d", f"{filename_no_extension}.tar.xz"]) run(["tar", "xvf", f"{filename_no_extension}.tar"]) @@ -330,9 +330,9 @@ def upload_file( *, source: Path, dest: PurePosixPath, public_read: bool = False ): if public_read: - run(["gsutil.py", "cp", "-a", "public-read", source, f"gs:/{dest}"]) + run(["gsutil", "cp", "-a", "public-read", source, f"gs:/{dest}"]) else: - run(["gsutil.py", "cp", source, f"gs:/{dest}"]) + run(["gsutil", "cp", source, f"gs:/{dest}"]) def maybe_download_crate(*, crate_name: str, crate_version: str): -- cgit v1.2.3 From 50afc9427c1d945cb0417996895cca3d61d26532 Mon Sep 17 00:00:00 2001 From: Denis Nikitin Date: Mon, 17 Apr 2023 10:31:36 -0700 Subject: crosperf: Fix perf profiling mode Create "debug/" when extracting debug.tgz (debug/ is no longer in the path of the debug.tgz files). Move ReportDiskspace out of `all_toolchain_perf` and place it into buildbot_test_toolchains.py where the nightly-test experiment is composed. BUG=b:278569903 TEST=tested on a local DUT Change-Id: I4cedad584cb0756cee6651cda0655a2638ffc008 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4435109 Reviewed-by: Manoj Gupta Tested-by: Denis Nikitin Reviewed-by: George Burgess Commit-Queue: Denis Nikitin --- buildbot_test_toolchains.py | 6 ++++++ crosperf/download_images.py | 19 +++++++++++-------- crosperf/experiment_factory.py | 15 --------------- 3 files changed, 17 insertions(+), 23 deletions(-) diff --git a/buildbot_test_toolchains.py b/buildbot_test_toolchains.py index e67a151b..88ab4052 100755 --- a/buildbot_test_toolchains.py +++ b/buildbot_test_toolchains.py @@ -181,6 +181,12 @@ class ToolchainComparator(object): iterations: 3 run_local: False } + + benchmark: platform.ReportDiskUsage { + suite: tast + iterations: 1 + run_local: False + } """ with open(experiment_file, "w", encoding="utf-8") as f: diff --git a/crosperf/download_images.py b/crosperf/download_images.py index 9a46280d..0f184c0b 100644 --- a/crosperf/download_images.py +++ b/crosperf/download_images.py @@ -8,6 +8,7 @@ import ast import os +import shlex from cros_utils import command_executer import test_flag @@ -338,15 +339,11 @@ class ImageDownloader(object): # File exists on server, download and uncompress it self.DownloadSingleFile(chromeos_root, build_id, debug_archive_name) - self.UncompressSingleFile( - chromeos_root, build_id, debug_archive_name, "tar -xf " - ) # Extract and move debug files into the proper location. - debug_dir = "debug_files/usr/lib" - command = "cd %s ; mkdir -p %s; mv debug %s" % ( - download_path, - debug_dir, - debug_dir, + debug_dir = "debug_files/usr/lib/debug" + command = ( + f"cd {shlex.quote(download_path)}; " + f"mkdir -p {shlex.quote(debug_dir)}" ) if self.log_level != "verbose": self._logger.LogOutput("CMD: %s" % command) @@ -357,6 +354,12 @@ class ImageDownloader(object): "Could not create directory %s" % os.path.join(debug_dir, "debug") ) + self.UncompressSingleFile( + chromeos_root, + build_id, + debug_archive_name, + f"tar -C {shlex.quote(debug_dir)} -xf ", + ) return debug_rel_path diff --git a/crosperf/experiment_factory.py b/crosperf/experiment_factory.py index e3a82f77..2a9dae7d 100644 --- a/crosperf/experiment_factory.py +++ b/crosperf/experiment_factory.py @@ -383,21 +383,6 @@ class ExperimentFactory(object): ) # Add non-telemetry toolchain-perf benchmarks: - # Tast test platform.ReportDiskUsage for image size. - benchmarks.append( - Benchmark( - "platform.ReportDiskUsage", - "platform.ReportDiskUsage", - "", - 1, # This is not a performance benchmark, only run once. - rm_chroot_tmp, - "", - "tast", # Specify the suite to be 'tast' - show_all_results, - retries, - ) - ) - # TODO: crbug.com/1057755 Do not enable graphics_WebGLAquarium until # it gets fixed. # -- cgit v1.2.3 From b38642cc1b7fcc1017a5775788aa867fd409b12b Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Thu, 13 Apr 2023 12:48:46 -0600 Subject: pgo_rust: tweak tar invocation - `v` prints over 6,000 lines explaining what was unpacked, which isn't super useful, since all of the output of this command is buffered. - we can combine the `xz -d` and `tar` invocations for a simpler, slightly faster unpack that also doesn't leave a tar file in your tempdir This also adds `encoding = "utf-8"` to appease `cros lint`. BUG=b:215615637 TEST=./pgo_rust.py generate Change-Id: Id9bc655afbb11be9943265494e243c3175af1a38 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4422324 Reviewed-by: Bob Haarman Tested-by: George Burgess Commit-Queue: George Burgess --- pgo_tools_rust/pgo_rust.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pgo_tools_rust/pgo_rust.py b/pgo_tools_rust/pgo_rust.py index 3b56cd77..10042f14 100755 --- a/pgo_tools_rust/pgo_rust.py +++ b/pgo_tools_rust/pgo_rust.py @@ -215,8 +215,7 @@ def download_unpack_crate(*, crate_name: str, crate_version: str): ) with chdir(local_path): run(["gsutil", "cp", f"gs:/{gs_path}", "."]) - run(["xz", "-d", f"{filename_no_extension}.tar.xz"]) - run(["tar", "xvf", f"{filename_no_extension}.tar"]) + run(["tar", "xaf", f"{filename_no_extension}.tar.xz"]) def build_crate( @@ -229,7 +228,7 @@ def build_crate( local_path = LOCAL_BASE / "crates" / f"{crate_name}-{crate_version}" with chdir(local_path): Path(".cargo").mkdir(exist_ok=True) - with open(".cargo/config.toml", "w") as f: + with open(".cargo/config.toml", "w", encoding="utf-8") as f: f.write( "\n".join( ( -- cgit v1.2.3 From 8b2884b90c4d99e8ef244b8493daea1b931513c5 Mon Sep 17 00:00:00 2001 From: mobiletc-prebuild Date: Wed, 5 Apr 2023 10:05:26 -0700 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-4.19 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update amd profile on chromeos-kernel-5.15 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: I822c094be4faa5776a393a2b40fc6745361e6b18 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4401827 Tested-by: Denis Nikitin Reviewed-by: Denis Nikitin Commit-Queue: Denis Nikitin --- afdo_metadata/kernel_afdo.json | 10 +++++----- afdo_metadata/kernel_arm_afdo.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index fce7fd8a..22db1426 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -1,17 +1,17 @@ { "chromeos-kernel-4_14": { - "name": "R114-15389.0-1679909864" + "name": "R114-15393.6-1680514587" }, "chromeos-kernel-4_19": { - "name": "R114-15359.24-1679909722" + "name": "R114-15359.37-1680514333" }, "chromeos-kernel-5_4": { - "name": "R114-15378.0-1679909526" + "name": "R114-15393.6-1680514409" }, "chromeos-kernel-5_10": { - "name": "R114-15389.0-1679909654" + "name": "R114-15393.7-1680514436" }, "chromeos-kernel-5_15": { - "name": "R114-15378.0-1679909526" + "name": "R114-15393.6-1680514706" } } diff --git a/afdo_metadata/kernel_arm_afdo.json b/afdo_metadata/kernel_arm_afdo.json index 20c3eed1..1b26da77 100644 --- a/afdo_metadata/kernel_arm_afdo.json +++ b/afdo_metadata/kernel_arm_afdo.json @@ -1,5 +1,5 @@ { "chromeos-kernel-5_15": { - "name": "R114-15389.0-1679909797" + "name": "R114-15393.6-1680514764" } } -- cgit v1.2.3 From 3ecaf021b8c4d34007735171261a118c71c32a31 Mon Sep 17 00:00:00 2001 From: mobiletc-prebuild Date: Wed, 19 Apr 2023 10:09:28 -0700 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-4.19 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update amd profile on chromeos-kernel-5.15 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: I3408bc26bb37a47f464c62b46ccaa22f9fb3dc24 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4448369 Commit-Queue: Manoj Gupta Tested-by: Manoj Gupta Reviewed-by: Manoj Gupta --- afdo_metadata/kernel_afdo.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index 22db1426..a8bc35c7 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -1,17 +1,17 @@ { "chromeos-kernel-4_14": { - "name": "R114-15393.6-1680514587" + "name": "R114-15419.0-1681724239" }, "chromeos-kernel-4_19": { - "name": "R114-15359.37-1680514333" + "name": "R114-15393.12-1681724128" }, "chromeos-kernel-5_4": { - "name": "R114-15393.6-1680514409" + "name": "R114-15416.0-1681724025" }, "chromeos-kernel-5_10": { - "name": "R114-15393.7-1680514436" + "name": "R114-15419.0-1681723991" }, "chromeos-kernel-5_15": { - "name": "R114-15393.6-1680514706" + "name": "R114-15416.0-1681723984" } } -- cgit v1.2.3 From 2d40106aa7a9058d89c0837773481f2424111336 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Mon, 17 Apr 2023 15:37:44 -0600 Subject: copy_rust_bootstrap: use gsutil gsutil.py is no longer supported in the chroot: https://crrev.com/860a3a19d64f00a3876f23e2465c6bc241fb97ce BUG=b:278606581 TEST=Ran the script Change-Id: Iffda99cb85207b98b8f4d6d57e8045fce5314a33 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4437270 Reviewed-by: Bob Haarman Commit-Queue: George Burgess Tested-by: George Burgess --- rust_tools/copy_rust_bootstrap.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rust_tools/copy_rust_bootstrap.py b/rust_tools/copy_rust_bootstrap.py index f62fc78c..c32d1fd9 100755 --- a/rust_tools/copy_rust_bootstrap.py +++ b/rust_tools/copy_rust_bootstrap.py @@ -6,7 +6,7 @@ """Copies rust-bootstrap artifacts from an SDK build to localmirror. We use localmirror to host these artifacts, but they've changed a bit over -time, so simply `gsutil.py cp $FROM $TO` doesn't work. This script allows the +time, so simply `gsutil cp $FROM $TO` doesn't work. This script allows the convenience of the old `cp` command. """ @@ -50,7 +50,7 @@ def _download(remote_path: str, local_file: Path): """Downloads the given gs:// path to the given local file.""" logging.info("Downloading %s -> %s", remote_path, local_file) subprocess.run( - ["gsutil.py", "cp", remote_path, str(local_file)], + ["gsutil", "cp", remote_path, str(local_file)], check=True, ) @@ -138,7 +138,7 @@ def _debinpkgify(binpkg_file: Path) -> Path: def _upload(local_file: Path, remote_path: str, force: bool): """Uploads the local file to the given gs:// path.""" logging.info("Uploading %s -> %s", local_file, remote_path) - cmd_base = ["gsutil.py", "cp", "-a", "public-read"] + cmd_base = ["gsutil", "cp", "-a", "public-read"] if not force: cmd_base.append("-n") subprocess.run( -- cgit v1.2.3 From 3266e5383f76c36578ce7efbba260893e35a187e Mon Sep 17 00:00:00 2001 From: Denis Nikitin Date: Wed, 19 Apr 2023 15:03:53 -0700 Subject: update_kernel_afdo: Freeze arm/5.15 on 114 BUG=b:277922889 TEST=./update_kernel_afdo --noupload canary Change-Id: I4f8f562603116e7b2d3f299e3a82e49468551347 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4450607 Tested-by: Denis Nikitin Reviewed-by: Manoj Gupta Commit-Queue: Denis Nikitin --- afdo_tools/update_kernel_afdo | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/afdo_tools/update_kernel_afdo b/afdo_tools/update_kernel_afdo index 5695e1a7..2e8e07f3 100755 --- a/afdo_tools/update_kernel_afdo +++ b/afdo_tools/update_kernel_afdo @@ -52,12 +52,14 @@ SKIPPED_BRANCHES="95" # The second scenario is when we want to disable kernel AFDO (when all devices # move to kernelnext and there are no new profiles from the field). In this # case we disable AFDO in main but still keep it live in beta and stable. -declare -A SKIPPED_KVERS_IN_BRANCHES -# In SKIPPED_KVERS_IN_BRANCHES +declare -A SKIPPED_ARCHKVERS_IN_BRANCHES +# In SKIPPED_ARCHKVERS_IN_BRANCHES # - key is a branch number string; -# - value is the list of kernels separated by space. -# Example: SKIPPED_KVERS_IN_BRANCHES["105"]="4.4 4.14" +# - value is the list of arch/kver separated by space. +# Example: SKIPPED_ARCHKVERS_IN_BRANCHES["105"]="amd/4.4 arm/5.15" # ------------------- +# Kernel tracing was disabled on arm in 114, b/275560674. +SKIPPED_ARCHKVERS_IN_BRANCHES["114"]="arm/5.15" script_dir=$(dirname "$0") tc_utils_dir="${script_dir}/.." @@ -218,15 +220,16 @@ do do # Skip kernels disabled in this branch. skipped=false - for skipped_branch in "${!SKIPPED_KVERS_IN_BRANCHES[@]}" + for skipped_branch in "${!SKIPPED_ARCHKVERS_IN_BRANCHES[@]}" do if [[ ${curr_branch_number} == "${skipped_branch}" ]] then - # Current branch is in the keys of SKIPPED_KVERS_IN_BRANCHES. - # Now lets check if $kver is in the list. - for skipped_kver in ${SKIPPED_KVERS_IN_BRANCHES[${skipped_branch}]} + # Current branch is in the keys of SKIPPED_ARCHKVERS_IN_BRANCHES. + # Now lets check if $arch/$kver is in the list. + for skipped_archkver in \ + ${SKIPPED_ARCHKVERS_IN_BRANCHES[${skipped_branch}]} do - if [[ ${kver} == "${skipped_kver}" ]] + if [[ "${arch}/${kver}" == "${skipped_archkver}" ]] then skipped=true break @@ -236,7 +239,7 @@ do done if ${skipped} then - echo "${kver} is skipped in branch ${curr_branch_number}. Skip it." + echo "${arch}/${kver} is skipped in branch ${curr_branch_number}." continue fi # Sort the gs output by timestamp, default ordering is by name. So -- cgit v1.2.3 From 175023704e47886351659befc62f27fba645f8c1 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Thu, 20 Apr 2023 10:39:50 -0600 Subject: githooks: remove all mentions of yapf We swapped to `black` for formatting a while ago. BUG=b:279033962 TEST=repo upload Change-Id: I51e4a2a03f03f3ae8fb87df6dd7bcb51d8e83591 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4454909 Reviewed-by: Manoj Gupta Tested-by: George Burgess Commit-Queue: George Burgess --- toolchain_utils_githooks/check-presubmit.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/toolchain_utils_githooks/check-presubmit.py b/toolchain_utils_githooks/check-presubmit.py index ebbc6c3f..a584cffb 100755 --- a/toolchain_utils_githooks/check-presubmit.py +++ b/toolchain_utils_githooks/check-presubmit.py @@ -302,7 +302,7 @@ def check_py_format( thread_pool: multiprocessing.pool.ThreadPool, files: t.Iterable[str], ) -> t.List[CheckResult]: - """Runs yapf on files to check for style bugs. Also checks for #!s.""" + """Runs black on files to check for style bugs. Also checks for #!s.""" black = "black" if not has_executable_on_path(black): return CheckResult( @@ -698,7 +698,10 @@ def ensure_pip_deps_installed() -> None: print("Autoinstalling `pip`...") subprocess.check_call(["sudo", "emerge", "dev-python/pip"]) - for package in ("scipy", "yapf"): + # This was originally written as a loop, but the number of packages we need + # has decreaed. Leave it that way so adding new packages is easier in the + # future. + for package in ("scipy",): exit_code = subprocess.call( ["python3", "-c", f"import {package}"], stdout=subprocess.DEVNULL, -- cgit v1.2.3 From 001d24b7a2e24955451379e1570f39daf6209396 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Thu, 20 Apr 2023 11:08:52 -0600 Subject: rust_watch: add rotation link to new-rust-release bugs BUG=None TEST=Unittests Change-Id: Ib55681343255ef122ab62aa0ed4a16dcffecdf1f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4454910 Reviewed-by: Bob Haarman Tested-by: George Burgess Commit-Queue: George Burgess --- rust_tools/rust_watch.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rust_tools/rust_watch.py b/rust_tools/rust_watch.py index 9eb28dca..743396f1 100755 --- a/rust_tools/rust_watch.py +++ b/rust_tools/rust_watch.py @@ -270,6 +270,8 @@ def maybe_compose_bug( "If you notice any bugs or issues you'd like to share, please " "also note them on go/shared-rust-update-notes.\n" "\n" + "See go/crostc-rust-rotation for the current rotation schedule.\n" + "\n" "For questions about this bot, please contact chromeos-toolchain@ and " "CC gbiv@." ) -- cgit v1.2.3 From 316ee36d5a93b37c7952cd7ce019664134064415 Mon Sep 17 00:00:00 2001 From: Denis Nikitin Date: Tue, 25 Apr 2023 14:01:22 -0700 Subject: crosperf: Remove outdated tests kraken was removed from telemetry. It is replaced by jetstream2 which is already in some of crosperf suites. While here remove other out-dated suites. BUG=b:279523653 TEST=unit tests Change-Id: Ie65e604df2c9b38541e3b62e54670bd6a8be9433 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4475491 Tested-by: Denis Nikitin Reviewed-by: George Burgess Commit-Queue: Denis Nikitin --- crosperf/experiment_factory.py | 83 +-------------------------------- crosperf/experiment_factory_unittest.py | 10 ++-- 2 files changed, 8 insertions(+), 85 deletions(-) diff --git a/crosperf/experiment_factory.py b/crosperf/experiment_factory.py index 2a9dae7d..6d2ca0a8 100644 --- a/crosperf/experiment_factory.py +++ b/crosperf/experiment_factory.py @@ -28,33 +28,8 @@ import config # specified sets. Here we define sets of tests that users may want # to run together. -telemetry_perfv2_tests = [ - "kraken", - "octane", -] - -telemetry_pagecycler_tests = [ - "page_cycler_v2.intl_ar_fa_he", - "page_cycler_v2.intl_es_fr_pt-BR", - "page_cycler_v2.intl_hi_ru", - "page_cycler_v2.intl_ja_zh", - "page_cycler_v2.intl_ko_th_vi", - "page_cycler_v2.typical_25", -] - -telemetry_toolchain_old_perf_tests = [ - "page_cycler_v2.intl_es_fr_pt-BR", - "page_cycler_v2.intl_hi_ru", - "page_cycler_v2.intl_ja_zh", - "page_cycler_v2.intl_ko_th_vi", - "page_cycler_v2.netsim.top_10", - "page_cycler_v2.typical_25", - "spaceport", - "tab_switching.top_10", -] telemetry_toolchain_perf_tests = [ "octane", - "kraken", "speedometer", "speedometer2", "jetstream2", @@ -68,13 +43,10 @@ graphics_perf_tests = [ ] # TODO: disable rendering.desktop by default as the benchmark is # currently in a bad state -# page_cycler_v2.typical_25 is deprecated and the recommend replacement is -# loading.desktop@@typical (crbug.com/916340) telemetry_crosbolt_perf_tests = [ "octane", - "kraken", "speedometer2", - "jetstream", + "jetstream2", "loading.desktop", # 'rendering.desktop', ] @@ -84,12 +56,6 @@ crosbolt_perf_tests = [ "tast.video.PlaybackPerfVP91080P30FPS", ] -# 'cheets_AntutuTest', -# 'cheets_PerfBootServer', -# 'cheets_CandyCrushTest', -# 'cheets_LinpackTest', -# ] - dso_list = [ "all", "chrome", @@ -307,37 +273,7 @@ class ExperimentFactory(object): ) if suite == "telemetry_Crosperf": - if test_name == "all_perfv2": - self.AppendBenchmarkSet( - benchmarks, - telemetry_perfv2_tests, - test_args, - iterations, - rm_chroot_tmp, - perf_args, - suite, - show_all_results, - retries, - run_local, - cwp_dso, - weight, - ) - elif test_name == "all_pagecyclers": - self.AppendBenchmarkSet( - benchmarks, - telemetry_pagecycler_tests, - test_args, - iterations, - rm_chroot_tmp, - perf_args, - suite, - show_all_results, - retries, - run_local, - cwp_dso, - weight, - ) - elif test_name == "all_crosbolt_perf": + if test_name == "all_crosbolt_perf": self.AppendBenchmarkSet( benchmarks, telemetry_crosbolt_perf_tests, @@ -400,21 +336,6 @@ class ExperimentFactory(object): # run_local=False, # cwp_dso=cwp_dso, # weight=weight)) - elif test_name == "all_toolchain_perf_old": - self.AppendBenchmarkSet( - benchmarks, - telemetry_toolchain_old_perf_tests, - test_args, - iterations, - rm_chroot_tmp, - perf_args, - suite, - show_all_results, - retries, - run_local, - cwp_dso, - weight, - ) else: benchmark = Benchmark( benchmark_name, diff --git a/crosperf/experiment_factory_unittest.py b/crosperf/experiment_factory_unittest.py index 8050ebdc..2196fcd0 100755 --- a/crosperf/experiment_factory_unittest.py +++ b/crosperf/experiment_factory_unittest.py @@ -259,7 +259,7 @@ class ExperimentFactoryTest(unittest.TestCase): bench_list = [] ef.AppendBenchmarkSet( bench_list, - experiment_factory.telemetry_perfv2_tests, + experiment_factory.telemetry_crosbolt_perf_tests, "", 1, False, @@ -272,14 +272,15 @@ class ExperimentFactoryTest(unittest.TestCase): 0, ) self.assertEqual( - len(bench_list), len(experiment_factory.telemetry_perfv2_tests) + len(bench_list), + len(experiment_factory.telemetry_crosbolt_perf_tests), ) self.assertTrue(isinstance(bench_list[0], benchmark.Benchmark)) bench_list = [] ef.AppendBenchmarkSet( bench_list, - experiment_factory.telemetry_pagecycler_tests, + experiment_factory.telemetry_toolchain_perf_tests, "", 1, False, @@ -292,7 +293,8 @@ class ExperimentFactoryTest(unittest.TestCase): 0, ) self.assertEqual( - len(bench_list), len(experiment_factory.telemetry_pagecycler_tests) + len(bench_list), + len(experiment_factory.telemetry_toolchain_perf_tests), ) self.assertTrue(isinstance(bench_list[0], benchmark.Benchmark)) -- cgit v1.2.3 From 8001140ede34249b91b221d837a0e84e6766b930 Mon Sep 17 00:00:00 2001 From: mobiletc-prebuild Date: Wed, 26 Apr 2023 10:06:04 -0700 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-4.19 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update amd profile on chromeos-kernel-5.15 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: I557666e3984d8a41a5178a7f8e83144310c4d023 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4478235 Reviewed-by: Christopher Di Bella Tested-by: Christopher Di Bella Commit-Queue: Christopher Di Bella --- afdo_metadata/kernel_afdo.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index a8bc35c7..c7f39deb 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -1,17 +1,17 @@ { "chromeos-kernel-4_14": { - "name": "R114-15419.0-1681724239" + "name": "R114-15428.0-1682328736" }, "chromeos-kernel-4_19": { - "name": "R114-15393.12-1681724128" + "name": "R114-15419.0-1682328921" }, "chromeos-kernel-5_4": { - "name": "R114-15416.0-1681724025" + "name": "R114-15428.0-1682329008" }, "chromeos-kernel-5_10": { - "name": "R114-15419.0-1681723991" + "name": "R114-15428.0-1682328749" }, "chromeos-kernel-5_15": { - "name": "R114-15416.0-1681723984" + "name": "R114-15419.0-1682328871" } } -- cgit v1.2.3 From 965f171bea1033536a7bb4b08c022b18a2cdc8fc Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Thu, 27 Apr 2023 18:30:22 +0000 Subject: llvm_tools: Disable patches via can_patch_version At present, we were disabling patches based on is_old, but this can disable patches that only apply in the future. Instead, change it to only disable patches that apply now. BUG=b:279934635 TEST=patch_utils_unittest.py Change-Id: I39380a9bdd2d0e80edc0d655ed3fd4e7cae31d2c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4483470 Tested-by: Jordan Abrahams-Whitehead Reviewed-by: Manoj Gupta Commit-Queue: Jordan Abrahams-Whitehead --- llvm_tools/patch_utils.py | 4 +++- llvm_tools/patch_utils_unittest.py | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/llvm_tools/patch_utils.py b/llvm_tools/patch_utils.py index 84f9adff..a7f9f73f 100644 --- a/llvm_tools/patch_utils.py +++ b/llvm_tools/patch_utils.py @@ -560,7 +560,9 @@ def update_version_ranges_with_entries( """ modified_entries: List[PatchEntry] = [] applied_patches: List[PatchEntry] = [] - active_patches = (pe for pe in patch_entries if not pe.is_old(svn_version)) + active_patches = ( + pe for pe in patch_entries if pe.can_patch_version(svn_version) + ) with git_clean_context(llvm_src_dir): for pe in active_patches: test_result = pe.test_apply(llvm_src_dir) diff --git a/llvm_tools/patch_utils_unittest.py b/llvm_tools/patch_utils_unittest.py index 603ba74e..5d0e8376 100755 --- a/llvm_tools/patch_utils_unittest.py +++ b/llvm_tools/patch_utils_unittest.py @@ -266,6 +266,16 @@ Hunk #1 SUCCEEDED at 96 with fuzz 1. "until": 2, }, ), + pu.PatchEntry( + workdir=dirpath, + rel_patch_path="z.patch", + metadata=None, + platforms=None, + version_range={ + "from": 4, + "until": 5, + }, + ), ] patches[0].apply = mock.MagicMock( return_value=pu.PatchResult( @@ -275,6 +285,9 @@ Hunk #1 SUCCEEDED at 96 with fuzz 1. patches[1].apply = mock.MagicMock( return_value=pu.PatchResult(succeeded=True) ) + patches[2].apply = mock.MagicMock( + return_value=pu.PatchResult(succeeded=False) + ) results, _ = pu.update_version_ranges_with_entries( 1, dirpath, patches ) @@ -284,6 +297,7 @@ Hunk #1 SUCCEEDED at 96 with fuzz 1. self.assertEqual(results[0].version_range, {"from": 0, "until": 1}) self.assertEqual(patches[0].version_range, {"from": 0, "until": 1}) self.assertEqual(patches[1].version_range, {"from": 0, "until": 2}) + self.assertEqual(patches[2].version_range, {"from": 4, "until": 5}) @mock.patch("builtins.print") def test_remove_old_patches(self, _): -- cgit v1.2.3 From 5602ae3db4d6238006a1a4e48dfc2a3583022e07 Mon Sep 17 00:00:00 2001 From: Denis Nikitin Date: Wed, 26 Apr 2023 12:05:48 -0700 Subject: update_kernel_afdo: Skip arm/5_15 on 115 BUG=b:279767300 TEST=./update_kernel_afdo --noupload main Change-Id: I6dfa0364f47e2a2592531b9a8d26631795648e91 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4481515 Reviewed-by: Christopher Di Bella Commit-Queue: Christopher Di Bella Tested-by: Denis Nikitin --- afdo_tools/update_kernel_afdo | 1 + 1 file changed, 1 insertion(+) diff --git a/afdo_tools/update_kernel_afdo b/afdo_tools/update_kernel_afdo index 2e8e07f3..89d8a924 100755 --- a/afdo_tools/update_kernel_afdo +++ b/afdo_tools/update_kernel_afdo @@ -60,6 +60,7 @@ declare -A SKIPPED_ARCHKVERS_IN_BRANCHES # ------------------- # Kernel tracing was disabled on arm in 114, b/275560674. SKIPPED_ARCHKVERS_IN_BRANCHES["114"]="arm/5.15" +SKIPPED_ARCHKVERS_IN_BRANCHES["115"]="arm/5.15" script_dir=$(dirname "$0") tc_utils_dir="${script_dir}/.." -- cgit v1.2.3 From 576ba95956ac835ed8e31680773be51f6b5d5841 Mon Sep 17 00:00:00 2001 From: Denis Nikitin Date: Thu, 27 Apr 2023 15:43:46 -0700 Subject: crosperf: Add keep_stateful experiment field Experiment field "keep_stateful=true" flags the image_chromeos script to drop "--clobber-stateful" flag in `cros flash` which was always on before. This is especially helpful when running tests on a DUT connected via Wi-Fi. There are also other uses cases where we want to keep the stateful information. BUG=b:277269271 TEST=tested locally with crosperf Change-Id: I11bf25a4c84ac6dce0abbf04a340e1bca6007f6f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4484929 Reviewed-by: George Burgess Tested-by: Denis Nikitin Commit-Queue: Denis Nikitin --- crosperf/crosperf_unittest.py | 2 +- crosperf/experiment.py | 8 ++++++-- crosperf/experiment_factory.py | 2 ++ crosperf/experiment_factory_unittest.py | 6 ++++++ crosperf/machine_manager.py | 31 +++++++++++++++++++++++-------- crosperf/settings_factory.py | 9 +++++++++ crosperf/settings_factory_unittest.py | 4 ++-- image_chromeos.py | 21 ++++++++++++++++----- 8 files changed, 65 insertions(+), 18 deletions(-) diff --git a/crosperf/crosperf_unittest.py b/crosperf/crosperf_unittest.py index 9f5cb0d0..bbcb1712 100755 --- a/crosperf/crosperf_unittest.py +++ b/crosperf/crosperf_unittest.py @@ -67,7 +67,7 @@ class CrosperfTest(unittest.TestCase): settings = crosperf.ConvertOptionsToSettings(options) self.assertIsNotNone(settings) self.assertIsInstance(settings, settings_factory.GlobalSettings) - self.assertEqual(len(settings.fields), 41) + self.assertEqual(len(settings.fields), 42) self.assertTrue(settings.GetField("rerun")) argv = ["crosperf/crosperf.py", "temp.exp"] options, _ = parser.parse_known_args(argv) diff --git a/crosperf/experiment.py b/crosperf/experiment.py index 9973f7e9..7d35e319 100644 --- a/crosperf/experiment.py +++ b/crosperf/experiment.py @@ -44,6 +44,7 @@ class Experiment(object): ignore_min_max, crosfleet, dut_config, + keep_stateful: bool, no_lock: bool, ): self.name = name @@ -101,7 +102,11 @@ class Experiment(object): if test_flag.GetTestMode(): machine_manager_fn = MockMachineManager self.machine_manager = machine_manager_fn( - chromeos_root, acquire_timeout, log_level, locks_directory + chromeos_root, + acquire_timeout, + log_level, + locks_directory, + keep_stateful=keep_stateful, ) self.l = logger.GetLogger(log_dir) @@ -137,7 +142,6 @@ class Experiment(object): for label in self.labels: for benchmark in self.benchmarks: for iteration in range(1, benchmark.iterations + 1): - benchmark_run_name = "%s: %s (%s)" % ( label.name, benchmark.name, diff --git a/crosperf/experiment_factory.py b/crosperf/experiment_factory.py index 6d2ca0a8..e89adb87 100644 --- a/crosperf/experiment_factory.py +++ b/crosperf/experiment_factory.py @@ -177,6 +177,7 @@ class ExperimentFactory(object): "turbostat": global_settings.GetField("turbostat"), "top_interval": global_settings.GetField("top_interval"), } + keep_stateful = global_settings.GetField("keep_stateful") # Default cache hit conditions. The image checksum in the cache and the # computed checksum of the image must match. Also a cache file must exist. @@ -521,6 +522,7 @@ class ExperimentFactory(object): ignore_min_max, crosfleet, dut_config, + keep_stateful, no_lock=no_lock, ) diff --git a/crosperf/experiment_factory_unittest.py b/crosperf/experiment_factory_unittest.py index 2196fcd0..87e8c4f9 100755 --- a/crosperf/experiment_factory_unittest.py +++ b/crosperf/experiment_factory_unittest.py @@ -420,10 +420,13 @@ class ExperimentFactoryTest(unittest.TestCase): ) self.assertEqual(exp.labels[0].autotest_path, "/tmp/autotest") self.assertEqual(exp.labels[0].board, "lumpy") + self.assertEqual(exp.machine_manager.keep_stateful, False) # Second test: Remotes listed in labels. test_flag.SetTestMode(True) label_settings.SetField("remote", "chromeos1.cros chromeos2.cros") + # Also verify keep_stateful. + global_settings.SetField("keep_stateful", "true") exp = ef.GetExperiment(mock_experiment_file, "", "") self.assertCountEqual( exp.remote, @@ -434,6 +437,9 @@ class ExperimentFactoryTest(unittest.TestCase): "chromeos2.cros", ], ) + # keep_stateful is propagated to machine_manager which flashes the + # images. + self.assertEqual(exp.machine_manager.keep_stateful, True) # Third test: Automatic fixing of bad logging_level param: global_settings.SetField("logging_level", "really loud!") diff --git a/crosperf/machine_manager.py b/crosperf/machine_manager.py index ffb0b5e6..17db64f5 100644 --- a/crosperf/machine_manager.py +++ b/crosperf/machine_manager.py @@ -221,6 +221,7 @@ class MachineManager(object): locks_dir, cmd_exec=None, lgr=None, + keep_stateful: bool = False, ): self._lock = threading.RLock() self._all_machines = [] @@ -233,6 +234,7 @@ class MachineManager(object): self.acquire_timeout = acquire_timeout self.log_level = log_level self.locks_dir = locks_dir + self.keep_stateful = keep_stateful self.ce = cmd_exec or command_executer.GetCommandExecuter( log_level=self.log_level ) @@ -282,14 +284,16 @@ class MachineManager(object): image_chromeos_args = [ image_chromeos.__file__, "--no_lock", - "--chromeos_root=%s" % chromeos_root, - "--image=%s" % label.chromeos_image, - "--image_args=%s" % label.image_args, - "--remote=%s" % machine.name, - "--logging_level=%s" % self.log_level, + f"--chromeos_root={chromeos_root}", + f"--image={label.chromeos_image}", + f"--image_args={label.image_args}", + f"--remote={machine.name}", + f"--logging_level={self.log_level}", ] if label.board: - image_chromeos_args.append("--board=%s" % label.board) + image_chromeos_args.append(f"--board={label.board}") + if self.keep_stateful: + image_chromeos_args.append("--keep_stateful") # Currently can't image two machines at once. # So have to serialized on this lock. @@ -729,9 +733,20 @@ power management: class MockMachineManager(MachineManager): """Mock machine manager class.""" - def __init__(self, chromeos_root, acquire_timeout, log_level, locks_dir): + def __init__( + self, + chromeos_root, + acquire_timeout, + log_level, + locks_dir, + keep_stateful: bool = False, + ): super(MockMachineManager, self).__init__( - chromeos_root, acquire_timeout, log_level, locks_dir + chromeos_root, + acquire_timeout, + log_level, + locks_dir, + keep_stateful=keep_stateful, ) def _TryToLockMachine(self, cros_machine): diff --git a/crosperf/settings_factory.py b/crosperf/settings_factory.py index 2bf4119a..b34f0b16 100644 --- a/crosperf/settings_factory.py +++ b/crosperf/settings_factory.py @@ -559,6 +559,15 @@ class GlobalSettings(Settings): " Useful when lock is held externally, say with crosfleet.", ) ) + self.AddField( + BooleanField( + "keep_stateful", + default=False, + description="When flashing a ChromeOS image keep the stateful" + " partition, i.e. don't use --clobber-stateful. This option" + " is useful to keep ssh keys, wi-fi settings and so on.", + ) + ) class SettingsFactory(object): diff --git a/crosperf/settings_factory_unittest.py b/crosperf/settings_factory_unittest.py index 4b7c725e..a6771c03 100755 --- a/crosperf/settings_factory_unittest.py +++ b/crosperf/settings_factory_unittest.py @@ -49,7 +49,7 @@ class GlobalSettingsTest(unittest.TestCase): def test_init(self): res = settings_factory.GlobalSettings("g_settings") self.assertIsNotNone(res) - self.assertEqual(len(res.fields), 41) + self.assertEqual(len(res.fields), 42) self.assertEqual(res.GetField("name"), "") self.assertEqual(res.GetField("board"), "") self.assertEqual(res.GetField("crosfleet"), False) @@ -115,7 +115,7 @@ class SettingsFactoryTest(unittest.TestCase): "global", "global" ) self.assertIsInstance(g_settings, settings_factory.GlobalSettings) - self.assertEqual(len(g_settings.fields), 41) + self.assertEqual(len(g_settings.fields), 42) if __name__ == "__main__": diff --git a/image_chromeos.py b/image_chromeos.py index 5d222691..38300591 100755 --- a/image_chromeos.py +++ b/image_chromeos.py @@ -49,12 +49,12 @@ def CheckForCrosFlash(chromeos_root, remote, log_level): command, chromeos_root=chromeos_root, machine=remote ) logger.GetLogger().LogFatalIf( - ret == 255, "Failed ssh to %s (for checking cherrypy)" % remote + ret == 255, f"Failed ssh to {remote} (for checking cherrypy)" ) logger.GetLogger().LogFatalIf( ret != 0, - "Failed to find cherrypy or ctypes on remote '{}', " - "cros flash cannot work.".format(remote), + f"Failed to find cherrypy or ctypes on '{remote}', " + "cros flash cannot work.", ) @@ -142,6 +142,13 @@ def DoImage(argv): "'quiet', 'average', and 'verbose'.", ) parser.add_argument("-a", "--image_args", dest="image_args") + parser.add_argument( + "--keep_stateful", + dest="keep_stateful", + default=False, + action="store_true", + help="Do not clobber the stateful partition.", + ) options = parser.parse_args(argv[1:]) @@ -261,9 +268,13 @@ def DoImage(argv): "cros", "flash", "--board=%s" % board, - "--clobber-stateful", - options.remote, ] + if not options.keep_stateful: + cros_flash_args.append("--clobber-stateful") + # New arguments should be added here. + + # The last two arguments are positional and have to be at the end. + cros_flash_args.append(options.remote) if local_image: cros_flash_args.append(chroot_image) else: -- cgit v1.2.3 From 8c8aba27b6576143f49fc509ef598f1e6dfe1304 Mon Sep 17 00:00:00 2001 From: mobiletc-prebuild Date: Wed, 3 May 2023 10:05:21 -0700 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-4.19 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update amd profile on chromeos-kernel-5.15 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: If9cc05f499907055a6b33b6997bdba56ba69397f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4500309 Reviewed-by: Denis Nikitin Tested-by: Denis Nikitin Commit-Queue: Denis Nikitin --- afdo_metadata/kernel_afdo.json | 10 +++++----- afdo_metadata/kernel_arm_afdo.json | 3 --- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index c7f39deb..38f0aef4 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -1,17 +1,17 @@ { "chromeos-kernel-4_14": { - "name": "R114-15428.0-1682328736" + "name": "R114-15437.4-1682933824" }, "chromeos-kernel-4_19": { - "name": "R114-15419.0-1682328921" + "name": "R115-15419.0-1682933533" }, "chromeos-kernel-5_4": { - "name": "R114-15428.0-1682329008" + "name": "R115-15437.4-1682933644" }, "chromeos-kernel-5_10": { - "name": "R114-15428.0-1682328749" + "name": "R115-15437.4-1682933719" }, "chromeos-kernel-5_15": { - "name": "R114-15419.0-1682328871" + "name": "R115-15428.0-1682933589" } } diff --git a/afdo_metadata/kernel_arm_afdo.json b/afdo_metadata/kernel_arm_afdo.json index 1b26da77..2c63c085 100644 --- a/afdo_metadata/kernel_arm_afdo.json +++ b/afdo_metadata/kernel_arm_afdo.json @@ -1,5 +1,2 @@ { - "chromeos-kernel-5_15": { - "name": "R114-15393.6-1680514764" - } } -- cgit v1.2.3 From c8fb682355dbfe7ad2eeec112689f2276f0a76ed Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Fri, 21 Apr 2023 12:18:26 -0700 Subject: cros_utils: Leverage chromite.lib.path_util for chroot translation BUG=b:275442353 TEST=cros format Cq-Depend: chromium:4477628 Change-Id: I2dd5995ee0e5729643a0a505e19c2c6fd11df2bd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4461771 Commit-Queue: Manoj Gupta Tested-by: Manoj Gupta Reviewed-by: Jordan Abrahams-Whitehead --- cros_utils/misc.py | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/cros_utils/misc.py b/cros_utils/misc.py index 5ce6447c..72cfb8b8 100644 --- a/cros_utils/misc.py +++ b/cros_utils/misc.py @@ -59,7 +59,7 @@ def ApplySubs(string, *substitutions): def UnitToNumber(unit_num, base=1000): """Convert a number with unit to float.""" - unit_dict = {"kilo": base, "mega": base ** 2, "giga": base ** 3} + unit_dict = {"kilo": base, "mega": base**2, "giga": base**3} unit_num = unit_num.lower() mo = re.search(r"(\d*)(.+)?", unit_num) number = mo.group(1) @@ -96,21 +96,20 @@ def GetChromeOSKeyFile(chromeos_root): ) -def GetChrootPath(chromeos_root): - return os.path.join(chromeos_root, "chroot") +def GetInsideChrootPath(chromeos_root, file_path): + sys.path.insert(0, chromeos_root) + from chromite.lib import path_util -def GetInsideChrootPath(chromeos_root, file_path): - if not file_path.startswith(GetChrootPath(chromeos_root)): - raise RuntimeError( - "File: %s doesn't seem to be in the chroot: %s" - % (file_path, chromeos_root) - ) - return file_path[len(GetChrootPath(chromeos_root)) :] + return path_util.ToChrootPath(path=file_path, source_path=chromeos_root) def GetOutsideChrootPath(chromeos_root, file_path): - return os.path.join(GetChrootPath(chromeos_root), file_path.lstrip("/")) + sys.path.insert(0, chromeos_root) + + from chromite.lib import path_util + + return path_util.FromChrootPath(path=file_path, source_path=chromeos_root) def FormatQuotedCommand(command): @@ -124,7 +123,10 @@ def FormatCommands(commands): def GetImageDir(chromeos_root, board): - return os.path.join(chromeos_root, "src", "build", "images", board) + return GetOutsideChrootPath( + chromeos_root, + os.path.join(chromeos_root, "src", "build", "images", board), + ) def LabelLatestImage(chromeos_root, board, label, vanilla_path=None): @@ -303,16 +305,16 @@ def IsFloat(text): def RemoveChromeBrowserObjectFiles(chromeos_root, board): """Remove any object files from all the posible locations.""" - out_dir = os.path.join( - GetChrootPath(chromeos_root), - "var/cache/chromeos-chrome/chrome-src/src/out_%s" % board, + out_dir = GetOutsideChrootPath( + chromeos_root, + "/var/cache/chromeos-chrome/chrome-src/src/out_%s" % board, ) if os.path.exists(out_dir): shutil.rmtree(out_dir) logger.GetLogger().LogCmd("rm -rf %s" % out_dir) - out_dir = os.path.join( - GetChrootPath(chromeos_root), - "var/cache/chromeos-chrome/chrome-src-internal/src/out_%s" % board, + out_dir = GetOutsideChrootPath( + chromeos_root, + "/var/cache/chromeos-chrome/chrome-src-internal/src/out_%s" % board, ) if os.path.exists(out_dir): shutil.rmtree(out_dir) -- cgit v1.2.3 From db8454a2a059e5c43af75197911b23d245f4dfe2 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Fri, 21 Apr 2023 13:57:53 -0700 Subject: crosperf: Leverage more cros_utils chroot translation Tackle places where we assume we can append paths (like /tmp) to the chroot path. This may not always be the case, if /tmp or other stateful paths get mapped elsewhere outside the chroot. BUG=b:275442353 TEST=unit tests Change-Id: I97c7ec948c58fa3f0fb9e4b3dc7f984ab0157bc5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4461772 Tested-by: Jordan Abrahams-Whitehead Reviewed-by: Jordan Abrahams-Whitehead Reviewed-by: Manoj Gupta Commit-Queue: Manoj Gupta --- crosperf/download_images.py | 42 ++++++++++------ crosperf/download_images_unittest.py | 96 ++++++++++++++++++++++++------------ crosperf/results_cache.py | 32 ++++++------ crosperf/results_cache_unittest.py | 54 ++++++++++++++------ crosperf/suite_runner.py | 7 ++- 5 files changed, 149 insertions(+), 82 deletions(-) diff --git a/crosperf/download_images.py b/crosperf/download_images.py index 0f184c0b..38d5d68a 100644 --- a/crosperf/download_images.py +++ b/crosperf/download_images.py @@ -11,6 +11,7 @@ import os import shlex from cros_utils import command_executer +from cros_utils import misc import test_flag @@ -80,7 +81,9 @@ class ImageDownloader(object): ) # Make sure the directory for downloading the image exists. - download_path = os.path.join(chromeos_root, "chroot/tmp", build_id) + download_path = misc.GetOutsideChrootPath( + chromeos_root, os.path.join("/tmp", build_id) + ) image_path = os.path.join(download_path, "chromiumos_test_image.bin") if not os.path.exists(download_path): os.makedirs(download_path) @@ -106,18 +109,19 @@ class ImageDownloader(object): def UncompressImage(self, chromeos_root, build_id): # Check to see if the file has already been uncompresssed, etc. - if os.path.exists( + download_path = misc.GetOutsideChrootPath( + chromeos_root, os.path.join( - chromeos_root, - "chroot/tmp", + "/tmp", build_id, - "chromiumos_test_image.bin", - ) + ), + ) + if os.path.exists( + os.path.join(download_path, "chromiumos_test_image.bin") ): return # Uncompress and untar the downloaded image. - download_path = os.path.join(chromeos_root, "chroot/tmp", build_id) command = ( "cd %s ; tar -Jxf chromiumos_test_image.tar.xz " % download_path ) @@ -179,7 +183,9 @@ class ImageDownloader(object): ) # Make sure the directory for downloading the package exists. - download_path = os.path.join(chromeos_root, "chroot/tmp", build_id) + download_path = misc.GetOutsideChrootPath( + chromeos_root, os.path.join("/tmp", build_id) + ) package_path = os.path.join(download_path, package_file_name) if not os.path.exists(download_path): os.makedirs(download_path) @@ -205,7 +211,9 @@ class ImageDownloader(object): self, chromeos_root, build_id, package_file_name, uncompress_cmd ): # Uncompress file - download_path = os.path.join(chromeos_root, "chroot/tmp", build_id) + download_path = misc.GetOutsideChrootPath( + chromeos_root, os.path.join("/tmp", build_id) + ) command = "cd %s ; %s %s" % ( download_path, uncompress_cmd, @@ -253,13 +261,13 @@ class ImageDownloader(object): autotest_server_package_name = "autotest_server_package.tar.bz2" autotest_control_files_name = "control_files.tar" - download_path = os.path.join(chromeos_root, "chroot/tmp", build_id) + download_path = misc.GetOutsideChrootPath( + chromeos_root, os.path.join("/tmp", build_id) + ) # Autotest directory relative path wrt chroot autotest_rel_path = os.path.join("/tmp", build_id, "autotest_files") # Absolute Path to download files - autotest_path = os.path.join( - chromeos_root, "chroot/tmp", build_id, "autotest_files" - ) + autotest_path = os.path.join(download_path, "autotest_files") if not os.path.exists(autotest_path): # Quickly verify if the files are present on server @@ -316,12 +324,14 @@ class ImageDownloader(object): # Download autest package files (3 files) debug_archive_name = "debug.tgz" - download_path = os.path.join(chromeos_root, "chroot/tmp", build_id) + download_path = misc.GetOutsideChrootPath( + chromeos_root, os.path.join("/tmp", build_id) + ) # Debug directory relative path wrt chroot debug_rel_path = os.path.join("/tmp", build_id, "debug_files") # Debug path to download files - debug_path = os.path.join( - chromeos_root, "chroot/tmp", build_id, "debug_files" + debug_path = misc.GetOutsideChrootPath( + chromeos_root, os.path.join("/tmp", build_id, "debug_files") ) if not os.path.exists(debug_path): diff --git a/crosperf/download_images_unittest.py b/crosperf/download_images_unittest.py index 6a640f80..0e47e757 100755 --- a/crosperf/download_images_unittest.py +++ b/crosperf/download_images_unittest.py @@ -8,6 +8,7 @@ import os +import re import unittest import unittest.mock as mock @@ -20,6 +21,16 @@ import test_flag MOCK_LOGGER = logger.GetLogger(log_dir="", mock=True) +class RegexMatcher: + """A regex matcher, for passing to mocks.""" + + def __init__(self, regex): + self._regex = re.compile(regex) + + def __eq__(self, string): + return self._regex.search(string) is not None + + class ImageDownloaderTestcast(unittest.TestCase): """The image downloader test class.""" @@ -34,7 +45,6 @@ class ImageDownloaderTestcast(unittest.TestCase): @mock.patch.object(os, "makedirs") @mock.patch.object(os.path, "exists") def test_download_image(self, mock_path_exists, mock_mkdirs): - # Set mock and test values. mock_cmd_exec = mock.Mock(spec=command_executer.CommandExecuter) test_chroot = "/usr/local/home/chromeos" @@ -59,50 +69,63 @@ class ImageDownloaderTestcast(unittest.TestCase): image_path, ) - # Verify os.path.exists was called twice, with proper arguments. - self.assertEqual(mock_path_exists.call_count, 2) - mock_path_exists.assert_called_with( - "/usr/local/home/chromeos/chroot/tmp/lumpy-release/" - "R36-5814.0.0/chromiumos_test_image.bin" + # Verify os.path.exists was called thrice, with proper arguments. + self.assertEqual(mock_path_exists.call_count, 3) + mock_path_exists.assert_any_call( + RegexMatcher( + "/usr/local/home/chromeos/.*tmp/lumpy-release/" + "R36-5814.0.0/chromiumos_test_image.bin" + ) ) mock_path_exists.assert_any_call( - "/usr/local/home/chromeos/chroot/tmp/lumpy-release/R36-5814.0.0" + RegexMatcher( + "/usr/local/home/chromeos/.*tmp/lumpy-release/R36-5814.0.0" + ) ) + mock_path_exists.assert_any_call("/etc/cros_chroot_version") # Verify we called os.mkdirs self.assertEqual(mock_mkdirs.call_count, 1) mock_mkdirs.assert_called_with( - "/usr/local/home/chromeos/chroot/tmp/lumpy-release/R36-5814.0.0" + RegexMatcher( + "/usr/local/home/chromeos/.*tmp/lumpy-release/R36-5814.0.0" + ) ) # Verify we called RunCommand once, with proper arguments. self.assertEqual(mock_cmd_exec.RunCommand.call_count, 1) - expected_args = ( + expected_args = RegexMatcher( "/usr/local/home/chromeos/src/chromium/depot_tools/gsutil.py " "cp gs://chromeos-image-archive/lumpy-release/R36-5814.0.0/" "chromiumos_test_image.tar.xz " - "/usr/local/home/chromeos/chroot/tmp/lumpy-release/R36-5814.0.0" + "/usr/local/home/chromeos/.*tmp/lumpy-release/R36-5814.0.0" ) mock_cmd_exec.RunCommand.assert_called_with(expected_args) - # Reset the velues in the mocks; set os.path.exists to always return True. + # Reset the velues in the mocks; set os.path.exists to always return + # True (except for "inside chroot" check). mock_path_exists.reset_mock() mock_cmd_exec.reset_mock() - mock_path_exists.return_value = True + mock_path_exists.side_effect = lambda x: x != "/etc/cros_chroot_version" # Run downloader downloader.DownloadImage(test_chroot, test_build_id, image_path) - # Verify os.path.exists was called twice, with proper arguments. - self.assertEqual(mock_path_exists.call_count, 2) + # Verify os.path.exists was called thrice, with proper arguments. + self.assertEqual(mock_path_exists.call_count, 3) mock_path_exists.assert_called_with( - "/usr/local/home/chromeos/chroot/tmp/lumpy-release/" - "R36-5814.0.0/chromiumos_test_image.bin" + RegexMatcher( + "/usr/local/home/chromeos/.*tmp/lumpy-release/" + "R36-5814.0.0/chromiumos_test_image.bin" + ) ) mock_path_exists.assert_any_call( - "/usr/local/home/chromeos/chroot/tmp/lumpy-release/R36-5814.0.0" + RegexMatcher( + "/usr/local/home/chromeos/.*tmp/lumpy-release/R36-5814.0.0" + ) ) + mock_path_exists.assert_any_call("/etc/cros_chroot_version") # Verify we made no RunCommand or ChrootRunCommand calls (since # os.path.exists returned True, there was no work do be done). @@ -111,7 +134,6 @@ class ImageDownloaderTestcast(unittest.TestCase): @mock.patch.object(os.path, "exists") def test_uncompress_image(self, mock_path_exists): - # set mock and test values. mock_cmd_exec = mock.Mock(spec=command_executer.CommandExecuter) test_chroot = "/usr/local/home/chromeos" @@ -130,12 +152,15 @@ class ImageDownloaderTestcast(unittest.TestCase): test_build_id, ) - # Verify os.path.exists was called once, with correct arguments. - self.assertEqual(mock_path_exists.call_count, 1) + # Verify os.path.exists was called twice, with correct arguments. + self.assertEqual(mock_path_exists.call_count, 2) mock_path_exists.assert_called_with( - "/usr/local/home/chromeos/chroot/tmp/lumpy-release/" - "R36-5814.0.0/chromiumos_test_image.bin" + RegexMatcher( + "/usr/local/home/chromeos/.*tmp/lumpy-release/" + "R36-5814.0.0/chromiumos_test_image.bin" + ) ) + mock_path_exists.assert_any_call("/etc/cros_chroot_version") # Verify RunCommand was called twice with correct arguments. self.assertEqual(mock_cmd_exec.RunCommand.call_count, 2) @@ -143,8 +168,10 @@ class ImageDownloaderTestcast(unittest.TestCase): self.assertEqual(len(mock_cmd_exec.RunCommand.call_args_list[0]), 2) actual_arg = mock_cmd_exec.RunCommand.call_args_list[0][0] expected_arg = ( - "cd /usr/local/home/chromeos/chroot/tmp/lumpy-release/R36-5814.0.0 ; " - "tar -Jxf chromiumos_test_image.tar.xz ", + RegexMatcher( + "cd /usr/local/home/chromeos/.*tmp/lumpy-release/R36-5814.0.0 ; " + "tar -Jxf chromiumos_test_image.tar.xz " + ), ) self.assertEqual(expected_arg, actual_arg) # 2nd arg must be exception handler @@ -158,8 +185,10 @@ class ImageDownloaderTestcast(unittest.TestCase): self.assertEqual(len(mock_cmd_exec.RunCommand.call_args_list[1]), 2) actual_arg = mock_cmd_exec.RunCommand.call_args_list[1][0] expected_arg = ( - "cd /usr/local/home/chromeos/chroot/tmp/lumpy-release/R36-5814.0.0 ; " - "rm -f chromiumos_test_image.bin ", + RegexMatcher( + "cd /usr/local/home/chromeos/.*tmp/lumpy-release/R36-5814.0.0 ; " + "rm -f chromiumos_test_image.bin " + ), ) self.assertEqual(expected_arg, actual_arg) # 2nd arg must be empty @@ -167,24 +196,27 @@ class ImageDownloaderTestcast(unittest.TestCase): "{}" in repr(mock_cmd_exec.RunCommand.call_args_list[1][1]) ) - # Set os.path.exists to always return True and run uncompress. + # Set os.path.exists to always return True (except for "inside chroot" + # check) and run uncompress. mock_path_exists.reset_mock() mock_cmd_exec.reset_mock() - mock_path_exists.return_value = True + mock_path_exists.side_effect = lambda x: x != "/etc/cros_chroot_version" downloader.UncompressImage(test_chroot, test_build_id) # Verify os.path.exists was called once, with correct arguments. - self.assertEqual(mock_path_exists.call_count, 1) + self.assertEqual(mock_path_exists.call_count, 2) mock_path_exists.assert_called_with( - "/usr/local/home/chromeos/chroot/tmp/lumpy-release/" - "R36-5814.0.0/chromiumos_test_image.bin" + RegexMatcher( + "/usr/local/home/chromeos/.*tmp/lumpy-release/" + "R36-5814.0.0/chromiumos_test_image.bin" + ) ) + mock_path_exists.assert_any_call("/etc/cros_chroot_version") # Verify RunCommand was not called. self.assertEqual(mock_cmd_exec.RunCommand.call_count, 0) def test_run(self): - # Set test arguments test_chroot = "/usr/local/home/chromeos" test_build_id = "remote/lumpy/latest-dev" diff --git a/crosperf/results_cache.py b/crosperf/results_cache.py index c4cdc454..97688dc8 100644 --- a/crosperf/results_cache.py +++ b/crosperf/results_cache.py @@ -185,8 +185,9 @@ class Result(object): # Otherwise get the base filename and create the correct # path for it. _, f_base = misc.GetRoot(f) - data_filename = os.path.join( - self.chromeos_root, "chroot/tmp", self.temp_dir, f_base + data_filename = misc.GetOutsideChrootPath( + self.chromeos_root, + os.path.join("/tmp", self.temp_dir, f_base), ) if data_filename.find(".json") > 0: raw_dict = dict() @@ -258,22 +259,24 @@ class Result(object): return results_dict def GetKeyvals(self): - results_in_chroot = os.path.join(self.chromeos_root, "chroot", "tmp") + results_in_chroot = misc.GetOutsideChrootPath( + self.chromeos_root, "/tmp" + ) if not self.temp_dir: self.temp_dir = tempfile.mkdtemp(dir=results_in_chroot) command = f"cp -r {self.results_dir}/* {self.temp_dir}" self.ce.RunCommand(command, print_to_console=False) + tmp_dir_in_chroot = misc.GetInsideChrootPath( + self.chromeos_root, self.temp_dir + ) command = "./generate_test_report --no-color --csv %s" % ( - os.path.join("/tmp", os.path.basename(self.temp_dir)) + tmp_dir_in_chroot ) _, out, _ = self.ce.ChrootRunCommandWOutput( self.chromeos_root, command, print_to_console=False ) keyvals_dict = {} - tmp_dir_in_chroot = misc.GetInsideChrootPath( - self.chromeos_root, self.temp_dir - ) for line in out.splitlines(): tokens = re.split("=|,", line) key = tokens[-2] @@ -297,8 +300,8 @@ class Result(object): chroot_perf_data_file = misc.GetInsideChrootPath( self.chromeos_root, perf_data_file ) - perf_path = os.path.join( - self.chromeos_root, "chroot", "usr/bin/perf" + perf_path = misc.GetOutsideChrootPath( + self.chromeos_root, "/usr/bin/perf" ) perf_file = "/usr/sbin/perf" if os.path.exists(perf_path): @@ -464,10 +467,7 @@ class Result(object): return self.FindFilesInResultsDir("-name wait_time.log").split("\n")[0] def _CheckDebugPath(self, option, path): - relative_path = path[1:] - out_chroot_path = os.path.join( - self.chromeos_root, "chroot", relative_path - ) + out_chroot_path = misc.GetOutsideChrootPath(self.chromeos_root, path) if os.path.exists(out_chroot_path): if option == "kallsyms": path = os.path.join(path, "System.map-*") @@ -495,8 +495,8 @@ class Result(object): chroot_perf_report_file = misc.GetInsideChrootPath( self.chromeos_root, perf_report_file ) - perf_path = os.path.join( - self.chromeos_root, "chroot", "usr/bin/perf" + perf_path = misc.GetOutsideChrootPath( + self.chromeos_root, "/usr/bin/perf" ) perf_file = "/usr/sbin/perf" @@ -1186,7 +1186,7 @@ class Result(object): # Untar the tarball to a temporary directory self.temp_dir = tempfile.mkdtemp( - dir=os.path.join(self.chromeos_root, "chroot", "tmp") + dir=misc.GetOutsideChrootPath(self.chromeos_root, "/tmp") ) command = "cd %s && tar xf %s" % ( diff --git a/crosperf/results_cache_unittest.py b/crosperf/results_cache_unittest.py index bc90c5a9..aecd7939 100755 --- a/crosperf/results_cache_unittest.py +++ b/crosperf/results_cache_unittest.py @@ -11,6 +11,7 @@ import io import os import pickle +import re import shutil import tempfile import unittest @@ -449,6 +450,16 @@ class MockResult(Result): return keyvals +class RegexMatcher: + """A regex matcher, for passing to mocks.""" + + def __init__(self, regex): + self._regex = re.compile(regex) + + def __eq__(self, string): + return self._regex.search(string) is not None + + class ResultTest(unittest.TestCase): """Result test class.""" @@ -490,7 +501,9 @@ class ResultTest(unittest.TestCase): None, ) - def testCreateFromRun(self): + @mock.patch.object(os.path, "exists") + def testCreateFromRun(self, mock_path_exists): + mock_path_exists.side_effect = lambda x: x != "/etc/cros_chroot_version" result = MockResult.CreateFromRun( logger.GetLogger(), "average", @@ -508,7 +521,7 @@ class ResultTest(unittest.TestCase): ) self.assertEqual( result.results_dir, - "/tmp/chroot/tmp/test_that.PO1234567/platform_LibCBench", + RegexMatcher("/tmp/.*tmp/test_that.PO1234567/platform_LibCBench"), ) self.assertEqual(result.retval, 0) @@ -517,12 +530,12 @@ class ResultTest(unittest.TestCase): self.mock_logger, self.mock_label, "average", self.mock_cmd_exec ) self.result.chromeos_root = "/tmp/chromeos" + self.orig_exists = os.path.exists @mock.patch.object(os.path, "isdir") @mock.patch.object(command_executer.CommandExecuter, "RunCommand") @mock.patch.object(command_executer.CommandExecuter, "CopyFiles") def test_copy_files_to(self, mock_copyfiles, mock_runcmd, mock_isdir): - files = ["src_file_1", "src_file_2", "src_file_3"] dest_dir = "/tmp/test" self.mock_cmd_exec.RunCommand = mock_runcmd @@ -738,7 +751,6 @@ class ResultTest(unittest.TestCase): def test_get_keyvals( self, mock_chrootruncmd, mock_runcmd, mock_mkdtemp, mock_getpath ): - self.kv_dict = {} self.callGetNewKeyvals = False @@ -863,7 +875,6 @@ class ResultTest(unittest.TestCase): self.assertEqual(samples, [12345 - 60, "samples"]) def test_get_results_dir(self): - self.result.out = "" self.assertRaises(Exception, self.result.GetResultsDir) @@ -873,7 +884,6 @@ class ResultTest(unittest.TestCase): @mock.patch.object(command_executer.CommandExecuter, "RunCommandGeneric") def test_find_files_in_results_dir(self, mock_runcmd): - self.result.results_dir = None res = self.result.FindFilesInResultsDir("-name perf.data") self.assertEqual(res, "") @@ -1347,10 +1357,18 @@ class ResultTest(unittest.TestCase): ), ) + @mock.patch.object(os.path, "exists") @mock.patch.object(misc, "GetInsideChrootPath") @mock.patch.object(command_executer.CommandExecuter, "ChrootRunCommand") - def test_generate_perf_report_files(self, mock_chrootruncmd, mock_getpath): - fake_file = "/usr/chromeos/chroot/tmp/results/fake_file" + def test_generate_perf_report_files( + self, mock_chrootruncmd, mock_getpath, mock_pathexists + ): + mock_pathexists.side_effect = ( + lambda x: self.orig_exists(x) + if x != "/etc/cros_chroot_version" + else False + ) + fake_file = "/tmp/results/perf.data.report" self.result.perf_data_files = ["/tmp/results/perf.data"] self.result.board = "lumpy" mock_getpath.return_value = fake_file @@ -1359,7 +1377,8 @@ class ResultTest(unittest.TestCase): # Debug path not found self.result.label.debug_path = "" tmp = self.result.GeneratePerfReportFiles() - self.assertEqual(tmp, ["/tmp/chromeos/chroot%s" % fake_file]) + self.assertEqual(len(tmp), 1) + self.assertEqual(tmp[0], RegexMatcher("/tmp/chromeos.*%s" % fake_file)) self.assertEqual( mock_chrootruncmd.call_args_list[0][0], ( @@ -1369,12 +1388,18 @@ class ResultTest(unittest.TestCase): ), ) + @mock.patch.object(os.path, "exists") @mock.patch.object(misc, "GetInsideChrootPath") @mock.patch.object(command_executer.CommandExecuter, "ChrootRunCommand") def test_generate_perf_report_files_debug( - self, mock_chrootruncmd, mock_getpath + self, mock_chrootruncmd, mock_getpath, mock_pathexists ): - fake_file = "/usr/chromeos/chroot/tmp/results/fake_file" + mock_pathexists.side_effect = ( + lambda x: self.orig_exists(x) + if x != "/etc/cros_chroot_version" + else False + ) + fake_file = "/tmp/results/perf.data.report" self.result.perf_data_files = ["/tmp/results/perf.data"] self.result.board = "lumpy" mock_getpath.return_value = fake_file @@ -1383,7 +1408,8 @@ class ResultTest(unittest.TestCase): # Debug path found self.result.label.debug_path = "/tmp/debug" tmp = self.result.GeneratePerfReportFiles() - self.assertEqual(tmp, ["/tmp/chromeos/chroot%s" % fake_file]) + self.assertEqual(len(tmp), 1) + self.assertEqual(tmp[0], RegexMatcher("/tmp/chromeos.*%s" % fake_file)) self.assertEqual( mock_chrootruncmd.call_args_list[0][0], ( @@ -1669,7 +1695,6 @@ class ResultTest(unittest.TestCase): command_executer.CommandExecuter, "ChrootRunCommandWOutput" ) def test_populate_from_cache_dir(self, mock_runchrootcmd, mock_getpath): - # pylint: disable=redefined-builtin def FakeMkdtemp(dir=None): if dir: @@ -1803,7 +1828,6 @@ class ResultTest(unittest.TestCase): @mock.patch.object(misc, "GetRoot") @mock.patch.object(command_executer.CommandExecuter, "RunCommand") def test_cleanup(self, mock_runcmd, mock_getroot): - # Test 1. 'rm_chroot_tmp' is True; self.results_dir exists; # self.temp_dir exists; results_dir name contains 'test_that_results_'. mock_getroot.return_value = [ @@ -2036,7 +2060,6 @@ class TelemetryResultTest(unittest.TestCase): self.assertEqual(self.result.retval, 3) def test_populate_from_cache_dir_and_process_results(self): - self.result = TelemetryResult( self.mock_logger, self.mock_label, "average", self.mock_machine ) @@ -2249,7 +2272,6 @@ class ResultsCacheTest(unittest.TestCase): @mock.patch.object(os.path, "isdir") @mock.patch.object(Result, "CreateFromCacheHit") def test_read_result(self, mock_create, mock_isdir, mock_runcmd): - self.fakeCacheReturnResult = None def FakeGetCacheDirForRead(): diff --git a/crosperf/suite_runner.py b/crosperf/suite_runner.py index e777a57f..f5566f51 100644 --- a/crosperf/suite_runner.py +++ b/crosperf/suite_runner.py @@ -17,6 +17,7 @@ import subprocess import time from cros_utils import command_executer +from cros_utils import misc # sshwatcher path, relative to ChromiumOS source root. @@ -152,7 +153,9 @@ class SuiteRunner(object): def RemoveTelemetryTempFile(self, machine, chromeos_root): filename = "telemetry@%s" % machine - fullname = os.path.join(chromeos_root, "chroot", "tmp", filename) + fullname = misc.GetOutsideChrootPath( + chromeos_root, os.path.join("/tmp", filename) + ) if os.path.exists(fullname): os.remove(fullname) @@ -286,7 +289,7 @@ class SuiteRunner(object): def DownloadResult(self, label, task_id): gsutil_cmd = os.path.join(label.chromeos_root, GS_UTIL) result_dir = "gs://chromeos-autotest-results/swarming-%s" % task_id - download_path = os.path.join(label.chromeos_root, "chroot/tmp") + download_path = misc.GetOutsideChrootPath(label.chromeos_root, "/tmp") ls_command = "%s ls %s" % ( gsutil_cmd, os.path.join(result_dir, "autoserv_test"), -- cgit v1.2.3 From 1d8a72ff45b1482bf4d4e364b6c9ff910166b5a1 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Tue, 25 Apr 2023 16:44:39 -0700 Subject: crosperf: results_cache: Lint BUG=none TEST=pre-upload checks TEST=cros format Change-Id: Iae4eb51844bc733a4efb634e59a5e35a6ba01c16 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4477494 Commit-Queue: Manoj Gupta Tested-by: Manoj Gupta Reviewed-by: Jordan Abrahams-Whitehead --- crosperf/results_cache.py | 34 +++++++++++++++++++++------------- crosperf/results_cache_unittest.py | 25 ++++++++++++++----------- 2 files changed, 35 insertions(+), 24 deletions(-) diff --git a/crosperf/results_cache.py b/crosperf/results_cache.py index 97688dc8..b08fde48 100644 --- a/crosperf/results_cache.py +++ b/crosperf/results_cache.py @@ -192,7 +192,9 @@ class Result(object): if data_filename.find(".json") > 0: raw_dict = dict() if os.path.exists(data_filename): - with open(data_filename, "r") as data_file: + with open( + data_filename, "r", encoding="utf-8" + ) as data_file: raw_dict = json.load(data_file) if "charts" in raw_dict: @@ -221,7 +223,9 @@ class Result(object): units_dict[key] = result_dict["units"] else: if os.path.exists(data_filename): - with open(data_filename, "r") as data_file: + with open( + data_filename, "r", encoding="utf-8" + ) as data_file: lines = data_file.readlines() for line in lines: tmp_dict = json.loads(line) @@ -366,7 +370,7 @@ class Result(object): } idle_samples = 0 - with open(perf_report_file) as f: + with open(perf_report_file, encoding="utf-8") as f: try: for line in f: line = line.strip() @@ -564,7 +568,7 @@ class Result(object): def GatherPerfResults(self): report_id = 0 for perf_report_file in self.perf_report_files: - with open(perf_report_file, "r") as f: + with open(perf_report_file, "r", encoding="utf-8") as f: report_contents = f.read() for group in re.findall( r"Events: (\S+) (\S+)", report_contents @@ -614,7 +618,7 @@ class Result(object): raise IOError("%s does not exist" % filename) keyvals = {} - with open(filename, "r") as f: + with open(filename, "r", encoding="utf-8") as f: raw_dict = json.load(f) if "charts" in raw_dict: raw_dict = raw_dict["charts"] @@ -662,7 +666,7 @@ class Result(object): """ cpustats = {} read_data = "" - with open(self.turbostat_log_file) as f: + with open(self.turbostat_log_file, encoding="utf-8") as f: read_data = f.readlines() if not read_data: @@ -734,7 +738,7 @@ class Result(object): 121 root 20 0 0 0 0 S 1.0 0.0 0:00.45 spi5 """ all_data = "" - with open(self.top_log_file) as f: + with open(self.top_log_file, encoding="utf-8") as f: all_data = f.read() if not all_data: @@ -876,7 +880,7 @@ class Result(object): cpustats = {} read_data = "" - with open(self.cpustats_log_file) as f: + with open(self.cpustats_log_file, encoding="utf-8") as f: read_data = f.readlines() if not read_data: @@ -937,7 +941,7 @@ class Result(object): raise IOError("%s does not exist" % filename) keyvals = {} - with open(filename) as f: + with open(filename, encoding="utf-8") as f: histograms = json.load(f) value_map = {} # Gets generic set values. @@ -1131,7 +1135,7 @@ class Result(object): if self.perf_data_files and self.top_cmds: self.VerifyPerfDataPID() if self.wait_time_log_file: - with open(self.wait_time_log_file) as f: + with open(self.wait_time_log_file, encoding="utf-8") as f: wait_time = f.readline().strip() try: wait_time = float(wait_time) @@ -1164,7 +1168,7 @@ class Result(object): chrome_version = "" keys_file = os.path.join(cache_dir, CACHE_KEYS_FILE) if os.path.exists(keys_file): - with open(keys_file, "r") as f: + with open(keys_file, "r", encoding="utf-8") as f: lines = f.readlines() for l in lines: if l.startswith("Google Chrome "): @@ -1246,7 +1250,9 @@ class Result(object): pickle.dump(self.retval, f) if not test_flag.GetTestMode(): - with open(os.path.join(temp_dir, CACHE_KEYS_FILE), "w") as f: + with open( + os.path.join(temp_dir, CACHE_KEYS_FILE), "w", encoding="utf-8" + ) as f: f.write("%s\n" % self.label.name) f.write("%s\n" % self.label.chrome_version) f.write("%s\n" % self.machine.checksum_string) @@ -1261,7 +1267,9 @@ class Result(object): # Store machine info. # TODO(asharif): Make machine_manager a singleton, and don't pass it into # this function. - with open(os.path.join(temp_dir, MACHINE_FILE), "w") as f: + with open( + os.path.join(temp_dir, MACHINE_FILE), "w", encoding="utf-8" + ) as f: f.write(machine_manager.machine_checksum_string[self.label.name]) if os.path.exists(cache_dir): diff --git a/crosperf/results_cache_unittest.py b/crosperf/results_cache_unittest.py index aecd7939..06a8b94d 100755 --- a/crosperf/results_cache_unittest.py +++ b/crosperf/results_cache_unittest.py @@ -1164,11 +1164,12 @@ class ResultTest(unittest.TestCase): """Normal case when log exists and contains valid data.""" self.result.turbostat_log_file = "/tmp/somelogfile.log" with mock.patch( - "builtins.open", mock.mock_open(read_data=TURBOSTAT_LOG_OUTPUT) + "builtins.open", + mock.mock_open(read_data=TURBOSTAT_LOG_OUTPUT), ) as mo: cpustats = self.result.ProcessTurbostatResults() # Check that the log got opened and data were read/parsed. - calls = [mock.call("/tmp/somelogfile.log")] + calls = [mock.call("/tmp/somelogfile.log", encoding="utf-8")] mo.assert_has_calls(calls) self.assertEqual(cpustats, TURBOSTAT_DATA) @@ -1179,7 +1180,7 @@ class ResultTest(unittest.TestCase): cpustats = self.result.ProcessTurbostatResults() # Check that the log got opened and parsed successfully and empty # data returned. - calls = [mock.call("/tmp/emptylogfile.log")] + calls = [mock.call("/tmp/emptylogfile.log", encoding="utf-8")] mo.assert_has_calls(calls) self.assertEqual(cpustats, {}) @@ -1204,11 +1205,12 @@ class ResultTest(unittest.TestCase): """ self.result.cpustats_log_file = "/tmp/somelogfile.log" with mock.patch( - "builtins.open", mock.mock_open(read_data=CPUSTATS_UNIQ_OUTPUT) + "builtins.open", + mock.mock_open(read_data=CPUSTATS_UNIQ_OUTPUT), ) as mo: cpustats = self.result.ProcessCpustatsResults() # Check that the log got opened and data were read/parsed. - calls = [mock.call("/tmp/somelogfile.log")] + calls = [mock.call("/tmp/somelogfile.log", encoding="utf-8")] mo.assert_has_calls(calls) self.assertEqual(cpustats, CPUSTATS_UNIQ_DATA) @@ -1222,11 +1224,12 @@ class ResultTest(unittest.TestCase): """ self.result.cpustats_log_file = "/tmp/somelogfile.log" with mock.patch( - "builtins.open", mock.mock_open(read_data=CPUSTATS_DUPL_OUTPUT) + "builtins.open", + mock.mock_open(read_data=CPUSTATS_DUPL_OUTPUT), ) as mo: cpustats = self.result.ProcessCpustatsResults() # Check that the log got opened and data were read/parsed. - calls = [mock.call("/tmp/somelogfile.log")] + calls = [mock.call("/tmp/somelogfile.log", encoding="utf-8")] mo.assert_has_calls(calls) self.assertEqual(cpustats, CPUSTATS_DUPL_DATA) @@ -1237,7 +1240,7 @@ class ResultTest(unittest.TestCase): cpustats = self.result.ProcessCpustatsResults() # Check that the log got opened and parsed successfully and empty # data returned. - calls = [mock.call("/tmp/emptylogfile.log")] + calls = [mock.call("/tmp/emptylogfile.log", encoding="utf-8")] mo.assert_has_calls(calls) self.assertEqual(cpustats, {}) @@ -1250,7 +1253,7 @@ class ResultTest(unittest.TestCase): ) as mo: topproc = self.result.ProcessTopResults() # Check that the log got opened and data were read/parsed. - calls = [mock.call("/tmp/fakelogfile.log")] + calls = [mock.call("/tmp/fakelogfile.log", encoding="utf-8")] mo.assert_has_calls(calls) self.assertEqual(topproc, TOP_DATA) @@ -1261,7 +1264,7 @@ class ResultTest(unittest.TestCase): topcalls = self.result.ProcessTopResults() # Check that the log got opened and parsed successfully and empty # data returned. - calls = [mock.call("/tmp/emptylogfile.log")] + calls = [mock.call("/tmp/emptylogfile.log", encoding="utf-8")] mo.assert_has_calls(calls) self.assertEqual(topcalls, []) @@ -1552,7 +1555,7 @@ class ResultTest(unittest.TestCase): # format self.result.suite = "telemetry_Crosperf" self.result.results_file = [tempfile.mkdtemp() + "/histograms.json"] - with open(self.result.results_file[0], "w") as f: + with open(self.result.results_file[0], "w", encoding="utf-8") as f: f.write(HISTOGRAMSET) self.result.ProcessResults() shutil.rmtree(os.path.dirname(self.result.results_file[0])) -- cgit v1.2.3 From 94ed0868973b479b831d5fc35f2b4fa4c5508313 Mon Sep 17 00:00:00 2001 From: Ryan Beltran Date: Thu, 4 May 2023 20:59:58 +0000 Subject: compiler_wrapper: ignore gomacc-path for tidy Ignore the --gomacc-path flag when clang tidy is invoked via the compile wrapper, as we do not run linting via remote builds. BUG=b:280641529 TEST=go test Change-Id: I7836401f4c593dc73b7dc734b943aa7de419a524 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4508275 Auto-Submit: Ryan Beltran Commit-Queue: Manoj Gupta Tested-by: Ryan Beltran Reviewed-by: Manoj Gupta --- compiler_wrapper/compiler_wrapper.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/compiler_wrapper/compiler_wrapper.go b/compiler_wrapper/compiler_wrapper.go index 2a1ddcb7..ada91b22 100644 --- a/compiler_wrapper/compiler_wrapper.go +++ b/compiler_wrapper/compiler_wrapper.go @@ -160,8 +160,14 @@ func callCompilerInternal(env env, cfg *config, inputCmd *command) (exitCode int } if tidyMode != tidyModeNone { allowCCache = false + // Remove and ignore goma flags. + _, err := removeOneUserCmdlineFlagWithValue(mainBuilder, "--gomacc-path") + if err != nil && err != errNoSuchCmdlineArg { + return 0, err + } + clangCmdWithoutRemoteBuildAndCCache := mainBuilder.build() - var err error + switch tidyMode { case tidyModeTricium: err = runClangTidyForTricium(env, clangCmdWithoutRemoteBuildAndCCache, cSrcFile, tidyFlags, cfg.crashArtifactsDir) -- cgit v1.2.3 From b3d6d50936204862e109a2732f584641f11bce52 Mon Sep 17 00:00:00 2001 From: Denis Nikitin Date: Mon, 8 May 2023 14:36:06 -0700 Subject: compiler_wrapper: Suppress gnu-offsetof-extensions [-Werror, -Wgnu-offsetof-extensions] shows up in the bazel when it builds @upb as part of the bazel testing. upb revision wasn't updated in the latest bazel and there are no obvious ways to patch bazel deps, so let's just suppress the warning. BUG=b:280021348 TEST=go test Change-Id: Ia972537114629ed5157c47681734a0a2bce22e9f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4515855 Reviewed-by: Manoj Gupta Commit-Queue: Denis Nikitin Tested-by: Denis Nikitin --- compiler_wrapper/config.go | 1 + .../testdata/cros_clang_host_golden/bisect.json | 9 ++++-- .../clang_ftrapv_maincc_target_specific.json | 27 ++++++++++------ .../cros_clang_host_golden/clang_host_wrapper.json | 3 +- .../clang_maincc_target_specific.json | 27 ++++++++++------ .../cros_clang_host_golden/clang_path.json | 36 ++++++++++++++-------- .../clang_sanitizer_args.json | 24 ++++++++++----- .../clang_specific_args.json | 12 +++++--- .../testdata/cros_clang_host_golden/clangtidy.json | 24 ++++++++++----- .../force_disable_werror.json | 11 +++++-- .../testdata/cros_hardened_golden/bisect.json | 3 ++ .../clang_ftrapv_maincc_target_specific.json | 9 ++++++ .../clang_maincc_target_specific.json | 9 ++++++ .../testdata/cros_hardened_golden/clang_path.json | 12 ++++++++ .../cros_hardened_golden/clang_sanitizer_args.json | 8 +++++ .../cros_hardened_golden/clang_specific_args.json | 4 +++ .../clang_sysroot_wrapper_common.json | 6 ++++ .../testdata/cros_hardened_golden/clangtidy.json | 8 +++++ .../cros_hardened_golden/force_disable_werror.json | 5 +++ .../cros_hardened_golden/gcc_clang_syntax.json | 4 +++ .../cros_hardened_llvmnext_golden/bisect.json | 3 ++ .../cros_hardened_llvmnext_golden/clang_path.json | 12 ++++++++ .../cros_hardened_llvmnext_golden/clangtidy.json | 8 +++++ .../force_disable_werror.json | 5 +++ .../gcc_clang_syntax.json | 4 +++ .../cros_hardened_noccache_golden/bisect.json | 3 ++ .../cros_hardened_noccache_golden/clang_path.json | 12 ++++++++ .../cros_hardened_noccache_golden/clangtidy.json | 8 +++++ .../force_disable_werror.json | 5 +++ .../gcc_clang_syntax.json | 4 +++ .../testdata/cros_nonhardened_golden/bisect.json | 3 ++ .../clang_ftrapv_maincc_target_specific.json | 9 ++++++ .../clang_maincc_target_specific.json | 9 ++++++ .../cros_nonhardened_golden/clang_path.json | 12 ++++++++ .../clang_sanitizer_args.json | 8 +++++ .../clang_specific_args.json | 4 +++ .../clang_sysroot_wrapper_common.json | 6 ++++ .../cros_nonhardened_golden/clangtidy.json | 8 +++++ .../force_disable_werror.json | 5 +++ .../cros_nonhardened_golden/gcc_clang_syntax.json | 4 +++ 40 files changed, 317 insertions(+), 57 deletions(-) diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index d5f24c1f..89d62516 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -146,6 +146,7 @@ func crosCommonClangPostFlags() []string { "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", } } diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/bisect.json b/compiler_wrapper/testdata/cros_clang_host_golden/bisect.json index 0fd109c1..9c9dac03 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/bisect.json @@ -52,7 +52,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ], "env_updates": [ "PYTHONPATH=/somepath/test_binary" @@ -115,7 +116,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ], "env_updates": [ "PYTHONPATH=/somepath/test_binary" @@ -181,7 +183,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ], "env_updates": [ "PYTHONPATH=/somepath/test_binary" diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_ftrapv_maincc_target_specific.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_ftrapv_maincc_target_specific.json index a713330f..281239a5 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_ftrapv_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_ftrapv_maincc_target_specific.json @@ -43,7 +43,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -93,7 +94,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -143,7 +145,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -193,7 +196,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -243,7 +247,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -293,7 +298,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -343,7 +349,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -393,7 +400,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -443,7 +451,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_host_wrapper.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_host_wrapper.json index 50eafc5e..045b6438 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_host_wrapper.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_host_wrapper.json @@ -42,7 +42,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_maincc_target_specific.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_maincc_target_specific.json index afb06d32..7f4b1c9e 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_maincc_target_specific.json @@ -42,7 +42,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -91,7 +92,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -140,7 +142,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -189,7 +192,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -238,7 +242,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -287,7 +292,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -336,7 +342,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -385,7 +392,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -434,7 +442,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_path.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_path.json index d4a21339..a965ca7f 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_path.json @@ -42,7 +42,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -94,7 +95,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] }, "stdout": "somemessage", @@ -147,7 +149,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -199,7 +202,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -260,7 +264,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -324,7 +329,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -388,7 +394,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] }, "stdout": "somemessage", @@ -440,7 +447,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -489,7 +497,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -538,7 +547,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -587,7 +597,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -639,7 +650,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_sanitizer_args.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_sanitizer_args.json index b2fd7550..76f3f14b 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_sanitizer_args.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_sanitizer_args.json @@ -45,7 +45,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -97,7 +98,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -149,7 +151,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -201,7 +204,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -252,7 +256,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -305,7 +310,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -356,7 +362,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -407,7 +414,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clang_specific_args.json b/compiler_wrapper/testdata/cros_clang_host_golden/clang_specific_args.json index 41452944..493a3dc2 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clang_specific_args.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clang_specific_args.json @@ -60,7 +60,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -111,7 +112,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -162,7 +164,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -213,7 +216,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/clangtidy.json b/compiler_wrapper/testdata/cros_clang_host_golden/clangtidy.json index 51980427..e425e074 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/clangtidy.json @@ -58,7 +58,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } }, @@ -94,7 +95,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -160,7 +162,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } }, @@ -196,7 +199,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -264,7 +268,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] }, "stdout": "somemessage", @@ -303,7 +308,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -372,7 +378,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } }, @@ -408,7 +415,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] }, "stdout": "somemessage", diff --git a/compiler_wrapper/testdata/cros_clang_host_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_clang_host_golden/force_disable_werror.json index c4de4246..0fb8e1f2 100644 --- a/compiler_wrapper/testdata/cros_clang_host_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_clang_host_golden/force_disable_werror.json @@ -45,7 +45,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] } } @@ -98,7 +99,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] }, "stderr": "-Werror originalerror", @@ -137,6 +139,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-Wno-error", "-Wno-error=poison-system-directories" ] @@ -192,7 +195,8 @@ "-Wno-deprecated-copy", "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", - "-Wno-string-concatenation" + "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions" ] }, "stderr": "-Werror originalerror", @@ -231,6 +235,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-Wno-error", "-Wno-error=poison-system-directories" ] diff --git a/compiler_wrapper/testdata/cros_hardened_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_golden/bisect.json index 976fa12c..67953b07 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/bisect.json @@ -63,6 +63,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -143,6 +144,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -226,6 +228,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json index 932efe27..68e1f2b9 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json @@ -55,6 +55,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -125,6 +126,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -195,6 +197,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -265,6 +268,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-B../../bin", "-target", "armv7m-cros-linux-gnu" @@ -334,6 +338,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-B../../bin", "-target", "armv7m-cros-eabi" @@ -403,6 +408,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-B../../bin", "-target", "armv7m-cros-win-gnu" @@ -472,6 +478,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-B../../bin", "-target", "armv8m-cros-linux-gnu" @@ -541,6 +548,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-B../../bin", "-target", "armv8m-cros-eabi" @@ -610,6 +618,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-B../../bin", "-target", "armv8m-cros-win-gnu" diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json index d421febc..e123a918 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json @@ -53,6 +53,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -121,6 +122,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -189,6 +191,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -257,6 +260,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-B../../bin", "-target", "armv7m-cros-linux-gnu" @@ -324,6 +328,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-B../../bin", "-target", "armv7m-cros-eabi" @@ -391,6 +396,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-B../../bin", "-target", "armv7m-cros-win-gnu" @@ -458,6 +464,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-B../../bin", "-target", "armv8m-cros-linux-gnu" @@ -525,6 +532,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-B../../bin", "-target", "armv8m-cros-eabi" @@ -592,6 +600,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-B../../bin", "-target", "armv8m-cros-win-gnu" diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json index be05b215..c3785977 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json @@ -53,6 +53,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -124,6 +125,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -196,6 +198,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -267,6 +270,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -347,6 +351,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -430,6 +435,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -508,6 +514,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -579,6 +586,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -647,6 +655,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-Ba/b/c/d/e/bin", "-target", @@ -715,6 +724,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-Ba/b/c/d/e/bin", "-target", @@ -783,6 +793,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../bin", "-target", @@ -854,6 +865,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json index 3ac18b54..91b7012f 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json @@ -55,6 +55,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -125,6 +126,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -195,6 +197,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -265,6 +268,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -334,6 +338,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -405,6 +410,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -474,6 +480,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -544,6 +551,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json index 73e0f1d3..dd30f48d 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json @@ -71,6 +71,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -141,6 +142,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -211,6 +213,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -281,6 +284,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json index 57df3b7d..2f5a9e77 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json @@ -89,6 +89,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -160,6 +161,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -225,6 +227,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -295,6 +298,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -365,6 +369,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-B../../bin", "-target", "armv7a-cros-linux-gnueabihf" @@ -433,6 +438,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json index 35004155..79911010 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json @@ -68,6 +68,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -117,6 +118,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -196,6 +198,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -246,6 +249,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -327,6 +331,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -380,6 +385,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -462,6 +468,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -512,6 +519,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json index 14215269..da818c3c 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json @@ -56,6 +56,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -128,6 +129,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -185,6 +187,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -260,6 +263,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -317,6 +321,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json index e3145db2..b00f2c86 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json @@ -53,6 +53,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -146,6 +147,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -234,6 +236,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -305,6 +308,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json index 976fa12c..67953b07 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json @@ -63,6 +63,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -143,6 +144,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -226,6 +228,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json index be05b215..c3785977 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json @@ -53,6 +53,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -124,6 +125,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -196,6 +198,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -267,6 +270,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -347,6 +351,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -430,6 +435,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -508,6 +514,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -579,6 +586,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -647,6 +655,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-Ba/b/c/d/e/bin", "-target", @@ -715,6 +724,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-Ba/b/c/d/e/bin", "-target", @@ -783,6 +793,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../bin", "-target", @@ -854,6 +865,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json index 35004155..79911010 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json @@ -68,6 +68,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -117,6 +118,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -196,6 +198,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -246,6 +249,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -327,6 +331,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -380,6 +385,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -462,6 +468,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -512,6 +519,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json index 14215269..da818c3c 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json @@ -56,6 +56,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -128,6 +129,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -185,6 +187,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -260,6 +263,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -317,6 +321,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json index e3145db2..b00f2c86 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json @@ -53,6 +53,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -146,6 +147,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -234,6 +236,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -305,6 +308,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json index 92c70fa9..8a6234bc 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json @@ -62,6 +62,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -138,6 +139,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -217,6 +219,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json index b779e258..199d6bb1 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json @@ -52,6 +52,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -117,6 +118,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -183,6 +185,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -248,6 +251,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -322,6 +326,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -400,6 +405,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -477,6 +483,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -542,6 +549,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -604,6 +612,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-Ba/b/c/d/e/bin", "-target", @@ -666,6 +675,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-Ba/b/c/d/e/bin", "-target", @@ -728,6 +738,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../bin", "-target", @@ -793,6 +804,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json index 35004155..79911010 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json @@ -68,6 +68,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -117,6 +118,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -196,6 +198,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -246,6 +249,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -327,6 +331,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -380,6 +385,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -462,6 +468,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -512,6 +519,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json index d091968b..18263f44 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json @@ -55,6 +55,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -121,6 +122,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -172,6 +174,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -241,6 +244,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -292,6 +296,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json index 15c98982..f34a44ba 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json @@ -53,6 +53,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -141,6 +142,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -229,6 +231,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -300,6 +303,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/bisect.json b/compiler_wrapper/testdata/cros_nonhardened_golden/bisect.json index 2d00f949..9a71937a 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/bisect.json @@ -55,6 +55,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -127,6 +128,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -202,6 +204,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_ftrapv_maincc_target_specific.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_ftrapv_maincc_target_specific.json index 393239e8..aa9dfa80 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_ftrapv_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_ftrapv_maincc_target_specific.json @@ -47,6 +47,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -109,6 +110,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -171,6 +173,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -234,6 +237,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-B../../bin", "-target", "armv7m-cros-linux-gnu" @@ -295,6 +299,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-B../../bin", "-target", "armv7m-cros-eabi" @@ -357,6 +362,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-B../../bin", "-target", "armv7m-cros-win-gnu" @@ -419,6 +425,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-B../../bin", "-target", "armv8m-cros-linux-gnu" @@ -480,6 +487,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-B../../bin", "-target", "armv8m-cros-eabi" @@ -542,6 +550,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-B../../bin", "-target", "armv8m-cros-win-gnu" diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_maincc_target_specific.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_maincc_target_specific.json index 479510bb..778e7a0b 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_maincc_target_specific.json @@ -45,6 +45,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -105,6 +106,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -165,6 +167,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -226,6 +229,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-B../../bin", "-target", "armv7m-cros-linux-gnu" @@ -285,6 +289,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-B../../bin", "-target", "armv7m-cros-eabi" @@ -345,6 +350,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-B../../bin", "-target", "armv7m-cros-win-gnu" @@ -405,6 +411,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-B../../bin", "-target", "armv8m-cros-linux-gnu" @@ -464,6 +471,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-B../../bin", "-target", "armv8m-cros-eabi" @@ -524,6 +532,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-B../../bin", "-target", "armv8m-cros-win-gnu" diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_path.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_path.json index 0027b077..b9ff8405 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_path.json @@ -45,6 +45,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -108,6 +109,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -172,6 +174,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -235,6 +238,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -307,6 +311,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -382,6 +387,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -452,6 +458,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -515,6 +522,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -575,6 +583,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-Ba/b/c/d/e/bin", "-target", @@ -635,6 +644,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-Ba/b/c/d/e/bin", "-target", @@ -695,6 +705,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../bin", "-target", @@ -758,6 +769,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sanitizer_args.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sanitizer_args.json index 1d7c8bbb..27404a12 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sanitizer_args.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sanitizer_args.json @@ -48,6 +48,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -111,6 +112,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -174,6 +176,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -237,6 +240,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -299,6 +303,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -363,6 +368,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -425,6 +431,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -487,6 +494,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_specific_args.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_specific_args.json index f37fc0ec..03d90589 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_specific_args.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_specific_args.json @@ -63,6 +63,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -125,6 +126,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -187,6 +189,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -249,6 +252,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sysroot_wrapper_common.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sysroot_wrapper_common.json index 7a2e9cfc..3ceaa3f7 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sysroot_wrapper_common.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clang_sysroot_wrapper_common.json @@ -78,6 +78,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -141,6 +142,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -198,6 +200,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -261,6 +264,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -325,6 +329,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-B../../bin", "-target", "armv7a-cros-linux-gnueabihf" @@ -385,6 +390,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/clangtidy.json b/compiler_wrapper/testdata/cros_nonhardened_golden/clangtidy.json index b04e39fc..b8575a09 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/clangtidy.json @@ -60,6 +60,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -101,6 +102,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -172,6 +174,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -214,6 +217,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -287,6 +291,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -332,6 +337,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -406,6 +412,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -448,6 +455,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_nonhardened_golden/force_disable_werror.json index 9b85fe14..ff37898f 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/force_disable_werror.json @@ -48,6 +48,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -112,6 +113,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -161,6 +163,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -228,6 +231,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -277,6 +281,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", diff --git a/compiler_wrapper/testdata/cros_nonhardened_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_nonhardened_golden/gcc_clang_syntax.json index b2434351..771b224a 100644 --- a/compiler_wrapper/testdata/cros_nonhardened_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_nonhardened_golden/gcc_clang_syntax.json @@ -45,6 +45,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -127,6 +128,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -204,6 +206,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", @@ -267,6 +270,7 @@ "-Wno-unused-but-set-variable", "-Wno-implicit-int-float-conversion", "-Wno-string-concatenation", + "-Wno-gnu-offsetof-extensions", "-mno-movbe", "-B../../bin", "-target", -- cgit v1.2.3 From 37071ee989e7806c7f08c9805f55d519b979fd81 Mon Sep 17 00:00:00 2001 From: mobiletc-prebuild Date: Wed, 17 May 2023 10:05:19 -0700 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-4.19 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update amd profile on chromeos-kernel-5.15 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: Icb42d71858d55d92a369addaeeb6099614798a93 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4545337 Tested-by: Denis Nikitin Reviewed-by: Denis Nikitin Commit-Queue: Denis Nikitin --- afdo_metadata/kernel_afdo.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index 38f0aef4..6f188dca 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -1,17 +1,17 @@ { "chromeos-kernel-4_14": { - "name": "R114-15437.4-1682933824" + "name": "R115-15437.12-1684143483" }, "chromeos-kernel-4_19": { - "name": "R115-15419.0-1682933533" + "name": "R115-15437.12-1684143610" }, "chromeos-kernel-5_4": { - "name": "R115-15437.4-1682933644" + "name": "R115-15437.12-1684143269" }, "chromeos-kernel-5_10": { - "name": "R115-15437.4-1682933719" + "name": "R115-15437.12-1684143223" }, "chromeos-kernel-5_15": { - "name": "R115-15428.0-1682933589" + "name": "R115-15437.12-1684143156" } } -- cgit v1.2.3 From 739b6ff1c3979bff78e952068d2b3fa1da979c84 Mon Sep 17 00:00:00 2001 From: mobiletc-prebuild Date: Fri, 26 May 2023 12:15:38 -0700 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-4.19 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update amd profile on chromeos-kernel-5.15 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: Ief99220deee1de104b5839cd2a357006442a9182 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4571171 Reviewed-by: Denis Nikitin Tested-by: Denis Nikitin Commit-Queue: Denis Nikitin --- afdo_metadata/kernel_afdo.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index 6f188dca..4b0fb2b1 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -1,17 +1,17 @@ { "chromeos-kernel-4_14": { - "name": "R115-15437.12-1684143483" + "name": "R115-15437.21-1684748223" }, "chromeos-kernel-4_19": { - "name": "R115-15437.12-1684143610" + "name": "R115-15437.21-1684748297" }, "chromeos-kernel-5_4": { - "name": "R115-15437.12-1684143269" + "name": "R115-15437.21-1684748170" }, "chromeos-kernel-5_10": { - "name": "R115-15437.12-1684143223" + "name": "R115-15437.21-1684748116" }, "chromeos-kernel-5_15": { - "name": "R115-15437.12-1684143156" + "name": "R115-15437.21-1684748064" } } -- cgit v1.2.3 From 929282657898625a97f249f27ff9ce8828adee65 Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Fri, 19 May 2023 20:05:16 +0000 Subject: llvm_tools: Remove verbose argument This argument does nothing. This is just clean up for other changes. BUG=None TEST=run_tests llvm_tools/* Change-Id: I4c4a518d9300806ad9aff313dd51fe47a81d018f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4575382 Reviewed-by: Bob Haarman Auto-Submit: Jordan Abrahams-Whitehead Commit-Queue: Bob Haarman Tested-by: Jordan Abrahams-Whitehead --- llvm_tools/update_chromeos_llvm_hash.py | 24 +----------------------- llvm_tools/update_packages_and_run_tests.py | 9 --------- 2 files changed, 1 insertion(+), 32 deletions(-) diff --git a/llvm_tools/update_chromeos_llvm_hash.py b/llvm_tools/update_chromeos_llvm_hash.py index c8595e64..090c3c7a 100755 --- a/llvm_tools/update_chromeos_llvm_hash.py +++ b/llvm_tools/update_chromeos_llvm_hash.py @@ -47,11 +47,6 @@ class LLVMVariant(enum.Enum): next = "LLVM_NEXT_HASH" -# If set to `True`, then the contents of `stdout` after executing a command will -# be displayed to the terminal. -verbose = False - - def defaultCrosRoot() -> Path: """Get default location of chroot_path. @@ -105,14 +100,6 @@ def GetCommandLineArgs(): "(default: %(default)s)", ) - # Add argument for whether to display command contents to `stdout`. - parser.add_argument( - "--verbose", - action="store_true", - help="display contents of a command to the terminal " - "(default: %(default)s)", - ) - # Add argument for the LLVM hash to update parser.add_argument( "--is_llvm_next", @@ -153,16 +140,7 @@ def GetCommandLineArgs(): ) # Parse the command line. - args_output = parser.parse_args() - - # FIXME: We shouldn't be using globals here, but until we fix it, make pylint - # stop complaining about it. - # pylint: disable=global-statement - global verbose - - verbose = args_output.verbose - - return args_output + return parser.parse_args() def GetEbuildPathsFromSymLinkPaths(symlinks): diff --git a/llvm_tools/update_packages_and_run_tests.py b/llvm_tools/update_packages_and_run_tests.py index 43c8390b..62befd62 100755 --- a/llvm_tools/update_packages_and_run_tests.py +++ b/llvm_tools/update_packages_and_run_tests.py @@ -94,14 +94,6 @@ def GetCommandLineArgs(): help="The reviewers for the package update changelist", ) - # Add argument for whether to display command contents to `stdout`. - parser.add_argument( - "--verbose", - action="store_true", - help="display contents of a command to the terminal " - "(default: %(default)s)", - ) - subparsers = parser.add_subparsers(dest="subparser_name") subparser_names = [] # Testing with the tryjobs. @@ -457,7 +449,6 @@ def main(): llvm_variant = update_chromeos_llvm_hash.LLVMVariant.current if args_output.is_llvm_next: llvm_variant = update_chromeos_llvm_hash.LLVMVariant.next - update_chromeos_llvm_hash.verbose = args_output.verbose extra_commit_msg = None if args_output.subparser_name == "cq": cq_depend_msg = GetCQDependString(args_output.extra_change_lists) -- cgit v1.2.3 From e59a6448bb070580dfc397a01c17a5247d891a6c Mon Sep 17 00:00:00 2001 From: Denis Nikitin Date: Fri, 26 May 2023 10:38:23 -0700 Subject: update_kernel_afdo: Handle missing profiles Skip arch/kver update if profiles are missing in the current and previous milestone. BUG=b:284158194 TEST=./update_kernel_afdo --noupload main Change-Id: I8dc74e0a2f9fa3790b080c262773d76f7293307a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4571164 Tested-by: Denis Nikitin Reviewed-by: Ryan Beltran Commit-Queue: Denis Nikitin --- afdo_tools/update_kernel_afdo | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/afdo_tools/update_kernel_afdo b/afdo_tools/update_kernel_afdo index 89d8a924..d1cf685f 100755 --- a/afdo_tools/update_kernel_afdo +++ b/afdo_tools/update_kernel_afdo @@ -132,7 +132,7 @@ do exit 0 ;; -*) - echo "Option \"${arg}\" is not supported." >&2 + echo "ERROR: Option \"${arg}\" is not supported." >&2 echo "${USAGE}" exit 1 ;; @@ -248,11 +248,20 @@ do # R86-13310.18-1595237847.gcov.xz. latest=$(gsutil.py ls -l "${arch_gsbase[${arch}]}/${kver}/" | sort -k2 | \ grep "R${curr_branch_number}" | tail -1 || true) + prev_branch=$((curr_branch_number - 1)) if [[ -z "${latest}" && "${channel}" != "stable" ]] then # if no profiles exist for the current branch, try the previous branch latest=$(gsutil.py ls -l "${arch_gsbase[${arch}]}/${kver}/" | \ - sort -k2 | grep "R$((curr_branch_number - 1))" | tail -1) + sort -k2 | grep "R${prev_branch}" | tail -1 || true) + fi + if [[ -z "${latest}" ]] + then + echo "ERROR: No M${curr_branch_number}, M${prev_branch} profiles in\ + ${arch_gsbase[${arch}]}/${kver}/" >&2 + echo "Skipping ${arch}/${kver}" >&2 + errs="${errs} ${kver}" + continue fi # Verify that the file has the expected date. @@ -261,7 +270,8 @@ do if [ "${file_time_unix}" -lt "${expected_time}" ] then expected=$(env TZ=UTC date +%Y-%m-%dT%H:%M:%SZ -d @"${expected_time}") - echo "Wrong date for ${kver}: ${file_time} is before ${expected}" >&2 + echo "ERROR: Wrong date for ${kver}: ${file_time} is before\ + ${expected}" >&2 errs="${errs} ${kver}" continue fi @@ -290,7 +300,7 @@ EOT # If we did not succeed for any kvers, exit now. if [[ ${successes} -eq 0 ]] then - echo "error: AFDO profiles out of date for all kernel versions" >&2 + echo "ERROR: AFDO profiles out of date for all kernel versions" >&2 failed_channels="${failed_channels} ${channel}" continue fi @@ -310,7 +320,7 @@ EOT # If we had any errors, warn about them. if [[ -n "${errs}" ]] then - echo "warning: failed to update ${errs} in ${channel}" >&2 + echo "WARNING: failed to update ${errs} in ${channel}" >&2 failed_channels="${failed_channels} ${channel}" continue fi @@ -349,7 +359,7 @@ BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator" ;; * ) - echo "internal error: unhandled channel \"${channel}\"" >&2 + echo "Internal error: unhandled channel \"${channel}\"" >&2 exit 2 esac @@ -399,7 +409,7 @@ then if [[ -n "${failed_channels}" ]] then echo - echo "error: failed to update kernel afdo in ${failed_channels}" >&2 + echo "ERROR: failed to update kernel afdo in ${failed_channels}" >&2 exit 3 fi else @@ -408,7 +418,7 @@ else then echo "No changes are applied. It looks like AFDO versions are up to date." else - echo "error: update in ${failed_channels} failed" >&2 + echo "ERROR: update in ${failed_channels} failed" >&2 exit 3 fi fi -- cgit v1.2.3 From aee3e11fea5daf0e983a4cf93dfc51c4890a1943 Mon Sep 17 00:00:00 2001 From: mobiletc-prebuild Date: Wed, 31 May 2023 10:05:54 -0700 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-4.19 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update amd profile on chromeos-kernel-5.15 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: I1c1ddd734433656158cbf9941b5d89edeb9cbed4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4576214 Commit-Queue: Denis Nikitin Reviewed-by: Denis Nikitin Tested-by: Denis Nikitin --- afdo_metadata/kernel_afdo.json | 10 +++++----- afdo_metadata/kernel_arm_afdo.json | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index 4b0fb2b1..dc216cfb 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -1,17 +1,17 @@ { "chromeos-kernel-4_14": { - "name": "R115-15437.21-1684748223" + "name": "R116-15470.0-1685352949" }, "chromeos-kernel-4_19": { - "name": "R115-15437.21-1684748297" + "name": "R116-15437.25-1685352880" }, "chromeos-kernel-5_4": { - "name": "R115-15437.21-1684748170" + "name": "R116-15470.0-1685352827" }, "chromeos-kernel-5_10": { - "name": "R115-15437.21-1684748116" + "name": "R116-15470.0-1685352727" }, "chromeos-kernel-5_15": { - "name": "R115-15437.21-1684748064" + "name": "R116-15470.0-1685353070" } } diff --git a/afdo_metadata/kernel_arm_afdo.json b/afdo_metadata/kernel_arm_afdo.json index 2c63c085..6590b62a 100644 --- a/afdo_metadata/kernel_arm_afdo.json +++ b/afdo_metadata/kernel_arm_afdo.json @@ -1,2 +1,5 @@ { + "chromeos-kernel-5_15": { + "name": "R116-15470.0-1685352853" + } } -- cgit v1.2.3 From 7da37073a7102a5702bb4f328c71ce2f71d16447 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Wed, 31 May 2023 16:54:00 -0600 Subject: afdo_tools: cc gbiv on kernel afdo updates I would like to subscribe to this newsletter :) BUG=None TEST=None Change-Id: Ide832ddfbff89dd102830312b111e2098a7da491 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4577644 Reviewed-by: Denis Nikitin Auto-Submit: George Burgess Tested-by: George Burgess Commit-Queue: Denis Nikitin --- afdo_tools/update_kernel_afdo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afdo_tools/update_kernel_afdo b/afdo_tools/update_kernel_afdo index d1cf685f..4c7afb38 100755 --- a/afdo_tools/update_kernel_afdo +++ b/afdo_tools/update_kernel_afdo @@ -43,7 +43,7 @@ ARM_GS_BASE=gs://chromeos-prebuilt/afdo-job/vetted/kernel/arm UPDATE_CONFIG_FILE="afdo_tools/update_kernel_afdo.cfg" # CL reviewers and cc. REVIEWERS="c-compiler-chrome@google.com" -CC="denik@google.com" +CC="denik@google.com,gbiv@google.com" # Add skipped chrome branches in ascending order here. SKIPPED_BRANCHES="95" # NOTE: We enable/disable kernel AFDO starting from a particular branch. -- cgit v1.2.3 From 71e83767cd254231b9cbf573a8370d566f19387c Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Wed, 24 May 2023 22:58:19 +0000 Subject: llvm_tools: Separate atomic_write and patch_utils patch_utils currently has the very handy atomic_write function. However, this function isn't actually patch related. We will need atomic_write in the manifest updating code, so let's move it to its own file which can be separately imported by everything else. BUG=b:275877115 TEST=patch_utils_unittest.py TEST=atomic_write_unittest.py Change-Id: Id58ddd3cfd9e5f9cfb915bf01567ab25d52c41f1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4575383 Tested-by: Jordan Abrahams-Whitehead Reviewed-by: George Burgess Commit-Queue: Jordan Abrahams-Whitehead --- llvm_tools/atomic_write_file.py | 54 ++++++++++++++++++++++++++++++++ llvm_tools/atomic_write_file_unittest.py | 48 ++++++++++++++++++++++++++++ llvm_tools/patch_manager_unittest.py | 5 ++- llvm_tools/patch_utils.py | 40 +++-------------------- llvm_tools/patch_utils_unittest.py | 27 ---------------- 5 files changed, 111 insertions(+), 63 deletions(-) create mode 100644 llvm_tools/atomic_write_file.py create mode 100644 llvm_tools/atomic_write_file_unittest.py diff --git a/llvm_tools/atomic_write_file.py b/llvm_tools/atomic_write_file.py new file mode 100644 index 00000000..0bf88818 --- /dev/null +++ b/llvm_tools/atomic_write_file.py @@ -0,0 +1,54 @@ +# Copyright 2023 The ChromiumOS Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Atomic file writing utilities. + +Provides atomic_write(...), which allows atomically replacing the contents +of a file. +""" + +import contextlib +from pathlib import Path +from typing import Union + + +@contextlib.contextmanager +def atomic_write(fp: Union[Path, str], mode="w", *args, **kwargs): + """Write to a filepath atomically. + + This works by a temp file swap, created with a .tmp suffix in + the same directory briefly until being renamed to the desired + filepath. + + In the event an exception is raised during the write, the + temporary file is deleted and the original filepath is untouched. + + Args: + fp: Filepath to open. + mode: File mode; can be 'w', 'wb'. Default 'w'. + *args: Passed to Path.open as nargs. + **kwargs: Passed to Path.open as kwargs. + + Raises: + ValueError when the mode is invalid. + + Usage: + >>> with atomic_write("my_file.txt", encoding="utf-8") as f: + >>> f.write("Hello world!") + >>> # my_file.txt is still unmodified + >>> # "f" is closed here, and my_file.txt is written to. + """ + if isinstance(fp, str): + fp = Path(fp) + if mode not in ("w", "wb"): + raise ValueError(f"mode {mode} not accepted") + temp_fp = fp.with_suffix(fp.suffix + ".tmp") + try: + with temp_fp.open(mode, *args, **kwargs) as f: + yield f + except: + if temp_fp.is_file(): + temp_fp.unlink() + raise + temp_fp.rename(fp) diff --git a/llvm_tools/atomic_write_file_unittest.py b/llvm_tools/atomic_write_file_unittest.py new file mode 100644 index 00000000..78115569 --- /dev/null +++ b/llvm_tools/atomic_write_file_unittest.py @@ -0,0 +1,48 @@ +# Copyright 2023 The ChromiumOS Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +from pathlib import Path +import tempfile +import unittest + +import atomic_write_file + + +class TestAtomicWrite(unittest.TestCase): + """Test atomic_write.""" + + def test_atomic_write(self): + """Test that atomic write safely writes.""" + prior_contents = "This is a test written by patch_utils_unittest.py\n" + new_contents = "I am a test written by patch_utils_unittest.py\n" + with tempfile.TemporaryDirectory( + prefix="patch_utils_unittest" + ) as dirname: + dirpath = Path(dirname) + filepath = dirpath / "test_atomic_write.txt" + with filepath.open("w", encoding="utf-8") as f: + f.write(prior_contents) + + def _t(): + with atomic_write_file.atomic_write( + filepath, encoding="utf-8" + ) as f: + f.write(new_contents) + raise Exception("Expected failure") + + self.assertRaises(Exception, _t) + with filepath.open(encoding="utf-8") as f: + lines = f.readlines() + self.assertEqual(lines[0], prior_contents) + with atomic_write_file.atomic_write( + filepath, encoding="utf-8" + ) as f: + f.write(new_contents) + with filepath.open(encoding="utf-8") as f: + lines = f.readlines() + self.assertEqual(lines[0], new_contents) + + +if __name__ == "__main__": + unittest.main() diff --git a/llvm_tools/patch_manager_unittest.py b/llvm_tools/patch_manager_unittest.py index 42697d91..91573a82 100755 --- a/llvm_tools/patch_manager_unittest.py +++ b/llvm_tools/patch_manager_unittest.py @@ -12,6 +12,7 @@ from typing import Callable import unittest from unittest import mock +import atomic_write_file import patch_manager import patch_utils @@ -103,7 +104,9 @@ class PatchManagerTest(unittest.TestCase): ), ] patches_path = dirpath / "PATCHES.json" - with patch_utils.atomic_write(patches_path, encoding="utf-8") as f: + with atomic_write_file.atomic_write( + patches_path, encoding="utf-8" + ) as f: json.dump([pe.to_dict() for pe in patch_entries], f) def _harness1( diff --git a/llvm_tools/patch_utils.py b/llvm_tools/patch_utils.py index a7f9f73f..fe6edf98 100644 --- a/llvm_tools/patch_utils.py +++ b/llvm_tools/patch_utils.py @@ -12,7 +12,9 @@ from pathlib import Path import re import subprocess import sys -from typing import Any, Dict, IO, Iterable, List, Optional, Tuple, Union +from typing import Any, Dict, IO, Iterable, List, Optional, Tuple + +import atomic_write_file CHECKED_FILE_RE = re.compile(r"^checking file\s+(.*)$") @@ -22,38 +24,6 @@ HUNK_END_RE = re.compile(r"^--\s*$") PATCH_SUBFILE_HEADER_RE = re.compile(r"^\+\+\+ [ab]/(.*)$") -@contextlib.contextmanager -def atomic_write(fp: Union[Path, str], mode="w", *args, **kwargs): - """Write to a filepath atomically. - - This works by a temp file swap, created with a .tmp suffix in - the same directory briefly until being renamed to the desired - filepath. - - Args: - fp: Filepath to open. - mode: File mode; can be 'w', 'wb'. Default 'w'. - *args: Passed to Path.open as nargs. - **kwargs: Passed to Path.open as kwargs. - - Raises: - ValueError when the mode is invalid. - """ - if isinstance(fp, str): - fp = Path(fp) - if mode not in ("w", "wb"): - raise ValueError(f"mode {mode} not accepted") - temp_fp = fp.with_suffix(fp.suffix + ".tmp") - try: - with temp_fp.open(mode, *args, **kwargs) as f: - yield f - except: - if temp_fp.is_file(): - temp_fp.unlink() - raise - temp_fp.rename(fp) - - @dataclasses.dataclass class Hunk: """Represents a patch Hunk.""" @@ -521,7 +491,7 @@ def update_version_ranges( modified_entries, applied_patches = update_version_ranges_with_entries( svn_version, llvm_src_dir, patch_entries ) - with atomic_write(patches_json_fp, encoding="utf-8") as f: + with atomic_write_file.atomic_write(patches_json_fp, encoding="utf-8") as f: _write_json_changes( [p.to_dict() for p in patch_entries], f, indent_len=indent_len ) @@ -608,7 +578,7 @@ def remove_old_patches( ) oldness = [(entry, entry.is_old(svn_version)) for entry in patch_entries] filtered_entries = [entry.to_dict() for entry, old in oldness if not old] - with atomic_write(patches_json_fp, encoding="utf-8") as f: + with atomic_write_file.atomic_write(patches_json_fp, encoding="utf-8") as f: _write_json_changes(filtered_entries, f, indent_len=indent_len) removed_entries = [entry for entry, old in oldness if old] plural_patches = "patch" if len(removed_entries) == 1 else "patches" diff --git a/llvm_tools/patch_utils_unittest.py b/llvm_tools/patch_utils_unittest.py index 5d0e8376..dfee55e3 100755 --- a/llvm_tools/patch_utils_unittest.py +++ b/llvm_tools/patch_utils_unittest.py @@ -20,33 +20,6 @@ import patch_utils as pu class TestPatchUtils(unittest.TestCase): """Test the patch_utils.""" - def test_atomic_write(self): - """Test that atomic write safely writes.""" - prior_contents = "This is a test written by patch_utils_unittest.py\n" - new_contents = "I am a test written by patch_utils_unittest.py\n" - with tempfile.TemporaryDirectory( - prefix="patch_utils_unittest" - ) as dirname: - dirpath = Path(dirname) - filepath = dirpath / "test_atomic_write.txt" - with filepath.open("w", encoding="utf-8") as f: - f.write(prior_contents) - - def _t(): - with pu.atomic_write(filepath, encoding="utf-8") as f: - f.write(new_contents) - raise Exception("Expected failure") - - self.assertRaises(Exception, _t) - with filepath.open(encoding="utf-8") as f: - lines = f.readlines() - self.assertEqual(lines[0], prior_contents) - with pu.atomic_write(filepath, encoding="utf-8") as f: - f.write(new_contents) - with filepath.open(encoding="utf-8") as f: - lines = f.readlines() - self.assertEqual(lines[0], new_contents) - def test_predict_indent(self): test_str1 = """ a -- cgit v1.2.3 From ce681148809afa88dd5a27c111fc6d1410058f1c Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Wed, 24 May 2023 23:02:24 +0000 Subject: llvm_tools: Add manifest_utils This is part of the effort to get LLVM 9999 ebuilds working. Because LLVM 9999 ebuilds need to know what revision LLVM is at, and because that info is only available during unpack time currently, we need to move the LLVM_HASH into the manifest files. Having the LLVM_HASH in the manifest allows repo init to pull down the correct LLVM revision in the source tree checkout. This then allows chromeos-version.sh to determine what the new ebuild name should be during the PUpr rename stage. We could either parse the ebuild via chromeos-version.sh, or we could update the manifest. This is part of the effort for the latter implementation. This library contains functions that let us locate and update the manifest file, which we want to be as seamless as possible for toolchain maintainers in ChromeOS. BUG=b:275877115 TEST=manifest_utils_unittest.py Change-Id: I45b8ebc72d5e6462552e6873d897199481007f46 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4575384 Tested-by: Jordan Abrahams-Whitehead Reviewed-by: Ryan Beltran Commit-Queue: Jordan Abrahams-Whitehead --- llvm_tools/manifest_utils.py | 95 +++++++++++++++++++++++++++++++++++ llvm_tools/manifest_utils_unittest.py | 75 +++++++++++++++++++++++++++ 2 files changed, 170 insertions(+) create mode 100644 llvm_tools/manifest_utils.py create mode 100644 llvm_tools/manifest_utils_unittest.py diff --git a/llvm_tools/manifest_utils.py b/llvm_tools/manifest_utils.py new file mode 100644 index 00000000..3b24cedf --- /dev/null +++ b/llvm_tools/manifest_utils.py @@ -0,0 +1,95 @@ +# Copyright 2023 The ChromiumOS Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Provides utilities to read and edit the ChromiumOS Manifest entries. + +While this code reads and edits the internal manifest, it should only operate +on toolchain projects (llvm-project, etc.) which are public. +""" + +from pathlib import Path +import shutil +import subprocess +from xml.etree import ElementTree + +import atomic_write_file + + +LLVM_PROJECT_PATH = "src/third_party/llvm-project" + + +class FormattingError(Exception): + """Error occurred when formatting the manifest.""" + + pass + + +class UpdateManifestError(Exception): + """Error occurred when updating the manifest.""" + + pass + + +def update_chromeos_manifest(revision: str, src_tree: Path): + """Replaces the manifest project revision with 'revision'. + + Notably, this function reformats the manifest file to preserve + the formatting as specified by 'cros format'. + + Args: + revision: Revision (git sha) to use in the manifest. + src_tree: Path to the root of the source tree checkout. + + Post: + The llvm-project revision info in the chromeos repo manifest + is updated with 'revision'. + + Raises: + UpdateManifestError: The manifest could not be changed. + FormattingError: The manifest could not be reformatted. + """ + manifest_path = get_chromeos_manifest_path(src_tree) + parser = ElementTree.XMLParser( + target=ElementTree.TreeBuilder(insert_comments=True) + ) + xmltree = ElementTree.parse(manifest_path, parser) + update_chromeos_manifest_tree(revision, xmltree.getroot()) + with atomic_write_file.atomic_write(manifest_path, mode="wb") as f: + xmltree.write(f, encoding="UTF-8") + format_manifest(manifest_path) + + +def get_chromeos_manifest_path(src_tree: Path) -> Path: + """Return the path to the toolchain manifest.""" + # TODO(284281070): This should be updated to be _toolchain.xml + return src_tree / "manifest-internal" / "full.xml" + + +def update_chromeos_manifest_tree(revision: str, xmlroot: ElementTree.Element): + """Update the revision info for LLVM for a manifest XML root.""" + + # This exists mostly for testing. + def is_llvm_project(child): + return ( + child.tag == "project" and child.attrib["path"] == LLVM_PROJECT_PATH + ) + + finder = (child for child in xmlroot if is_llvm_project(child)) + llvm_project_elem = next(finder, None) + # Element objects can be falsy, so we need to explicitly check None. + if llvm_project_elem is not None: + # Update the llvm revision git sha + llvm_project_elem.attrib["revision"] = revision + else: + raise UpdateManifestError("xmltree did not have llvm-project") + + +def format_manifest(repo_manifest: Path): + """Use cros format to format the given manifest.""" + if not shutil.which("cros"): + raise FormattingError( + "unable to format manifest, 'cros'" " executable not in PATH" + ) + cmd = ["cros", "format", repo_manifest] + subprocess.run(cmd, check=True) diff --git a/llvm_tools/manifest_utils_unittest.py b/llvm_tools/manifest_utils_unittest.py new file mode 100644 index 00000000..c99b01ab --- /dev/null +++ b/llvm_tools/manifest_utils_unittest.py @@ -0,0 +1,75 @@ +# Copyright 2023 The ChromiumOS Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import io +from pathlib import Path +import re +import unittest +from xml.etree import ElementTree + +import manifest_utils + + +"""Provides utilities to read and edit the ChromiumOS Manifest entries. + +While this code reads and edits the internal manifest, it should only operate +on toolchain projects (llvm-project, etc.) which are public. +""" + +MANIFEST_FIXTURE = """ + + + + + + + + + + + + + + + + +""" + + +class TestManifestUtils(unittest.TestCase): + """Test manifest_utils.""" + + def test_update_chromeos_manifest(self): + root = ElementTree.fromstring(MANIFEST_FIXTURE) + manifest_utils.update_chromeos_manifest_tree("wxyz", root) + string_root1 = ElementTree.tostring(root) + self.assertRegex( + str(string_root1, encoding="utf-8"), + r'revision="wxyz"', + ) + self.assertNotRegex( + str(string_root1, encoding="utf-8"), + r'revision="abcd"', + ) + # Check idempotence. + manifest_utils.update_chromeos_manifest_tree("wxyz", root) + string_root2 = ElementTree.tostring(root) + self.assertEqual(string_root1, string_root2) + + +if __name__ == "__main__": + unittest.main() -- cgit v1.2.3 From 87df30f98e8e67f5f81ee417e5ee6a310ea4ffb1 Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Thu, 25 May 2023 23:34:49 +0000 Subject: llvm_tools: Update git tooling The git tooling for llvm_tools is severly out of date with both general best python practices, and also ChromeOS git interactions. This CL attempts to modernise the git interactions ever-so-slightly. Notable improvements include: * Using m/main instead of cros/main (as m/main works for internal checkouts). * Work with other remote origins beyond chromiumos-overlay * Silence stdout during upload * Allow uploading as WIP for debugging. BUG=None TEST=git_unittest.py Change-Id: I57e82b980945595ff78b821855a17255f75e3369 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4575385 Tested-by: Jordan Abrahams-Whitehead Commit-Queue: Jordan Abrahams-Whitehead Reviewed-by: Bob Haarman --- llvm_tools/git.py | 21 ++++++++++++--------- llvm_tools/git_unittest.py | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/llvm_tools/git.py b/llvm_tools/git.py index 0f56aa0d..3bb702c9 100755 --- a/llvm_tools/git.py +++ b/llvm_tools/git.py @@ -65,14 +65,17 @@ def DeleteBranch(repo, branch): if not os.path.isdir(repo): raise ValueError("Invalid directory path provided: %s" % repo) - subprocess.check_output(["git", "-C", repo, "checkout", "cros/main"]) + def run_checked(cmd): + subprocess.run(["git", "-C", repo] + cmd, check=True) - subprocess.check_output(["git", "-C", repo, "reset", "HEAD", "--hard"]) - - subprocess.check_output(["git", "-C", repo, "branch", "-D", branch]) + run_checked(["checkout", "-q", "m/main"]) + run_checked(["reset", "-q", "HEAD", "--hard"]) + run_checked(["branch", "-q", "-D", branch]) -def UploadChanges(repo, branch, commit_messages, reviewers=None, cc=None): +def UploadChanges( + repo, branch, commit_messages, reviewers=None, cc=None, wip=False +): """Uploads the changes in the specifed branch of the given repo for review. Args: @@ -114,6 +117,8 @@ def UploadChanges(repo, branch, commit_messages, reviewers=None, cc=None): if cc: git_args.append(f'--cc={",".join(cc)}') + if wip: + git_args.append("--wip") out = subprocess.check_output( git_args, @@ -123,13 +128,11 @@ def UploadChanges(repo, branch, commit_messages, reviewers=None, cc=None): ) print(out) - + # Matches both internal and external CLs. found_url = re.search( - r"https://chromium-review.googlesource.com/c/" - r"chromiumos/overlays/chromiumos-overlay/\+/([0-9]+)", + r"https?://[\w-]*-review.googlesource.com/c/.*/([0-9]+)", out.rstrip(), ) - if not found_url: raise ValueError("Failed to find change list URL.") diff --git a/llvm_tools/git_unittest.py b/llvm_tools/git_unittest.py index ce21e6c9..35ba2430 100755 --- a/llvm_tools/git_unittest.py +++ b/llvm_tools/git_unittest.py @@ -68,7 +68,7 @@ class HelperFunctionsTest(unittest.TestCase): mock_isdir.assert_called_once() @mock.patch.object(os.path, "isdir", return_value=True) - @mock.patch.object(subprocess, "check_output", return_value=None) + @mock.patch.object(subprocess, "run", return_value=None) def testSuccessfullyDeletedBranch(self, mock_command_output, mock_isdir): path_to_repo = "/valid/path/to/repo" branch = "branch-name" -- cgit v1.2.3 From fe32a06d2c77ebdb0b1cecdfd15440d97803fc42 Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Thu, 25 May 2023 23:43:15 +0000 Subject: llvm_tools: Update repo manifest with llvm hash At present, the only parts of the ChromeOS tree that update_chromeos_manifest needs to edit are the LLVM_HASH and LLVM_NEXT_HASH entries. However, as we transition to LLVM-9999 ebuilds, we will need to also update the repo manifest files to the same hash for the PUpr builder. This introduces a new flag for update_chromeos_llvm_hash, called --repo_manifest, which sets the llvm-project revision to whatever is set as the LLVM git sha. Then it uploads this change for review, alongside the LLVM_*_HASH changes. BUG=b:275877115 TEST=./update_chromeos_llvm_hash.py \ --is_llvm_next --llvm_version google3 \ --failure_mode continue --repo_manifest TEST=update_chromeos_llvm_hash_unittest.py Change-Id: Iebdd020e39e40f6241d4a02e2177233b00373ba5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4575386 Tested-by: Jordan Abrahams-Whitehead Reviewed-by: Bob Haarman Commit-Queue: Jordan Abrahams-Whitehead --- llvm_tools/update_chromeos_llvm_hash.py | 61 ++++++++++++++++++++++-- llvm_tools/update_chromeos_llvm_hash_unittest.py | 4 +- 2 files changed, 60 insertions(+), 5 deletions(-) diff --git a/llvm_tools/update_chromeos_llvm_hash.py b/llvm_tools/update_chromeos_llvm_hash.py index 090c3c7a..b74583d8 100755 --- a/llvm_tools/update_chromeos_llvm_hash.py +++ b/llvm_tools/update_chromeos_llvm_hash.py @@ -17,12 +17,14 @@ import os from pathlib import Path import re import subprocess +import textwrap from typing import Dict, Iterable import chroot import failure_modes import get_llvm_hash import git +import manifest_utils import patch_utils import subprocess_helpers @@ -138,6 +140,12 @@ def GetCommandLineArgs(): help="the .json file that has all the patches and their " "metadata if applicable (default: PATCHES.json inside $FILESDIR)", ) + parser.add_argument( + "--repo_manifest", + action="store_true", + help="Updates the llvm-project revision attribute" + " in the internal manifest.", + ) # Parse the command line. return parser.parse_args() @@ -485,8 +493,8 @@ def StagePackagesPatchResultsForCommit(package_info_dict, commit_messages): return commit_messages -def UpdateManifests(packages: Iterable[str], chroot_path: Path): - """Updates manifest files for packages. +def UpdatePortageManifests(packages: Iterable[str], chroot_path: Path): + """Updates portage manifest files for packages. Args: packages: A list of packages to update manifests for. @@ -597,7 +605,7 @@ def UpdatePackages( commit_lines.append(f"{parent_dir_name}/{cur_dir_name}") if manifest_packages: - UpdateManifests(manifest_packages, chroot_path) + UpdatePortageManifests(manifest_packages, chroot_path) commit_lines.append("Updated manifest for:") commit_lines.extend(manifest_packages) @@ -730,12 +738,48 @@ def UpdatePackagesPatchMetadataFile( patches_info = patch_utils.update_version_ranges( svn_version, src_path, patches_json_fp ) + else: + raise RuntimeError(f"unsupported failure mode: {mode}") package_info[cur_package] = patches_info._asdict() return package_info +def ChangeRepoManifest(git_hash: str, chroot_path: Path): + """Change the repo internal manifest for llvm-project.""" + manifest_path = manifest_utils.get_chromeos_manifest_path(chroot_path) + manifest_dir = manifest_utils.get_chromeos_manifest_path(chroot_path).parent + branch_name = "update-llvm-project-" + git_hash + commit_lines = textwrap.dedent( + f""" + manifest: Update llvm-project to {git_hash} + + Upgrade the local LLVM reversion to match the new llvm ebuild + hash. This must be merged along with any chromiumos-overlay + changes to LLVM. Automatic uprevs rely on the manifest hash + to match what is specified by LLVM_HASH. + + This CL is generated by the update_chromeos_llvm_hash.py script. + + BUG=None + TEST=CQ + """ + ).lstrip().splitlines() + + git.CreateBranch(manifest_dir, branch_name) + try: + manifest_utils.update_chromeos_manifest( + git_hash, + chroot_path, + ) + subprocess.run(["git", "-C", manifest_dir, "add", manifest_path.name], check=True) + change_list = git.UploadChanges(manifest_dir, branch_name, commit_lines) + finally: + git.DeleteBranch(manifest_dir, branch_name) + return change_list + + def main(): """Updates the LLVM next hash for each package. @@ -782,6 +826,17 @@ def main(): print(f"Gerrit URL: {change_list.url}") print(f"Change list number: {change_list.cl_number}") + if args_output.repo_manifest: + print( + f"Updating internal manifest to {git_hash} ({svn_version})...", + end="", + ) + change_list = ChangeRepoManifest(git_hash, args_output.chroot_path) + print(" Done!") + print("New repo manifest CL:") + print(f" URL: {change_list.url}") + print(f" CL Number: {change_list.cl_number}") + if __name__ == "__main__": main() diff --git a/llvm_tools/update_chromeos_llvm_hash_unittest.py b/llvm_tools/update_chromeos_llvm_hash_unittest.py index 91fc645d..762a9e79 100755 --- a/llvm_tools/update_chromeos_llvm_hash_unittest.py +++ b/llvm_tools/update_chromeos_llvm_hash_unittest.py @@ -374,8 +374,8 @@ class UpdateLLVMHashTest(unittest.TestCase): def testManifestUpdate(self, mock_subprocess, mock_ebuild_paths): manifest_packages = ["sys-devel/llvm"] chroot_path = "/path/to/chroot" - update_chromeos_llvm_hash.UpdateManifests( - manifest_packages, chroot_path + update_chromeos_llvm_hash.UpdatePortageManifests( + manifest_packages, Path(chroot_path) ) args = mock_subprocess.call_args_list[0] -- cgit v1.2.3 From fe855b22231fe6bb2c6a2ca488e21af7ada2519a Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Fri, 2 Jun 2023 18:40:10 +0000 Subject: crosperf: Remove benchmark scipy dependency At present, we use scipy.norm's isf function (inverse survival function). This commit introduces a hand-rolled replacement that uses a numerical interpolation technique to compute the inverse survival function. Testing this automatically is not easy if we wish to remove scipy, but with 0.01 pitch, we see about 4 digits of accuracy. Mind you, we do not handle the infinite cases, but this is not a problem for the use case presented in this function. BUG=b:284489250 TEST=doctest TEST=check scipy.norm.isf(xs) - CachedISF().isf(xs) Change-Id: I90bda8929a4034052c1457ae9f51f162eeaa5bc3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4585444 Tested-by: Jordan Abrahams-Whitehead Reviewed-by: George Burgess Commit-Queue: Jordan Abrahams-Whitehead --- crosperf/benchmark.py | 50 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 44 insertions(+), 6 deletions(-) diff --git a/crosperf/benchmark.py b/crosperf/benchmark.py index f9de0cf3..eb8661e9 100644 --- a/crosperf/benchmark.py +++ b/crosperf/benchmark.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2013 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -7,10 +6,10 @@ import math +import statistics +from typing import Any -# FIXME(denik): Fix the import in chroot. -# pylint: disable=import-error -from scipy import stats +import numpy as np # See crbug.com/673558 for how these are estimated. @@ -26,10 +25,49 @@ _estimated_stddev = { "loading.desktop": 0.021, # Copied from page_cycler initially } +# Numpy makes it hard to know the real type of some inputs +# and outputs, so this type alias is just for docs. +FloatLike = Any + + +def isf(x: FloatLike, mu=0.0, sigma=1.0, pitch=0.01) -> FloatLike: + """Compute the inverse survival function for value x. + + In the abscence of using scipy.stats.norm's isf(), this function + attempts to re-implement the inverse survival function by calculating + the numerical inverse of the survival function, interpolating between + table values. See bug b/284489250 for details. + + Survival function as defined by: + https://en.wikipedia.org/wiki/Survival_function + + Examples: + >>> -2.0e-16 < isf(0.5) < 2.0e-16 + True + + Args: + x: float or numpy array-like to compute the ISF for. + mu: Center of the underlying normal distribution. + sigma: Spread of the underlying normal distribution. + pitch: Absolute spacing between y-value interpolation points. + + Returns: + float or numpy array-like representing the ISF of `x`. + """ + norm = statistics.NormalDist(mu, sigma) + # np.interp requires a monotonically increasing x table. + # Because the survival table is monotonically decreasing, we have to + # reverse the y_vals too. + y_vals = np.flip(np.arange(-4.0, 4.0, pitch)) + survival_table = np.fromiter( + (1.0 - norm.cdf(y) for y in y_vals), y_vals.dtype + ) + return np.interp(x, survival_table, y_vals) + # Get #samples needed to guarantee a given confidence interval, assuming the # samples follow normal distribution. -def _samples(b): +def _samples(b: str) -> int: # TODO: Make this an option # CI = (0.9, 0.02), i.e., 90% chance that |sample mean - true mean| < 2%. p = 0.9 @@ -39,7 +77,7 @@ def _samples(b): d = _estimated_stddev[b] # Get at least 2 samples so as to calculate standard deviation, which is # needed in T-test for p-value. - n = int(math.ceil((stats.norm.isf((1 - p) / 2) * d / e) ** 2)) + n = int(math.ceil((isf((1 - p) / 2) * d / e) ** 2)) return n if n > 1 else 2 -- cgit v1.2.3 From 945266fd948146ff01067433f90b1d41c05ca5da Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Fri, 2 Jun 2023 22:21:04 +0000 Subject: cros_utils: Reimplement ttest_ind locally This computes a 2-tailed indepdent student's t test, using a random sample integration cumulative density function method. There's bits of this program that relied on Python2 sorting methods, which I've had to hack around in a very ugly manner. The good news is that likely these code paths are not used by our modern toolchain-utils? BUG=b:284489250 TEST=run_tests_for.py cros_utils/* TEST=Compared various baselines and samples between scipy/local Change-Id: I70c974dfb3d27e6338eecc23342ce70ed69cf7b7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4585445 Reviewed-by: George Burgess Commit-Queue: Jordan Abrahams-Whitehead Tested-by: Jordan Abrahams-Whitehead --- cros_utils/tabulator.py | 61 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 55 insertions(+), 6 deletions(-) diff --git a/cros_utils/tabulator.py b/cros_utils/tabulator.py index d079ea22..2cfd5d35 100644 --- a/cros_utils/tabulator.py +++ b/cros_utils/tabulator.py @@ -67,13 +67,44 @@ import getpass import math import statistics import sys +from typing import Tuple, Union from cros_utils import misc from cros_utils.email_sender import EmailSender +import numpy as np -# TODO(crbug.com/980719): Drop scipy in the future. -# pylint: disable=import-error -import scipy + +def _ttest_ind( + sample: Union[np.ndarray, list], baseline: Union[np.ndarray, list] +) -> Tuple[float, float]: + """Independent, two-sided student's T test. + + Reimplementation of scipy.stats.ttest_ind. + """ + if isinstance(sample, list): + sample = np.asarray(sample) + if isinstance(baseline, list): + baseline = np.asarray(baseline) + diff = np.mean(sample) - np.mean(baseline) + diff_stderr = np.sqrt(sample.var(ddof=1) + baseline.var(ddof=1)) + t_value = np.mean(diff) / (diff_stderr / np.sqrt(len(sample))) + samples = _sample_student_t(len(sample), 1000) + # Assuming two-sided student's t + if t_value < 0: + # Lower tail + return t_value, 2 * np.sum(samples < t_value) / len(samples) + # Upper tail + return t_value, 2 * np.sum(samples > t_value) / len(samples) + + +def _sample_student_t( + dof: float, num_samples: int +) -> np.ndarray: + # In theory this probably should be memoized. However, + # that's a lot of data points to store in memory for + # the lifetime of the program? + sample_generator = np.random.default_rng() + return sample_generator.standard_t(dof, num_samples) def _AllFloat(values): @@ -141,6 +172,15 @@ class TableGenerator(object): values = _StripNone(values) if _AllFloat(values): values = _GetFloats(values) + values = [ + float(v) + for v in values + if isinstance(v, float) + or isinstance(v, int) + or v.lower() in ("nan", "inf") + ] + if not values: + return float("nan") return max(values) def _GetLowestValue(self, key): @@ -152,6 +192,15 @@ class TableGenerator(object): values = _StripNone(values) if _AllFloat(values): values = _GetFloats(values) + values = [ + float(v) + for v in values + if isinstance(v, float) + or isinstance(v, int) + or v.lower() in ("nan", "inf") + ] + if not values: + return float("nan") return min(values) def _SortKeys(self, keys): @@ -415,7 +464,7 @@ class SamplesTableGenerator(TableGenerator): # weighted_samples we added up. one_dict = {} if run: - one_dict[u"weighted_samples"] = [run, u"samples"] + one_dict["weighted_samples"] = [run, "samples"] one_dict["retval"] = 0 else: one_dict["retval"] = 1 @@ -682,7 +731,7 @@ class PValueResult(ComparisonResult): if len(values) < 2 or len(baseline_values) < 2: cell.value = float("nan") return - _, cell.value = scipy.stats.ttest_ind(values, baseline_values) + _, cell.value = _ttest_ind(values, baseline_values) def _ComputeString(self, cell, values, baseline_values): return float("nan") @@ -940,7 +989,7 @@ class StorageFormat(Format): current += 1 if current: - divisor = base ** current + divisor = base**current cell.string_value = "%1.1f%s" % ( (v / divisor), suffices[current - 1], -- cgit v1.2.3 From e679e30c19f25c70f6d3cf64f711380dbfbdcb7d Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Mon, 5 Jun 2023 11:01:01 -0600 Subject: auto_delete_nightly_test_data: use new chroot tmpdir BUG=b:285889394 TEST=None Change-Id: Ib6aaa1a1b76827101d1f0ea96380997135bf8d4e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4590789 Tested-by: George Burgess Reviewed-by: Ryan Beltran Commit-Queue: George Burgess --- auto_delete_nightly_test_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auto_delete_nightly_test_data.py b/auto_delete_nightly_test_data.py index e666d23a..e846bf2a 100755 --- a/auto_delete_nightly_test_data.py +++ b/auto_delete_nightly_test_data.py @@ -254,7 +254,7 @@ def CleanChromeOsImageFiles( def CleanChromeOsTmpAndImages(days_to_preserve=1, dry_run=False): """Delete temporaries, images under crostc/chromeos.""" chromeos_chroot_tmp = os.path.join( - constants.CROSTC_WORKSPACE, "chromeos", "chroot", "tmp" + constants.CROSTC_WORKSPACE, "chromeos", "out", "tmp" ) # Clean files in tmp directory rv = CleanChromeOsTmpFiles(chromeos_chroot_tmp, days_to_preserve, dry_run) -- cgit v1.2.3 From a950609f6a75f6a665eeb1f9dacb1e4debfe389f Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Mon, 5 Jun 2023 11:02:36 -0600 Subject: auto_delete_nightly_test_data: update /tmp deletion heuristic I ran `find ~/crostc/chromeos/out/tmp/ \ -name 'tmp*' -maxdepth 1 -type f -mtime +3 | \ wc -l` and a very large number was printed. Looks like we were missing a lot of files with our existing logic here. While these files are small, we seem to collect ~250 or so of them per day from our nightly jobs. Autodelete them so /tmp isn't literally 99.9999% composed of these tiny tempfiles. BUG=None TEST=None Change-Id: I50ba616af686c21550d28bedb42d0b0dbb51ed5c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4590790 Commit-Queue: George Burgess Tested-by: George Burgess Reviewed-by: Ryan Beltran --- auto_delete_nightly_test_data.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/auto_delete_nightly_test_data.py b/auto_delete_nightly_test_data.py index e846bf2a..7405496d 100755 --- a/auto_delete_nightly_test_data.py +++ b/auto_delete_nightly_test_data.py @@ -195,11 +195,12 @@ def IsChromeOsTmpDeletionCandidate(file_name: str): "test_that_", "cros-update", "CrAU_temp_data", + # This might seem a bit broad, but after using custom heuristics for a + # while, `/tmp` was observed to have >75K files that matched all sorts + # of different `tmp.*` name patterns. Just remove them all. + "tmp", ) - if any(file_name.startswith(x) for x in name_prefixes): - return True - # Remove files that look like `tmpABCDEFGHI`. - return len(file_name) == 9 and file_name.startswith("tmp") + return any(file_name.startswith(x) for x in name_prefixes) def CleanChromeOsTmpFiles( -- cgit v1.2.3 From 19e5617fca642a315e0288c54b0f6713c25ee8e6 Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Fri, 2 Jun 2023 18:30:07 +0000 Subject: toolchain_utils_githooks: Remove dependencies The last remaining dependency was scipy, which we can no longer install. However, we still need to install numpy to conduct linear algebra operations. Presubmits still fail for most files, but these failures are all from cros lint, which we historically have not kept too clean. BUG=b:284489250 TEST=check-presubmit.py llvm_tools/*, checked no dependency errors Change-Id: Ib9e080021a151d130edc93347cec7ab5f676cdb1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4585446 Tested-by: Jordan Abrahams-Whitehead Reviewed-by: George Burgess Commit-Queue: Jordan Abrahams-Whitehead --- toolchain_utils_githooks/check-presubmit.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/toolchain_utils_githooks/check-presubmit.py b/toolchain_utils_githooks/check-presubmit.py index a584cffb..af8a360b 100755 --- a/toolchain_utils_githooks/check-presubmit.py +++ b/toolchain_utils_githooks/check-presubmit.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -# -*- coding: utf-8 -*- # # Copyright 2019 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be @@ -27,6 +26,11 @@ import typing as t # external tooling realizes that this script is Py3. USE_PYTHON3 = True +# This was originally had many packages in it (notably scipy) +# but due to changes in how scipy is built, we can no longer install +# it in the chroot. See b/284489250 +PIP_DEPENDENCIES = ("numpy",) + def run_command_unchecked( command: t.List[str], cwd: str, env: t.Dict[str, str] = None @@ -694,14 +698,15 @@ def maybe_reexec_inside_chroot(autofix: bool, files: t.List[str]) -> None: def ensure_pip_deps_installed() -> None: + if not PIP_DEPENDENCIES: + # No need to install pip if we don't have any deps. + return + if not has_executable_on_path("pip"): print("Autoinstalling `pip`...") subprocess.check_call(["sudo", "emerge", "dev-python/pip"]) - # This was originally written as a loop, but the number of packages we need - # has decreaed. Leave it that way so adding new packages is easier in the - # future. - for package in ("scipy",): + for package in PIP_DEPENDENCIES: exit_code = subprocess.call( ["python3", "-c", f"import {package}"], stdout=subprocess.DEVNULL, -- cgit v1.2.3 From eeb92f744c60df0f2c88f8bf46a60a0e3ee3582c Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Tue, 30 May 2023 23:35:04 +0000 Subject: llvm_tools: Remove race condition in atomic_write This ensures that we use tempfile to create the temporary swap file. We have to be a bit creative here because we can't let the temporary file destroy itself. Also use replace() instead of rename(). Also fix some lints. BUG=None TEST=run_tests.py llvm_tools/*unittest.py Change-Id: I5953c94101f5c17804c2c30db4e7069c3ad262d2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4575392 Commit-Queue: Jordan Abrahams-Whitehead Tested-by: Jordan Abrahams-Whitehead Reviewed-by: Bob Haarman --- llvm_tools/atomic_write_file.py | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/llvm_tools/atomic_write_file.py b/llvm_tools/atomic_write_file.py index 0bf88818..aa6f112e 100644 --- a/llvm_tools/atomic_write_file.py +++ b/llvm_tools/atomic_write_file.py @@ -9,7 +9,10 @@ of a file. """ import contextlib +import logging +import os from pathlib import Path +import tempfile from typing import Union @@ -24,6 +27,12 @@ def atomic_write(fp: Union[Path, str], mode="w", *args, **kwargs): In the event an exception is raised during the write, the temporary file is deleted and the original filepath is untouched. + Examples: + >>> with atomic_write("my_file.txt", encoding="utf-8") as f: + >>> f.write("Hello world!") + >>> # my_file.txt is still unmodified + >>> # "f" is closed here, and my_file.txt is written to. + Args: fp: Filepath to open. mode: File mode; can be 'w', 'wb'. Default 'w'. @@ -32,23 +41,27 @@ def atomic_write(fp: Union[Path, str], mode="w", *args, **kwargs): Raises: ValueError when the mode is invalid. - - Usage: - >>> with atomic_write("my_file.txt", encoding="utf-8") as f: - >>> f.write("Hello world!") - >>> # my_file.txt is still unmodified - >>> # "f" is closed here, and my_file.txt is written to. """ if isinstance(fp, str): fp = Path(fp) if mode not in ("w", "wb"): raise ValueError(f"mode {mode} not accepted") - temp_fp = fp.with_suffix(fp.suffix + ".tmp") + + # We use mkstemp here because we want to handle the closing and + # replacement ourselves. + (fd, tmp_path) = tempfile.mkstemp( + prefix=fp.name, + suffix=".tmp", + dir=fp.parent, + ) + tmp_path = Path(tmp_path) try: - with temp_fp.open(mode, *args, **kwargs) as f: + with os.fdopen(fd, mode=mode, *args, **kwargs) as f: yield f except: - if temp_fp.is_file(): - temp_fp.unlink() + try: + tmp_path.unlink() + except Exception as e: + logging.exception("unexpected error removing temporary file %s", e) raise - temp_fp.rename(fp) + tmp_path.replace(fp) -- cgit v1.2.3 From 4bd3bb6536198610b05699477b0bc8b282a90361 Mon Sep 17 00:00:00 2001 From: mobiletc-prebuild Date: Wed, 14 Jun 2023 10:05:23 -0700 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-4.19 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update amd profile on chromeos-kernel-5.15 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: I0e4ca8c41edeb77f78e7fe8382ce07a74413344f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4615494 Commit-Queue: George Burgess Tested-by: George Burgess Reviewed-by: George Burgess --- afdo_metadata/kernel_afdo.json | 10 +++++----- afdo_metadata/kernel_arm_afdo.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index dc216cfb..65014a17 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -1,17 +1,17 @@ { "chromeos-kernel-4_14": { - "name": "R116-15470.0-1685352949" + "name": "R116-15489.0-1686563605" }, "chromeos-kernel-4_19": { - "name": "R116-15437.25-1685352880" + "name": "R116-15470.0-1685958151" }, "chromeos-kernel-5_4": { - "name": "R116-15470.0-1685352827" + "name": "R116-15489.0-1686562435" }, "chromeos-kernel-5_10": { - "name": "R116-15470.0-1685352727" + "name": "R116-15489.0-1686562491" }, "chromeos-kernel-5_15": { - "name": "R116-15470.0-1685353070" + "name": "R116-15495.0-1686562747" } } diff --git a/afdo_metadata/kernel_arm_afdo.json b/afdo_metadata/kernel_arm_afdo.json index 6590b62a..f458ea38 100644 --- a/afdo_metadata/kernel_arm_afdo.json +++ b/afdo_metadata/kernel_arm_afdo.json @@ -1,5 +1,5 @@ { "chromeos-kernel-5_15": { - "name": "R116-15470.0-1685352853" + "name": "R116-15489.0-1686563155" } } -- cgit v1.2.3 From a183b1cee008352b7055d2783dcf895f9ebb3d94 Mon Sep 17 00:00:00 2001 From: AdityaK Date: Fri, 16 Jun 2023 16:04:17 -0700 Subject: Remove empty files when applying patches patch command leaves the deleted files (at least on Mac) as empty files. Bug: b/287560304 Change-Id: Iba328ed9ab87c4abd9eb63e776a429df901a3bfc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4621106 Reviewed-by: Manoj Gupta Commit-Queue: Manoj Gupta Tested-by: Manoj Gupta --- llvm_tools/patch_utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/llvm_tools/patch_utils.py b/llvm_tools/patch_utils.py index fe6edf98..0c8ad19c 100644 --- a/llvm_tools/patch_utils.py +++ b/llvm_tools/patch_utils.py @@ -230,6 +230,7 @@ class PatchEntry: "-d", root_dir.absolute(), "-f", + "-E", "-p1", "--no-backup-if-mismatch", "-i", -- cgit v1.2.3 From 00ccd5fff0d63c8afe033cea44a8a1c916f95903 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Wed, 21 Jun 2023 13:33:46 -0600 Subject: auto_llvm_bisection: make `cros lint` happy BUG=b:187794504 TEST=cros lint && unittests Change-Id: I495c8ff8eb65b36d12ff5bb8578898763ccfa574 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4634277 Reviewed-by: Bob Haarman Tested-by: George Burgess Commit-Queue: George Burgess --- llvm_tools/auto_llvm_bisection.py | 25 +++++++++++++++---------- llvm_tools/auto_llvm_bisection_unittest.py | 11 +++++------ 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/llvm_tools/auto_llvm_bisection.py b/llvm_tools/auto_llvm_bisection.py index c52c21b2..361a55eb 100755 --- a/llvm_tools/auto_llvm_bisection.py +++ b/llvm_tools/auto_llvm_bisection.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -# -*- coding: utf-8 -*- # 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. @@ -49,10 +48,15 @@ class BuilderStatus(enum.Enum): RUNNING = "running" +# Writing a dict with `.value`s spelled out makes `black`'s style conflict with +# `cros lint`'s diagnostics. builder_status_mapping = { - BuilderStatus.PASS.value: update_tryjob_status.TryjobStatus.GOOD.value, - BuilderStatus.FAIL.value: update_tryjob_status.TryjobStatus.BAD.value, - BuilderStatus.RUNNING.value: update_tryjob_status.TryjobStatus.PENDING.value, + a.value: b.value + for a, b in ( + (BuilderStatus.PASS, update_tryjob_status.TryjobStatus.GOOD), + (BuilderStatus.FAIL, update_tryjob_status.TryjobStatus.BAD), + (BuilderStatus.RUNNING, update_tryjob_status.TryjobStatus.PENDING), + ) } @@ -98,7 +102,7 @@ def main(): """Bisects LLVM using the result of `cros buildresult` of each tryjob. Raises: - AssertionError: The script was run inside the chroot. + AssertionError: The script was run inside the chroot. """ chroot.VerifyOutsideChroot() @@ -116,7 +120,7 @@ def main(): # Update the status of existing tryjobs if os.path.isfile(args_output.last_tested): update_start_time = time.time() - with open(args_output.last_tested) as json_file: + with open(args_output.last_tested, encoding="utf-8") as json_file: json_dict = json.load(json_file) while True: print( @@ -141,15 +145,16 @@ def main(): print("-" * 40) - # Proceed to the next step if all the existing tryjobs have completed. + # Proceed to the next step if all the existing tryjobs have + # completed. if completed: break delta_time = time.time() - update_start_time if delta_time > POLLING_LIMIT_SECS: - # Something is wrong with updating the tryjobs's 'status' via - # `cros buildresult` (e.g. network issue, etc.). + # Something is wrong with updating the tryjobs's 'status' + # via `cros buildresult` (e.g. network issue, etc.). sys.exit("Failed to update pending tryjobs.") print("-" * 40) @@ -159,7 +164,7 @@ def main(): # There should always be update from the tryjobs launched in the # last iteration. temp_filename = "%s.new" % args_output.last_tested - with open(temp_filename, "w") as temp_file: + with open(temp_filename, "w", encoding="utf-8") as temp_file: json.dump( json_dict, temp_file, indent=4, separators=(",", ": ") ) diff --git a/llvm_tools/auto_llvm_bisection_unittest.py b/llvm_tools/auto_llvm_bisection_unittest.py index e57637eb..aa8efa54 100755 --- a/llvm_tools/auto_llvm_bisection_unittest.py +++ b/llvm_tools/auto_llvm_bisection_unittest.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -# -*- coding: utf-8 -*- # 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. @@ -13,7 +12,7 @@ import subprocess import time import traceback import unittest -import unittest.mock as mock +from unittest import mock import auto_llvm_bisection import chroot @@ -78,8 +77,8 @@ class AutoLLVMBisectionTest(unittest.TestCase): update_tryjob_status.TryjobStatus.GOOD.value ) - # Verify the excpetion is raised when successfully found the bad revision. - # Uses `sys.exit(0)` to indicate success. + # Verify the excpetion is raised when successfully found the bad + # revision. Uses `sys.exit(0)` to indicate success. with self.assertRaises(SystemExit) as err: auto_llvm_bisection.main() @@ -265,8 +264,8 @@ class AutoLLVMBisectionTest(unittest.TestCase): tryjob_contents = {buildbucket_id: {"status": invalid_build_status}} mock_chroot_command.return_value = json.dumps(tryjob_contents) - # Verify the exception is raised when the return value of `cros buildresult` - # is not in the `builder_status_mapping`. + # Verify an exception is raised when the return value of `cros + # buildresult` is not in the `builder_status_mapping`. with self.assertRaises(ValueError) as err: auto_llvm_bisection.GetBuildResult(chroot_path, buildbucket_id) -- cgit v1.2.3 From 44a94083ac8ea8846b20d26ad3115db75b5869c4 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Wed, 21 Jun 2023 13:23:44 -0600 Subject: auto_llvm_bisection: remove `cros_sdk` invocation `cros buildresult` is available outside of the chroot, and the `cros_sdk` here might eat users' Ctrl-Cs. In either case, since `cros buildresult` relies on chromite sources from the tree you're currently in, entering the chroot seemingly buys us nothing here. BUG=b:187794504 TEST=Unittests Change-Id: Id8f7332c850a52818f81c37c4b6ccf45e02cb293 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4634278 Reviewed-by: Bob Haarman Commit-Queue: George Burgess Tested-by: George Burgess --- llvm_tools/auto_llvm_bisection.py | 2 -- llvm_tools/auto_llvm_bisection_unittest.py | 6 ------ 2 files changed, 8 deletions(-) diff --git a/llvm_tools/auto_llvm_bisection.py b/llvm_tools/auto_llvm_bisection.py index 361a55eb..9b4b8559 100755 --- a/llvm_tools/auto_llvm_bisection.py +++ b/llvm_tools/auto_llvm_bisection.py @@ -67,8 +67,6 @@ def GetBuildResult(chroot_path, buildbucket_id): try: tryjob_json = subprocess.check_output( [ - "cros_sdk", - "--", "cros", "buildresult", "--buildbucket-id", diff --git a/llvm_tools/auto_llvm_bisection_unittest.py b/llvm_tools/auto_llvm_bisection_unittest.py index aa8efa54..30e7dfb3 100755 --- a/llvm_tools/auto_llvm_bisection_unittest.py +++ b/llvm_tools/auto_llvm_bisection_unittest.py @@ -216,8 +216,6 @@ class AutoLLVMBisectionTest(unittest.TestCase): mock_chroot_command.assert_called_once_with( [ - "cros_sdk", - "--", "cros", "buildresult", "--buildbucket-id", @@ -240,8 +238,6 @@ class AutoLLVMBisectionTest(unittest.TestCase): auto_llvm_bisection.GetBuildResult(chroot_path, buildbucket_id) mock_chroot_command.assert_called_once_with( [ - "cros_sdk", - "--", "cros", "buildresult", "--buildbucket-id", @@ -277,8 +273,6 @@ class AutoLLVMBisectionTest(unittest.TestCase): mock_chroot_command.assert_called_once_with( [ - "cros_sdk", - "--", "cros", "buildresult", "--buildbucket-id", -- cgit v1.2.3 From 989e22cf9a3e6b6fa6730415d1ce6df932818e0b Mon Sep 17 00:00:00 2001 From: mobiletc-prebuild Date: Wed, 28 Jun 2023 10:05:22 -0700 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-4.19 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update amd profile on chromeos-kernel-5.15 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: I880f196fafb56a1d79adddac25a06777f056c5e1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4654667 Tested-by: George Burgess Reviewed-by: George Burgess Commit-Queue: George Burgess --- afdo_metadata/kernel_afdo.json | 10 +++++----- afdo_metadata/kernel_arm_afdo.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index 65014a17..e1aaf364 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -1,17 +1,17 @@ { "chromeos-kernel-4_14": { - "name": "R116-15489.0-1686563605" + "name": "R117-15506.0-1687772102" }, "chromeos-kernel-4_19": { - "name": "R116-15470.0-1685958151" + "name": "R117-15501.0-1687772905" }, "chromeos-kernel-5_4": { - "name": "R116-15489.0-1686562435" + "name": "R117-15506.0-1687772241" }, "chromeos-kernel-5_10": { - "name": "R116-15489.0-1686562491" + "name": "R117-15506.0-1687772372" }, "chromeos-kernel-5_15": { - "name": "R116-15495.0-1686562747" + "name": "R117-15506.0-1687772174" } } diff --git a/afdo_metadata/kernel_arm_afdo.json b/afdo_metadata/kernel_arm_afdo.json index f458ea38..2b2558f5 100644 --- a/afdo_metadata/kernel_arm_afdo.json +++ b/afdo_metadata/kernel_arm_afdo.json @@ -1,5 +1,5 @@ { "chromeos-kernel-5_15": { - "name": "R116-15489.0-1686563155" + "name": "R117-15506.0-1687772033" } } -- cgit v1.2.3 From aaa2a2a2ec82e674bb8f916f5b5e47cc154fa0e9 Mon Sep 17 00:00:00 2001 From: mobiletc-prebuild Date: Wed, 5 Jul 2023 10:05:37 -0700 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-4.19 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update amd profile on chromeos-kernel-5.15 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: I2ebab1b2e378a883ca1c0e5160f10c1a6b8f4fbb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4667569 Reviewed-by: George Burgess Commit-Queue: George Burgess Tested-by: George Burgess --- afdo_metadata/kernel_afdo.json | 10 +++++----- afdo_metadata/kernel_arm_afdo.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index e1aaf364..17e458be 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -1,17 +1,17 @@ { "chromeos-kernel-4_14": { - "name": "R117-15506.0-1687772102" + "name": "R117-15509.6-1688376886" }, "chromeos-kernel-4_19": { - "name": "R117-15501.0-1687772905" + "name": "R117-15501.0-1688376778" }, "chromeos-kernel-5_4": { - "name": "R117-15506.0-1687772241" + "name": "R117-15509.6-1688376748" }, "chromeos-kernel-5_10": { - "name": "R117-15506.0-1687772372" + "name": "R117-15509.6-1688376752" }, "chromeos-kernel-5_15": { - "name": "R117-15506.0-1687772174" + "name": "R117-15509.6-1688376767" } } diff --git a/afdo_metadata/kernel_arm_afdo.json b/afdo_metadata/kernel_arm_afdo.json index 2b2558f5..14f550be 100644 --- a/afdo_metadata/kernel_arm_afdo.json +++ b/afdo_metadata/kernel_arm_afdo.json @@ -1,5 +1,5 @@ { "chromeos-kernel-5_15": { - "name": "R117-15506.0-1687772033" + "name": "R117-15509.6-1688376946" } } -- cgit v1.2.3 From b512a4b3d22fe924647233824f5d2dca43ec5f2b Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Fri, 30 Jun 2023 21:48:23 +0000 Subject: cros_utils: Clean command_executor in email_sender In an attempt to free ourselves from command_executor, this commit replaces command_executor with subrprocess, which has both a nicer interface and also doesn't rely on broken scripts. This is part of a general clean up process to help us not use remote_access.sh BUG=b:289058911 TEST=run_tests_for cros_utils/* Change-Id: I18199ba3ad2bb4eb33412d02fb303cd5196b6017 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4659483 Reviewed-by: George Burgess Tested-by: George Burgess Commit-Queue: George Burgess --- cros_utils/email_sender.py | 86 ++++++++++++++++++++++------------------------ 1 file changed, 41 insertions(+), 45 deletions(-) diff --git a/cros_utils/email_sender.py b/cros_utils/email_sender.py index ccf4c1b4..b47c3beb 100755 --- a/cros_utils/email_sender.py +++ b/cros_utils/email_sender.py @@ -1,6 +1,4 @@ #!/usr/bin/env python3 -# -*- coding: utf-8 -*- - # 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. @@ -19,10 +17,9 @@ import getpass import json import os import smtplib +import subprocess import tempfile -from cros_utils import command_executer - X20_PATH = "/google/data/rw/teams/c-compiler-chrome/prod_emails" @@ -31,7 +28,7 @@ X20_PATH = "/google/data/rw/teams/c-compiler-chrome/prod_emails" def AtomicallyWriteFile(file_path): temp_path = file_path + ".in_progress" try: - with open(temp_path, "w") as f: + with open(temp_path, "w", encoding="utf-8") as f: yield f os.rename(temp_path, file_path) except: @@ -39,10 +36,10 @@ def AtomicallyWriteFile(file_path): raise -class EmailSender(object): +class EmailSender: """Utility class to send email through SMTP or SendGMR.""" - class Attachment(object): + class Attachment: """Small class to keep track of attachment info.""" def __init__(self, name, content): @@ -61,27 +58,29 @@ class EmailSender(object): """Enqueues an email in our x20 outbox. These emails ultimately get sent by the machinery in - //depot/google3/googleclient/chrome/chromeos_toolchain/mailer/mail.go. This - kind of sending is intended for accounts that don't have smtp or gmr access - (e.g., role accounts), but can be used by anyone with x20 access. + //depot/google3/googleclient/chrome/chromeos_toolchain/mailer/mail.go. + This kind of sending is intended for accounts that don't have smtp or + gmr access (e.g., role accounts), but can be used by anyone with x20 + access. - All emails are sent from `mdb.c-compiler-chrome+${identifier}@google.com`. + All emails are sent from + `mdb.c-compiler-chrome+${identifier}@google.com`. Args: - subject: email subject. Must be nonempty. - identifier: email identifier, or the text that lands after the `+` in the - "From" email address. Must be nonempty. - well_known_recipients: a list of well-known recipients for the email. - These are translated into addresses by our mailer. - Current potential values for this are ('detective', - 'cwp-team', 'cros-team', 'mage'). Either this or - direct_recipients must be a nonempty list. - direct_recipients: @google.com emails to send addresses to. Either this - or well_known_recipients must be a nonempty list. - text_body: a 'text/plain' email body to send. Either this or html_body - must be a nonempty string. Both may be specified - html_body: a 'text/html' email body to send. Either this or text_body - must be a nonempty string. Both may be specified + subject: email subject. Must be nonempty. + identifier: email identifier, or the text that lands after the + `+` in the "From" email address. Must be nonempty. + well_known_recipients: a list of well-known recipients for the + email. These are translated into addresses by our mailer. + Current potential values for this are ('detective', + 'cwp-team', 'cros-team', 'mage'). Either this or + direct_recipients must be a nonempty list. + direct_recipients: @google.com emails to send addresses to. Either + this or well_known_recipients must be a nonempty list. + text_body: a 'text/plain' email body to send. Either this or + html_body must be a nonempty string. Both may be specified + html_body: a 'text/html' email body to send. Either this or + text_body must be a nonempty string. Both may be specified """ # `str`s act a lot like tuples/lists. Ensure that we're not accidentally # iterating over one of those (or anything else that's sketchy, for that @@ -241,8 +240,6 @@ class EmailSender(object): attachments, ): """Send email via sendgmr program.""" - ce = command_executer.GetCommandExecuter(log_level="none") - if not email_from: email_from = getpass.getuser() + "@google.com" @@ -260,30 +257,29 @@ class EmailSender(object): f.flush() to_be_deleted.append(f.name) - # Fix single-quotes inside the subject. In bash, to escape a single quote - # (e.g 'don't') you need to replace it with '\'' (e.g. 'don'\''t'). To - # make Python read the backslash as a backslash rather than an escape - # character, you need to double it. So... + # Fix single-quotes inside the subject. In bash, to escape a single + # quote (e.g 'don't') you need to replace it with '\'' (e.g. + # 'don'\''t'). To make Python read the backslash as a backslash + # rather than an escape character, you need to double it. So... subject = subject.replace("'", "'\\''") + command = [ + "sendgmr", + f"--to={to_list}", + f"--from={email_from}", + f"--subject={subject}", + ] if msg_type == "html": - command = ( - "sendgmr --to='%s' --from='%s' --subject='%s' " - "--html_file='%s' --body_file=/dev/null" - % (to_list, email_from, subject, f.name) - ) + command += [f"--html_file={f.name}", "--body_file=/dev/null"] else: - command = ( - "sendgmr --to='%s' --from='%s' --subject='%s' " - "--body_file='%s'" % (to_list, email_from, subject, f.name) - ) + command.append(f"--body_file={f.name}") if email_cc: cc_list = ",".join(email_cc) - command += " --cc='%s'" % cc_list + command.append(f"--cc={cc_list}") if email_bcc: bcc_list = ",".join(email_bcc) - command += " --bcc='%s'" % bcc_list + command.append(f"--bcc={bcc_list}") if attachments: attachment_files = [] @@ -302,12 +298,12 @@ class EmailSender(object): f.flush() attachment_files.append(f.name) files = ",".join(attachment_files) - command += " --attachment_files='%s'" % files + command.append(f"--attachment_files={files}") to_be_deleted += attachment_files # Send the message via our own GMR server. - status = ce.RunCommand(command) - return status + completed_process = subprocess.run(command, check=False) + return completed_process.returncode finally: for f in to_be_deleted: -- cgit v1.2.3 From 0797298a9a6a62bd9bdffd29faf3daa2f49525ca Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Fri, 30 Jun 2023 21:52:12 +0000 Subject: cros_utils: Delete device_setup_utils* These are not used by anything, as far as I can tell. It's just dead code. This code makes use of command_executor, so it's another free clean up. BUG=b:289058911 TEST=run_tests_for cros_utils/* Change-Id: I2599f1d8efa300c29cd1fafb32b7a9a739a04b63 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4659484 Tested-by: George Burgess Commit-Queue: George Burgess Auto-Submit: Jordan Abrahams-Whitehead Tested-by: Jordan Abrahams-Whitehead Reviewed-by: George Burgess --- cros_utils/device_setup_utils.py | 615 ----------------------- cros_utils/device_setup_utils_unittest.py | 805 ------------------------------ 2 files changed, 1420 deletions(-) delete mode 100644 cros_utils/device_setup_utils.py delete mode 100755 cros_utils/device_setup_utils_unittest.py diff --git a/cros_utils/device_setup_utils.py b/cros_utils/device_setup_utils.py deleted file mode 100644 index 443c6474..00000000 --- a/cros_utils/device_setup_utils.py +++ /dev/null @@ -1,615 +0,0 @@ -# -*- coding: utf-8 -*- -# -# 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. - -"""Utils for setting devices - -This script provides utils to set device specs. -""" - - -__author__ = "zhizhouy@google.com (Zhizhou Yang)" - -from contextlib import contextmanager -import re -import time - -from cros_utils import command_executer - - -class DutWrapper(object): - """Wrap DUT parameters inside.""" - - def __init__( - self, - chromeos_root, - remote, - log_level="verbose", - logger=None, - ce=None, - dut_config=None, - ): - self.chromeos_root = chromeos_root - self.remote = remote - self.log_level = log_level - self.logger = logger - self.ce = ce or command_executer.GetCommandExecuter(log_level=log_level) - self.dut_config = dut_config - - def RunCommandOnDut(self, command, ignore_status=False): - """Helper function to run command on DUT.""" - ret, msg, err_msg = self.ce.CrosRunCommandWOutput( - command, machine=self.remote, chromeos_root=self.chromeos_root - ) - - if ret: - err_msg = ( - "Command execution on DUT %s failed.\n" - "Failing command: %s\n" - "returned %d\n" - "Error message: %s" % (self.remote, command, ret, err_msg) - ) - if ignore_status: - self.logger.LogError( - err_msg + "\n(Failure is considered non-fatal. Continue.)" - ) - else: - self.logger.LogFatal(err_msg) - - return ret, msg, err_msg - - def DisableASLR(self): - """Disable ASLR on DUT.""" - disable_aslr = ( - "set -e; " - "if [[ -e /proc/sys/kernel/randomize_va_space ]]; then " - " echo 0 > /proc/sys/kernel/randomize_va_space; " - "fi" - ) - if self.log_level == "average": - self.logger.LogOutput("Disable ASLR.") - self.RunCommandOnDut(disable_aslr) - - def SetCpuGovernor(self, governor, ignore_status=False): - """Setup CPU Governor on DUT.""" - set_gov_cmd = ( - "for f in `ls -d /sys/devices/system/cpu/cpu*/cpufreq 2>/dev/null`; do " - # Skip writing scaling_governor if cpu is offline. - " [[ -e ${f/cpufreq/online} ]] && grep -q 0 ${f/cpufreq/online} " - " && continue; " - " cd $f; " - " if [[ -e scaling_governor ]]; then " - " echo %s > scaling_governor; fi; " - "done; " - ) - if self.log_level == "average": - self.logger.LogOutput("Setup CPU Governor: %s." % governor) - ret, _, _ = self.RunCommandOnDut( - set_gov_cmd % governor, ignore_status=ignore_status - ) - return ret - - def DisableTurbo(self): - """Disable Turbo on DUT.""" - dis_turbo_cmd = ( - "if [[ -e /sys/devices/system/cpu/intel_pstate/no_turbo ]]; then " - " if grep -q 0 /sys/devices/system/cpu/intel_pstate/no_turbo; then " - " echo -n 1 > /sys/devices/system/cpu/intel_pstate/no_turbo; " - " fi; " - "fi; " - ) - if self.log_level == "average": - self.logger.LogOutput("Disable Turbo.") - self.RunCommandOnDut(dis_turbo_cmd) - - def SetupCpuUsage(self): - """Setup CPU usage. - - Based on self.dut_config['cpu_usage'] configure CPU cores - utilization. - """ - - if ( - self.dut_config["cpu_usage"] == "big_only" - or self.dut_config["cpu_usage"] == "little_only" - ): - _, arch, _ = self.RunCommandOnDut("uname -m") - - if arch.lower().startswith("arm") or arch.lower().startswith( - "aarch64" - ): - self.SetupArmCores() - - def SetupArmCores(self): - """Setup ARM big/little cores.""" - - # CPU implemeters/part numbers of big/LITTLE CPU. - # Format: dict(CPU implementer: set(CPU part numbers)) - LITTLE_CORES = { - "0x41": { - "0xd01", # Cortex A32 - "0xd03", # Cortex A53 - "0xd04", # Cortex A35 - "0xd05", # Cortex A55 - }, - } - BIG_CORES = { - "0x41": { - "0xd07", # Cortex A57 - "0xd08", # Cortex A72 - "0xd09", # Cortex A73 - "0xd0a", # Cortex A75 - "0xd0b", # Cortex A76 - }, - } - - # Values of CPU Implementer and CPU part number are exposed by cpuinfo. - # Format: - # ================= - # processor : 0 - # model name : ARMv8 Processor rev 4 (v8l) - # BogoMIPS : 48.00 - # Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 - # CPU implementer : 0x41 - # CPU architecture: 8 - # CPU variant : 0x0 - # CPU part : 0xd03 - # CPU revision : 4 - - _, cpuinfo, _ = self.RunCommandOnDut("cat /proc/cpuinfo") - - # List of all CPU cores: 0, 1, .. - proc_matches = re.findall( - r"^processor\s*: (\d+)$", cpuinfo, re.MULTILINE - ) - # List of all corresponding CPU implementers - impl_matches = re.findall( - r"^CPU implementer\s*: (0x[\da-f]+)$", cpuinfo, re.MULTILINE - ) - # List of all corresponding CPU part numbers - part_matches = re.findall( - r"^CPU part\s*: (0x[\da-f]+)$", cpuinfo, re.MULTILINE - ) - assert len(proc_matches) == len(impl_matches) - assert len(part_matches) == len(impl_matches) - - all_cores = set(proc_matches) - dut_big_cores = { - core - for core, impl, part in zip( - proc_matches, impl_matches, part_matches - ) - if impl in BIG_CORES and part in BIG_CORES[impl] - } - dut_lit_cores = { - core - for core, impl, part in zip( - proc_matches, impl_matches, part_matches - ) - if impl in LITTLE_CORES and part in LITTLE_CORES[impl] - } - - if self.dut_config["cpu_usage"] == "big_only": - cores_to_enable = dut_big_cores - cores_to_disable = all_cores - dut_big_cores - elif self.dut_config["cpu_usage"] == "little_only": - cores_to_enable = dut_lit_cores - cores_to_disable = all_cores - dut_lit_cores - else: - self.logger.LogError( - "cpu_usage=%s is not supported on ARM.\n" - "Ignore ARM CPU setup and continue." - % self.dut_config["cpu_usage"] - ) - return - - if cores_to_enable: - cmd_enable_cores = ( - "echo 1 | tee /sys/devices/system/cpu/cpu{%s}/online" - % ",".join(sorted(cores_to_enable)) - ) - - cmd_disable_cores = "" - if cores_to_disable: - cmd_disable_cores = ( - "echo 0 | tee /sys/devices/system/cpu/cpu{%s}/online" - % ",".join(sorted(cores_to_disable)) - ) - - self.RunCommandOnDut( - "; ".join([cmd_enable_cores, cmd_disable_cores]) - ) - else: - # If there are no cores enabled by dut_config then configuration - # is invalid for current platform and should be ignored. - self.logger.LogError( - '"cpu_usage" is invalid for targeted platform.\n' - "dut_config[cpu_usage]=%s\n" - "dut big cores: %s\n" - "dut little cores: %s\n" - "Ignore ARM CPU setup and continue." - % (self.dut_config["cpu_usage"], dut_big_cores, dut_lit_cores) - ) - - def GetCpuOnline(self): - """Get online status of CPU cores. - - Return dict of {int(cpu_num): <0|1>}. - """ - get_cpu_online_cmd = ( - 'paste -d" "' - " <(ls /sys/devices/system/cpu/cpu*/online)" - " <(cat /sys/devices/system/cpu/cpu*/online)" - ) - _, online_output_str, _ = self.RunCommandOnDut(get_cpu_online_cmd) - - # Here is the output we expect to see: - # ----------------- - # /sys/devices/system/cpu/cpu0/online 0 - # /sys/devices/system/cpu/cpu1/online 1 - - cpu_online = {} - cpu_online_match = re.compile(r"^[/\S]+/cpu(\d+)/[/\S]+\s+(\d+)$") - for line in online_output_str.splitlines(): - match = cpu_online_match.match(line) - if match: - cpu = int(match.group(1)) - status = int(match.group(2)) - cpu_online[cpu] = status - # At least one CPU has to be online. - assert cpu_online - - return cpu_online - - def SetupCpuFreq(self, online_cores): - """Setup CPU frequency. - - Based on self.dut_config['cpu_freq_pct'] setup frequency of online CPU cores - to a supported value which is less or equal to (freq_pct * max_freq / 100) - limited by min_freq. - - NOTE: scaling_available_frequencies support is required. - Otherwise the function has no effect. - """ - freq_percent = self.dut_config["cpu_freq_pct"] - list_all_avail_freq_cmd = ( - "ls /sys/devices/system/cpu/cpu{%s}/cpufreq/" - "scaling_available_frequencies" - ) - # Ignore error to support general usage of frequency setup. - # Not all platforms support scaling_available_frequencies. - ret, all_avail_freq_str, _ = self.RunCommandOnDut( - list_all_avail_freq_cmd - % ",".join(str(core) for core in online_cores), - ignore_status=True, - ) - if ret or not all_avail_freq_str: - # No scalable frequencies available for the core. - return ret - for avail_freq_path in all_avail_freq_str.split(): - # Get available freq from every scaling_available_frequency path. - # Error is considered fatal in self.RunCommandOnDut(). - _, avail_freq_str, _ = self.RunCommandOnDut( - "cat " + avail_freq_path - ) - assert avail_freq_str - - all_avail_freq = sorted( - int(freq_str) for freq_str in avail_freq_str.split() - ) - min_freq = all_avail_freq[0] - max_freq = all_avail_freq[-1] - # Calculate the frequency we are targeting. - target_freq = round(max_freq * freq_percent / 100) - # More likely it's not in the list of supported frequencies - # and our goal is to find the one which is less or equal. - # Default is min and we will try to maximize it. - avail_ngt_target = min_freq - # Find the largest not greater than the target. - for next_largest in reversed(all_avail_freq): - if next_largest <= target_freq: - avail_ngt_target = next_largest - break - - max_freq_path = avail_freq_path.replace( - "scaling_available_frequencies", "scaling_max_freq" - ) - min_freq_path = avail_freq_path.replace( - "scaling_available_frequencies", "scaling_min_freq" - ) - # With default ignore_status=False we expect 0 status or Fatal error. - self.RunCommandOnDut( - "echo %s | tee %s %s" - % (avail_ngt_target, max_freq_path, min_freq_path) - ) - - def WaitCooldown(self): - """Wait for DUT to cool down to certain temperature.""" - waittime = 0 - timeout_in_sec = int(self.dut_config["cooldown_time"]) * 60 - # Temperature from sensors come in uCelsius units. - temp_in_ucels = int(self.dut_config["cooldown_temp"]) * 1000 - sleep_interval = 30 - - # Wait until any of two events occurs: - # 1. CPU cools down to a specified temperature. - # 2. Timeout cooldown_time expires. - # For the case when targeted temperature is not reached within specified - # timeout the benchmark is going to start with higher initial CPU temp. - # In the worst case it may affect test results but at the same time we - # guarantee the upper bound of waiting time. - # TODO(denik): Report (or highlight) "high" CPU temperature in test results. - # "high" should be calculated based on empirical data per platform. - # Based on such reports we can adjust CPU configuration or - # cooldown limits accordingly. - while waittime < timeout_in_sec: - _, temp_output, _ = self.RunCommandOnDut( - "cat /sys/class/thermal/thermal_zone*/temp", ignore_status=True - ) - if any(int(temp) > temp_in_ucels for temp in temp_output.split()): - time.sleep(sleep_interval) - waittime += sleep_interval - else: - # Exit the loop when: - # 1. Reported temp numbers from all thermal sensors do not exceed - # 'cooldown_temp' or - # 2. No data from the sensors. - break - - self.logger.LogOutput("Cooldown wait time: %.1f min" % (waittime / 60)) - return waittime - - def DecreaseWaitTime(self): - """Change the ten seconds wait time for pagecycler to two seconds.""" - FILE = ( - "/usr/local/telemetry/src/tools/perf/page_sets/page_cycler_story.py" - ) - ret = self.RunCommandOnDut("ls " + FILE) - - if not ret: - sed_command = 'sed -i "s/_TTI_WAIT_TIME = 10/_TTI_WAIT_TIME = 2/g" ' - self.RunCommandOnDut(sed_command + FILE) - - def StopUI(self): - """Stop UI on DUT.""" - # Added "ignore_status" for the case when crosperf stops ui service which - # was already stopped. Command is going to fail with 1. - self.RunCommandOnDut("stop ui", ignore_status=True) - - def StartUI(self): - """Start UI on DUT.""" - # Similar to StopUI, `start ui` fails if the service is already started. - self.RunCommandOnDut("start ui", ignore_status=True) - - def KerncmdUpdateNeeded(self, intel_pstate): - """Check whether kernel cmdline update is needed. - - Args: - intel_pstate: kernel command line argument (active, passive, no_hwp) - - Returns: - True if update is needed. - """ - - good = 0 - - # Check that dut platform supports hwp - cmd = "grep -q '^flags.*hwp' /proc/cpuinfo" - ret_code, _, _ = self.RunCommandOnDut(cmd, ignore_status=True) - if ret_code != good: - # Intel hwp is not supported, update is not needed. - return False - - kern_cmdline_cmd = ( - 'grep -q "intel_pstate=%s" /proc/cmdline' % intel_pstate - ) - ret_code, _, _ = self.RunCommandOnDut( - kern_cmdline_cmd, ignore_status=True - ) - self.logger.LogOutput("grep /proc/cmdline returned %d" % ret_code) - if ( - intel_pstate - and ret_code == good - or not intel_pstate - and ret_code != good - ): - # No need to updated cmdline if: - # 1. We are setting intel_pstate and we found it is already set. - # 2. Not using intel_pstate and it is not in cmdline. - return False - - # Otherwise we need to update intel_pstate. - return True - - def UpdateKerncmdIntelPstate(self, intel_pstate): - """Update kernel command line. - - Args: - intel_pstate: kernel command line argument (active, passive, no_hwp) - """ - - good = 0 - - # First phase is to remove rootfs verification to allow cmdline change. - remove_verif_cmd = " ".join( - [ - "/usr/share/vboot/bin/make_dev_ssd.sh", - "--remove_rootfs_verification", - "--partition %d", - ] - ) - # Command for partition 2. - verif_part2_failed, _, _ = self.RunCommandOnDut( - remove_verif_cmd % 2, ignore_status=True - ) - # Command for partition 4 - # Some machines in the lab use partition 4 to boot from, - # so cmdline should be update for both partitions. - verif_part4_failed, _, _ = self.RunCommandOnDut( - remove_verif_cmd % 4, ignore_status=True - ) - if verif_part2_failed or verif_part4_failed: - self.logger.LogFatal( - "ERROR. Failed to update kernel cmdline on partition %d.\n" - "Remove verification failed with status %d" - % ( - 2 if verif_part2_failed else 4, - verif_part2_failed or verif_part4_failed, - ) - ) - - self.RunCommandOnDut("reboot && exit") - # Give enough time for dut to complete reboot - # TODO(denik): Replace with the function checking machine availability. - time.sleep(30) - - # Second phase to update intel_pstate in kernel cmdline. - kern_cmdline = "\n".join( - [ - "tmpfile=$(mktemp)", - "partnumb=%d", - "pstate=%s", - # Store kernel cmdline in a temp file. - "/usr/share/vboot/bin/make_dev_ssd.sh --partition ${partnumb}" - " --save_config ${tmpfile}", - # Remove intel_pstate argument if present. - "sed -i -r 's/ intel_pstate=[A-Za-z_]+//g' ${tmpfile}.${partnumb}", - # Insert intel_pstate with a new value if it is set. - "[[ -n ${pstate} ]] &&" - ' sed -i -e "s/ *$/ intel_pstate=${pstate}/" ${tmpfile}.${partnumb}', - # Save the change in kernel cmdline. - # After completion we have to reboot. - "/usr/share/vboot/bin/make_dev_ssd.sh --partition ${partnumb}" - " --set_config ${tmpfile}", - ] - ) - kern_part2_cmdline_cmd = kern_cmdline % (2, intel_pstate) - self.logger.LogOutput( - "Command to change kernel command line: %s" % kern_part2_cmdline_cmd - ) - upd_part2_failed, _, _ = self.RunCommandOnDut( - kern_part2_cmdline_cmd, ignore_status=True - ) - # Again here we are updating cmdline for partition 4 - # in addition to partition 2. Without this some machines - # in the lab might fail. - kern_part4_cmdline_cmd = kern_cmdline % (4, intel_pstate) - self.logger.LogOutput( - "Command to change kernel command line: %s" % kern_part4_cmdline_cmd - ) - upd_part4_failed, _, _ = self.RunCommandOnDut( - kern_part4_cmdline_cmd, ignore_status=True - ) - if upd_part2_failed or upd_part4_failed: - self.logger.LogFatal( - "ERROR. Failed to update kernel cmdline on partition %d.\n" - "intel_pstate update failed with status %d" - % ( - 2 if upd_part2_failed else 4, - upd_part2_failed or upd_part4_failed, - ) - ) - - self.RunCommandOnDut("reboot && exit") - # Wait 30s after reboot. - time.sleep(30) - - # Verification phase. - # Check that cmdline was updated. - # Throw an exception if not. - kern_cmdline_cmd = ( - 'grep -q "intel_pstate=%s" /proc/cmdline' % intel_pstate - ) - ret_code, _, _ = self.RunCommandOnDut( - kern_cmdline_cmd, ignore_status=True - ) - if ( - intel_pstate - and ret_code != good - or not intel_pstate - and ret_code == good - ): - # Kernel cmdline doesn't match input intel_pstate. - self.logger.LogFatal( - "ERROR. Failed to update kernel cmdline. " - "Final verification failed with status %d" % ret_code - ) - - self.logger.LogOutput("Kernel cmdline updated successfully.") - - @contextmanager - def PauseUI(self): - """Stop UI before and Start UI after the context block. - - Context manager will make sure UI is always resumed at the end. - """ - self.StopUI() - try: - yield - - finally: - self.StartUI() - - def SetupDevice(self): - """Setup device to get it ready for testing. - - @Returns Wait time of cool down for this benchmark run. - """ - self.logger.LogOutput("Update kernel cmdline if necessary and reboot") - intel_pstate = self.dut_config["intel_pstate"] - if intel_pstate and self.KerncmdUpdateNeeded(intel_pstate): - self.UpdateKerncmdIntelPstate(intel_pstate) - - wait_time = 0 - # Pause UI while configuring the DUT. - # This will accelerate setup (waiting for cooldown has x10 drop) - # and help to reset a Chrome state left after the previous test. - with self.PauseUI(): - # Unless the user turns on ASLR in the flag, we first disable ASLR - # before running the benchmarks - if not self.dut_config["enable_aslr"]: - self.DisableASLR() - - # CPU usage setup comes first where we enable/disable cores. - self.SetupCpuUsage() - cpu_online_status = self.GetCpuOnline() - # List of online cores of type int (core number). - online_cores = [ - core for core, status in cpu_online_status.items() if status - ] - if self.dut_config["cooldown_time"]: - # Setup power conservative mode for effective cool down. - # Set ignore status since powersave may no be available - # on all platforms and we are going to handle it. - ret = self.SetCpuGovernor("powersave", ignore_status=True) - if ret: - # "powersave" is not available, use "ondemand". - # Still not a fatal error if it fails. - ret = self.SetCpuGovernor("ondemand", ignore_status=True) - # TODO(denik): Run comparison test for 'powersave' and 'ondemand' - # on scarlet and kevin64. - # We might have to consider reducing freq manually to the min - # if it helps to reduce waiting time. - wait_time = self.WaitCooldown() - - # Setup CPU governor for the benchmark run. - # It overwrites the previous governor settings. - governor = self.dut_config["governor"] - # FIXME(denik): Pass online cores to governor setup. - self.SetCpuGovernor(governor) - - # Disable Turbo and Setup CPU freq should ALWAYS proceed governor setup - # since governor may change: - # - frequency; - # - turbo/boost. - self.DisableTurbo() - self.SetupCpuFreq(online_cores) - - self.DecreaseWaitTime() - # FIXME(denik): Currently we are not recovering the previous cpufreq - # settings since we do reboot/setup every time anyway. - # But it may change in the future and then we have to recover the - # settings. - return wait_time diff --git a/cros_utils/device_setup_utils_unittest.py b/cros_utils/device_setup_utils_unittest.py deleted file mode 100755 index d7339e25..00000000 --- a/cros_utils/device_setup_utils_unittest.py +++ /dev/null @@ -1,805 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# -# 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. - -"""Unittest for device_setup_utils.""" - - -import time -import unittest -from unittest import mock - -from cros_utils import command_executer -from cros_utils import logger -from cros_utils.device_setup_utils import DutWrapper - - -BIG_LITTLE_CPUINFO = """processor : 0 -model name : ARMv8 Processor rev 4 (v8l) -BogoMIPS : 48.00 -Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 -CPU implementer : 0x41 -CPU architecture: 8 -CPU variant : 0x0 -CPU part : 0xd03 -CPU revision : 4 - -processor : 1 -model name : ARMv8 Processor rev 4 (v8l) -BogoMIPS : 48.00 -Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 -CPU implementer : 0x41 -CPU architecture: 8 -CPU variant : 0x0 -CPU part : 0xd03 -CPU revision : 4 - -processor : 2 -model name : ARMv8 Processor rev 2 (v8l) -BogoMIPS : 48.00 -Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 -CPU implementer : 0x41 -CPU architecture: 8 -CPU variant : 0x0 -CPU part : 0xd08 -CPU revision : 2 -""" -LITTLE_ONLY_CPUINFO = """processor : 0 -model name : ARMv8 Processor rev 4 (v8l) -BogoMIPS : 48.00 -Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 -CPU implementer : 0x41 -CPU architecture: 8 -CPU variant : 0x0 -CPU part : 0xd03 -CPU revision : 4 - -processor : 1 -model name : ARMv8 Processor rev 4 (v8l) -BogoMIPS : 48.00 -Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 -CPU implementer : 0x41 -CPU architecture: 8 -CPU variant : 0x0 -CPU part : 0xd03 -CPU revision : 4 -""" - -NOT_BIG_LITTLE_CPUINFO = """processor : 0 -model name : ARMv7 Processor rev 1 (v7l) -Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpv4 -CPU implementer : 0x41 -CPU architecture: 7 -CPU variant : 0x0 -CPU part : 0xc0d -CPU revision : 1 - -processor : 1 -model name : ARMv7 Processor rev 1 (v7l) -Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpv4 -CPU implementer : 0x41 -CPU architecture: 7 -CPU variant : 0x0 -CPU part : 0xc0d -CPU revision : 1 - -Hardware : Rockchip (Device Tree) -Revision : 0000 -Serial : 0000000000000000 -""" - - -class DutWrapperTest(unittest.TestCase): - """Class of DutWrapper test.""" - - real_logger = logger.GetLogger() - - mock_cmd_exec = mock.Mock(spec=command_executer.CommandExecuter) - mock_logger = mock.Mock(spec=logger.Logger) - - def __init__(self, *args, **kwargs): - super(DutWrapperTest, self).__init__(*args, **kwargs) - - def setUp(self): - self.dw = DutWrapper( - "/tmp/chromeos", - "lumpy.cros2", - log_level="verbose", - logger=self.mock_logger, - ce=self.mock_cmd_exec, - dut_config={}, - ) - - @mock.patch.object( - command_executer.CommandExecuter, "CrosRunCommandWOutput" - ) - def test_run_command_on_dut(self, mock_cros_runcmd): - self.mock_cmd_exec.CrosRunCommandWOutput = mock_cros_runcmd - mock_cros_runcmd.return_value = (0, "", "") - mock_cros_runcmd.assert_not_called() - self.dw.RunCommandOnDut("run command;") - mock_cros_runcmd.assert_called_once_with( - "run command;", chromeos_root="/tmp/chromeos", machine="lumpy.cros2" - ) - - @mock.patch.object( - command_executer.CommandExecuter, "CrosRunCommandWOutput" - ) - def test_dut_wrapper_fatal_error(self, mock_cros_runcmd): - self.mock_cmd_exec.CrosRunCommandWOutput = mock_cros_runcmd - # Command returns error 1. - mock_cros_runcmd.return_value = (1, "", "Error!") - mock_cros_runcmd.assert_not_called() - self.dw.RunCommandOnDut("run command;") - mock_cros_runcmd.assert_called_once_with( - "run command;", chromeos_root="/tmp/chromeos", machine="lumpy.cros2" - ) - # Error status causes log fatal. - self.assertEqual( - self.mock_logger.method_calls[-1], - mock.call.LogFatal( - "Command execution on DUT lumpy.cros2 failed.\n" - "Failing command: run command;\nreturned 1\n" - "Error message: Error!" - ), - ) - - @mock.patch.object( - command_executer.CommandExecuter, "CrosRunCommandWOutput" - ) - def test_dut_wrapper_ignore_error(self, mock_cros_runcmd): - self.mock_cmd_exec.CrosRunCommandWOutput = mock_cros_runcmd - # Command returns error 1. - mock_cros_runcmd.return_value = (1, "", "Error!") - self.dw.RunCommandOnDut("run command;", ignore_status=True) - mock_cros_runcmd.assert_called_once_with( - "run command;", chromeos_root="/tmp/chromeos", machine="lumpy.cros2" - ) - # Error status is not fatal. LogError records the error message. - self.assertEqual( - self.mock_logger.method_calls[-1], - mock.call.LogError( - "Command execution on DUT lumpy.cros2 failed.\n" - "Failing command: run command;\nreturned 1\n" - "Error message: Error!\n" - "(Failure is considered non-fatal. Continue.)" - ), - ) - - def test_disable_aslr(self): - self.dw.RunCommandOnDut = mock.Mock(return_value=(0, "", "")) - self.dw.DisableASLR() - # pyformat: disable - set_cpu_cmd = ( - "set -e; " - "if [[ -e /proc/sys/kernel/randomize_va_space ]]; then " - " echo 0 > /proc/sys/kernel/randomize_va_space; " - "fi" - ) - self.dw.RunCommandOnDut.assert_called_once_with(set_cpu_cmd) - - def test_set_cpu_governor(self): - self.dw.RunCommandOnDut = mock.Mock(return_value=(0, "", "")) - self.dw.SetCpuGovernor("new_governor", ignore_status=False) - set_cpu_cmd = ( - "for f in `ls -d /sys/devices/system/cpu/cpu*/cpufreq 2>/dev/null`; do " - # Skip writing scaling_governor if cpu is offline. - " [[ -e ${f/cpufreq/online} ]] && grep -q 0 ${f/cpufreq/online} " - " && continue; " - " cd $f; " - " if [[ -e scaling_governor ]]; then " - " echo %s > scaling_governor; fi; " - "done; " - ) - self.dw.RunCommandOnDut.assert_called_once_with( - set_cpu_cmd % "new_governor", ignore_status=False - ) - - def test_set_cpu_governor_propagate_error(self): - self.dw.RunCommandOnDut = mock.Mock(return_value=(1, "", "Error.")) - self.dw.SetCpuGovernor("non-exist_governor") - set_cpu_cmd = ( - "for f in `ls -d /sys/devices/system/cpu/cpu*/cpufreq 2>/dev/null`; do " - # Skip writing scaling_governor if cpu is not online. - " [[ -e ${f/cpufreq/online} ]] && grep -q 0 ${f/cpufreq/online} " - " && continue; " - " cd $f; " - " if [[ -e scaling_governor ]]; then " - " echo %s > scaling_governor; fi; " - "done; " - ) - # By default error status is fatal. - self.dw.RunCommandOnDut.assert_called_once_with( - set_cpu_cmd % "non-exist_governor", ignore_status=False - ) - - def test_set_cpu_governor_ignore_status(self): - self.dw.RunCommandOnDut = mock.Mock(return_value=(1, "", "Error.")) - ret_code = self.dw.SetCpuGovernor( - "non-exist_governor", ignore_status=True - ) - set_cpu_cmd = ( - "for f in `ls -d /sys/devices/system/cpu/cpu*/cpufreq 2>/dev/null`; do " - # Skip writing scaling_governor if cpu is not online. - " [[ -e ${f/cpufreq/online} ]] && grep -q 0 ${f/cpufreq/online} " - " && continue; " - " cd $f; " - " if [[ -e scaling_governor ]]; then " - " echo %s > scaling_governor; fi; " - "done; " - ) - self.dw.RunCommandOnDut.assert_called_once_with( - set_cpu_cmd % "non-exist_governor", ignore_status=True - ) - self.assertEqual(ret_code, 1) - - def test_disable_turbo(self): - self.dw.RunCommandOnDut = mock.Mock(return_value=(0, "", "")) - self.dw.DisableTurbo() - set_cpu_cmd = ( - # Disable Turbo in Intel pstate driver - "if [[ -e /sys/devices/system/cpu/intel_pstate/no_turbo ]]; then " - " if grep -q 0 /sys/devices/system/cpu/intel_pstate/no_turbo; then " - " echo -n 1 > /sys/devices/system/cpu/intel_pstate/no_turbo; " - " fi; " - "fi; " - ) - self.dw.RunCommandOnDut.assert_called_once_with(set_cpu_cmd) - - def test_get_cpu_online_two(self): - """Test one digit CPU #.""" - self.dw.RunCommandOnDut = mock.Mock( - return_value=( - 0, - "/sys/devices/system/cpu/cpu0/online 0\n" - "/sys/devices/system/cpu/cpu1/online 1\n", - "", - ) - ) - cpu_online = self.dw.GetCpuOnline() - self.assertEqual(cpu_online, {0: 0, 1: 1}) - - def test_get_cpu_online_twelve(self): - """Test two digit CPU #.""" - self.dw.RunCommandOnDut = mock.Mock( - return_value=( - 0, - "/sys/devices/system/cpu/cpu0/online 1\n" - "/sys/devices/system/cpu/cpu1/online 0\n" - "/sys/devices/system/cpu/cpu10/online 1\n" - "/sys/devices/system/cpu/cpu11/online 1\n" - "/sys/devices/system/cpu/cpu2/online 1\n" - "/sys/devices/system/cpu/cpu3/online 0\n" - "/sys/devices/system/cpu/cpu4/online 1\n" - "/sys/devices/system/cpu/cpu5/online 0\n" - "/sys/devices/system/cpu/cpu6/online 1\n" - "/sys/devices/system/cpu/cpu7/online 0\n" - "/sys/devices/system/cpu/cpu8/online 1\n" - "/sys/devices/system/cpu/cpu9/online 0\n", - "", - ) - ) - cpu_online = self.dw.GetCpuOnline() - self.assertEqual( - cpu_online, - { - 0: 1, - 1: 0, - 2: 1, - 3: 0, - 4: 1, - 5: 0, - 6: 1, - 7: 0, - 8: 1, - 9: 0, - 10: 1, - 11: 1, - }, - ) - - def test_get_cpu_online_no_output(self): - """Test error case, no output.""" - self.dw.RunCommandOnDut = mock.Mock(return_value=(0, "", "")) - with self.assertRaises(AssertionError): - self.dw.GetCpuOnline() - - def test_get_cpu_online_command_error(self): - """Test error case, command error.""" - self.dw.RunCommandOnDut = mock.Mock(side_effect=AssertionError) - with self.assertRaises(AssertionError): - self.dw.GetCpuOnline() - - @mock.patch.object(DutWrapper, "SetupArmCores") - def test_setup_cpu_usage_little_on_arm(self, mock_setup_arm): - self.dw.SetupArmCores = mock_setup_arm - self.dw.RunCommandOnDut = mock.Mock(return_value=(0, "armv7l", "")) - self.dw.dut_config["cpu_usage"] = "little_only" - self.dw.SetupCpuUsage() - self.dw.SetupArmCores.assert_called_once_with() - - @mock.patch.object(DutWrapper, "SetupArmCores") - def test_setup_cpu_usage_big_on_aarch64(self, mock_setup_arm): - self.dw.SetupArmCores = mock_setup_arm - self.dw.RunCommandOnDut = mock.Mock(return_value=(0, "aarch64", "")) - self.dw.dut_config["cpu_usage"] = "big_only" - self.dw.SetupCpuUsage() - self.dw.SetupArmCores.assert_called_once_with() - - @mock.patch.object(DutWrapper, "SetupArmCores") - def test_setup_cpu_usage_big_on_intel(self, mock_setup_arm): - self.dw.SetupArmCores = mock_setup_arm - self.dw.RunCommandOnDut = mock.Mock(return_value=(0, "x86_64", "")) - self.dw.dut_config["cpu_usage"] = "big_only" - self.dw.SetupCpuUsage() - # Check that SetupArmCores not called with invalid setup. - self.dw.SetupArmCores.assert_not_called() - - @mock.patch.object(DutWrapper, "SetupArmCores") - def test_setup_cpu_usage_all_on_intel(self, mock_setup_arm): - self.dw.SetupArmCores = mock_setup_arm - self.dw.RunCommandOnDut = mock.Mock(return_value=(0, "x86_64", "")) - self.dw.dut_config["cpu_usage"] = "all" - self.dw.SetupCpuUsage() - # Check that SetupArmCores not called in general case. - self.dw.SetupArmCores.assert_not_called() - - def test_setup_arm_cores_big_on_big_little(self): - self.dw.RunCommandOnDut = mock.Mock( - side_effect=[ - (0, BIG_LITTLE_CPUINFO, ""), - (0, "", ""), - ] - ) - self.dw.dut_config["cpu_usage"] = "big_only" - self.dw.SetupArmCores() - self.dw.RunCommandOnDut.assert_called_with( - "echo 1 | tee /sys/devices/system/cpu/cpu{2}/online; " - "echo 0 | tee /sys/devices/system/cpu/cpu{0,1}/online" - ) - - def test_setup_arm_cores_little_on_big_little(self): - self.dw.RunCommandOnDut = mock.Mock( - side_effect=[ - (0, BIG_LITTLE_CPUINFO, ""), - (0, "", ""), - ] - ) - self.dw.dut_config["cpu_usage"] = "little_only" - self.dw.SetupArmCores() - self.dw.RunCommandOnDut.assert_called_with( - "echo 1 | tee /sys/devices/system/cpu/cpu{0,1}/online; " - "echo 0 | tee /sys/devices/system/cpu/cpu{2}/online" - ) - - def test_setup_arm_cores_invalid_config(self): - self.dw.RunCommandOnDut = mock.Mock( - side_effect=[ - (0, LITTLE_ONLY_CPUINFO, ""), - (0, "", ""), - ] - ) - self.dw.dut_config["cpu_usage"] = "big_only" - self.dw.SetupArmCores() - # Check that setup command is not sent when trying - # to use 'big_only' on a platform with all little cores. - self.dw.RunCommandOnDut.assert_called_once_with("cat /proc/cpuinfo") - - def test_setup_arm_cores_not_big_little(self): - self.dw.RunCommandOnDut = mock.Mock( - side_effect=[ - (0, NOT_BIG_LITTLE_CPUINFO, ""), - (0, "", ""), - ] - ) - self.dw.dut_config["cpu_usage"] = "big_only" - self.dw.SetupArmCores() - # Check that setup command is not sent when trying - # to use 'big_only' on a platform w/o support of big/little. - self.dw.RunCommandOnDut.assert_called_once_with("cat /proc/cpuinfo") - - def test_setup_arm_cores_unsupported_cpu_usage(self): - self.dw.RunCommandOnDut = mock.Mock( - side_effect=[ - (0, BIG_LITTLE_CPUINFO, ""), - (0, "", ""), - ] - ) - self.dw.dut_config["cpu_usage"] = "exclusive_cores" - self.dw.SetupArmCores() - # Check that setup command is not sent when trying to use - # 'exclusive_cores' on ARM CPU setup. - self.dw.RunCommandOnDut.assert_called_once_with("cat /proc/cpuinfo") - - def test_setup_cpu_freq_single_full(self): - online = [0] - self.dw.RunCommandOnDut = mock.Mock( - side_effect=[ - ( - 0, - "/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies\n", - "", - ), - (0, "1 2 3 4 5 6 7 8 9 10", ""), - (0, "", ""), - ] - ) - self.dw.dut_config["cpu_freq_pct"] = 100 - self.dw.SetupCpuFreq(online) - self.assertGreaterEqual(self.dw.RunCommandOnDut.call_count, 3) - self.assertEqual( - self.dw.RunCommandOnDut.call_args, - mock.call( - "echo 10 | tee " - "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq " - "/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq" - ), - ) - - def test_setup_cpu_freq_middle(self): - online = [0] - self.dw.RunCommandOnDut = mock.Mock( - side_effect=[ - ( - 0, - "/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies\n", - "", - ), - (0, "1 2 3 4 5 6 7 8 9 10", ""), - (0, "", ""), - ] - ) - self.dw.dut_config["cpu_freq_pct"] = 60 - self.dw.SetupCpuFreq(online) - self.assertGreaterEqual(self.dw.RunCommandOnDut.call_count, 2) - self.assertEqual( - self.dw.RunCommandOnDut.call_args, - mock.call( - "echo 6 | tee " - "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq " - "/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq" - ), - ) - - def test_setup_cpu_freq_lowest(self): - online = [0] - self.dw.RunCommandOnDut = mock.Mock( - side_effect=[ - ( - 0, - "/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies\n", - "", - ), - (0, "1 2 3 4 5 6 7 8 9 10", ""), - (0, "", ""), - ] - ) - self.dw.dut_config["cpu_freq_pct"] = 0 - self.dw.SetupCpuFreq(online) - self.assertGreaterEqual(self.dw.RunCommandOnDut.call_count, 2) - self.assertEqual( - self.dw.RunCommandOnDut.call_args, - mock.call( - "echo 1 | tee " - "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq " - "/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq" - ), - ) - - def test_setup_cpu_freq_multiple_middle(self): - online = [0, 1] - self.dw.RunCommandOnDut = mock.Mock( - side_effect=[ - ( - 0, - "/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies\n" - "/sys/devices/system/cpu/cpu1/cpufreq/scaling_available_frequencies\n", - "", - ), - (0, "1 2 3 4 5 6 7 8 9 10", ""), - (0, "", ""), - (0, "1 4 6 8 10 12 14 16 18 20", ""), - (0, "", ""), - ] - ) - self.dw.dut_config["cpu_freq_pct"] = 70 - self.dw.SetupCpuFreq(online) - self.assertEqual(self.dw.RunCommandOnDut.call_count, 5) - self.assertEqual( - self.dw.RunCommandOnDut.call_args_list[2], - mock.call( - "echo 7 | tee " - "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq " - "/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq" - ), - ) - self.assertEqual( - self.dw.RunCommandOnDut.call_args_list[4], - mock.call( - "echo 14 | tee " - "/sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq " - "/sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq" - ), - ) - - def test_setup_cpu_freq_no_scaling_available(self): - online = [0, 1] - self.dw.RunCommandOnDut = mock.Mock( - return_value=(2, "", "No such file or directory") - ) - self.dw.dut_config["cpu_freq_pct"] = 50 - self.dw.SetupCpuFreq(online) - self.dw.RunCommandOnDut.assert_called_once() - self.assertNotRegex( - self.dw.RunCommandOnDut.call_args_list[0][0][0], - "^echo.*scaling_max_freq$", - ) - - def test_setup_cpu_freq_multiple_no_access(self): - online = [0, 1] - self.dw.RunCommandOnDut = mock.Mock( - side_effect=[ - ( - 0, - "/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies\n" - "/sys/devices/system/cpu/cpu1/cpufreq/scaling_available_frequencies\n", - "", - ), - (0, "1 4 6 8 10 12 14 16 18 20", ""), - AssertionError(), - ] - ) - self.dw.dut_config["cpu_freq_pct"] = 30 - # Error status causes log fatal. - with self.assertRaises(AssertionError): - self.dw.SetupCpuFreq(online) - - @mock.patch.object(time, "sleep") - def test_wait_cooldown_nowait(self, mock_sleep): - mock_sleep.return_value = 0 - self.dw.RunCommandOnDut = mock.Mock(return_value=(0, "39000", "")) - self.dw.dut_config["cooldown_time"] = 10 - self.dw.dut_config["cooldown_temp"] = 40 - wait_time = self.dw.WaitCooldown() - # Send command to DUT only once to check temperature - # and make sure it does not exceed the threshold. - self.dw.RunCommandOnDut.assert_called_once() - mock_sleep.assert_not_called() - self.assertEqual(wait_time, 0) - - @mock.patch.object(time, "sleep") - def test_wait_cooldown_needwait_once(self, mock_sleep): - """Wait one iteration for cooldown. - - Set large enough timeout and changing temperature - output. Make sure it exits when expected value - received. - Expect that WaitCooldown check temp twice. - """ - mock_sleep.return_value = 0 - self.dw.RunCommandOnDut = mock.Mock( - side_effect=[(0, "41000", ""), (0, "39999", "")] - ) - self.dw.dut_config["cooldown_time"] = 100 - self.dw.dut_config["cooldown_temp"] = 40 - wait_time = self.dw.WaitCooldown() - self.dw.RunCommandOnDut.assert_called() - self.assertEqual(self.dw.RunCommandOnDut.call_count, 2) - mock_sleep.assert_called() - self.assertGreater(wait_time, 0) - - @mock.patch.object(time, "sleep") - def test_wait_cooldown_needwait(self, mock_sleep): - """Test exit by timeout. - - Send command to DUT checking the temperature and - check repeatedly until timeout goes off. - Output from temperature sensor never changes. - """ - mock_sleep.return_value = 0 - self.dw.RunCommandOnDut = mock.Mock(return_value=(0, "41000", "")) - self.dw.dut_config["cooldown_time"] = 60 - self.dw.dut_config["cooldown_temp"] = 40 - wait_time = self.dw.WaitCooldown() - self.dw.RunCommandOnDut.assert_called() - self.assertGreater(self.dw.RunCommandOnDut.call_count, 2) - mock_sleep.assert_called() - self.assertGreater(wait_time, 0) - - @mock.patch.object(time, "sleep") - def test_wait_cooldown_needwait_multtemp(self, mock_sleep): - """Wait until all temps go down. - - Set large enough timeout and changing temperature - output. Make sure it exits when expected value - for all temperatures received. - Expect 3 checks. - """ - mock_sleep.return_value = 0 - self.dw.RunCommandOnDut = mock.Mock( - side_effect=[ - (0, "41000\n20000\n30000\n45000", ""), - (0, "39000\n20000\n30000\n41000", ""), - (0, "39000\n20000\n30000\n31000", ""), - ] - ) - self.dw.dut_config["cooldown_time"] = 100 - self.dw.dut_config["cooldown_temp"] = 40 - wait_time = self.dw.WaitCooldown() - self.dw.RunCommandOnDut.assert_called() - self.assertEqual(self.dw.RunCommandOnDut.call_count, 3) - mock_sleep.assert_called() - self.assertGreater(wait_time, 0) - - @mock.patch.object(time, "sleep") - def test_wait_cooldown_thermal_error(self, mock_sleep): - """Handle error status. - - Any error should be considered non-fatal. - """ - mock_sleep.return_value = 0 - self.dw.RunCommandOnDut = mock.Mock( - side_effect=[ - (1, "39000\n20000\n30000\n41000", "Thermal error"), - (1, "39000\n20000\n30000\n31000", "Thermal error"), - ] - ) - self.dw.dut_config["cooldown_time"] = 10 - self.dw.dut_config["cooldown_temp"] = 40 - wait_time = self.dw.WaitCooldown() - # Check that errors are ignored. - self.dw.RunCommandOnDut.assert_called_with( - "cat /sys/class/thermal/thermal_zone*/temp", ignore_status=True - ) - self.assertEqual(self.dw.RunCommandOnDut.call_count, 2) - # Check that we are waiting even when an error is returned - # as soon as data is coming. - mock_sleep.assert_called() - self.assertGreater(wait_time, 0) - - @mock.patch.object(time, "sleep") - def test_wait_cooldown_thermal_no_output(self, mock_sleep): - """Handle no output. - - Check handling of empty stdout. - """ - mock_sleep.return_value = 0 - self.dw.RunCommandOnDut = mock.Mock( - side_effect=[(1, "", "Thermal error")] - ) - self.dw.dut_config["cooldown_time"] = 10 - self.dw.dut_config["cooldown_temp"] = 40 - wait_time = self.dw.WaitCooldown() - # Check that errors are ignored. - self.dw.RunCommandOnDut.assert_called_once_with( - "cat /sys/class/thermal/thermal_zone*/temp", ignore_status=True - ) - # No wait. - mock_sleep.assert_not_called() - self.assertEqual(wait_time, 0) - - @mock.patch.object(time, "sleep") - def test_wait_cooldown_thermal_ws_output(self, mock_sleep): - """Handle whitespace output. - - Check handling of whitespace only. - """ - mock_sleep.return_value = 0 - self.dw.RunCommandOnDut = mock.Mock( - side_effect=[(1, "\n", "Thermal error")] - ) - self.dw.dut_config["cooldown_time"] = 10 - self.dw.dut_config["cooldown_temp"] = 40 - wait_time = self.dw.WaitCooldown() - # Check that errors are ignored. - self.dw.RunCommandOnDut.assert_called_once_with( - "cat /sys/class/thermal/thermal_zone*/temp", ignore_status=True - ) - # No wait. - mock_sleep.assert_not_called() - self.assertEqual(wait_time, 0) - - def test_stop_ui(self): - self.dw.RunCommandOnDut = mock.Mock(return_value=(0, "", "")) - self.dw.StopUI() - self.dw.RunCommandOnDut.assert_called_once_with( - "stop ui", ignore_status=True - ) - - def test_start_ui(self): - self.dw.RunCommandOnDut = mock.Mock(return_value=(0, "", "")) - self.dw.StartUI() - self.dw.RunCommandOnDut.assert_called_once_with( - "start ui", ignore_status=True - ) - - def test_setup_device(self): - def FakeRunner(command, ignore_status=False): - # pylint fix for unused variable. - del command, ignore_status - return 0, "", "" - - def SetupMockFunctions(): - self.dw.RunCommandOnDut = mock.Mock(return_value=FakeRunner) - self.dw.KerncmdUpdateNeeded = mock.Mock(return_value=True) - self.dw.UpdateKerncmdIntelPstate = mock.Mock(return_value=0) - self.dw.DisableASLR = mock.Mock(return_value=0) - self.dw.SetupCpuUsage = mock.Mock(return_value=0) - self.dw.SetupCpuFreq = mock.Mock(return_value=0) - self.dw.GetCpuOnline = mock.Mock(return_value={0: 1, 1: 1, 2: 0}) - self.dw.SetCpuGovernor = mock.Mock(return_value=0) - self.dw.DisableTurbo = mock.Mock(return_value=0) - self.dw.StopUI = mock.Mock(return_value=0) - self.dw.StartUI = mock.Mock(return_value=0) - self.dw.WaitCooldown = mock.Mock(return_value=0) - self.dw.DecreaseWaitTime = mock.Mock(return_value=0) - - self.dw.dut_config["enable_aslr"] = False - self.dw.dut_config["cooldown_time"] = 0 - self.dw.dut_config["governor"] = "fake_governor" - self.dw.dut_config["cpu_freq_pct"] = 65 - self.dw.dut_config["intel_pstate"] = "no_hwp" - - SetupMockFunctions() - self.dw.SetupDevice() - - self.dw.KerncmdUpdateNeeded.assert_called_once() - self.dw.UpdateKerncmdIntelPstate.assert_called_once() - self.dw.DisableASLR.assert_called_once() - self.dw.SetupCpuUsage.assert_called_once_with() - self.dw.SetupCpuFreq.assert_called_once_with([0, 1]) - self.dw.GetCpuOnline.assert_called_once_with() - self.dw.SetCpuGovernor.assert_called_once_with("fake_governor") - self.dw.DisableTurbo.assert_called_once_with() - self.dw.DecreaseWaitTime.assert_called_once_with() - self.dw.StopUI.assert_called_once_with() - self.dw.StartUI.assert_called_once_with() - self.dw.WaitCooldown.assert_not_called() - - # Test SetupDevice with cooldown - self.dw.dut_config["cooldown_time"] = 10 - - SetupMockFunctions() - self.dw.GetCpuOnline = mock.Mock(return_value={0: 0, 1: 1}) - - self.dw.SetupDevice() - - self.dw.WaitCooldown.assert_called_once_with() - self.dw.DisableASLR.assert_called_once() - self.dw.DisableTurbo.assert_called_once_with() - self.dw.SetupCpuUsage.assert_called_once_with() - self.dw.SetupCpuFreq.assert_called_once_with([1]) - self.dw.SetCpuGovernor.assert_called() - self.dw.GetCpuOnline.assert_called_once_with() - self.dw.StopUI.assert_called_once_with() - self.dw.StartUI.assert_called_once_with() - self.assertGreater(self.dw.SetCpuGovernor.call_count, 1) - self.assertEqual( - self.dw.SetCpuGovernor.call_args, mock.call("fake_governor") - ) - - # Test SetupDevice with cooldown - SetupMockFunctions() - self.dw.SetupCpuUsage = mock.Mock(side_effect=RuntimeError()) - - with self.assertRaises(RuntimeError): - self.dw.SetupDevice() - - # This call injected an exception. - self.dw.SetupCpuUsage.assert_called_once_with() - # Calls following the expeption are skipped. - self.dw.WaitCooldown.assert_not_called() - self.dw.DisableTurbo.assert_not_called() - self.dw.SetupCpuFreq.assert_not_called() - self.dw.SetCpuGovernor.assert_not_called() - self.dw.GetCpuOnline.assert_not_called() - # Check that Stop/Start UI are always called. - self.dw.StopUI.assert_called_once_with() - self.dw.StartUI.assert_called_once_with() - - -if __name__ == "__main__": - unittest.main() -- cgit v1.2.3 From 57137104fec59d99d27e02f4bb3975190ab6a9a8 Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Thu, 6 Jul 2023 23:09:23 +0000 Subject: toolchain-utils: Remove buildbot_test_llvm.py As far as I can tell, this file is no longer used by anything internally or externally. The program doesn't seem to work either, and hasn't had a functional update since 2019. It uses command_executor, and we're trying to clean up uses of that wherever possible. BUG=b:289058911 TEST=./run_tests_for.py cros_utils/*test* Change-Id: Iad14fb9076dd56e4a08c0486ad478aad18ea4f6c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4672449 Commit-Queue: Jordan Abrahams-Whitehead Reviewed-by: George Burgess Tested-by: Jordan Abrahams-Whitehead --- buildbot_test_llvm.py | 218 -------------------------------------------------- 1 file changed, 218 deletions(-) delete mode 100755 buildbot_test_llvm.py diff --git a/buildbot_test_llvm.py b/buildbot_test_llvm.py deleted file mode 100755 index 57f029c7..00000000 --- a/buildbot_test_llvm.py +++ /dev/null @@ -1,218 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# -# Copyright 2017 The ChromiumOS Authors -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Script for running llvm validation tests on ChromeOS. - -This script launches a buildbot to build ChromeOS with the llvm on -a particular board; then it finds and downloads the trybot image and the -corresponding official image, and runs test for correctness. -It then generates a report, emails it to the c-compiler-chrome, as -well as copying the result into a directory. -""" - -# Script to test different toolchains against ChromeOS benchmarks. - - -import argparse -import datetime -import os -import sys -import time - -from cros_utils import buildbot_utils -from cros_utils import command_executer -from cros_utils import logger - - -CROSTC_ROOT = "/usr/local/google/crostc" -ROLE_ACCOUNT = "mobiletc-prebuild" -TOOLCHAIN_DIR = os.path.dirname(os.path.realpath(__file__)) -MAIL_PROGRAM = "~/var/bin/mail-detective" -VALIDATION_RESULT_DIR = os.path.join(CROSTC_ROOT, "validation_result") -START_DATE = datetime.date(2016, 1, 1) -TEST_PER_DAY = 4 -DATA_DIR = "/google/data/rw/users/mo/mobiletc-prebuild/waterfall-report-data/" - -# Information about Rotating Boards -# Board Arch Reference Platform Kernel -# Board Version -# ------------ ------- ------------ ------------- ------- -# atlas x86_64 poppy kabylake-y 4.4.* -# cave x86_64 glados skylake-y 3.18 -# coral x86_64 reef apollo lake 4.4.* -# cyan x86_64 strago braswell 3.18 -# elm aarch64 oak mediatek-8173 3.18 arm32 userspace -# eve x86_64 poppy kabylake-u/r 4.4.* -# gale armv7 3.18 -# grunt x86_64 grunt stoney ridge 4.14.* -# fizz-moblab x86_64 4.4 -# kevin aarch64 gru rockchip-3399 4.4.* arm32 userspace -# kevin64 aarch64 gru rockchip-3399 4.4.* arm64 userspace -# lakitu x86_64 4.4.* -# nyan_kitty armv7 nyan tegra 3.10.18 -# octopus x86_64 octopus GLK 4.14.* -# sentry x86_64 kunimitsu skylake-u 3.18 -# tidus x86_64 auron broadwell 3.14 -# veyron_mighty armv7 veyron-pinky rockchip-3288 3.14 -# whirlwind armv7 3.14 -# winky x86_64 rambi baytrail 4.4.* - -TEST_BOARD = [ - "atlas", - "cave", - "coral", - "cyan", - "elm", - # 'eve', tested by amd64-llvm-next-toolchain builder. - "gale", - "grunt", - "fizz-moblab", - # 'kevin', tested by arm64-llvm-next-toolchain builder. - "kevin64", - "lakitu", - "nyan_kitty", - "octopus", - "sentry", - "tidus", - # 'veyron_mighty', tested by arm-llvm-next-toolchain builder. - "whirlwind", - "winky", -] - - -class ToolchainVerifier(object): - """Class for the toolchain verifier.""" - - def __init__(self, board, chromeos_root, weekday, patches, compiler): - self._board = board - self._chromeos_root = chromeos_root - self._base_dir = os.getcwd() - self._ce = command_executer.GetCommandExecuter() - self._l = logger.GetLogger() - self._compiler = compiler - self._build = "%s-%s-toolchain-tryjob" % (board, compiler) - self._patches = patches.split(",") if patches else [] - self._patches_string = "_".join(str(p) for p in self._patches) - - if not weekday: - self._weekday = time.strftime("%a") - else: - self._weekday = weekday - self._reports = os.path.join(VALIDATION_RESULT_DIR, compiler, board) - - def DoAll(self): - """Main function inside ToolchainComparator class. - - Launch trybot, get image names, create crosperf experiment file, run - crosperf, and copy images into seven-day report directories. - """ - buildbucket_id, _ = buildbot_utils.GetTrybotImage( - self._chromeos_root, - self._build, - self._patches, - tryjob_flags=["--hwtest"], - asynchronous=True, - ) - - return buildbucket_id - - -def WriteRotatingReportsData(results_dict, date): - """Write data for waterfall report.""" - fname = "%d-%02d-%02d.builds" % (date.year, date.month, date.day) - filename = os.path.join(DATA_DIR, "rotating-builders", fname) - with open(filename, "w", encoding="utf-8") as out_file: - for board in results_dict.keys(): - buildbucket_id = results_dict[board] - out_file.write("%s,%s\n" % (buildbucket_id, board)) - - -def Main(argv): - """The main function.""" - - # Common initializations - command_executer.InitCommandExecuter() - parser = argparse.ArgumentParser() - parser.add_argument( - "--chromeos_root", - dest="chromeos_root", - help="The chromeos root from which to run tests.", - ) - parser.add_argument( - "--weekday", - default="", - dest="weekday", - help="The day of the week for which to run tests.", - ) - parser.add_argument( - "--board", default="", dest="board", help="The board to test." - ) - parser.add_argument( - "--patch", - dest="patches", - default="", - help="The patches to use for the testing, " - "seprate the patch numbers with ',' " - "for more than one patches.", - ) - parser.add_argument( - "--compiler", - dest="compiler", - help="Which compiler (llvm, llvm-next or gcc) to use for " "testing.", - ) - - options = parser.parse_args(argv[1:]) - if not options.chromeos_root: - print("Please specify the ChromeOS root directory.") - return 1 - if not options.compiler: - print( - "Please specify which compiler to test (gcc, llvm, or llvm-next)." - ) - return 1 - - if options.board: - fv = ToolchainVerifier( - options.board, - options.chromeos_root, - options.weekday, - options.patches, - options.compiler, - ) - return fv.DoAll() - - today = datetime.date.today() - delta = today - START_DATE - days = delta.days - - start_board = (days * TEST_PER_DAY) % len(TEST_BOARD) - results_dict = dict() - for i in range(TEST_PER_DAY): - try: - board = TEST_BOARD[(start_board + i) % len(TEST_BOARD)] - fv = ToolchainVerifier( - board, - options.chromeos_root, - options.weekday, - options.patches, - options.compiler, - ) - buildbucket_id = fv.DoAll() - if buildbucket_id: - results_dict[board] = buildbucket_id - except SystemExit: - logfile = os.path.join( - VALIDATION_RESULT_DIR, options.compiler, board - ) - with open(logfile, "w", encoding="utf-8") as f: - f.write("Verifier got an exception, please check the log.\n") - WriteRotatingReportsData(results_dict, today) - - -if __name__ == "__main__": - retval = Main(sys.argv) - sys.exit(retval) -- cgit v1.2.3 From f8facb3028d430d26af12515baceba9773856617 Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Mon, 10 Jul 2023 20:08:34 +0000 Subject: cros_utils: Make GetLogger have type guarantees At present, GetLogger could return None, Logger, or MockLogger. No code seems to be built for when GetLogger returns None, and it would instead be nice to have that safety. The original InitLogger relies on modifying global state to ensure the main_logger is not None. This does not make the type analysis happy, so instead lets have InitLogger return the logger we initted. This also does a minor clean up of the code. BUG=None TEST=./run_tests_for.py cros_utils/* Change-Id: I2f5b142e088ceb0299d7ac2513b7c3c6f3800800 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4674780 Tested-by: Jordan Abrahams-Whitehead Reviewed-by: George Burgess Commit-Queue: Jordan Abrahams-Whitehead --- cros_utils/logger.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cros_utils/logger.py b/cros_utils/logger.py index e9b9d1ba..7df3f8ff 100644 --- a/cros_utils/logger.py +++ b/cros_utils/logger.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # 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. @@ -10,6 +9,7 @@ import os.path import sys import traceback +from typing import Union # TODO(yunlian@google.com): Use GetRoot from misc @@ -19,7 +19,7 @@ def GetRoot(scr_name): return (os.path.dirname(abs_path), os.path.basename(abs_path)) -class Logger(object): +class Logger: """Logging helper class.""" MAX_LOG_FILES = 10 @@ -67,7 +67,7 @@ class Logger(object): def _CreateLogFileHandle(self, name): fd = None try: - fd = open(name, "w") + fd = open(name, "w", encoding="utf-8") except IOError: print("Warning: could not open %s for writing." % name) return fd @@ -215,7 +215,7 @@ class Logger(object): self.stderr.flush() -class MockLogger(object): +class MockLogger: """Logging helper class.""" MAX_LOG_FILES = 10 @@ -363,7 +363,8 @@ def InitLogger(script_name, log_dir, print_console=True, mock=False): """Initialize a global logger. To be called only once.""" # pylint: disable=global-statement global main_logger - assert not main_logger, "The logger has already been initialized" + if main_logger: + return main_logger rootdir, basefilename = GetRoot(script_name) if not log_dir: log_dir = rootdir @@ -371,12 +372,11 @@ def InitLogger(script_name, log_dir, print_console=True, mock=False): main_logger = Logger(log_dir, basefilename, print_console) else: main_logger = MockLogger(log_dir, basefilename, print_console) + return main_logger -def GetLogger(log_dir="", mock=False): - if not main_logger: - InitLogger(sys.argv[0], log_dir, mock=mock) - return main_logger +def GetLogger(log_dir="", mock=False) -> Union[Logger, MockLogger]: + return InitLogger(sys.argv[0], log_dir, mock=mock) def HandleUncaughtExceptions(fun): -- cgit v1.2.3 From c283de4032ddc8acda707bce5b18ab48c7008143 Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Mon, 10 Jul 2023 20:12:36 +0000 Subject: cros_utils: Reformat buildbot_utils This attempts to isolate some of the style changes to make cros lint happier. It's not all encompassing. BUG=None TEST=./run_tests_for.py cros_utils/*test.py Change-Id: I55e264771ab2aa7160b43679602955dcfcf72beb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4674781 Tested-by: Jordan Abrahams-Whitehead Commit-Queue: Jordan Abrahams-Whitehead Reviewed-by: George Burgess --- cros_utils/buildbot_utils.py | 51 +++++++++++++++++------------------ cros_utils/buildbot_utils_unittest.py | 12 +++------ 2 files changed, 28 insertions(+), 35 deletions(-) diff --git a/cros_utils/buildbot_utils.py b/cros_utils/buildbot_utils.py index 8f0ce5e0..36c68c13 100644 --- a/cros_utils/buildbot_utils.py +++ b/cros_utils/buildbot_utils.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2017 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -41,13 +40,13 @@ def PeekTrybotImage(chromeos_root, buildbucket_id): """Get the artifact URL of a given tryjob. Args: - buildbucket_id: buildbucket-id - chromeos_root: root dir of chrome os checkout + buildbucket_id: buildbucket-id + chromeos_root: root dir of chrome os checkout Returns: - (status, url) where status can be 'pass', 'fail', 'running', + (status, url) where status can be 'pass', 'fail', 'running', and url looks like: - gs://chromeos-image-archive/trybot-elm-release-tryjob/R67-10468.0.0-b20789 + gs://chromeos-image-archive/trybot-elm-release-tryjob/R67-10468.0.0-b20789 """ command = ( "cros buildresult --report json --buildbucket-id %s" % buildbucket_id @@ -72,10 +71,10 @@ def ParseTryjobBuildbucketId(msg): """Find the buildbucket-id in the messages from `cros tryjob`. Args: - msg: messages from `cros tryjob` + msg: messages from `cros tryjob` Returns: - buildbucket-id, which will be passed to `cros buildresult` + buildbucket-id, which will be passed to `cros buildresult` """ output_list = ast.literal_eval(msg) output_dict = output_list[0] @@ -94,17 +93,17 @@ def SubmitTryjob( """Calls `cros tryjob ...` Args: - chromeos_root: the path to the ChromeOS root, needed for finding chromite - and launching the buildbot. - buildbot_name: the name of the buildbot queue, such as lumpy-release or - daisy-paladin. - patch_list: a python list of the patches, if any, for the buildbot to use. - tryjob_flags: See cros tryjob --help for available options. - build_toolchain: builds and uses the latest toolchain, rather than the - prebuilt one in SDK. + chromeos_root: the path to the ChromeOS root, needed for finding chromite + and launching the buildbot. + buildbot_name: the name of the buildbot queue, such as lumpy-release or + daisy-paladin. + patch_list: a python list of the patches, if any, for the buildbot to use. + tryjob_flags: See cros tryjob --help for available options. + build_toolchain: builds and uses the latest toolchain, rather than the + prebuilt one in SDK. Returns: - buildbucket id + buildbucket id """ patch_arg = "" if patch_list: @@ -151,19 +150,19 @@ def GetTrybotImage( artifact (if one was created), and returns that artifact name. Args: - chromeos_root: the path to the ChromeOS root, needed for finding chromite - and launching the buildbot. - buildbot_name: the name of the buildbot queue, such as lumpy-release or - daisy-paladin. - patch_list: a python list of the patches, if any, for the buildbot to use. - tryjob_flags: See cros tryjob --help for available options. - build_toolchain: builds and uses the latest toolchain, rather than the + chromeos_root: the path to the ChromeOS root, needed for finding chromite + and launching the buildbot. + buildbot_name: the name of the buildbot queue, such as lumpy-release or + daisy-paladin. + patch_list: a python list of the patches, if any, for the buildbot to use. + tryjob_flags: See cros tryjob --help for available options. + build_toolchain: builds and uses the latest toolchain, rather than the prebuilt one in SDK. - asynchronous: don't wait for artifacts; just return the buildbucket id + asynchronous: don't wait for artifacts; just return the buildbucket id Returns: - (buildbucket id, partial image url) e.g. - (8952271933586980528, trybot-elm-release-tryjob/R67-10480.0.0-b2373596) + (buildbucket id, partial image url) e.g. + (8952271933586980528, trybot-elm-release-tryjob/R67-10480.0.0-b2373596) """ buildbucket_id = SubmitTryjob( chromeos_root, buildbot_name, patch_list, tryjob_flags, build_toolchain diff --git a/cros_utils/buildbot_utils_unittest.py b/cros_utils/buildbot_utils_unittest.py index 2c9585b5..9e006f20 100755 --- a/cros_utils/buildbot_utils_unittest.py +++ b/cros_utils/buildbot_utils_unittest.py @@ -1,6 +1,4 @@ #!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# # Copyright 2018 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -154,7 +152,7 @@ class TrybotTest(unittest.TestCase): ) mocked_imageexist.return_value = True image = buildbot_utils.GetLatestImage("", IMAGE_DIR) - self.assertEqual(image, "{0}/R78-12423.0.0".format(IMAGE_DIR)) + self.assertEqual(image, f"{IMAGE_DIR}/R78-12423.0.0") def testGetLatestImageInvalid(self): with patch.object( @@ -190,9 +188,7 @@ class TrybotTest(unittest.TestCase): image = buildbot_utils.GetLatestRecipeImage("", IMAGE_DIR) self.assertEqual( image, - "{0}/R83-13003.0.0-30218-8884712858556419".format( - IMAGE_DIR - ), + f"{IMAGE_DIR}/R83-13003.0.0-30218-8884712858556419", ) def testGetLatestRecipeImageInvalid(self): @@ -232,9 +228,7 @@ class TrybotTest(unittest.TestCase): image = buildbot_utils.GetLatestRecipeImage("", IMAGE_DIR) self.assertEqual( image, - "{0}/R83-13003.0.0-30196-8884755532184725".format( - IMAGE_DIR - ), + f"{IMAGE_DIR}/R83-13003.0.0-30196-8884755532184725", ) -- cgit v1.2.3 From 25005ff0c8b6e4ce30f4f934c420a3b7411c64ee Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Tue, 11 Jul 2023 09:41:31 -0600 Subject: compiler_wrapper: add flag to skip automatic sysroot logic Adding `--sysroot` and the implicit library path here breaks glibc's build when `llvm-libunwind` is installed. Since glibc is a special package, it seems OK to let it own its own destiny WRT gathering the proper includes & linking to libraries properly. BUG=b:290144273 TEST=emerge glibc Change-Id: I4f814b39334147631a0fdcb67ad1f0e067e1d674 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4678360 Reviewed-by: Jordan Abrahams-Whitehead Tested-by: George Burgess Commit-Queue: George Burgess --- compiler_wrapper/sysroot_flag.go | 24 +++++++++++++++++++++--- compiler_wrapper/sysroot_flag_test.go | 26 ++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/compiler_wrapper/sysroot_flag.go b/compiler_wrapper/sysroot_flag.go index 597153a9..0256abcd 100644 --- a/compiler_wrapper/sysroot_flag.go +++ b/compiler_wrapper/sysroot_flag.go @@ -9,19 +9,37 @@ import ( "strings" ) +const skipSysrootAutodetectionFlag = "--cros-skip-wrapper-sysroot-autodetection" + func processSysrootFlag(builder *commandBuilder) { + hadSkipSysrootMagicFlag := false fromUser := false userSysroot := "" - for _, arg := range builder.args { - if arg.fromUser && strings.HasPrefix(arg.value, "--sysroot=") { + builder.transformArgs(func(arg builderArg) string { + switch { + // In rare cases (e.g., glibc), we want all sysroot autodetection logic to be + // disabled. This flag can be passed to disable that. + case arg.value == skipSysrootAutodetectionFlag: + hadSkipSysrootMagicFlag = true + return "" + + case arg.fromUser && strings.HasPrefix(arg.value, "--sysroot="): fromUser = true sysrootArg := strings.Split(arg.value, "=") if len(sysrootArg) == 2 { userSysroot = sysrootArg[1] } - break + return arg.value + + default: + return arg.value } + }) + + if hadSkipSysrootMagicFlag { + return } + sysroot, syrootPresent := builder.env.getenv("SYSROOT") if syrootPresent { builder.updateEnv("SYSROOT=") diff --git a/compiler_wrapper/sysroot_flag_test.go b/compiler_wrapper/sysroot_flag_test.go index 9fea6848..bca8d1b0 100644 --- a/compiler_wrapper/sysroot_flag_test.go +++ b/compiler_wrapper/sysroot_flag_test.go @@ -6,9 +6,35 @@ package main import ( "path" + "regexp" "testing" ) +func TestOmitSysrootGivenSysrootSuppressionFlag(t *testing.T) { + escapedAutodetectionFlag := regexp.QuoteMeta(skipSysrootAutodetectionFlag) + withTestContext(t, func(ctx *testContext) { + runWithCompiler := func(compiler string) { + cmd := ctx.must(callCompiler(ctx, ctx.cfg, + ctx.newCommand(compiler, skipSysrootAutodetectionFlag, mainCc))) + if err := verifyArgOrder(cmd, mainCc); err != nil { + t.Error(err) + } + if err := verifyArgCount(cmd, 0, "--sysroot.*"); err != nil { + t.Error(err) + } + if err := verifyArgCount(cmd, 0, "-L.*"); err != nil { + t.Error(err) + } + if err := verifyArgCount(cmd, 0, escapedAutodetectionFlag); err != nil { + t.Error(err) + } + } + + runWithCompiler(gccX86_64) + runWithCompiler(clangX86_64) + }) +} + func TestOmitSysrootGivenUserDefinedSysroot(t *testing.T) { withTestContext(t, func(ctx *testContext) { runWithCompiler := func(compiler string) { -- cgit v1.2.3 From b3e3219b54f42c5322f30d486b2ebea60e430d77 Mon Sep 17 00:00:00 2001 From: mobiletc-prebuild Date: Wed, 12 Jul 2023 10:05:32 -0700 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-4.19 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update amd profile on chromeos-kernel-5.15 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: Ib35046845f8045deb4c2f37c1f25e6c7d0c7c32b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4680457 Reviewed-by: George Burgess Commit-Queue: George Burgess Tested-by: George Burgess --- afdo_metadata/kernel_afdo.json | 10 +++++----- afdo_metadata/kernel_arm_afdo.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index 17e458be..0e953c78 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -1,17 +1,17 @@ { "chromeos-kernel-4_14": { - "name": "R117-15509.6-1688376886" + "name": "R117-15509.6-1688981610" }, "chromeos-kernel-4_19": { - "name": "R117-15501.0-1688376778" + "name": "R117-15509.6-1688981510" }, "chromeos-kernel-5_4": { - "name": "R117-15509.6-1688376748" + "name": "R117-15509.6-1688981733" }, "chromeos-kernel-5_10": { - "name": "R117-15509.6-1688376752" + "name": "R117-15509.6-1688981532" }, "chromeos-kernel-5_15": { - "name": "R117-15509.6-1688376767" + "name": "R117-15509.6-1688981665" } } diff --git a/afdo_metadata/kernel_arm_afdo.json b/afdo_metadata/kernel_arm_afdo.json index 14f550be..ca17f11f 100644 --- a/afdo_metadata/kernel_arm_afdo.json +++ b/afdo_metadata/kernel_arm_afdo.json @@ -1,5 +1,5 @@ { "chromeos-kernel-5_15": { - "name": "R117-15509.6-1688376946" + "name": "R117-15509.6-1688981807" } } -- cgit v1.2.3 From 99e441aedcd071ecfb72f14a86b9566ee52bbda9 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Thu, 13 Jul 2023 14:40:35 -0600 Subject: heatmaps: remove This tool was used primarily to turn perf.data profiles into pictures representing where in the binary %ip was over time. It almost certainly hasn't been used in many years, and as LLVM has gotten better at promoting code locality (especially through things like ThinLTO), it seems like it's increasingly unlikely for this to be relevant to us in the future. BUG=b:286091080 TEST=None Change-Id: Id1da1485f40b4aa974125167b06215431867373d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4683721 Reviewed-by: Jordan Abrahams-Whitehead Commit-Queue: George Burgess Tested-by: George Burgess --- heatmaps/heat_map.py | 206 --------------- heatmaps/heat_map_test.py | 179 ------------- heatmaps/heatmap_generator.py | 524 ------------------------------------- heatmaps/heatmap_generator_test.py | 326 ----------------------- heatmaps/perf-to-inst-page.sh | 68 ----- 5 files changed, 1303 deletions(-) delete mode 100755 heatmaps/heat_map.py delete mode 100755 heatmaps/heat_map_test.py delete mode 100644 heatmaps/heatmap_generator.py delete mode 100755 heatmaps/heatmap_generator_test.py delete mode 100755 heatmaps/perf-to-inst-page.sh diff --git a/heatmaps/heat_map.py b/heatmaps/heat_map.py deleted file mode 100755 index a3c52369..00000000 --- a/heatmaps/heat_map.py +++ /dev/null @@ -1,206 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright 2015 The ChromiumOS Authors -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Wrapper to generate heat maps for chrome.""" - - -import argparse -import os -import shutil -import sys -import tempfile - -from cros_utils import command_executer -from heatmaps import heatmap_generator - - -def IsARepoRoot(directory): - """Returns True if directory is the root of a repo checkout.""" - return os.path.exists( - os.path.join(os.path.realpath(os.path.expanduser(directory)), ".repo") - ) - - -class HeatMapProducer(object): - """Class to produce heat map.""" - - def __init__( - self, chromeos_root, perf_data, hugepage, binary, title, logger=None - ): - self.chromeos_root = os.path.realpath(os.path.expanduser(chromeos_root)) - self.perf_data = os.path.realpath(os.path.expanduser(perf_data)) - self.hugepage = hugepage - self.dir = os.path.dirname(os.path.realpath(__file__)) - self.binary = binary - self.ce = command_executer.GetCommandExecuter() - self.temp_dir = "" - self.temp_perf_inchroot = "" - self.temp_dir_created = False - self.perf_report = "" - self.title = title - self.logger = logger - - def _EnsureFileInChroot(self): - chroot_prefix = os.path.join(self.chromeos_root, "chroot") - if self.perf_data.startswith(chroot_prefix): - # If the path to perf_data starts with the same chromeos_root, assume - # it's in the chromeos_root so no need for temporary directory and copy. - self.temp_dir = self.perf_data.replace("perf.data", "") - self.temp_perf_inchroot = self.temp_dir.replace(chroot_prefix, "") - - else: - # Otherwise, create a temporary directory and copy perf.data into chroot. - self.temp_dir = tempfile.mkdtemp( - prefix=os.path.join(self.chromeos_root, "src/") - ) - temp_perf = os.path.join(self.temp_dir, "perf.data") - shutil.copy2(self.perf_data, temp_perf) - self.temp_perf_inchroot = os.path.join( - "~/trunk/src", os.path.basename(self.temp_dir) - ) - self.temp_dir_created = True - - def _GeneratePerfReport(self): - cmd = ( - "cd %s && perf report -D -i perf.data > perf_report.txt" - % self.temp_perf_inchroot - ) - retval = self.ce.ChrootRunCommand(self.chromeos_root, cmd) - if retval: - raise RuntimeError("Failed to generate perf report") - self.perf_report = os.path.join(self.temp_dir, "perf_report.txt") - - def _GetHeatMap(self, top_n_pages): - generator = heatmap_generator.HeatmapGenerator( - perf_report=self.perf_report, - page_size=4096, - hugepage=self.hugepage, - title=self.title, - ) - generator.draw() - # Analyze top N hottest symbols with the binary, if provided - if self.binary: - generator.analyze(self.binary, top_n_pages) - - def _RemoveFiles(self): - files = [ - "out.txt", - "inst-histo.txt", - "inst-histo-hp.txt", - "inst-histo-sp.txt", - ] - for f in files: - if os.path.exists(f): - os.remove(f) - - def Run(self, top_n_pages): - try: - self._EnsureFileInChroot() - self._GeneratePerfReport() - self._GetHeatMap(top_n_pages) - finally: - self._RemoveFiles() - msg = ( - "heat map and time histogram genereated in the current " - "directory with name heat_map.png and timeline.png " - "accordingly." - ) - if self.binary: - msg += ( - "\nThe hottest %d pages inside and outside hugepage " - "is symbolized and saved to addr2symbol.txt" % top_n_pages - ) - if self.logger: - self.logger.LogOutput(msg) - else: - print(msg) - - -def main(argv): - """Parse the options. - - Args: - argv: The options with which this script was invoked. - - Returns: - 0 unless an exception is raised. - """ - parser = argparse.ArgumentParser() - - parser.add_argument( - "--chromeos_root", - dest="chromeos_root", - required=True, - help="ChromeOS root to use for generate heatmaps.", - ) - parser.add_argument( - "--perf_data", - dest="perf_data", - required=True, - help="The raw perf data. Must be collected with -e instructions while " - "disabling ASLR.", - ) - parser.add_argument( - "--binary", - dest="binary", - help="The path to the Chrome binary. Only useful if want to print " - "symbols on hottest pages", - default=None, - ) - parser.add_argument( - "--top_n", - dest="top_n", - type=int, - default=10, - help="Print out top N hottest pages within/outside huge page range. " - "Must be used with --hugepage and --binary. (Default: %(default)s)", - ) - parser.add_argument( - "--title", dest="title", help="Title of the heatmap", default="" - ) - parser.add_argument( - "--hugepage", - dest="hugepage", - help="A range of addresses (start,end) where huge page starts and ends" - " in text section, separated by a comma." - " Used to differentiate regions in heatmap." - " Example: --hugepage=0,4096" - " If not specified, no effect on the heatmap.", - default=None, - ) - - options = parser.parse_args(argv) - - if not IsARepoRoot(options.chromeos_root): - parser.error("%s does not contain .repo dir." % options.chromeos_root) - - if not os.path.isfile(options.perf_data): - parser.error("Cannot find perf_data: %s." % options.perf_data) - - hugepage_range = None - if options.hugepage: - hugepage_range = options.hugepage.split(",") - if len(hugepage_range) != 2 or int(hugepage_range[0]) > int( - hugepage_range[1] - ): - parser.error( - "Wrong format of hugepage range: %s" % options.hugepage - ) - hugepage_range = [int(x) for x in hugepage_range] - - heatmap_producer = HeatMapProducer( - options.chromeos_root, - options.perf_data, - hugepage_range, - options.binary, - options.title, - ) - - heatmap_producer.Run(options.top_n) - - -if __name__ == "__main__": - sys.exit(main(sys.argv[1:])) diff --git a/heatmaps/heat_map_test.py b/heatmaps/heat_map_test.py deleted file mode 100755 index 96300bb4..00000000 --- a/heatmaps/heat_map_test.py +++ /dev/null @@ -1,179 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# -# 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. - -"""Tests for heat_map.py.""" - - -import os -import unittest -import unittest.mock as mock - -from cros_utils import command_executer -from heatmaps import heat_map -from heatmaps import heatmap_generator - - -def make_heatmap( - chromeos_root="/path/to/fake/chromeos_root/", - perf_data="/any_path/perf.data", -): - return heat_map.HeatMapProducer(chromeos_root, perf_data, None, None, "") - - -def fake_mkdtemp(prefix): - """Mock tempfile.mkdtemp() by just create a pathname.""" - return prefix + "random_dir" - - -def fake_parser_error(_, msg): - """Redirect parser.error() to exception.""" - raise Exception(msg) - - -def fake_generate_perf_report_exception(_): - raise Exception - - -class HeatmapTest(unittest.TestCase): - """All of our tests for heat_map.""" - - # pylint: disable=protected-access - @mock.patch("shutil.copy2") - @mock.patch("tempfile.mkdtemp") - def test_EnsureFileInChrootAlreadyInside(self, mock_mkdtemp, mock_copy): - perf_data_inchroot = ( - "/path/to/fake/chromeos_root/chroot/inchroot_path/perf.data" - ) - heatmap = make_heatmap(perf_data=perf_data_inchroot) - heatmap._EnsureFileInChroot() - self.assertFalse(heatmap.temp_dir_created) - self.assertEqual( - heatmap.temp_dir, - "/path/to/fake/chromeos_root/chroot/inchroot_path/", - ) - self.assertEqual(heatmap.temp_perf_inchroot, "/inchroot_path/") - mock_mkdtemp.assert_not_called() - mock_copy.assert_not_called() - - @mock.patch("shutil.copy2") - @mock.patch("tempfile.mkdtemp", fake_mkdtemp) - def test_EnsureFileInChrootOutsideNeedCopy(self, mock_copy): - heatmap = make_heatmap() - heatmap._EnsureFileInChroot() - self.assertTrue(heatmap.temp_dir_created) - self.assertEqual(mock_copy.call_count, 1) - self.assertEqual( - heatmap.temp_dir, "/path/to/fake/chromeos_root/src/random_dir" - ) - self.assertEqual(heatmap.temp_perf_inchroot, "~/trunk/src/random_dir") - - @mock.patch.object(command_executer.CommandExecuter, "ChrootRunCommand") - def test_GeneratePerfReport(self, mock_ChrootRunCommand): - heatmap = make_heatmap() - heatmap.temp_dir = "/fake/chroot/inchroot_path/" - heatmap.temp_perf_inchroot = "/inchroot_path/" - mock_ChrootRunCommand.return_value = 0 - heatmap._GeneratePerfReport() - cmd = ( - "cd %s && perf report -D -i perf.data > perf_report.txt" - % heatmap.temp_perf_inchroot - ) - mock_ChrootRunCommand.assert_called_with(heatmap.chromeos_root, cmd) - self.assertEqual(mock_ChrootRunCommand.call_count, 1) - self.assertEqual( - heatmap.perf_report, "/fake/chroot/inchroot_path/perf_report.txt" - ) - - @mock.patch.object(heatmap_generator, "HeatmapGenerator") - def test_GetHeatMap(self, mock_heatmap_generator): - heatmap = make_heatmap() - heatmap._GetHeatMap(10) - self.assertTrue(mock_heatmap_generator.called) - - @mock.patch.object(heat_map.HeatMapProducer, "_EnsureFileInChroot") - @mock.patch.object(heat_map.HeatMapProducer, "_GeneratePerfReport") - @mock.patch.object(heat_map.HeatMapProducer, "_GetHeatMap") - @mock.patch.object(heat_map.HeatMapProducer, "_RemoveFiles") - def test_Run( - self, - mock_remove_files, - mock_get_heatmap, - mock_generate_perf_report, - mock_ensure_file_in_chroot, - ): - heatmap = make_heatmap() - heatmap.Run(10) - mock_ensure_file_in_chroot.assert_called_once_with() - mock_generate_perf_report.assert_called_once_with() - mock_get_heatmap.assert_called_once_with(10) - mock_remove_files.assert_called_once_with() - - @mock.patch.object(heat_map.HeatMapProducer, "_EnsureFileInChroot") - @mock.patch.object( - heat_map.HeatMapProducer, - "_GeneratePerfReport", - new=fake_generate_perf_report_exception, - ) - @mock.patch.object(heat_map.HeatMapProducer, "_GetHeatMap") - @mock.patch.object(heat_map.HeatMapProducer, "_RemoveFiles") - @mock.patch("builtins.print") - def test_Run_with_exception( - self, - mock_print, - mock_remove_files, - mock_get_heatmap, - mock_ensure_file_in_chroot, - ): - heatmap = make_heatmap() - with self.assertRaises(Exception): - heatmap.Run(10) - mock_ensure_file_in_chroot.assert_called_once_with() - mock_get_heatmap.assert_not_called() - mock_remove_files.assert_called_once_with() - mock_print.assert_not_called() - - @mock.patch("argparse.ArgumentParser.error", fake_parser_error) - @mock.patch.object(os.path, "isfile") - @mock.patch.object(heat_map, "IsARepoRoot") - def test_main_arg_format(self, mock_IsARepoRoot, mock_isfile): - """Test wrong arg format are detected.""" - args = [ - "--chromeos_root=/fake/chroot/", - "--perf_data=/path/to/perf.data", - ] - - # Test --chromeos_root format - mock_IsARepoRoot.return_value = False - with self.assertRaises(Exception) as msg: - heat_map.main(args) - self.assertIn("does not contain .repo dir.", str(msg.exception)) - - # Test --perf_data format - mock_IsARepoRoot.return_value = True - mock_isfile.return_value = False - with self.assertRaises(Exception) as msg: - heat_map.main(args) - self.assertIn("Cannot find perf_data", str(msg.exception)) - - # Test --hugepage format - mock_isfile.return_value = True - args.append("--hugepage=0") - with self.assertRaises(Exception) as msg: - heat_map.main(args) - self.assertIn("Wrong format of hugepage range", str(msg.exception)) - - # Test --hugepage parse - args[-1] = "--hugepage=0,4096" - heat_map.HeatMapProducer = mock.MagicMock() - heat_map.main(args) - heat_map.HeatMapProducer.assert_called_with( - "/fake/chroot/", "/path/to/perf.data", [0, 4096], None, "" - ) - - -if __name__ == "__main__": - unittest.main() diff --git a/heatmaps/heatmap_generator.py b/heatmaps/heatmap_generator.py deleted file mode 100644 index 703c37d4..00000000 --- a/heatmaps/heatmap_generator.py +++ /dev/null @@ -1,524 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2018 The ChromiumOS Authors -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Python module to draw heat map for Chrome - -heat map is a histogram used to analyze the locality of function layout. - -This module is used by heat_map.py. HeatmapGenerator is a class to -generate data for drawing heat maps (the actual drawing of heat maps is -performed by another script perf-to-inst-page.sh). It can also analyze -the symbol names in hot pages. -""" - - -import bisect -import collections -import os -import pipes -import subprocess - -from cros_utils import command_executer - - -HugepageRange = collections.namedtuple("HugepageRange", ["start", "end"]) - - -class MMap(object): - """Class to store mmap information in perf report. - - We assume ASLR is disabled, so MMap for all Chrome is assumed to be - the same. This class deals with the case hugepage creates several - mmaps for Chrome but should be merged together. In these case, we - assume the first MMAP is not affected by the bug and use the MMAP. - """ - - def __init__(self, addr, size, offset): - self.start_address = addr - self.size = size - self.offset = offset - - def __str__(self): - return "(%x, %x, %x)" % (self.start_address, self.size, self.offset) - - def merge(self, mmap): - # This function should not be needed, since we should only have - # one MMAP on Chrome of each process. This function only deals with - # images that is affected by http://crbug.com/931465. - - # This function is only checking a few conditions to make sure - # the bug is within our expectation. - - if self.start_address == mmap.start_address: - assert ( - self.size >= mmap.size - ), "Original MMAP size(%x) is smaller than the forked process(%x)." % ( - self.size, - mmap.size, - ) - # The case that the MMAP is forked from the previous process - # No need to do anything, OR - # The case where hugepage causes a small Chrome mmap. - # In this case, we use the prior MMAP for the whole Chrome - return - - assert self.start_address < mmap.start_address, ( - "Original MMAP starting address(%x) is larger than the forked" - "process(%x)." % (self.start_address, mmap.start_address) - ) - - assert ( - self.start_address + self.size >= mmap.start_address + mmap.size - ), "MMAP of the forked process exceeds the end of original MMAP." - - -class HeatmapGenerator(object): - """Class to generate heat map with a perf report, containing mmaps and - - samples. This class contains two interfaces with other modules: - draw() and analyze(). - - draw() draws a heatmap with the sample information given in the perf report - analyze() prints out the symbol names in hottest pages with the given - chrome binary - """ - - def __init__( - self, perf_report, page_size, hugepage, title, log_level="verbose" - ): - self.perf_report = perf_report - # Pick 1G as a relatively large number. All addresses less than it will - # be recorded. The actual heatmap will show up to a boundary of the - # largest address in text segment. - self.max_addr = 1024 * 1024 * 1024 - self.ce = command_executer.GetCommandExecuter(log_level=log_level) - self.dir = os.path.dirname(os.path.realpath(__file__)) - with open(perf_report, "r", encoding="utf-8") as f: - self.perf_report_contents = f.readlines() - # Write histogram results to a text file, in order to use gnu plot to draw - self.hist_temp_output = open("out.txt", "w", encoding="utf-8") - self.processes = {} - self.deleted_processes = {} - self.count = 0 - if hugepage: - self.hugepage = HugepageRange(start=hugepage[0], end=hugepage[1]) - else: - self.hugepage = None - self.title = title - self.symbol_addresses = [] - self.symbol_names = [] - self.page_size = page_size - - def _parse_perf_sample(self, line): - # In a perf report, generated with -D, a PERF_RECORD_SAMPLE command should - # look like this: TODO: some arguments are unknown - # - # cpuid cycle unknown [unknown]: PERF_RECORD_SAMPLE(IP, 0x2): pid/tid: - # 0xaddr period: period addr: addr - # ... thread: threadname:tid - # ...... dso: process - # - # This is an example: - # 1 136712833349 0x6a558 [0x30]: PERF_RECORD_SAMPLE(IP, 0x2): 5227/5227: - # 0x55555683b810 period: 372151 addr: 0 - # ... thread: chrome:5227 - # ...... dso: /opt/google/chrome/chrome - # - # For this function, the 7th argument (args[6]) after spltting with spaces - # is pid/tid. We use the combination of the two as the pid. - # Also, we add an assertion here to check the tid in the 7th argument( - # args[6]) and the 15th argument(arg[14]) are the same - # - # The function returns the ((pid,tid), address) pair if the sampling - # is on Chrome. Otherwise, return (None, None) pair. - - if ( - "thread: chrome" not in line - or "dso: /opt/google/chrome/chrome" not in line - ): - return None, None - args = line.split(" ") - pid_raw = args[6].split("/") - assert ( - pid_raw[1][:-1] == args[14].split(":")[1][:-1] - ), "TID in %s of sample is not the same: %s/%s" % ( - line[:-1], - pid_raw[1][:-1], - args[14].split(":")[1][:-1], - ) - key = (int(pid_raw[0]), int(pid_raw[1][:-1])) - address = int(args[7], base=16) - return key, address - - def _parse_perf_record(self, line): - # In a perf report, generated with -D, a PERF_RECORD_MMAP2 command should - # look like this: TODO: some arguments are unknown - # - # cpuid cycle unknown [unknown]: PERF_RECORD_MMAP2 pid/tid: - # [0xaddr(0xlength) @ pageoffset maj:min ino ino_generation]: - # permission process - # - # This is an example. - # 2 136690556823 0xa6898 [0x80]: PERF_RECORD_MMAP2 5227/5227: - # [0x555556496000(0x8d1b000) @ 0xf42000 b3:03 92844 1892514370]: - # r-xp /opt/google/chrome/chrome - # - # For this function, the 6th argument (args[5]) after spltting with spaces - # is pid/tid. We use the combination of the two as the pid. - # The 7th argument (args[6]) is the [0xaddr(0xlength). We can peel the - # string to get the address and size of the mmap. - # The 9th argument (args[8]) is the page offset. - # The function returns the ((pid,tid), mmap) pair if the mmap is for Chrome - # is on Chrome. Otherwise, return (None, None) pair. - - if "chrome/chrome" not in line: - return None, None - args = line.split(" ") - pid_raw = args[5].split("/") - assert ( - pid_raw[0] == pid_raw[1][:-1] - ), "PID in %s of mmap is not the same: %s/%s" % ( - line[:-1], - pid_raw[0], - pid_raw[1], - ) - pid = (int(pid_raw[0]), int(pid_raw[1][:-1])) - address_raw = args[6].split("(") - start_address = int(address_raw[0][1:], base=16) - size = int(address_raw[1][:-1], base=16) - offset = int(args[8], base=16) - # Return an mmap object instead of only starting address, - # in case there are many mmaps for the sample PID - return pid, MMap(start_address, size, offset) - - def _parse_pair_event(self, arg): - # This function is called by the _parse_* functions that has a pattern of - # pids like: (pid:tid):(pid:tid), i.e. - # PERF_RECORD_FORK and PERF_RECORD_COMM - _, remain = arg.split("(", 1) - pid1, remain = remain.split(":", 1) - pid2, remain = remain.split(")", 1) - _, remain = remain.split("(", 1) - pid3, remain = remain.split(":", 1) - pid4, remain = remain.split(")", 1) - return (int(pid1), int(pid2)), (int(pid3), int(pid4)) - - def _process_perf_record(self, line): - # This function calls _parse_perf_record() to get information from - # PERF_RECORD_MMAP2. It records the mmap object for each pid (a pair of - # pid,tid), into a dictionary. - pid, mmap = self._parse_perf_record(line) - if pid is None: - # PID = None meaning the mmap is not for chrome - return - if pid in self.processes: - # This should never happen for a correct profiling result, as we - # should only have one MMAP for Chrome for each process. - # If it happens, see http://crbug.com/931465 - self.processes[pid].merge(mmap) - else: - self.processes[pid] = mmap - - def _process_perf_fork(self, line): - # In a perf report, generated with -D, a PERF_RECORD_FORK command should - # look like this: - # - # cpuid cycle unknown [unknown]: - # PERF_RECORD_FORK(pid_to:tid_to):(pid_from:tid_from) - # - # This is an example. - # 0 0 0x22a8 [0x38]: PERF_RECORD_FORK(1:1):(0:0) - # - # In this function, we need to peel the information of pid:tid pairs - # So we get the last argument and send it to function _parse_pair_event() - # for analysis. - # We use (pid, tid) as the pid. - args = line.split(" ") - pid_to, pid_from = self._parse_pair_event(args[-1]) - if pid_from in self.processes: - assert pid_to not in self.processes - self.processes[pid_to] = MMap( - self.processes[pid_from].start_address, - self.processes[pid_from].size, - self.processes[pid_from].offset, - ) - - def _process_perf_exit(self, line): - # In a perf report, generated with -D, a PERF_RECORD_EXIT command should - # look like this: - # - # cpuid cycle unknown [unknown]: - # PERF_RECORD_EXIT(pid1:tid1):(pid2:tid2) - # - # This is an example. - # 1 136082505621 0x30810 [0x38]: PERF_RECORD_EXIT(3851:3851):(3851:3851) - # - # In this function, we need to peel the information of pid:tid pairs - # So we get the last argument and send it to function _parse_pair_event() - # for analysis. - # We use (pid, tid) as the pid. - args = line.split(" ") - pid_to, pid_from = self._parse_pair_event(args[-1]) - assert pid_to == pid_from, "(%d, %d) (%d, %d)" % ( - pid_to[0], - pid_to[1], - pid_from[0], - pid_from[1], - ) - if pid_to in self.processes: - # Don't delete the process yet - self.deleted_processes[pid_from] = self.processes[pid_from] - - def _process_perf_sample(self, line): - # This function calls _parse_perf_sample() to get information from - # the perf report. - # It needs to check the starting address of allocated mmap from - # the dictionary (self.processes) to calculate the offset within - # the text section of the sampling. - # The offset is calculated into pages (4KB or 2MB) and writes into - # out.txt together with the total counts, which will be used to - # calculate histogram. - pid, addr = self._parse_perf_sample(line) - if pid is None: - return - - assert ( - pid in self.processes and pid not in self.deleted_processes - ), "PID %d not found mmap and not forked from another process" - - start_address = self.processes[pid].start_address - address = addr - start_address - assert ( - address >= 0 - and "addresses accessed in PERF_RECORD_SAMPLE should be larger than" - " the starting address of Chrome" - ) - if address < self.max_addr: - self.count += 1 - line = "%d/%d: %d %d" % ( - pid[0], - pid[1], - self.count, - address // self.page_size * self.page_size, - ) - if self.hugepage: - if self.hugepage.start <= address < self.hugepage.end: - line += " hugepage" - else: - line += " smallpage" - print(line, file=self.hist_temp_output) - - def _read_perf_report(self): - # Serve as main function to read perf report, generated by -D - lines = iter(self.perf_report_contents) - for line in lines: - if "PERF_RECORD_MMAP" in line: - self._process_perf_record(line) - elif "PERF_RECORD_FORK" in line: - self._process_perf_fork(line) - elif "PERF_RECORD_EXIT" in line: - self._process_perf_exit(line) - elif "PERF_RECORD_SAMPLE" in line: - # Perf sample is multi-line - self._process_perf_sample(line + next(lines) + next(lines)) - self.hist_temp_output.close() - - def _draw_heat_map(self): - # Calls a script (perf-to-inst-page.sh) to calculate histogram - # of results written in out.txt and also generate pngs for - # heat maps. - heatmap_script = os.path.join(self.dir, "perf-to-inst-page.sh") - if self.hugepage: - hp_arg = "hugepage" - else: - hp_arg = "none" - - cmd = "{0} {1} {2}".format( - heatmap_script, pipes.quote(self.title), hp_arg - ) - retval = self.ce.RunCommand(cmd) - if retval: - raise RuntimeError("Failed to run script to generate heatmap") - - def _restore_histogram(self): - # When hugepage is used, there are two files inst-histo-{hp,sp}.txt - # So we need to read in all the files. - names = [ - x for x in os.listdir(".") if "inst-histo" in x and ".txt" in x - ] - hist = {} - for n in names: - with open(n, encoding="utf-8") as f: - for l in f.readlines(): - num, addr = l.strip().split(" ") - assert int(addr) not in hist - hist[int(addr)] = int(num) - return hist - - def _read_symbols_from_binary(self, binary): - # FIXME: We are using nm to read symbol names from Chrome binary - # for now. Can we get perf to hand us symbol names, instead of - # using nm in the future? - # - # Get all the symbols (and their starting addresses) that fall into - # the page. Will be used to print out information of hot pages - # Each line shows the information of a symbol: - # [symbol value (0xaddr)] [symbol type] [symbol name] - # For some symbols, the [symbol name] field might be missing. - # e.g. - # 0000000001129da0 t Builtins_LdaNamedPropertyHandler - - # Generate a list of symbols from nm tool and check each line - # to extract symbols names - text_section_start = 0 - for l in subprocess.check_output(["nm", "-n", binary]).split("\n"): - args = l.strip().split(" ") - if len(args) < 3: - # No name field - continue - addr_raw, symbol_type, name = args - addr = int(addr_raw, base=16) - if "t" not in symbol_type and "T" not in symbol_type: - # Filter out symbols not in text sections - continue - if not self.symbol_addresses: - # The first symbol in text sections - text_section_start = addr - self.symbol_addresses.append(0) - self.symbol_names.append(name) - else: - assert ( - text_section_start != 0 - ), "The starting address of text section has not been found" - if addr == self.symbol_addresses[-1]: - # if the same address has multiple symbols, put them together - # and separate symbol names with '/' - self.symbol_names[-1] += "/" + name - else: - # The output of nm -n command is already sorted by address - # Insert to the end will result in a sorted array for bisect - self.symbol_addresses.append(addr - text_section_start) - self.symbol_names.append(name) - - def _map_addr_to_symbol(self, addr): - # Find out the symbol name - assert self.symbol_addresses - index = bisect.bisect(self.symbol_addresses, addr) - assert ( - 0 < index <= len(self.symbol_names) - ), "Failed to find an index (%d) in the list (len=%d)" % ( - index, - len(self.symbol_names), - ) - return self.symbol_names[index - 1] - - def _print_symbols_in_hot_pages(self, fp, pages_to_show): - # Print symbols in all the pages of interest - for page_num, sample_num in pages_to_show: - print( - "----------------------------------------------------------", - file=fp, - ) - print( - "Page Offset: %d MB, Count: %d" - % (page_num // 1024 // 1024, sample_num), - file=fp, - ) - - symbol_counts = collections.Counter() - # Read Sample File and find out the occurance of symbols in the page - lines = iter(self.perf_report_contents) - for line in lines: - if "PERF_RECORD_SAMPLE" in line: - pid, addr = self._parse_perf_sample( - line + next(lines) + next(lines) - ) - if pid is None: - # The sampling is not on Chrome - continue - if ( - addr // self.page_size - != (self.processes[pid].start_address + page_num) - // self.page_size - ): - # Sampling not in the current page - continue - - name = self._map_addr_to_symbol( - addr - self.processes[pid].start_address - ) - assert name, "Failed to find symbol name of addr %x" % addr - symbol_counts[name] += 1 - - assert ( - sum(symbol_counts.values()) == sample_num - ), "Symbol name matching missing for some addresses: %d vs %d" % ( - sum(symbol_counts.values()), - sample_num, - ) - - # Print out the symbol names sorted by the number of samples in - # the page - for name, count in sorted( - symbol_counts.items(), key=lambda kv: kv[1], reverse=True - ): - if count == 0: - break - print("> %s : %d" % (name, count), file=fp) - print("\n\n", file=fp) - - def draw(self): - # First read perf report to process information and save histogram - # into a text file - self._read_perf_report() - # Then use gnu plot to draw heat map - self._draw_heat_map() - - def analyze(self, binary, top_n): - # Read histogram from histo.txt - hist = self._restore_histogram() - # Sort the pages in histogram - sorted_hist = sorted( - hist.items(), key=lambda value: value[1], reverse=True - ) - - # Generate symbolizations - self._read_symbols_from_binary(binary) - - # Write hottest pages - with open("addr2symbol.txt", "w", encoding="utf-8") as fp: - if self.hugepage: - # Print hugepage region first - print( - "Hugepage top %d hot pages (%d MB - %d MB):" - % ( - top_n, - self.hugepage.start // 1024 // 1024, - self.hugepage.end // 1024 // 1024, - ), - file=fp, - ) - pages_to_print = [ - (k, v) - for k, v in sorted_hist - if self.hugepage.start <= k < self.hugepage.end - ][:top_n] - self._print_symbols_in_hot_pages(fp, pages_to_print) - print("==========================================", file=fp) - print( - "Top %d hot pages landed outside of hugepage:" % top_n, - file=fp, - ) - # Then print outside pages - pages_to_print = [ - (k, v) - for k, v in sorted_hist - if k < self.hugepage.start or k >= self.hugepage.end - ][:top_n] - self._print_symbols_in_hot_pages(fp, pages_to_print) - else: - # Print top_n hottest pages. - pages_to_print = sorted_hist[:top_n] - self._print_symbols_in_hot_pages(fp, pages_to_print) diff --git a/heatmaps/heatmap_generator_test.py b/heatmaps/heatmap_generator_test.py deleted file mode 100755 index 898c7370..00000000 --- a/heatmaps/heatmap_generator_test.py +++ /dev/null @@ -1,326 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright 2018 The ChromiumOS Authors -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Tests for heatmap_generator.py.""" - - -import os -import unittest -import unittest.mock as mock - -from heatmaps import heatmap_generator - - -def _write_perf_mmap(pid, tid, addr, size, fp): - print( - "0 0 0 0 PERF_RECORD_MMAP2 %d/%d: " - "[%x(%x) @ 0x0 0:0 0 0] " - "r-xp /opt/google/chrome/chrome\n" % (pid, tid, addr, size), - file=fp, - ) - - -def _write_perf_fork(pid_from, tid_from, pid_to, tid_to, fp): - print( - "0 0 0 0 PERF_RECORD_FORK(%d:%d):(%d:%d)\n" - % (pid_to, tid_to, pid_from, tid_from), - file=fp, - ) - - -def _write_perf_exit(pid_from, tid_from, pid_to, tid_to, fp): - print( - "0 0 0 0 PERF_RECORD_EXIT(%d:%d):(%d:%d)\n" - % (pid_to, tid_to, pid_from, tid_from), - file=fp, - ) - - -def _write_perf_sample(pid, tid, addr, fp): - print( - "0 0 0 0 PERF_RECORD_SAMPLE(IP, 0x2): " - "%d/%d: %x period: 100000 addr: 0" % (pid, tid, addr), - file=fp, - ) - print(" ... thread: chrome:%d" % tid, file=fp) - print(" ...... dso: /opt/google/chrome/chrome\n", file=fp) - - -def _heatmap(file_name, page_size=4096, hugepage=None, analyze=False, top_n=10): - generator = heatmap_generator.HeatmapGenerator( - file_name, page_size, hugepage, "", log_level="none" - ) # Don't log to stdout - generator.draw() - if analyze: - generator.analyze("/path/to/chrome", top_n) - - -def _cleanup(file_name): - files = [ - file_name, - "out.txt", - "inst-histo.txt", - "inst-histo-hp.txt", - "inst-histo-sp.txt", - "heat_map.png", - "timeline.png", - "addr2symbol.txt", - ] - for f in files: - if os.path.exists(f): - os.remove(f) - - -class HeatmapGeneratorDrawTests(unittest.TestCase): - """All of our tests for heatmap_generator.draw() and related.""" - - def test_with_one_mmap_one_sample(self): - """Tests one perf record and one sample.""" - fname = "test.txt" - with open(fname, "w") as f: - _write_perf_mmap(101, 101, 0xABCD000, 0x100, f) - _write_perf_sample(101, 101, 0xABCD101, f) - self.addCleanup(_cleanup, fname) - _heatmap(fname) - self.assertIn("out.txt", os.listdir(".")) - with open("out.txt") as f: - lines = f.readlines() - self.assertEqual(len(lines), 1) - self.assertIn("101/101: 1 0", lines[0]) - - def test_with_one_mmap_multiple_samples(self): - """Tests one perf record and three samples.""" - fname = "test.txt" - with open(fname, "w") as f: - _write_perf_mmap(101, 101, 0xABCD000, 0x100, f) - _write_perf_sample(101, 101, 0xABCD101, f) - _write_perf_sample(101, 101, 0xABCD102, f) - _write_perf_sample(101, 101, 0xABCE102, f) - self.addCleanup(_cleanup, fname) - _heatmap(fname) - self.assertIn("out.txt", os.listdir(".")) - with open("out.txt") as f: - lines = f.readlines() - self.assertEqual(len(lines), 3) - self.assertIn("101/101: 1 0", lines[0]) - self.assertIn("101/101: 2 0", lines[1]) - self.assertIn("101/101: 3 4096", lines[2]) - - def test_with_fork_and_exit(self): - """Tests perf fork and perf exit.""" - fname = "test_fork.txt" - with open(fname, "w") as f: - _write_perf_mmap(101, 101, 0xABCD000, 0x100, f) - _write_perf_fork(101, 101, 202, 202, f) - _write_perf_sample(101, 101, 0xABCD101, f) - _write_perf_sample(202, 202, 0xABCE101, f) - _write_perf_exit(202, 202, 202, 202, f) - self.addCleanup(_cleanup, fname) - _heatmap(fname) - self.assertIn("out.txt", os.listdir(".")) - with open("out.txt") as f: - lines = f.readlines() - self.assertEqual(len(lines), 2) - self.assertIn("101/101: 1 0", lines[0]) - self.assertIn("202/202: 2 4096", lines[1]) - - def test_hugepage_creates_two_chrome_mmaps(self): - """Test two chrome mmaps for the same process.""" - fname = "test_hugepage.txt" - with open(fname, "w") as f: - _write_perf_mmap(101, 101, 0xABCD000, 0x1000, f) - _write_perf_fork(101, 101, 202, 202, f) - _write_perf_mmap(202, 202, 0xABCD000, 0x100, f) - _write_perf_mmap(202, 202, 0xABCD300, 0xD00, f) - _write_perf_sample(101, 101, 0xABCD102, f) - _write_perf_sample(202, 202, 0xABCD102, f) - self.addCleanup(_cleanup, fname) - _heatmap(fname) - self.assertIn("out.txt", os.listdir(".")) - with open("out.txt") as f: - lines = f.readlines() - self.assertEqual(len(lines), 2) - self.assertIn("101/101: 1 0", lines[0]) - self.assertIn("202/202: 2 0", lines[1]) - - def test_hugepage_creates_two_chrome_mmaps_fail(self): - """Test two chrome mmaps for the same process.""" - fname = "test_hugepage.txt" - # Cases where first_mmap.size < second_mmap.size - with open(fname, "w") as f: - _write_perf_mmap(101, 101, 0xABCD000, 0x1000, f) - _write_perf_fork(101, 101, 202, 202, f) - _write_perf_mmap(202, 202, 0xABCD000, 0x10000, f) - self.addCleanup(_cleanup, fname) - with self.assertRaises(AssertionError) as msg: - _heatmap(fname) - self.assertIn("Original MMAP size", str(msg.exception)) - - # Cases where first_mmap.address > second_mmap.address - with open(fname, "w") as f: - _write_perf_mmap(101, 101, 0xABCD000, 0x1000, f) - _write_perf_fork(101, 101, 202, 202, f) - _write_perf_mmap(202, 202, 0xABCC000, 0x10000, f) - with self.assertRaises(AssertionError) as msg: - _heatmap(fname) - self.assertIn("Original MMAP starting address", str(msg.exception)) - - # Cases where first_mmap.address + size < - # second_mmap.address + second_mmap.size - with open(fname, "w") as f: - _write_perf_mmap(101, 101, 0xABCD000, 0x1000, f) - _write_perf_fork(101, 101, 202, 202, f) - _write_perf_mmap(202, 202, 0xABCD100, 0x10000, f) - with self.assertRaises(AssertionError) as msg: - _heatmap(fname) - self.assertIn("exceeds the end of original MMAP", str(msg.exception)) - - def test_histogram(self): - """Tests if the tool can generate correct histogram. - - In the tool, histogram is generated from statistics - of perf samples (saved to out.txt). The histogram is - generated by perf-to-inst-page.sh and saved to - inst-histo.txt. It will be used to draw heat maps. - """ - fname = "test_histo.txt" - with open(fname, "w") as f: - _write_perf_mmap(101, 101, 0xABCD000, 0x100, f) - for i in range(100): - _write_perf_sample(101, 101, 0xABCD000 + i, f) - _write_perf_sample(101, 101, 0xABCE000 + i, f) - _write_perf_sample(101, 101, 0xABFD000 + i, f) - _write_perf_sample(101, 101, 0xAFCD000 + i, f) - self.addCleanup(_cleanup, fname) - _heatmap(fname) - self.assertIn("inst-histo.txt", os.listdir(".")) - with open("inst-histo.txt") as f: - lines = f.readlines() - self.assertEqual(len(lines), 4) - self.assertIn("100 0", lines[0]) - self.assertIn("100 4096", lines[1]) - self.assertIn("100 196608", lines[2]) - self.assertIn("100 4194304", lines[3]) - - def test_histogram_two_mb_page(self): - """Tests handling of 2MB page.""" - fname = "test_histo.txt" - with open(fname, "w") as f: - _write_perf_mmap(101, 101, 0xABCD000, 0x100, f) - for i in range(100): - _write_perf_sample(101, 101, 0xABCD000 + i, f) - _write_perf_sample(101, 101, 0xABCE000 + i, f) - _write_perf_sample(101, 101, 0xABFD000 + i, f) - _write_perf_sample(101, 101, 0xAFCD000 + i, f) - self.addCleanup(_cleanup, fname) - _heatmap(fname, page_size=2 * 1024 * 1024) - self.assertIn("inst-histo.txt", os.listdir(".")) - with open("inst-histo.txt") as f: - lines = f.readlines() - self.assertEqual(len(lines), 2) - self.assertIn("300 0", lines[0]) - self.assertIn("100 4194304", lines[1]) - - def test_histogram_in_and_out_hugepage(self): - """Tests handling the case of separating samples in and out huge page.""" - fname = "test_histo.txt" - with open(fname, "w") as f: - _write_perf_mmap(101, 101, 0xABCD000, 0x100, f) - for i in range(100): - _write_perf_sample(101, 101, 0xABCD000 + i, f) - _write_perf_sample(101, 101, 0xABCE000 + i, f) - _write_perf_sample(101, 101, 0xABFD000 + i, f) - _write_perf_sample(101, 101, 0xAFCD000 + i, f) - self.addCleanup(_cleanup, fname) - _heatmap(fname, hugepage=[0, 8192]) - file_list = os.listdir(".") - self.assertNotIn("inst-histo.txt", file_list) - self.assertIn("inst-histo-hp.txt", file_list) - self.assertIn("inst-histo-sp.txt", file_list) - with open("inst-histo-hp.txt") as f: - lines = f.readlines() - self.assertEqual(len(lines), 2) - self.assertIn("100 0", lines[0]) - self.assertIn("100 4096", lines[1]) - with open("inst-histo-sp.txt") as f: - lines = f.readlines() - self.assertEqual(len(lines), 2) - self.assertIn("100 196608", lines[0]) - self.assertIn("100 4194304", lines[1]) - - -class HeatmapGeneratorAnalyzeTests(unittest.TestCase): - """All of our tests for heatmap_generator.analyze() and related.""" - - def setUp(self): - # Use the same perf report for testing - self.fname = "test_histo.txt" - with open(self.fname, "w") as f: - _write_perf_mmap(101, 101, 0xABCD000, 0x100, f) - for i in range(10): - _write_perf_sample(101, 101, 0xABCD000 + i, f) - _write_perf_sample(101, 101, 0xABCE000 + i, f) - _write_perf_sample(101, 101, 0xABFD000 + i, f) - self.nm = ( - "000000000abcd000 t Func1@Page1\n" - "000000000abcd001 t Func2@Page1\n" - "000000000abcd0a0 t Func3@Page1andFunc1@Page2\n" - "000000000abce010 t Func2@Page2\n" - "000000000abfd000 t Func1@Page3\n" - ) - - def tearDown(self): - _cleanup(self.fname) - - @mock.patch("subprocess.check_output") - def test_analyze_hot_pages_with_hp_top(self, mock_nm): - """Test if the analyze() can print the top page with hugepage.""" - mock_nm.return_value = self.nm - _heatmap(self.fname, hugepage=[0, 8192], analyze=True, top_n=1) - file_list = os.listdir(".") - self.assertIn("addr2symbol.txt", file_list) - with open("addr2symbol.txt") as f: - contents = f.read() - self.assertIn("Func2@Page1 : 9", contents) - self.assertIn("Func1@Page1 : 1", contents) - self.assertIn("Func1@Page3 : 10", contents) - # Only displaying one page in hugepage - self.assertNotIn("Func3@Page1andFunc1@Page2 : 10", contents) - - @mock.patch("subprocess.check_output") - def test_analyze_hot_pages_without_hp_top(self, mock_nm): - """Test if the analyze() can print the top page without hugepage.""" - mock_nm.return_value = self.nm - _heatmap(self.fname, analyze=True, top_n=1) - file_list = os.listdir(".") - self.assertIn("addr2symbol.txt", file_list) - with open("addr2symbol.txt") as f: - contents = f.read() - self.assertIn("Func2@Page1 : 9", contents) - self.assertIn("Func1@Page1 : 1", contents) - # Only displaying one page - self.assertNotIn("Func3@Page1andFunc1@Page2 : 10", contents) - self.assertNotIn("Func1@Page3 : 10", contents) - - @mock.patch("subprocess.check_output") - def test_analyze_hot_pages_with_hp_top10(self, mock_nm): - """Test if the analyze() can print with default top 10.""" - mock_nm.return_value = self.nm - _heatmap(self.fname, analyze=True) - # Make sure nm command is called correctly. - mock_nm.assert_called_with(["nm", "-n", "/path/to/chrome"]) - file_list = os.listdir(".") - self.assertIn("addr2symbol.txt", file_list) - with open("addr2symbol.txt") as f: - contents = f.read() - self.assertIn("Func2@Page1 : 9", contents) - self.assertIn("Func1@Page1 : 1", contents) - self.assertIn("Func3@Page1andFunc1@Page2 : 10", contents) - self.assertIn("Func1@Page3 : 10", contents) - - -if __name__ == "__main__": - unittest.main() diff --git a/heatmaps/perf-to-inst-page.sh b/heatmaps/perf-to-inst-page.sh deleted file mode 100755 index 5be1a2b9..00000000 --- a/heatmaps/perf-to-inst-page.sh +++ /dev/null @@ -1,68 +0,0 @@ -#! /bin/bash -u -# Copyright 2015 The ChromiumOS Authors -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# This script takes the out.txt, generated by heatmap_generator.py -# and sorted into a heatmap data file (inst-histo.txt) and then -# call gnu plot to draw the heat map and the time map. -# A heat map shows the overall hotness of instructions being executed -# while the time map shows the hotness of instruction at different time. -# -# Usage: -# ./perf-to-inst-page.sh HEATMAP_TITLE -# HEATMAP_TITLE: the title to display on the heatmap - -HEAT_PNG="heat_map.png" -TIMELINE_PNG="timeline.png" -HEATMAP_TITLE=$1 -ENABLE_HUGEPAGE=$2 - -heatmap_command=" -set terminal png size 600,450 -set xlabel \"Instruction Virtual Address (MB)\" -set ylabel \"Sample Occurance\" -set grid - -set output \"${HEAT_PNG}\" -set title \"${HEATMAP_TITLE}\" -" - -if [[ "${ENABLE_HUGEPAGE}" = "hugepage" ]]; then - hugepage_hist="inst-histo-hp.txt" - smallpage_hist="inst-histo-sp.txt" - cat out.txt | grep hugepage | awk '{print $3}' \ - | sort -n | uniq -c > "${hugepage_hist}" - cat out.txt | grep smallpage | awk '{print $3}' \ - | sort -n | uniq -c > "${smallpage_hist}" - # generate inst heat map - heatmap_in_hugepage=("'${hugepage_hist}' using \ -(\$2/1024/1024):1 with impulses notitle lt rgb 'red'") - heatmap_outside_hugepage=("'${smallpage_hist}' using \ -(\$2/1024/1024):1 with impulses notitle lt rgb 'blue'") - echo " - ${heatmap_command} - plot ${heatmap_in_hugepage}, ${heatmap_outside_hugepage} - " | gnuplot -else - awk '{print $3}' out.txt | sort -n | uniq -c > inst-histo.txt - # generate inst heat map - echo " - ${heatmap_command} - plot 'inst-histo.txt' using (\$2/1024/1024):1 with impulses notitle - " | gnuplot -fi - -# generate instruction page access timeline -num=$(awk 'END {print NR+1}' out.txt) - -echo " -set terminal png size 600,450 -set xlabel \"time (sec)\" -set ylabel \"Instruction Virtual Address (MB)\" - -set output \"${TIMELINE_PNG}\" -set title \"instruction page accessd timeline\" - -plot 'out.txt' using (\$0/$num*10):(\$3/1024/1024) with dots notitle -" | gnuplot -- cgit v1.2.3 From cc7c8d148ca349366e4a5d124b8d8b8c1444b9ae Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Fri, 21 Jul 2023 17:40:49 +0000 Subject: llvm_tools: Types for ConvertChrootPathsToAbsolutePaths We'll use this later in the patch stack. Also do some minor formatting clean up while we're here. BUG=None TEST=None Change-Id: I6d0b06d2d9ffeb9c07a485382620e6a00824a543 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4708692 Tested-by: Jordan Abrahams-Whitehead Reviewed-by: George Burgess Reviewed-by: Ryan Beltran Commit-Queue: Jordan Abrahams-Whitehead --- llvm_tools/chroot.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/llvm_tools/chroot.py b/llvm_tools/chroot.py index 2ec989c4..cb0ebc87 100755 --- a/llvm_tools/chroot.py +++ b/llvm_tools/chroot.py @@ -11,6 +11,7 @@ import collections import os from pathlib import Path import subprocess +from typing import List CommitContents = collections.namedtuple("CommitContents", ["url", "cl_number"]) @@ -74,7 +75,10 @@ def GetChrootEbuildPaths(chromeos_root, packages): return chroot_paths -def ConvertChrootPathsToAbsolutePaths(chromeos_root, chroot_paths): +def ConvertChrootPathsToAbsolutePaths( + chromeos_root: str, + chroot_paths: List[str], +) -> List[str]: """Converts the chroot path(s) to absolute symlink path(s). Args: @@ -90,11 +94,8 @@ def ConvertChrootPathsToAbsolutePaths(chromeos_root, chroot_paths): """ abs_paths = [] - chroot_prefix = "/mnt/host/source/" - # Iterate through the chroot paths. - # # For each chroot file path, remove '/mnt/host/source/' prefix # and combine the chroot path with the result and add it to the list. for chroot_path in chroot_paths: @@ -102,12 +103,8 @@ def ConvertChrootPathsToAbsolutePaths(chromeos_root, chroot_paths): raise ValueError( "Invalid prefix for the chroot path: %s" % chroot_path ) - rel_path = chroot_path[len(chroot_prefix) :] - # combine the chromeos root path + '/src/...' abs_path = os.path.join(chromeos_root, rel_path) - abs_paths.append(abs_path) - return abs_paths -- cgit v1.2.3 From fb6db883cd20da1aa7433b71a394b66ce59212b8 Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Mon, 24 Jul 2023 23:50:02 +0000 Subject: llvm_tools: Update _toolchain.xml instead of full.xml Since crrev.com/i/6046315, we should be using _toolchain.xml and merging hash changes there. BUG=b:275877115, b:267209587 TEST=update_chromeos_llvm_hash.py with --repo_manifest Change-Id: If4ccf39a9411b131f0b27c9c508203111d464f7b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4713544 Reviewed-by: Ryan Beltran Reviewed-by: George Burgess Commit-Queue: Jordan Abrahams-Whitehead Tested-by: Jordan Abrahams-Whitehead --- llvm_tools/manifest_utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/llvm_tools/manifest_utils.py b/llvm_tools/manifest_utils.py index 3b24cedf..bae35838 100644 --- a/llvm_tools/manifest_utils.py +++ b/llvm_tools/manifest_utils.py @@ -62,8 +62,7 @@ def update_chromeos_manifest(revision: str, src_tree: Path): def get_chromeos_manifest_path(src_tree: Path) -> Path: """Return the path to the toolchain manifest.""" - # TODO(284281070): This should be updated to be _toolchain.xml - return src_tree / "manifest-internal" / "full.xml" + return src_tree / "manifest-internal" / "_toolchain.xml" def update_chromeos_manifest_tree(revision: str, xmlroot: ElementTree.Element): -- cgit v1.2.3 From 9cf98be57924bb71c308f79420367f7806f5211d Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Tue, 25 Jul 2023 00:24:00 +0000 Subject: llvm_tools: Get manifest_path from update_chromeos_manifest We'll need the manifest path later for git operations, as manifest_utils.py does not handle any git commands itself. update_chromeos_llvm_hash.py apparently does not test whether the manifest_path actually is added to the CL. BUG=None TEST=CQ Change-Id: Iea4a5443c8012db4c15161df01dd5da498aaba98 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4713965 Reviewed-by: Ryan Beltran Tested-by: Jordan Abrahams-Whitehead Reviewed-by: George Burgess Commit-Queue: Jordan Abrahams-Whitehead --- llvm_tools/manifest_utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/llvm_tools/manifest_utils.py b/llvm_tools/manifest_utils.py index bae35838..83d0ca9d 100644 --- a/llvm_tools/manifest_utils.py +++ b/llvm_tools/manifest_utils.py @@ -31,7 +31,7 @@ class UpdateManifestError(Exception): pass -def update_chromeos_manifest(revision: str, src_tree: Path): +def update_chromeos_manifest(revision: str, src_tree: Path) -> Path: """Replaces the manifest project revision with 'revision'. Notably, this function reformats the manifest file to preserve @@ -41,6 +41,9 @@ def update_chromeos_manifest(revision: str, src_tree: Path): revision: Revision (git sha) to use in the manifest. src_tree: Path to the root of the source tree checkout. + Returns: + The manifest path. + Post: The llvm-project revision info in the chromeos repo manifest is updated with 'revision'. @@ -58,6 +61,7 @@ def update_chromeos_manifest(revision: str, src_tree: Path): with atomic_write_file.atomic_write(manifest_path, mode="wb") as f: xmltree.write(f, encoding="UTF-8") format_manifest(manifest_path) + return manifest_path def get_chromeos_manifest_path(src_tree: Path) -> Path: -- cgit v1.2.3 From 82ce7214523ef45dbc4b5d0503df97ac257123e0 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Thu, 20 Jul 2023 15:10:12 -0600 Subject: compiler_wrapper: manually apply -D_FORTIFY_SOURCE=2 We want to migrate to -D_FORTIFY_SOURCE=3, but doing so conflicts with the wrapper's implicit application of -D_FORTIFY_SOURCE=2. Have the wrapper skip the whole -D_FORTIFY_SOURCE=2 bit if it sees -D_FORTIFY_SOURCE=3 BUG=b:288411201 TEST=Made a json diff tool that treats -D_FORTIFY_SOURCE=2 as though TEST=it's always at the end of arg lists. All commands compared equally. Change-Id: Iedb42da661e1b67c8d640ca25ffc22200999ffa3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4706309 Tested-by: George Burgess Reviewed-by: Jordan Abrahams-Whitehead Commit-Queue: George Burgess --- compiler_wrapper/compiler_wrapper.go | 19 +++++++++++++++++ compiler_wrapper/config.go | 5 +++-- compiler_wrapper/config_test.go | 7 +------ .../testdata/cros_hardened_golden/bisect.json | 6 +++--- .../clang_ftrapv_maincc_target_specific.json | 18 ++++++++-------- .../clang_maincc_target_specific.json | 18 ++++++++-------- .../testdata/cros_hardened_golden/clang_path.json | 24 +++++++++++----------- .../cros_hardened_golden/clang_sanitizer_args.json | 2 +- .../cros_hardened_golden/clang_specific_args.json | 8 ++++---- .../clang_sysroot_wrapper_common.json | 14 ++++++------- .../testdata/cros_hardened_golden/clangtidy.json | 16 +++++++-------- .../cros_hardened_golden/force_disable_werror.json | 10 ++++----- .../cros_hardened_golden/gcc_clang_syntax.json | 14 ++++++------- .../gcc_maincc_target_specific.json | 18 ++++++++-------- .../testdata/cros_hardened_golden/gcc_path.json | 12 +++++------ .../cros_hardened_golden/gcc_sanitizer_args.json | 16 +++++++-------- .../cros_hardened_golden/gcc_specific_args.json | 6 +++--- .../gcc_sysroot_wrapper_common.json | 14 ++++++------- .../cros_hardened_llvmnext_golden/bisect.json | 6 +++--- .../cros_hardened_llvmnext_golden/clang_path.json | 24 +++++++++++----------- .../cros_hardened_llvmnext_golden/clangtidy.json | 16 +++++++-------- .../force_disable_werror.json | 10 ++++----- .../gcc_clang_syntax.json | 14 ++++++------- .../cros_hardened_llvmnext_golden/gcc_path.json | 12 +++++------ .../cros_hardened_noccache_golden/bisect.json | 6 +++--- .../cros_hardened_noccache_golden/clang_path.json | 24 +++++++++++----------- .../cros_hardened_noccache_golden/clangtidy.json | 16 +++++++-------- .../force_disable_werror.json | 10 ++++----- .../gcc_clang_syntax.json | 14 ++++++------- .../cros_hardened_noccache_golden/gcc_path.json | 12 +++++------ 30 files changed, 203 insertions(+), 188 deletions(-) diff --git a/compiler_wrapper/compiler_wrapper.go b/compiler_wrapper/compiler_wrapper.go index ada91b22..a299698c 100644 --- a/compiler_wrapper/compiler_wrapper.go +++ b/compiler_wrapper/compiler_wrapper.go @@ -332,10 +332,26 @@ func callCompilerInternal(env env, cfg *config, inputCmd *command) (exitCode int } } +// TODO(b/288411201): Add -D_FORTIFY_SOURCE=2 to args if -D_FORITFY_SOURCE=3 is not present. +// This makes migrating to -D_FORTIFY_SOURCE=3 _way_ easier, since the wrapper's implicit +// -D_FORTIFY_SOURCE=2 can be ignored. +func addPreUserFortifyFlag(builder *commandBuilder) { + for _, arg := range builder.args { + if arg.value == "-D_FORTIFY_SOURCE=3" { + return + } + } + + builder.addPreUserArgs("-D_FORTIFY_SOURCE=2") +} + func prepareClangCommand(builder *commandBuilder) (err error) { if !builder.cfg.isHostWrapper { processSysrootFlag(builder) } + if builder.cfg.isHardened { + addPreUserFortifyFlag(builder) + } builder.addPreUserArgs(builder.cfg.clangFlags...) if builder.cfg.crashArtifactsDir != "" { builder.addPreUserArgs("-fcrash-diagnostics-dir=" + builder.cfg.crashArtifactsDir) @@ -361,6 +377,9 @@ func calcGccCommand(enableRusage bool, builder *commandBuilder) (bool, *command, if !builder.cfg.isHostWrapper { processSysrootFlag(builder) } + if builder.cfg.isHardened { + addPreUserFortifyFlag(builder) + } builder.addPreUserArgs(builder.cfg.gccFlags...) calcCommonPreUserArgs(builder) processGccFlags(builder) diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index 89d62516..bcf73d79 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -35,7 +35,8 @@ type config struct { // Directory to store crash artifacts in. crashArtifactsDir string // Version. Only exposed via -print-config. - version string + version string + isHardened bool } // Version can be set via a linker flag. @@ -153,6 +154,7 @@ func crosCommonClangPostFlags() []string { // Full hardening. // Temporarily disable function splitting because of chromium:434751. var crosHardenedConfig = config{ + isHardened: true, clangRootRelPath: "../..", gccRootRelPath: "../../../../..", // Pass "-fcommon" till the packages are fixed to work with new clang/gcc @@ -160,7 +162,6 @@ var crosHardenedConfig = config{ commonFlags: []string{ "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", }, gccFlags: []string{ diff --git a/compiler_wrapper/config_test.go b/compiler_wrapper/config_test.go index 0e6b44c5..47432856 100644 --- a/compiler_wrapper/config_test.go +++ b/compiler_wrapper/config_test.go @@ -118,12 +118,7 @@ func TestRealConfigWithConfigNameFlag(t *testing.T) { } func isSysrootHardened(cfg *config) bool { - for _, arg := range cfg.commonFlags { - if arg == "-D_FORTIFY_SOURCE=2" { - return true - } - } - return false + return cfg.isHardened } func resetGlobals() { diff --git a/compiler_wrapper/testdata/cros_hardened_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_golden/bisect.json index 67953b07..b4cdd8d2 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/bisect.json @@ -26,6 +26,7 @@ "/usr/bin/ccache", "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -51,7 +52,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -107,6 +107,7 @@ "/usr/bin/ccache", "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -132,7 +133,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -191,6 +191,7 @@ "/usr/bin/ccache", "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -216,7 +217,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json index 68e1f2b9..83d7a8df 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_ftrapv_maincc_target_specific.json @@ -17,6 +17,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -42,7 +43,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -88,6 +88,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-eabi", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -113,7 +114,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-eabi-", @@ -159,6 +159,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-win-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -184,7 +185,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-win-gnu-", @@ -230,6 +230,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/armv7m-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -255,7 +256,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-static-libgcc", "-mthumb", "--prefix=../../bin/armv7m-cros-linux-gnu-", @@ -300,6 +300,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/armv7m-cros-eabi", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -325,7 +326,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/armv7m-cros-eabi-", @@ -370,6 +370,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/armv7m-cros-win-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -395,7 +396,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-static-libgcc", "-mthumb", "--prefix=../../bin/armv7m-cros-win-gnu-", @@ -440,6 +440,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/armv8m-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -465,7 +466,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-static-libgcc", "-mthumb", "--prefix=../../bin/armv8m-cros-linux-gnu-", @@ -510,6 +510,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/armv8m-cros-eabi", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -535,7 +536,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/armv8m-cros-eabi-", @@ -580,6 +580,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/armv8m-cros-win-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -605,7 +606,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-static-libgcc", "-mthumb", "--prefix=../../bin/armv8m-cros-win-gnu-", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json index e123a918..d072960a 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_maincc_target_specific.json @@ -16,6 +16,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -41,7 +42,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -85,6 +85,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-eabi", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -110,7 +111,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-eabi-", @@ -154,6 +154,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-win-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -179,7 +180,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-win-gnu-", @@ -223,6 +223,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/armv7m-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -248,7 +249,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-static-libgcc", "-mthumb", "--prefix=../../bin/armv7m-cros-linux-gnu-", @@ -291,6 +291,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/armv7m-cros-eabi", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -316,7 +317,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/armv7m-cros-eabi-", @@ -359,6 +359,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/armv7m-cros-win-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -384,7 +385,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-static-libgcc", "-mthumb", "--prefix=../../bin/armv7m-cros-win-gnu-", @@ -427,6 +427,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/armv8m-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -452,7 +453,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-static-libgcc", "-mthumb", "--prefix=../../bin/armv8m-cros-linux-gnu-", @@ -495,6 +495,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/armv8m-cros-eabi", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -520,7 +521,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/armv8m-cros-eabi-", @@ -563,6 +563,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/armv8m-cros-win-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -588,7 +589,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-static-libgcc", "-mthumb", "--prefix=../../bin/armv8m-cros-win-gnu-", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json index c3785977..fc120977 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_path.json @@ -16,6 +16,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -41,7 +42,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -88,6 +88,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -113,7 +114,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -160,6 +160,7 @@ "args": [ "../../usr/bin/clang++", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -185,7 +186,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "-std=gnu++14", @@ -233,6 +233,7 @@ "args": [ "somepath/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -258,7 +259,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -312,6 +312,7 @@ "args": [ "/somedir/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -337,7 +338,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -396,6 +396,7 @@ "args": [ "/somedir/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -421,7 +422,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -475,6 +475,7 @@ "args": [ "/somedir/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -500,7 +501,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -549,6 +549,7 @@ "args": [ "/usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -574,7 +575,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -618,6 +618,7 @@ "args": [ "a/b/c/d/e/usr/bin/clang", "--sysroot=/tmp/stable/a/b/c/d/e/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -643,7 +644,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=a/b/c/d/e/bin/x86_64-cros-linux-gnu-", @@ -687,6 +687,7 @@ "args": [ "a/b/c/d/e/usr/bin/clang", "--sysroot=/tmp/stable/a/b/c/d/e/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -712,7 +713,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=a/b/c/d/e/bin/x86_64-cros-linux-gnu-", @@ -756,6 +756,7 @@ "args": [ "../usr/bin/clang", "--sysroot=/tmp/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -781,7 +782,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../bin/x86_64-cros-linux-gnu-", @@ -828,6 +828,7 @@ "args": [ "/tmp/usr/bin/clang", "--sysroot=/tmp/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -853,7 +854,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../bin/x86_64-cros-linux-gnu-", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json index 91b7012f..0c9376cd 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_sanitizer_args.json @@ -513,6 +513,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -538,7 +539,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json index dd30f48d..d7f73998 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_specific_args.json @@ -26,6 +26,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -51,7 +52,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -104,6 +104,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -129,7 +130,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -175,6 +175,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -200,7 +201,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -246,6 +246,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -271,7 +272,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json b/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json index 2f5a9e77..537fc89c 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clang_sysroot_wrapper_common.json @@ -16,12 +16,12 @@ "path": "./x86_64-cros-linux-gnu-gcc.real", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -52,6 +52,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -77,7 +78,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -124,6 +124,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -149,7 +150,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -189,6 +189,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -214,7 +215,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -260,6 +260,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -284,7 +285,6 @@ "-ftrivial-auto-var-init=zero", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "-fno-stack-protector", @@ -331,6 +331,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/armv7a-cros-linux-gnueabihf", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -355,7 +356,6 @@ "-ftrivial-auto-var-init=zero", "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", - "-D_FORTIFY_SOURCE=2", "-static-libgcc", "-mthumb", "-fno-stack-protector", @@ -400,6 +400,7 @@ "path": "/usr/bin/ccache", "args": [ "../../usr/bin/clang", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -425,7 +426,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json index 79911010..5d88fec8 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/clangtidy.json @@ -31,6 +31,7 @@ "--", "-resource-dir=someResourceDir", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -56,7 +57,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -81,6 +81,7 @@ "path": "../../usr/bin/clang", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -106,7 +107,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -161,6 +161,7 @@ "--", "-resource-dir=someResourceDir", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -186,7 +187,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -212,6 +212,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -237,7 +238,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -294,6 +294,7 @@ "--", "-resource-dir=someResourceDir", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -319,7 +320,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -348,6 +348,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -373,7 +374,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -431,6 +431,7 @@ "--", "-resource-dir=someResourceDir", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -456,7 +457,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -482,6 +482,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -507,7 +508,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json index da818c3c..3d1e305e 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/force_disable_werror.json @@ -19,6 +19,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -44,7 +45,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -92,6 +92,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -117,7 +118,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -150,6 +150,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -175,7 +176,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -226,6 +226,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -251,7 +252,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -284,6 +284,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -309,7 +310,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json index b00f2c86..9d17797a 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/gcc_clang_syntax.json @@ -16,6 +16,7 @@ "path": "../../usr/bin/clang", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -41,7 +42,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -69,12 +69,12 @@ "args": [ "./x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -110,6 +110,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -135,7 +136,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -163,12 +163,12 @@ "args": [ "./x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -199,6 +199,7 @@ "path": "../../usr/bin/clang", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -224,7 +225,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -271,6 +271,7 @@ "path": "../../usr/bin/clang", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -296,7 +297,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -324,12 +324,12 @@ "args": [ "./x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/gcc_maincc_target_specific.json b/compiler_wrapper/testdata/cros_hardened_golden/gcc_maincc_target_specific.json index 63b7da18..86745dc6 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/gcc_maincc_target_specific.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/gcc_maincc_target_specific.json @@ -16,12 +16,12 @@ "args": [ "./x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -53,12 +53,12 @@ "args": [ "./x86_64-cros-eabi-gcc.real", "--sysroot=/usr/x86_64-cros-eabi", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -90,12 +90,12 @@ "args": [ "./x86_64-cros-win-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-win-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -127,12 +127,12 @@ "args": [ "./armv7m-cros-linux-gnu-gcc.real", "--sysroot=/usr/armv7m-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-static-libgcc", "-mthumb", "main.cc", @@ -163,12 +163,12 @@ "args": [ "./armv7m-cros-eabi-gcc.real", "--sysroot=/usr/armv7m-cros-eabi", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -199,12 +199,12 @@ "args": [ "./armv7m-cros-win-gnu-gcc.real", "--sysroot=/usr/armv7m-cros-win-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-static-libgcc", "-mthumb", "main.cc", @@ -235,12 +235,12 @@ "args": [ "./armv8m-cros-linux-gnu-gcc.real", "--sysroot=/usr/armv8m-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-static-libgcc", "-mthumb", "main.cc", @@ -271,12 +271,12 @@ "args": [ "./armv8m-cros-eabi-gcc.real", "--sysroot=/usr/armv8m-cros-eabi", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -307,12 +307,12 @@ "args": [ "./armv8m-cros-win-gnu-gcc.real", "--sysroot=/usr/armv8m-cros-win-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-static-libgcc", "-mthumb", "main.cc", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/gcc_path.json b/compiler_wrapper/testdata/cros_hardened_golden/gcc_path.json index 6e06ce18..b6f3d1d9 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/gcc_path.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/gcc_path.json @@ -16,12 +16,12 @@ "args": [ "./x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -56,12 +56,12 @@ "args": [ "./x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -96,12 +96,12 @@ "args": [ "/tmp/stable/x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -133,12 +133,12 @@ "args": [ "./a/b/c/d/e/f/g/x86_64-cros-linux-gnu-gcc.real", "--sysroot=/tmp/stable/a/b/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -170,12 +170,12 @@ "args": [ "./symlinked/x86_64-cros-linux-gnu-gcc.real", "--sysroot=/tmp/stable/a/b/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -210,12 +210,12 @@ "args": [ "/tmp/stable/pathenv/x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/gcc_sanitizer_args.json b/compiler_wrapper/testdata/cros_hardened_golden/gcc_sanitizer_args.json index 9aaf9c25..0552bf7c 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/gcc_sanitizer_args.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/gcc_sanitizer_args.json @@ -18,12 +18,12 @@ "args": [ "./x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "-fsanitize=kernel-address", @@ -58,12 +58,12 @@ "args": [ "./x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "-fsanitize=kernel-address", @@ -98,12 +98,12 @@ "args": [ "./x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "-fsanitize=kernel-address", @@ -138,12 +138,12 @@ "args": [ "./x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "-fsanitize=kernel-address", @@ -177,12 +177,12 @@ "args": [ "./x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "-fsanitize=fuzzer", @@ -217,12 +217,12 @@ "args": [ "./x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "-fsanitize=address", @@ -257,12 +257,12 @@ "args": [ "./x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "-fsanitize=address", @@ -296,12 +296,12 @@ "args": [ "./x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "-fprofile-instr-generate", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/gcc_specific_args.json b/compiler_wrapper/testdata/cros_hardened_golden/gcc_specific_args.json index 4ee90cbc..52c9f2cc 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/gcc_specific_args.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/gcc_specific_args.json @@ -17,12 +17,12 @@ "args": [ "./x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "-march=goldmont", @@ -56,12 +56,12 @@ "args": [ "./x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "-march=goldmont-plus", @@ -95,12 +95,12 @@ "args": [ "./x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "-march=skylake", diff --git a/compiler_wrapper/testdata/cros_hardened_golden/gcc_sysroot_wrapper_common.json b/compiler_wrapper/testdata/cros_hardened_golden/gcc_sysroot_wrapper_common.json index 9397333d..8b28e6e2 100644 --- a/compiler_wrapper/testdata/cros_hardened_golden/gcc_sysroot_wrapper_common.json +++ b/compiler_wrapper/testdata/cros_hardened_golden/gcc_sysroot_wrapper_common.json @@ -16,12 +16,12 @@ "path": "./x86_64-cros-linux-gnu-gcc.real", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -52,12 +52,12 @@ "args": [ "./x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -92,12 +92,12 @@ "args": [ "./x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -126,12 +126,12 @@ "args": [ "./x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "-nopie", @@ -165,11 +165,11 @@ "args": [ "./x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "-fno-stack-protector", @@ -204,11 +204,11 @@ "args": [ "./armv7a-cros-linux-gnueabihf-gcc.real", "--sysroot=/usr/armv7a-cros-linux-gnueabihf", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", - "-D_FORTIFY_SOURCE=2", "-static-libgcc", "-mthumb", "-fno-stack-protector", @@ -241,12 +241,12 @@ "path": "/usr/bin/ccache", "args": [ "./x86_64-cros-linux-gnu-gcc.real", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--sysroot=xyz", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json index 67953b07..b4cdd8d2 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/bisect.json @@ -26,6 +26,7 @@ "/usr/bin/ccache", "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -51,7 +52,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -107,6 +107,7 @@ "/usr/bin/ccache", "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -132,7 +133,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -191,6 +191,7 @@ "/usr/bin/ccache", "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -216,7 +217,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json index c3785977..fc120977 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clang_path.json @@ -16,6 +16,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -41,7 +42,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -88,6 +88,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -113,7 +114,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -160,6 +160,7 @@ "args": [ "../../usr/bin/clang++", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -185,7 +186,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "-std=gnu++14", @@ -233,6 +233,7 @@ "args": [ "somepath/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -258,7 +259,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -312,6 +312,7 @@ "args": [ "/somedir/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -337,7 +338,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -396,6 +396,7 @@ "args": [ "/somedir/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -421,7 +422,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -475,6 +475,7 @@ "args": [ "/somedir/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -500,7 +501,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -549,6 +549,7 @@ "args": [ "/usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -574,7 +575,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -618,6 +618,7 @@ "args": [ "a/b/c/d/e/usr/bin/clang", "--sysroot=/tmp/stable/a/b/c/d/e/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -643,7 +644,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=a/b/c/d/e/bin/x86_64-cros-linux-gnu-", @@ -687,6 +687,7 @@ "args": [ "a/b/c/d/e/usr/bin/clang", "--sysroot=/tmp/stable/a/b/c/d/e/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -712,7 +713,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=a/b/c/d/e/bin/x86_64-cros-linux-gnu-", @@ -756,6 +756,7 @@ "args": [ "../usr/bin/clang", "--sysroot=/tmp/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -781,7 +782,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../bin/x86_64-cros-linux-gnu-", @@ -828,6 +828,7 @@ "args": [ "/tmp/usr/bin/clang", "--sysroot=/tmp/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -853,7 +854,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../bin/x86_64-cros-linux-gnu-", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json index 79911010..5d88fec8 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/clangtidy.json @@ -31,6 +31,7 @@ "--", "-resource-dir=someResourceDir", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -56,7 +57,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -81,6 +81,7 @@ "path": "../../usr/bin/clang", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -106,7 +107,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -161,6 +161,7 @@ "--", "-resource-dir=someResourceDir", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -186,7 +187,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -212,6 +212,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -237,7 +238,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -294,6 +294,7 @@ "--", "-resource-dir=someResourceDir", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -319,7 +320,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -348,6 +348,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -373,7 +374,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -431,6 +431,7 @@ "--", "-resource-dir=someResourceDir", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -456,7 +457,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -482,6 +482,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -507,7 +508,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json index da818c3c..3d1e305e 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/force_disable_werror.json @@ -19,6 +19,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -44,7 +45,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -92,6 +92,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -117,7 +118,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -150,6 +150,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -175,7 +176,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -226,6 +226,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -251,7 +252,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -284,6 +284,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -309,7 +310,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json index b00f2c86..9d17797a 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_clang_syntax.json @@ -16,6 +16,7 @@ "path": "../../usr/bin/clang", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -41,7 +42,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -69,12 +69,12 @@ "args": [ "./x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -110,6 +110,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -135,7 +136,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -163,12 +163,12 @@ "args": [ "./x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -199,6 +199,7 @@ "path": "../../usr/bin/clang", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -224,7 +225,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -271,6 +271,7 @@ "path": "../../usr/bin/clang", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -296,7 +297,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -324,12 +324,12 @@ "args": [ "./x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", diff --git a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_path.json b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_path.json index 6e06ce18..b6f3d1d9 100644 --- a/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_path.json +++ b/compiler_wrapper/testdata/cros_hardened_llvmnext_golden/gcc_path.json @@ -16,12 +16,12 @@ "args": [ "./x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -56,12 +56,12 @@ "args": [ "./x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -96,12 +96,12 @@ "args": [ "/tmp/stable/x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -133,12 +133,12 @@ "args": [ "./a/b/c/d/e/f/g/x86_64-cros-linux-gnu-gcc.real", "--sysroot=/tmp/stable/a/b/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -170,12 +170,12 @@ "args": [ "./symlinked/x86_64-cros-linux-gnu-gcc.real", "--sysroot=/tmp/stable/a/b/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -210,12 +210,12 @@ "args": [ "/tmp/stable/pathenv/x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json index 8a6234bc..b476031b 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/bisect.json @@ -25,6 +25,7 @@ "/tmp/sysroot_bisect", "/usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -50,7 +51,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -102,6 +102,7 @@ "someBisectDir", "/usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -127,7 +128,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -182,6 +182,7 @@ "someBisectDir", "/usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -207,7 +208,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json index 199d6bb1..3849ecf8 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clang_path.json @@ -15,6 +15,7 @@ "path": "../../usr/bin/clang", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -40,7 +41,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -81,6 +81,7 @@ "path": "../../usr/bin/clang", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -106,7 +107,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -147,6 +147,7 @@ "path": "../../usr/bin/clang++", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -172,7 +173,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "-std=gnu++14", @@ -214,6 +214,7 @@ "path": "somepath/clang", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -239,7 +240,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -287,6 +287,7 @@ "path": "/somedir/clang", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -312,7 +313,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -366,6 +366,7 @@ "args": [ "/somedir/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -391,7 +392,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -444,6 +444,7 @@ "path": "/somedir/clang", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -469,7 +470,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -512,6 +512,7 @@ "path": "/usr/bin/clang", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -537,7 +538,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -575,6 +575,7 @@ "path": "a/b/c/d/e/usr/bin/clang", "args": [ "--sysroot=/tmp/stable/a/b/c/d/e/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -600,7 +601,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=a/b/c/d/e/bin/x86_64-cros-linux-gnu-", @@ -638,6 +638,7 @@ "path": "a/b/c/d/e/usr/bin/clang", "args": [ "--sysroot=/tmp/stable/a/b/c/d/e/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -663,7 +664,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=a/b/c/d/e/bin/x86_64-cros-linux-gnu-", @@ -701,6 +701,7 @@ "path": "../usr/bin/clang", "args": [ "--sysroot=/tmp/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -726,7 +727,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../bin/x86_64-cros-linux-gnu-", @@ -767,6 +767,7 @@ "path": "/tmp/usr/bin/clang", "args": [ "--sysroot=/tmp/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -792,7 +793,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../bin/x86_64-cros-linux-gnu-", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json index 79911010..5d88fec8 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/clangtidy.json @@ -31,6 +31,7 @@ "--", "-resource-dir=someResourceDir", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -56,7 +57,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -81,6 +81,7 @@ "path": "../../usr/bin/clang", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -106,7 +107,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -161,6 +161,7 @@ "--", "-resource-dir=someResourceDir", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -186,7 +187,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -212,6 +212,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -237,7 +238,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -294,6 +294,7 @@ "--", "-resource-dir=someResourceDir", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -319,7 +320,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -348,6 +348,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -373,7 +374,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -431,6 +431,7 @@ "--", "-resource-dir=someResourceDir", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -456,7 +457,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -482,6 +482,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -507,7 +508,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json index 18263f44..a4b2d2b4 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/force_disable_werror.json @@ -18,6 +18,7 @@ "path": "../../usr/bin/clang", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -43,7 +44,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -85,6 +85,7 @@ "path": "../../usr/bin/clang", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -110,7 +111,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -137,6 +137,7 @@ "path": "../../usr/bin/clang", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -162,7 +163,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -207,6 +207,7 @@ "path": "../../usr/bin/clang", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -232,7 +233,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -259,6 +259,7 @@ "path": "../../usr/bin/clang", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -284,7 +285,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json index f34a44ba..091e00f5 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_clang_syntax.json @@ -16,6 +16,7 @@ "path": "../../usr/bin/clang", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -41,7 +42,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -68,12 +68,12 @@ "path": "./x86_64-cros-linux-gnu-gcc.real", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -105,6 +105,7 @@ "args": [ "../../usr/bin/clang", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -130,7 +131,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -158,12 +158,12 @@ "args": [ "./x86_64-cros-linux-gnu-gcc.real", "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -194,6 +194,7 @@ "path": "../../usr/bin/clang", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -219,7 +220,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -266,6 +266,7 @@ "path": "../../usr/bin/clang", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-Qunused-arguments", "-Werror=poison-system-directories", "-Wno-compound-token-split-by-macro", @@ -291,7 +292,6 @@ "-fcrash-diagnostics-dir=/tmp/stable/clang_crash_diagnostics", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "--prefix=../../bin/x86_64-cros-linux-gnu-", @@ -318,12 +318,12 @@ "path": "./x86_64-cros-linux-gnu-gcc.real", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", diff --git a/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_path.json b/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_path.json index fb877370..ed60e6d6 100644 --- a/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_path.json +++ b/compiler_wrapper/testdata/cros_hardened_noccache_golden/gcc_path.json @@ -15,12 +15,12 @@ "path": "./x86_64-cros-linux-gnu-gcc.real", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -50,12 +50,12 @@ "path": "./x86_64-cros-linux-gnu-gcc.real", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -85,12 +85,12 @@ "path": "/tmp/stable/x86_64-cros-linux-gnu-gcc.real", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -117,12 +117,12 @@ "path": "./a/b/c/d/e/f/g/x86_64-cros-linux-gnu-gcc.real", "args": [ "--sysroot=/tmp/stable/a/b/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -149,12 +149,12 @@ "path": "./symlinked/x86_64-cros-linux-gnu-gcc.real", "args": [ "--sysroot=/tmp/stable/a/b/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", @@ -184,12 +184,12 @@ "path": "/tmp/stable/pathenv/x86_64-cros-linux-gnu-gcc.real", "args": [ "--sysroot=/usr/x86_64-cros-linux-gnu", + "-D_FORTIFY_SOURCE=2", "-fno-reorder-blocks-and-partition", "-Wno-unused-local-typedefs", "-Wno-maybe-uninitialized", "-fcommon", "-fstack-protector-strong", - "-D_FORTIFY_SOURCE=2", "-fno-omit-frame-pointer", "-static-libgcc", "main.cc", -- cgit v1.2.3 From a053718c4c3146d9d27be389d7a44ef443389216 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Tue, 25 Jul 2023 01:22:59 -0600 Subject: compiler_wrapper: disable _FORTIFY_SOURCE=3 for sanitizers Thanks to manojgupta for flagging this! BUG=b:288411201 TEST=CQ+1, unittests Change-Id: Ice3e555cb20f93f971d4ec923b442f46786a7e1c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4713974 Reviewed-by: Jordan Abrahams-Whitehead Commit-Queue: George Burgess Tested-by: George Burgess --- compiler_wrapper/sanitizer_flags.go | 20 ++++++++++++------ compiler_wrapper/sanitizer_flags_test.go | 36 ++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 6 deletions(-) diff --git a/compiler_wrapper/sanitizer_flags.go b/compiler_wrapper/sanitizer_flags.go index 3bf4434f..dd3529ed 100644 --- a/compiler_wrapper/sanitizer_flags.go +++ b/compiler_wrapper/sanitizer_flags.go @@ -47,6 +47,15 @@ func isInvasiveSanitizerFlag(flag string) bool { return false } +// Returns whether the flag given enables FORTIFY. Notably, this should return false if a flag +// disables FORTIFY. +func isFortifyEnableFlag(flag string) bool { + prefix := "-D_FORTIFY_SOURCE=" + // At the time of writing, -D_FORTIFY_SOURCE has the valid values 0, 1, 2, and 3. Seems + // unlikely to go past 9, so don't handle past 9. + return strings.HasPrefix(flag, prefix) && len(flag) == len(prefix)+1 && flag[len(prefix)] != '0' +} + func processSanitizerFlags(builder *commandBuilder) { hasSanitizeFlags := false // TODO: This doesn't take -fno-sanitize flags into account. This doesn't seem to be an @@ -64,10 +73,8 @@ func processSanitizerFlags(builder *commandBuilder) { // Flags not supported by sanitizers (ASan etc.) unsupportedSanitizerFlags := map[string]bool{ - "-D_FORTIFY_SOURCE=1": true, - "-D_FORTIFY_SOURCE=2": true, - "-Wl,--no-undefined": true, - "-Wl,-z,defs": true, + "-Wl,--no-undefined": true, + "-Wl,-z,defs": true, } builder.transformArgs(func(arg builderArg) string { @@ -75,9 +82,10 @@ func processSanitizerFlags(builder *commandBuilder) { // non user args for gcc. Fix this once we don't compare to the old wrapper anymore. linkerDefinedFlag := ",-z,defs" if builder.target.compilerType != gccType || arg.fromUser { - if unsupportedSanitizerFlags[arg.value] { + if unsupportedSanitizerFlags[arg.value] || isFortifyEnableFlag(arg.value) { return "" - } else if strings.Contains(arg.value, linkerDefinedFlag) { + } + if strings.Contains(arg.value, linkerDefinedFlag) { return strings.ReplaceAll(arg.value, linkerDefinedFlag, "") } } diff --git a/compiler_wrapper/sanitizer_flags_test.go b/compiler_wrapper/sanitizer_flags_test.go index 8fb3e9f4..c81d95c0 100644 --- a/compiler_wrapper/sanitizer_flags_test.go +++ b/compiler_wrapper/sanitizer_flags_test.go @@ -73,6 +73,42 @@ func TestFilterUnsupportedSanitizerFlagsIfSanitizeGiven(t *testing.T) { }) } +func TestAllFortifyEnableFlagsAreRemoved(t *testing.T) { + withTestContext(t, func(ctx *testContext) { + flagsToRemove := []string{ + "-D_FORTIFY_SOURCE=1", + "-D_FORTIFY_SOURCE=2", + "-D_FORTIFY_SOURCE=3", + } + for _, fortifyFlag := range flagsToRemove { + ctx.cfg.commonFlags = []string{fortifyFlag} + cmd := ctx.must(callCompiler(ctx, ctx.cfg, + ctx.newCommand(clangX86_64, "-fsanitize=kernel-address", mainCc))) + if err := verifyArgCount(cmd, 0, fortifyFlag); err != nil { + t.Errorf("Verifying FORTIFY flag %q is removed: %v", fortifyFlag, err) + } + } + }) +} + +func TestFortifyDisableFlagsAreKept(t *testing.T) { + withTestContext(t, func(ctx *testContext) { + flagsToKeep := []string{ + "-D_FORTIFY_SOURCE", + "-D_FORTIFY_SOURCE=", + "-D_FORTIFY_SOURCE=0", + } + for _, fortifyFlag := range flagsToKeep { + ctx.cfg.commonFlags = []string{fortifyFlag} + cmd := ctx.must(callCompiler(ctx, ctx.cfg, + ctx.newCommand(clangX86_64, "-fsanitize=kernel-address", mainCc))) + if err := verifyArgCount(cmd, 1, fortifyFlag); err != nil { + t.Errorf("Verifying FORTIFY flag %q is kept: %v", fortifyFlag, err) + } + } + }) +} + func TestFilterUnsupportedDefaultSanitizerFlagsIfSanitizeGivenForClang(t *testing.T) { withTestContext(t, func(ctx *testContext) { ctx.cfg.commonFlags = []string{"-D_FORTIFY_SOURCE=1"} -- cgit v1.2.3 From 0fad210081f198199ba296b9c4831c70ded66203 Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Tue, 25 Jul 2023 00:14:46 +0000 Subject: llvm_tools: Restructure update_chromeos_llvm_hash.py This commit fundamentally changes how "UpdatePackages" works. At present, UpdatePackages goes through a dictionary mapping between package names and ebuild symlinks. However, with the introduction of libcxx-999, this breaks as there is no symlink (and nothing to uprev). This breaks the assumptions of UpdatePackages. This commit reworks the function to create PortagePackage objects which infer the state of their overlay package and self-manage their updates accordingly. BUG=b:275877115, b:292048757, b:292054306 TEST=./run_tests_for.py llvm_tools/* TEST=update_chromeos_llvm_hash.py --is_llvm_next --repo_manifest Change-Id: Ifcc3740af80c1da1e1534afa9c01e79955295b6d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4713966 Tested-by: Jordan Abrahams-Whitehead Reviewed-by: George Burgess Reviewed-by: Ryan Beltran Commit-Queue: Jordan Abrahams-Whitehead --- llvm_tools/update_chromeos_llvm_hash.py | 260 ++++++------ llvm_tools/update_chromeos_llvm_hash_unittest.py | 501 ++++------------------- 2 files changed, 197 insertions(+), 564 deletions(-) diff --git a/llvm_tools/update_chromeos_llvm_hash.py b/llvm_tools/update_chromeos_llvm_hash.py index b74583d8..4404fa2b 100755 --- a/llvm_tools/update_chromeos_llvm_hash.py +++ b/llvm_tools/update_chromeos_llvm_hash.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -# -*- coding: utf-8 -*- # 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. @@ -18,7 +17,7 @@ from pathlib import Path import re import subprocess import textwrap -from typing import Dict, Iterable +from typing import Dict, Iterable, List, Optional import chroot import failure_modes @@ -49,6 +48,89 @@ class LLVMVariant(enum.Enum): next = "LLVM_NEXT_HASH" +class PortagePackage: + """Represents a portage package with location info.""" + + def __init__(self, chromeos_root: Path, package: str): + """Create a new PortagePackage. + + Args: + chromeos_root: Path to the root of the code checkout. + package: "category/package" string. + """ + self.package = package + potential_ebuild_path = PortagePackage.find_package_ebuild( + chromeos_root, package + ) + if potential_ebuild_path.is_symlink(): + self.uprev_target = potential_ebuild_path.absolute() + self.ebuild_path = potential_ebuild_path.resolve() + else: + # Should have a 9999 ebuild, no uprevs needed. + self.uprev_target = None + self.ebuild_path = potential_ebuild_path.absolute() + + @staticmethod + def find_package_ebuild(chromeos_root: Path, package: str) -> Path: + """Look up the package's ebuild location.""" + chromeos_root_str = str(chromeos_root) + ebuild_paths = chroot.GetChrootEbuildPaths( + chromeos_root_str, + [package], + ) + converted = chroot.ConvertChrootPathsToAbsolutePaths( + chromeos_root_str, ebuild_paths + )[0] + return Path(converted) + + def package_dir(self) -> Path: + """Return the package directory.""" + return self.ebuild_path.parent + + def update( + self, llvm_variant: LLVMVariant, git_hash: str, svn_version: int + ): + """Update the package with the new LLVM git sha and revision. + + Args: + llvm_variant: Which LLVM hash to update. + Either LLVM_HASH or LLVM_NEXT_HASH. + git_hash: Upstream LLVM git hash to update to. + svn_version: Matching LLVM revision string for the git_hash. + """ + live_ebuild = self.live_ebuild() + if live_ebuild: + # Working with a -9999 ebuild package here, no + # upreving. + UpdateEbuildLLVMHash( + live_ebuild, llvm_variant, git_hash, svn_version + ) + return + if not self.uprev_target: + # We can exit early if we're not working with a live ebuild, + # and we don't have something to uprev. + raise RuntimeError( + f"Cannot update: no live ebuild or symlink found for {self.package}" + ) + + UpdateEbuildLLVMHash( + self.ebuild_path, llvm_variant, git_hash, svn_version + ) + if llvm_variant == LLVMVariant.current: + UprevEbuildToVersion(str(self.uprev_target), svn_version, git_hash) + else: + UprevEbuildSymlink(str(self.uprev_target)) + + def live_ebuild(self) -> Optional[Path]: + """Path to the live ebuild if it exists. + + Returns: + The patch to the live ebuild if it exists. None otherwise. + """ + matches = self.package_dir().glob("*-9999.ebuild") + return next(matches, None) + + def defaultCrosRoot() -> Path: """Get default location of chroot_path. @@ -151,44 +233,6 @@ def GetCommandLineArgs(): return parser.parse_args() -def GetEbuildPathsFromSymLinkPaths(symlinks): - """Reads the symlink(s) to get the ebuild path(s) to the package(s). - - Args: - symlinks: A list of absolute path symlink/symlinks that point - to the package's ebuild. - - Returns: - A dictionary where the key is the absolute path of the symlink and the value - is the absolute path to the ebuild that was read from the symlink. - - Raises: - ValueError: Invalid symlink(s) were provided. - """ - - # A dictionary that holds: - # key: absolute symlink path - # value: absolute ebuild path - resolved_paths = {} - - # Iterate through each symlink. - # - # For each symlink, check that it is a valid symlink, - # and then construct the ebuild path, and - # then add the ebuild path to the dict. - for cur_symlink in symlinks: - if not os.path.islink(cur_symlink): - raise ValueError(f"Invalid symlink provided: {cur_symlink}") - - # Construct the absolute path to the ebuild. - ebuild_path = os.path.realpath(cur_symlink) - - if cur_symlink not in resolved_paths: - resolved_paths[cur_symlink] = ebuild_path - - return resolved_paths - - def UpdateEbuildLLVMHash(ebuild_path, llvm_variant, git_hash, svn_version): """Updates the LLVM hash in the ebuild. @@ -354,46 +398,11 @@ def UprevEbuildToVersion(symlink, svn_version, git_hash): # Create a symlink of the renamed ebuild new_symlink = new_ebuild[: -len(".ebuild")] + "-r1.ebuild" subprocess.check_output(["ln", "-s", "-r", new_ebuild, new_symlink]) - - if not os.path.islink(new_symlink): - raise ValueError( - f'Invalid symlink name: {new_ebuild[:-len(".ebuild")]}' - ) - subprocess.check_output(["git", "-C", symlink_dir, "add", new_symlink]) - # Remove the old symlink subprocess.check_output(["git", "-C", symlink_dir, "rm", symlink]) -def CreatePathDictionaryFromPackages(chroot_path, update_packages): - """Creates a symlink and ebuild path pair dictionary from the packages. - - Args: - chroot_path: The absolute path to the chroot. - update_packages: The filtered packages to be updated. - - Returns: - A dictionary where the key is the absolute path to the symlink - of the package and the value is the absolute path to the ebuild of - the package. - """ - - # Construct a list containing the chroot file paths of the package(s). - chroot_file_paths = chroot.GetChrootEbuildPaths( - chroot_path, update_packages - ) - - # Construct a list containing the symlink(s) of the package(s). - symlink_file_paths = chroot.ConvertChrootPathsToAbsolutePaths( - chroot_path, chroot_file_paths - ) - - # Create a dictionary where the key is the absolute path of the symlink to - # the package and the value is the absolute path to the ebuild of the package. - return GetEbuildPathsFromSymLinkPaths(symlink_file_paths) - - def RemovePatchesFromFilesDir(patches): """Removes the patches from $FILESDIR of a package. @@ -517,9 +526,9 @@ def UpdatePortageManifests(packages: Iterable[str], chroot_path: Path): def UpdatePackages( packages: Iterable[str], manifest_packages: Iterable[str], - llvm_variant, - git_hash, - svn_version, + llvm_variant: LLVMVariant, + git_hash: str, + svn_version: int, chroot_path: Path, mode, git_hash_source, @@ -549,86 +558,55 @@ def UpdatePackages( Gerrit commit URL and the second pair is the change list number. """ - # Construct a dictionary where the key is the absolute path of the symlink to - # the package and the value is the absolute path to the ebuild of the package. - paths_dict = CreatePathDictionaryFromPackages(chroot_path, packages) - - repo_path = os.path.dirname(next(iter(paths_dict.values()))) - - branch = "update-" + llvm_variant.value + "-" + git_hash + portage_packages = (PortagePackage(chroot_path, pkg) for pkg in packages) + chromiumos_overlay_path = ( + chroot_path / "src" / "third_party" / "chromiumos-overlay" + ) + branch_name = "update-" + llvm_variant.value + "-" + git_hash + + commit_message_header = "llvm" + if llvm_variant == LLVMVariant.next: + commit_message_header = "llvm-next" + if git_hash_source in get_llvm_hash.KNOWN_HASH_SOURCES: + commit_message_header += ( + f"/{git_hash_source}: upgrade to {git_hash} (r{svn_version})" + ) + else: + commit_message_header += f": upgrade to {git_hash} (r{svn_version})" - git.CreateBranch(repo_path, branch) + commit_lines = [ + commit_message_header + "\n", + "The following packages have been updated:", + ] + # Holds the list of packages that are updating. + updated_packages: List[str] = [] + git.CreateBranch(chromiumos_overlay_path, branch_name) try: - commit_message_header = "llvm" - if llvm_variant == LLVMVariant.next: - commit_message_header = "llvm-next" - if git_hash_source in get_llvm_hash.KNOWN_HASH_SOURCES: - commit_message_header += ( - f"/{git_hash_source}: upgrade to {git_hash} (r{svn_version})" - ) - else: - commit_message_header += f": upgrade to {git_hash} (r{svn_version})" - - commit_lines = [ - commit_message_header + "\n", - "The following packages have been updated:", - ] - - # Holds the list of packages that are updating. - packages = [] - - # Iterate through the dictionary. - # - # For each iteration: - # 1) Update the ebuild's LLVM hash. - # 2) Uprev the ebuild (symlink). - # 3) Add the modified package to the commit message. - for symlink_path, ebuild_path in paths_dict.items(): - path_to_ebuild_dir = os.path.dirname(ebuild_path) - - UpdateEbuildLLVMHash( - ebuild_path, llvm_variant, git_hash, svn_version - ) - - if llvm_variant == LLVMVariant.current: - UprevEbuildToVersion(symlink_path, svn_version, git_hash) - else: - UprevEbuildSymlink(symlink_path) - - cur_dir_name = os.path.basename(path_to_ebuild_dir) - parent_dir_name = os.path.basename( - os.path.dirname(path_to_ebuild_dir) - ) - - packages.append(f"{parent_dir_name}/{cur_dir_name}") - commit_lines.append(f"{parent_dir_name}/{cur_dir_name}") - + for pkg in portage_packages: + pkg.update(llvm_variant, git_hash, svn_version) + updated_packages.append(pkg.package) + commit_lines.append(pkg.package) if manifest_packages: UpdatePortageManifests(manifest_packages, chroot_path) commit_lines.append("Updated manifest for:") commit_lines.extend(manifest_packages) - EnsurePackageMaskContains(chroot_path, git_hash) - # Handle the patches for each package. package_info_dict = UpdatePackagesPatchMetadataFile( - chroot_path, svn_version, packages, mode + chroot_path, svn_version, updated_packages, mode ) - # Update the commit message if changes were made to a package's patches. commit_lines = StagePackagesPatchResultsForCommit( package_info_dict, commit_lines ) - if extra_commit_msg: commit_lines.append(extra_commit_msg) - - change_list = git.UploadChanges(repo_path, branch, commit_lines) - + change_list = git.UploadChanges( + chromiumos_overlay_path, branch_name, commit_lines + ) finally: - git.DeleteBranch(repo_path, branch) - + git.DeleteBranch(chromiumos_overlay_path, branch_name) return change_list @@ -706,7 +684,7 @@ def UpdatePackagesPatchMetadataFile( ) chroot_ebuild_path = Path( chroot.ConvertChrootPathsToAbsolutePaths( - chroot_path, [chroot_ebuild_str] + str(chroot_path), [chroot_ebuild_str] )[0] ) patches_json_fp = ( diff --git a/llvm_tools/update_chromeos_llvm_hash_unittest.py b/llvm_tools/update_chromeos_llvm_hash_unittest.py index 762a9e79..568242aa 100755 --- a/llvm_tools/update_chromeos_llvm_hash_unittest.py +++ b/llvm_tools/update_chromeos_llvm_hash_unittest.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -# -*- coding: utf-8 -*- # 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. @@ -13,6 +12,7 @@ import os from pathlib import Path import subprocess import sys +import tempfile import unittest import unittest.mock as mock @@ -53,7 +53,7 @@ class UpdateLLVMHashTest(unittest.TestCase): # does not exist. @mock.patch.object(os.path, "isfile", return_value=False) def testFailedToUpdateLLVMHashForInvalidEbuildPath(self, mock_isfile): - ebuild_path = "/some/path/to/package.ebuild" + ebuild_path = Path("/some/path/to/package.ebuild") llvm_variant = update_chromeos_llvm_hash.LLVMVariant.current git_hash = "a123testhash1" svn_version = 1000 @@ -94,7 +94,7 @@ class UpdateLLVMHashTest(unittest.TestCase): # 'LLVM_HASH'. with self.assertRaises(ValueError) as err: update_chromeos_llvm_hash.UpdateEbuildLLVMHash( - ebuild_file, llvm_variant, git_hash, svn_version + Path(ebuild_file), llvm_variant, git_hash, svn_version ) self.assertEqual(str(err.exception), "Failed to update LLVM_HASH") @@ -127,7 +127,7 @@ class UpdateLLVMHashTest(unittest.TestCase): # 'LLVM_NEXT_HASH'. with self.assertRaises(ValueError) as err: update_chromeos_llvm_hash.UpdateEbuildLLVMHash( - ebuild_file, llvm_variant, git_hash, svn_version + Path(ebuild_file), llvm_variant, git_hash, svn_version ) self.assertEqual( @@ -141,7 +141,6 @@ class UpdateLLVMHashTest(unittest.TestCase): def testSuccessfullyStageTheEbuildForCommitForLLVMHashUpdate( self, mock_stage_commit_command, mock_isfile ): - # Create a temporary file to simulate an ebuild file of a package. with test_helpers.CreateTemporaryJsonFile() as ebuild_file: # Updates LLVM_HASH to 'git_hash' and revision to @@ -163,7 +162,7 @@ class UpdateLLVMHashTest(unittest.TestCase): ) update_chromeos_llvm_hash.UpdateEbuildLLVMHash( - ebuild_file, llvm_variant, git_hash, svn_version + Path(ebuild_file), llvm_variant, git_hash, svn_version ) expected_file_contents = [ @@ -190,7 +189,6 @@ class UpdateLLVMHashTest(unittest.TestCase): def testSuccessfullyStageTheEbuildForCommitForLLVMNextHashUpdate( self, mock_stage_commit_command, mock_isfile ): - # Create a temporary file to simulate an ebuild file of a package. with test_helpers.CreateTemporaryJsonFile() as ebuild_file: # Updates LLVM_NEXT_HASH to 'git_hash' and revision to @@ -212,7 +210,7 @@ class UpdateLLVMHashTest(unittest.TestCase): ) update_chromeos_llvm_hash.UpdateEbuildLLVMHash( - ebuild_file, llvm_variant, git_hash, svn_version + Path(ebuild_file), llvm_variant, git_hash, svn_version ) expected_file_contents = [ @@ -473,122 +471,6 @@ class UpdateLLVMHashTest(unittest.TestCase): mock_command_output.assert_called_once() - # Simulate behavior of 'os.path.isdir()' when the path to the repo is not a - - # directory. - - @mock.patch.object(chroot, "GetChrootEbuildPaths") - @mock.patch.object(chroot, "ConvertChrootPathsToAbsolutePaths") - def testExceptionRaisedWhenCreatingPathDictionaryFromPackages( - self, mock_chroot_paths_to_symlinks, mock_get_chroot_paths - ): - - chroot_path = "/some/path/to/chroot" - - package_name = "test-pckg/package" - package_chroot_path = "/some/chroot/path/to/package-r1.ebuild" - - # Test function to simulate 'ConvertChrootPathsToAbsolutePaths' when a - # symlink does not start with the prefix '/mnt/host/source'. - def BadPrefixChrootPath(*args): - assert len(args) == 2 - raise ValueError( - "Invalid prefix for the chroot path: " - "%s" % package_chroot_path - ) - - # Simulate 'GetChrootEbuildPaths' when valid packages are passed in. - # - # Returns a list of chroot paths. - mock_get_chroot_paths.return_value = [package_chroot_path] - - # Use test function to simulate 'ConvertChrootPathsToAbsolutePaths' - # behavior. - mock_chroot_paths_to_symlinks.side_effect = BadPrefixChrootPath - - # Verify exception is raised when for an invalid prefix in the symlink. - with self.assertRaises(ValueError) as err: - update_chromeos_llvm_hash.CreatePathDictionaryFromPackages( - chroot_path, [package_name] - ) - - self.assertEqual( - str(err.exception), - "Invalid prefix for the chroot path: " "%s" % package_chroot_path, - ) - - mock_get_chroot_paths.assert_called_once_with( - chroot_path, [package_name] - ) - - mock_chroot_paths_to_symlinks.assert_called_once_with( - chroot_path, [package_chroot_path] - ) - - @mock.patch.object(chroot, "GetChrootEbuildPaths") - @mock.patch.object(chroot, "ConvertChrootPathsToAbsolutePaths") - @mock.patch.object( - update_chromeos_llvm_hash, "GetEbuildPathsFromSymLinkPaths" - ) - def testSuccessfullyCreatedPathDictionaryFromPackages( - self, - mock_ebuild_paths_from_symlink_paths, - mock_chroot_paths_to_symlinks, - mock_get_chroot_paths, - ): - - package_chroot_path = "/mnt/host/source/src/path/to/package-r1.ebuild" - - # Simulate 'GetChrootEbuildPaths' when returning a chroot path for a valid - # package. - # - # Returns a list of chroot paths. - mock_get_chroot_paths.return_value = [package_chroot_path] - - package_symlink_path = ( - "/some/path/to/chroot/src/path/to/package-r1.ebuild" - ) - - # Simulate 'ConvertChrootPathsToAbsolutePaths' when returning a symlink to - # a chroot path that points to a package. - # - # Returns a list of symlink file paths. - mock_chroot_paths_to_symlinks.return_value = [package_symlink_path] - - chroot_package_path = "/some/path/to/chroot/src/path/to/package.ebuild" - - # Simulate 'GetEbuildPathsFromSymlinkPaths' when returning a dictionary of - # a symlink that points to an ebuild. - # - # Returns a dictionary of a symlink and ebuild file path pair - # where the key is the absolute path to the symlink of the ebuild file - # and the value is the absolute path to the ebuild file of the package. - mock_ebuild_paths_from_symlink_paths.return_value = { - package_symlink_path: chroot_package_path - } - - chroot_path = "/some/path/to/chroot" - package_name = "test-pckg/package" - - self.assertEqual( - update_chromeos_llvm_hash.CreatePathDictionaryFromPackages( - chroot_path, [package_name] - ), - {package_symlink_path: chroot_package_path}, - ) - - mock_get_chroot_paths.assert_called_once_with( - chroot_path, [package_name] - ) - - mock_chroot_paths_to_symlinks.assert_called_once_with( - chroot_path, [package_chroot_path] - ) - - mock_ebuild_paths_from_symlink_paths.assert_called_once_with( - [package_symlink_path] - ) - @mock.patch.object(subprocess, "check_output", return_value=None) def testSuccessfullyRemovedPatchesFromFilesDir(self, mock_run_cmd): patches_to_remove_list = [ @@ -623,7 +505,6 @@ class UpdateLLVMHashTest(unittest.TestCase): @mock.patch.object(os.path, "isfile", return_value=True) @mock.patch.object(subprocess, "check_output", return_value=None) def testSuccessfullyStagedPatchMetadataFileForCommit(self, mock_run_cmd, _): - patch_metadata_path = "/abs/path/to/filesdir/PATCHES.json" update_chromeos_llvm_hash.StagePatchMetadataFileForCommit( @@ -672,7 +553,6 @@ class UpdateLLVMHashTest(unittest.TestCase): def testAddedPatchResultsForCommit( self, mock_remove_patches, mock_stage_patches_for_commit ): - package_1_patch_info_dict = { "applied_patches": [], "failed_patches": [], @@ -723,315 +603,90 @@ class UpdateLLVMHashTest(unittest.TestCase): self.assertEqual(mock_stage_patches_for_commit.call_count, 2) - @mock.patch.object(get_llvm_hash, "GetLLVMMajorVersion") - @mock.patch.object( - update_chromeos_llvm_hash, "CreatePathDictionaryFromPackages" - ) - @mock.patch.object(git, "CreateBranch") - @mock.patch.object(update_chromeos_llvm_hash, "UpdateEbuildLLVMHash") - @mock.patch.object(update_chromeos_llvm_hash, "UprevEbuildSymlink") - @mock.patch.object(git, "UploadChanges") - @mock.patch.object(git, "DeleteBranch") - @mock.patch.object(os.path, "realpath") - def testExceptionRaisedWhenUpdatingPackages( - self, - mock_realpath, - mock_delete_repo, - mock_upload_changes, - mock_uprev_symlink, - mock_update_llvm_next, - mock_create_repo, - mock_create_path_dict, - mock_llvm_major_version, - ): - - path_to_package_dir = "/some/path/to/chroot/src/path/to" - abs_path_to_package = os.path.join( - path_to_package_dir, "package.ebuild" - ) - symlink_path_to_package = os.path.join( - path_to_package_dir, "package-r1.ebuild" + def setup_mock_src_tree(self, src_tree: Path): + package_dir = ( + src_tree / "src/third_party/chromiumos-overlay/sys-devel/llvm" ) - - mock_llvm_major_version.return_value = "1234" - - # Test function to simulate 'CreateBranch' when successfully created the - # branch on a valid repo path. - def SuccessfullyCreateBranchForChanges(_, branch): - self.assertEqual(branch, "update-LLVM_NEXT_HASH-a123testhash4") - - # Test function to simulate 'UpdateEbuildLLVMHash' when successfully - # updated the ebuild's 'LLVM_NEXT_HASH'. - def SuccessfullyUpdatedLLVMHash(ebuild_path, _, git_hash, svn_version): - self.assertEqual(ebuild_path, abs_path_to_package) - self.assertEqual(git_hash, "a123testhash4") - self.assertEqual(svn_version, 1000) - - # Test function to simulate 'UprevEbuildSymlink' when the symlink to the - # ebuild does not have a revision number. - def FailedToUprevEbuildSymlink(_): - # Raises a 'ValueError' exception because the symlink did not have have a - # revision number. - raise ValueError("Failed to uprev the ebuild.") - - # Test function to fail on 'UploadChanges' if the function gets called - # when an exception is raised. - def ShouldNotExecuteUploadChanges(*args): - # Test function should not be called (i.e. execution should resume in the - # 'finally' block) because 'UprevEbuildSymlink' raised an - # exception. - assert len(args) == 3 - assert False, ( - 'Failed to go to "finally" block ' - "after the exception was raised." + package_dir.mkdir(parents=True) + ebuild_path = package_dir / "llvm-00.00_pre0_p0.ebuild" + with ebuild_path.open("w", encoding="utf-8") as f: + f.writelines( + [ + 'LLVM_HASH="abcdef123456" # r123456', + 'LLVM_NEXT_HASH="987654321fedcba" # r99453', + ] ) - - test_package_path_dict = {symlink_path_to_package: abs_path_to_package} - - # Simulate behavior of 'CreatePathDictionaryFromPackages()' when - # successfully created a dictionary where the key is the absolute path to - # the symlink of the package and value is the absolute path to the ebuild of - # the package. - mock_create_path_dict.return_value = test_package_path_dict - - # Use test function to simulate behavior. - mock_create_repo.side_effect = SuccessfullyCreateBranchForChanges - mock_update_llvm_next.side_effect = SuccessfullyUpdatedLLVMHash - mock_uprev_symlink.side_effect = FailedToUprevEbuildSymlink - mock_upload_changes.side_effect = ShouldNotExecuteUploadChanges - mock_realpath.return_value = ( - "/abs/path/to/test-packages/package1.ebuild" - ) - - packages_to_update = ["test-packages/package1"] - llvm_variant = update_chromeos_llvm_hash.LLVMVariant.next - git_hash = "a123testhash4" - svn_version = 1000 - chroot_path = Path("/some/path/to/chroot") - git_hash_source = "google3" - branch = "update-LLVM_NEXT_HASH-a123testhash4" - extra_commit_msg = None - - # Verify exception is raised when an exception is thrown within - # the 'try' block by UprevEbuildSymlink function. - with self.assertRaises(ValueError) as err: - update_chromeos_llvm_hash.UpdatePackages( - packages=packages_to_update, - manifest_packages=[], - llvm_variant=llvm_variant, - git_hash=git_hash, - svn_version=svn_version, - chroot_path=chroot_path, - mode=failure_modes.FailureModes.FAIL, - git_hash_source=git_hash_source, - extra_commit_msg=extra_commit_msg, + symlink_path = package_dir / "llvm-00.00_pre0_p0-r1234.ebuild" + symlink_path.symlink_to(ebuild_path) + return package_dir, ebuild_path, symlink_path + + def testPortagePackageConstruction(self): + with tempfile.TemporaryDirectory( + "update_chromeos_llvm_hash.tmp" + ) as workdir_str: + src_tree = Path(workdir_str) + package_dir, ebuild_path, symlink_path = self.setup_mock_src_tree( + src_tree ) - self.assertEqual(str(err.exception), "Failed to uprev the ebuild.") - - mock_create_path_dict.assert_called_once_with( - chroot_path, packages_to_update - ) - - mock_create_repo.assert_called_once_with(path_to_package_dir, branch) - - mock_update_llvm_next.assert_called_once_with( - abs_path_to_package, llvm_variant, git_hash, svn_version - ) - - mock_uprev_symlink.assert_called_once_with(symlink_path_to_package) + # Test that we're upreving if there's a symlink. + def mock_find_package_ebuild(_, package_name): + self.assertEqual( + package_name, + f"{package_dir.parent.name}/{package_dir.name}", + ) + return symlink_path + + with mock.patch( + "update_chromeos_llvm_hash.PortagePackage.find_package_ebuild", + mock_find_package_ebuild, + ): + pkg = update_chromeos_llvm_hash.PortagePackage( + src_tree, "sys-devel/llvm" + ) + self.assertEqual(pkg.uprev_target, symlink_path.absolute()) + self.assertEqual(pkg.ebuild_path, ebuild_path.absolute()) + self.assertEqual(pkg.live_ebuild(), None) - mock_upload_changes.assert_not_called() + # Make sure if the live ebuild is there, we find it. + live_ebuild_path = package_dir / "llvm-9999.ebuild" + live_ebuild_path.touch() - mock_delete_repo.assert_called_once_with(path_to_package_dir, branch) + pkg = update_chromeos_llvm_hash.PortagePackage( + src_tree, "sys-devel/llvm" + ) + self.assertEqual(pkg.live_ebuild(), live_ebuild_path) - @mock.patch.object(update_chromeos_llvm_hash, "EnsurePackageMaskContains") + @mock.patch("subprocess.run") + @mock.patch("subprocess.check_output") @mock.patch.object(get_llvm_hash, "GetLLVMMajorVersion") - @mock.patch.object( - update_chromeos_llvm_hash, "CreatePathDictionaryFromPackages" - ) - @mock.patch.object(git, "CreateBranch") - @mock.patch.object(update_chromeos_llvm_hash, "UpdateEbuildLLVMHash") - @mock.patch.object(update_chromeos_llvm_hash, "UprevEbuildSymlink") - @mock.patch.object(git, "UploadChanges") - @mock.patch.object(git, "DeleteBranch") - @mock.patch.object( - update_chromeos_llvm_hash, "UpdatePackagesPatchMetadataFile" - ) - @mock.patch.object( - update_chromeos_llvm_hash, "StagePatchMetadataFileForCommit" - ) - def testSuccessfullyUpdatedPackages( - self, - mock_stage_patch_file, - mock_update_package_metadata_file, - mock_delete_repo, - mock_upload_changes, - mock_uprev_symlink, - mock_update_llvm_next, - mock_create_repo, - mock_create_path_dict, - mock_llvm_version, - mock_mask_contains, + def testUpdatePackages( + self, mock_llvm_major_version, mock_check_output, mock_run ): - - path_to_package_dir = "/some/path/to/chroot/src/path/to" - abs_path_to_package = os.path.join( - path_to_package_dir, "package.ebuild" - ) - symlink_path_to_package = os.path.join( - path_to_package_dir, "package-r1.ebuild" - ) - - # Test function to simulate 'CreateBranch' when successfully created the - # branch for the changes to be made to the ebuild files. - def SuccessfullyCreateBranchForChanges(_, branch): - self.assertEqual(branch, "update-LLVM_NEXT_HASH-a123testhash5") - - # Test function to simulate 'UploadChanges' after a successfull update of - # 'LLVM_NEXT_HASH" of the ebuild file. - def SuccessfullyUpdatedLLVMHash(ebuild_path, _, git_hash, svn_version): - self.assertEqual( - ebuild_path, "/some/path/to/chroot/src/path/to/package.ebuild" - ) - self.assertEqual(git_hash, "a123testhash5") - self.assertEqual(svn_version, 1000) - - # Test function to simulate 'UprevEbuildSymlink' when successfully - # incremented the revision number by 1. - def SuccessfullyUprevedEbuildSymlink(symlink_path): - self.assertEqual( - symlink_path, - "/some/path/to/chroot/src/path/to/package-r1.ebuild", - ) - - # Test function to simulate 'UpdatePackagesPatchMetadataFile()' when the - # patch results contains a disabled patch in 'disable_patches' mode. - def RetrievedPatchResults(chroot_path, svn_version, packages, mode): - - self.assertEqual(chroot_path, Path("/some/path/to/chroot")) - self.assertEqual(svn_version, 1000) - self.assertListEqual(packages, ["path/to"]) - self.assertEqual(mode, failure_modes.FailureModes.DISABLE_PATCHES) - - patch_metadata_file = "PATCHES.json" - PatchInfo = collections.namedtuple( - "PatchInfo", - [ - "applied_patches", - "failed_patches", - "non_applicable_patches", - "disabled_patches", - "removed_patches", - "modified_metadata", - ], - ) - - package_patch_info = PatchInfo( - applied_patches=["fix_display.patch"], - failed_patches=["fix_stdout.patch"], - non_applicable_patches=[], - disabled_patches=["fix_stdout.patch"], - removed_patches=[], - modified_metadata="/abs/path/to/filesdir/%s" - % patch_metadata_file, + mock_llvm_major_version.return_value = "17" + with tempfile.TemporaryDirectory( + "update_chromeos_llvm_hash.tmp" + ) as workdir_str: + src_tree = Path(workdir_str) + package_dir, ebuild_path, symlink_path = self.setup_mock_src_tree( + src_tree ) - package_info_dict = {"path/to": package_patch_info._asdict()} - - # Returns a dictionary where the key is the package and the value is a - # dictionary that contains information about the package's patch results - # produced by the patch manager. - return package_info_dict - - # Test function to simulate 'UploadChanges()' when successfully created a - # commit for the changes made to the packages and their patches and - # retrieved the change list of the commit. - def SuccessfullyUploadedChanges(*args): - assert len(args) == 3 - commit_url = "https://some_name/path/to/commit/+/12345" - return git.CommitContents(url=commit_url, cl_number=12345) - - test_package_path_dict = {symlink_path_to_package: abs_path_to_package} - - # Simulate behavior of 'CreatePathDictionaryFromPackages()' when - # successfully created a dictionary where the key is the absolute path to - # the symlink of the package and value is the absolute path to the ebuild of - # the package. - mock_create_path_dict.return_value = test_package_path_dict - - # Use test function to simulate behavior. - mock_create_repo.side_effect = SuccessfullyCreateBranchForChanges - mock_update_llvm_next.side_effect = SuccessfullyUpdatedLLVMHash - mock_uprev_symlink.side_effect = SuccessfullyUprevedEbuildSymlink - mock_update_package_metadata_file.side_effect = RetrievedPatchResults - mock_upload_changes.side_effect = SuccessfullyUploadedChanges - mock_llvm_version.return_value = "1234" - mock_mask_contains.reurn_value = None - - packages_to_update = ["test-packages/package1"] - llvm_variant = update_chromeos_llvm_hash.LLVMVariant.next - git_hash = "a123testhash5" - svn_version = 1000 - chroot_path = Path("/some/path/to/chroot") - git_hash_source = "tot" - branch = "update-LLVM_NEXT_HASH-a123testhash5" - extra_commit_msg = "\ncommit-message-end" - - change_list = update_chromeos_llvm_hash.UpdatePackages( - packages=packages_to_update, - manifest_packages=[], - llvm_variant=llvm_variant, - git_hash=git_hash, - svn_version=svn_version, - chroot_path=chroot_path, - mode=failure_modes.FailureModes.DISABLE_PATCHES, - git_hash_source=git_hash_source, - extra_commit_msg=extra_commit_msg, - ) - - self.assertEqual( - change_list.url, "https://some_name/path/to/commit/+/12345" - ) - - self.assertEqual(change_list.cl_number, 12345) - - mock_create_path_dict.assert_called_once_with( - chroot_path, packages_to_update - ) - - mock_create_repo.assert_called_once_with(path_to_package_dir, branch) + def mock_find_package_ebuild(*_): + return symlink_path - mock_update_llvm_next.assert_called_once_with( - abs_path_to_package, llvm_variant, git_hash, svn_version - ) - - mock_uprev_symlink.assert_called_once_with(symlink_path_to_package) - - mock_mask_contains.assert_called_once_with(chroot_path, git_hash) - - expected_commit_messages = [ - "llvm-next/tot: upgrade to a123testhash5 (r1000)\n", - "The following packages have been updated:", - "path/to", - "\nFor the package path/to:", - "The patch metadata file PATCHES.json was modified", - "The following patches were disabled:", - "fix_stdout.patch", - "\ncommit-message-end", - ] - - mock_update_package_metadata_file.assert_called_once() - - mock_stage_patch_file.assert_called_once_with( - "/abs/path/to/filesdir/PATCHES.json" - ) - - mock_upload_changes.assert_called_once_with( - path_to_package_dir, branch, expected_commit_messages - ) - - mock_delete_repo.assert_called_once_with(path_to_package_dir, branch) + with mock.patch( + "update_chromeos_llvm_hash.PortagePackage.find_package_ebuild", + mock_find_package_ebuild, + ): + pkg = update_chromeos_llvm_hash.PortagePackage( + src_tree, "sys-devel/llvm" + ) + pkg.update( + update_chromeos_llvm_hash.LLVMVariant.current, + "beef3333", + 3333, + ) @mock.patch.object(chroot, "VerifyChromeOSRoot") @mock.patch.object(chroot, "VerifyOutsideChroot") -- cgit v1.2.3 From f5ad557552b7097d6d4d5e055272be48fa5e7035 Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Tue, 25 Jul 2023 00:19:09 +0000 Subject: llvm_tools: update_chromeos_llvm_hash.py straggling formats Ran cros format on the code again, and they couldn't cleanly fit in the patch stack. BUG=None TEST=CQ Change-Id: I8e5895903c0f4ca4aa4ecda76565d6ec9cb6fe06 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4713967 Tested-by: Jordan Abrahams-Whitehead Commit-Queue: Jordan Abrahams-Whitehead Reviewed-by: George Burgess Reviewed-by: Ryan Beltran --- llvm_tools/update_chromeos_llvm_hash.py | 86 +++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 37 deletions(-) diff --git a/llvm_tools/update_chromeos_llvm_hash.py b/llvm_tools/update_chromeos_llvm_hash.py index 4404fa2b..9a8754d4 100755 --- a/llvm_tools/update_chromeos_llvm_hash.py +++ b/llvm_tools/update_chromeos_llvm_hash.py @@ -19,6 +19,7 @@ import subprocess import textwrap from typing import Dict, Iterable, List, Optional +import atomic_write_file import chroot import failure_modes import get_llvm_hash @@ -233,7 +234,12 @@ def GetCommandLineArgs(): return parser.parse_args() -def UpdateEbuildLLVMHash(ebuild_path, llvm_variant, git_hash, svn_version): +def UpdateEbuildLLVMHash( + ebuild_path: Path, + llvm_variant: LLVMVariant, + git_hash: str, + svn_version: int, +): """Updates the LLVM hash in the ebuild. The build changes are staged for commit in the temporary repo. @@ -249,33 +255,26 @@ def UpdateEbuildLLVMHash(ebuild_path, llvm_variant, git_hash, svn_version): of the changes or failed to update the LLVM hash. """ - # Iterate through each ebuild. - # # For each ebuild, read the file in # advance and then create a temporary file # that gets updated with the new LLVM hash # and revision number and then the ebuild file # gets updated to the temporary file. - if not os.path.isfile(ebuild_path): raise ValueError(f"Invalid ebuild path provided: {ebuild_path}") - temp_ebuild_file = f"{ebuild_path}.temp" - with open(ebuild_path, encoding="utf-8") as ebuild_file: - # write updates to a temporary file in case of interrupts - with open(temp_ebuild_file, "w", encoding="utf-8") as temp_file: - for cur_line in ReplaceLLVMHash( - ebuild_file, llvm_variant, git_hash, svn_version - ): - temp_file.write(cur_line) - os.rename(temp_ebuild_file, ebuild_path) - - # Get the path to the parent directory. - parent_dir = os.path.dirname(ebuild_path) - + new_lines = list( + ReplaceLLVMHash(ebuild_file, llvm_variant, git_hash, svn_version) + ) + with atomic_write_file.atomic_write( + ebuild_path, "w", encoding="utf-8" + ) as ebuild_file: + ebuild_file.writelines(new_lines) # Stage the changes. - subprocess.check_output(["git", "-C", parent_dir, "add", ebuild_path]) + subprocess.check_output( + ["git", "-C", ebuild_path.parent, "add", ebuild_path] + ) def ReplaceLLVMHash(ebuild_lines, llvm_variant, git_hash, svn_version): @@ -724,34 +723,47 @@ def UpdatePackagesPatchMetadataFile( return package_info -def ChangeRepoManifest(git_hash: str, chroot_path: Path): - """Change the repo internal manifest for llvm-project.""" - manifest_path = manifest_utils.get_chromeos_manifest_path(chroot_path) - manifest_dir = manifest_utils.get_chromeos_manifest_path(chroot_path).parent +def ChangeRepoManifest(git_hash: str, src_tree: Path): + """Change the repo internal manifest for llvm-project. + + Args: + git_hash: The LLVM git hash to change to. + src_tree: ChromiumOS source tree checkout. + + Returns: + The uploaded changelist CommitContents. + """ + manifest_dir = manifest_utils.get_chromeos_manifest_path(src_tree).parent branch_name = "update-llvm-project-" + git_hash - commit_lines = textwrap.dedent( - f""" - manifest: Update llvm-project to {git_hash} + commit_lines = ( + textwrap.dedent( + f""" + manifest: Update llvm-project to {git_hash} - Upgrade the local LLVM reversion to match the new llvm ebuild - hash. This must be merged along with any chromiumos-overlay - changes to LLVM. Automatic uprevs rely on the manifest hash - to match what is specified by LLVM_HASH. + Upgrade the local LLVM reversion to match the new llvm ebuild + hash. This must be merged along with any chromiumos-overlay + changes to LLVM. Automatic uprevs rely on the manifest hash + to match what is specified by LLVM_HASH. - This CL is generated by the update_chromeos_llvm_hash.py script. + This CL is generated by the update_chromeos_llvm_hash.py script. - BUG=None - TEST=CQ - """ - ).lstrip().splitlines() + BUG=None + TEST=CQ + """ + ) + .lstrip() + .splitlines() + ) git.CreateBranch(manifest_dir, branch_name) try: - manifest_utils.update_chromeos_manifest( + manifest_path = manifest_utils.update_chromeos_manifest( git_hash, - chroot_path, + src_tree, + ) + subprocess.run( + ["git", "-C", manifest_dir, "add", manifest_path.name], check=True ) - subprocess.run(["git", "-C", manifest_dir, "add", manifest_path.name], check=True) change_list = git.UploadChanges(manifest_dir, branch_name, commit_lines) finally: git.DeleteBranch(manifest_dir, branch_name) -- cgit v1.2.3 From ae60a6b5ad7cb7877e7730f6a3e28640398e8fa9 Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Tue, 25 Jul 2023 01:16:17 +0000 Subject: llvm_tools: Preserve comments to manifest_utils Comments should be preserved in the manifest files. While the code seems to work, the test itself was broken because it did not use the custom parser. Expand upon the test to better show that everything works. BUG=None TEST=./run_tests_for.py llvm_tools/manifest_utils_unittest.py Change-Id: I9f6292b8418374cbed777c4f786d498fcb64842b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4713968 Reviewed-by: George Burgess Reviewed-by: Ryan Beltran Commit-Queue: Jordan Abrahams-Whitehead Tested-by: Jordan Abrahams-Whitehead --- llvm_tools/manifest_utils.py | 11 ++++++++--- llvm_tools/manifest_utils_unittest.py | 11 ++++++++++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/llvm_tools/manifest_utils.py b/llvm_tools/manifest_utils.py index 83d0ca9d..67eae4f3 100644 --- a/llvm_tools/manifest_utils.py +++ b/llvm_tools/manifest_utils.py @@ -31,6 +31,13 @@ class UpdateManifestError(Exception): pass +def make_xmlparser(): + """Return a new xmlparser with custom TreeBuilder.""" + return ElementTree.XMLParser( + target=ElementTree.TreeBuilder(insert_comments=True) + ) + + def update_chromeos_manifest(revision: str, src_tree: Path) -> Path: """Replaces the manifest project revision with 'revision'. @@ -53,9 +60,7 @@ def update_chromeos_manifest(revision: str, src_tree: Path) -> Path: FormattingError: The manifest could not be reformatted. """ manifest_path = get_chromeos_manifest_path(src_tree) - parser = ElementTree.XMLParser( - target=ElementTree.TreeBuilder(insert_comments=True) - ) + parser = make_xmlparser() xmltree = ElementTree.parse(manifest_path, parser) update_chromeos_manifest_tree(revision, xmltree.getroot()) with atomic_write_file.atomic_write(manifest_path, mode="wb") as f: diff --git a/llvm_tools/manifest_utils_unittest.py b/llvm_tools/manifest_utils_unittest.py index c99b01ab..9a21d990 100644 --- a/llvm_tools/manifest_utils_unittest.py +++ b/llvm_tools/manifest_utils_unittest.py @@ -19,6 +19,8 @@ on toolchain projects (llvm-project, etc.) which are public. MANIFEST_FIXTURE = """ + Date: Wed, 26 Jul 2023 10:05:34 -0700 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-4.19 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update amd profile on chromeos-kernel-5.15 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: Idd86874319dbcf34c655b30eed39b4be9803ebd5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4720046 Reviewed-by: George Burgess Commit-Queue: George Burgess Tested-by: George Burgess --- afdo_metadata/kernel_afdo.json | 10 +++++----- afdo_metadata/kernel_arm_afdo.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index 0e953c78..c3b2dc75 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -1,17 +1,17 @@ { "chromeos-kernel-4_14": { - "name": "R117-15509.6-1688981610" + "name": "R117-15509.27-1690191273" }, "chromeos-kernel-4_19": { - "name": "R117-15509.6-1688981510" + "name": "R117-15509.20-1690191373" }, "chromeos-kernel-5_4": { - "name": "R117-15509.6-1688981733" + "name": "R117-15509.27-1690191102" }, "chromeos-kernel-5_10": { - "name": "R117-15509.6-1688981532" + "name": "R117-15509.27-1690191159" }, "chromeos-kernel-5_15": { - "name": "R117-15509.6-1688981665" + "name": "R117-15509.27-1690191202" } } diff --git a/afdo_metadata/kernel_arm_afdo.json b/afdo_metadata/kernel_arm_afdo.json index ca17f11f..50113ce7 100644 --- a/afdo_metadata/kernel_arm_afdo.json +++ b/afdo_metadata/kernel_arm_afdo.json @@ -1,5 +1,5 @@ { "chromeos-kernel-5_15": { - "name": "R117-15509.6-1688981807" + "name": "R117-15509.27-1690191309" } } -- cgit v1.2.3 From 9d69fa5b02db7bc7fb95e5e355ac2b9e0c476c51 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Wed, 26 Jul 2023 16:19:34 -0600 Subject: auto_delete_nightly_test_data: remove dead parts Now that old logs have been moved around, this script (that tried to keep them somewhat tidy) is failing. Since we no longer need to keep these bits tidy, don't. BUG=b:293350157, b:288112082 TEST=Unittests Change-Id: I92fd25bb72de00a4791a9653ed6ea53644c2fb23 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4723016 Reviewed-by: Jordan Abrahams-Whitehead Commit-Queue: George Burgess Tested-by: George Burgess --- auto_delete_nightly_test_data.py | 100 ++------------------------------------- 1 file changed, 4 insertions(+), 96 deletions(-) diff --git a/auto_delete_nightly_test_data.py b/auto_delete_nightly_test_data.py index 7405496d..d45d4f70 100755 --- a/auto_delete_nightly_test_data.py +++ b/auto_delete_nightly_test_data.py @@ -26,74 +26,6 @@ from cros_utils import constants from cros_utils import misc -DIR_BY_WEEKDAY = ("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun") -NIGHTLY_TESTS_WORKSPACE = os.path.join( - constants.CROSTC_WORKSPACE, "nightly-tests" -) - - -def CleanNumberedDir(s, dry_run=False): - """Deleted directories under each dated_dir.""" - chromeos_dirs = [ - os.path.join(s, x) - for x in os.listdir(s) - if misc.IsChromeOsTree(os.path.join(s, x)) - ] - ce = command_executer.GetCommandExecuter(log_level="none") - all_succeeded = True - for cd in chromeos_dirs: - if misc.DeleteChromeOsTree(cd, dry_run=dry_run): - print(f"Successfully removed chromeos tree {cd!r}.") - else: - all_succeeded = False - print(f"Failed to remove chromeos tree {cd!r}, please check.") - - if not all_succeeded: - print("Failed to delete at least one chromeos tree, please check.") - return False - - ## Now delete the numbered dir Before forcibly removing the directory, just - ## check 's' to make sure it matches the expected pattern. A valid dir to be - ## removed must be '/usr/local/google/crostc/(SUN|MON|TUE...|SAT)'. - valid_dir_pattern = ( - "^" + NIGHTLY_TESTS_WORKSPACE + "/(" + "|".join(DIR_BY_WEEKDAY) + ")" - ) - if not re.search(valid_dir_pattern, s): - print( - f"Trying to delete an invalid dir {s!r} (must match " - f"{valid_dir_pattern!r}), please check." - ) - return False - - cmd = f"rm -fr {s}" - if dry_run: - print(cmd) - else: - if ( - ce.RunCommand(cmd, print_to_console=False, terminated_timeout=480) - == 0 - ): - print(f"Successfully removed {s!r}.") - else: - all_succeeded = False - print(f"Failed to remove {s!r}, please check.") - return all_succeeded - - -def CleanDatedDir(dated_dir, dry_run=False): - # List subdirs under dir - subdirs = [ - os.path.join(dated_dir, x) - for x in os.listdir(dated_dir) - if os.path.isdir(os.path.join(dated_dir, x)) - ] - all_succeeded = True - for s in subdirs: - if not CleanNumberedDir(s, dry_run): - all_succeeded = False - return all_succeeded - - def ProcessArguments(argv): """Process arguments.""" parser = argparse.ArgumentParser( @@ -319,42 +251,18 @@ def CleanChromeTelemetryTmpFiles(dry_run: bool) -> int: def Main(argv): """Delete nightly test data directories, tmps and test images.""" options = ProcessArguments(argv) - # Function 'isoweekday' returns 1(Monday) - 7 (Sunday). - d = datetime.datetime.today().isoweekday() - # We go back 1 week, delete from that day till we are - # options.days_to_preserve away from today. - s = d - 7 - e = d - int(options.days_to_preserve) - rv = 0 - for i in range(s + 1, e): - if i <= 0: - ## Wrap around if index is negative. 6 is from i + 7 - 1, because - ## DIR_BY_WEEKDAY starts from 0, while isoweekday is from 1-7. - dated_dir = DIR_BY_WEEKDAY[i + 6] - else: - dated_dir = DIR_BY_WEEKDAY[i - 1] - - rv += ( - 0 - if CleanDatedDir( - os.path.join(NIGHTLY_TESTS_WORKSPACE, dated_dir), - options.dry_run, - ) - else 1 - ) - ## Clean temporaries, images under crostc/chromeos - rv2 = CleanChromeOsTmpAndImages( + rv = CleanChromeOsTmpAndImages( int(options.days_to_preserve), options.dry_run ) # Clean CLs that are not updated in last 2 weeks. - rv3 = CleanOldCLs("14", options.dry_run) + rv += CleanOldCLs("14", options.dry_run) # Clean telemetry temporaries from chrome source tree inside chroot. - rv4 = CleanChromeTelemetryTmpFiles(options.dry_run) + rv += CleanChromeTelemetryTmpFiles(options.dry_run) - return rv + rv2 + rv3 + rv4 + return rv if __name__ == "__main__": -- cgit v1.2.3 From 0a6e2019ecc0c5ddfd78642db72ec176b10bd254 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Wed, 26 Jul 2023 16:23:20 -0600 Subject: auto_delete_nightly_test_data: clean up lints BUG=b:293350157, b:288112082 TEST=Unittests, `repo upload` Change-Id: I1e82b619971092950c2f87fde54c8c72d145bf4c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4723017 Reviewed-by: Jordan Abrahams-Whitehead Commit-Queue: George Burgess Tested-by: George Burgess --- auto_delete_nightly_test_data.py | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/auto_delete_nightly_test_data.py b/auto_delete_nightly_test_data.py index d45d4f70..ec459bef 100755 --- a/auto_delete_nightly_test_data.py +++ b/auto_delete_nightly_test_data.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -# -*- coding: utf-8 -*- # # Copyright 2019 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be @@ -10,10 +9,8 @@ __author__ = "shenhan@google.com (Han Shen)" import argparse -import datetime import os from pathlib import Path -import re import shutil import stat import sys @@ -23,7 +20,6 @@ from typing import Callable from cros_utils import command_executer from cros_utils import constants -from cros_utils import misc def ProcessArguments(argv): @@ -68,10 +64,10 @@ def RemoveAllSubdirsMatchingPredicate( try: dir_entries = list(base_dir.iterdir()) except FileNotFoundError as e: - # We get this if the directory itself doesn't exist. Since we're cleaning - # tempdirs, that's as good as a success. Further, the prior approach here - # was using the `find` binary, which exits successfully if nothing is - # found. + # We get this if the directory itself doesn't exist. Since we're + # cleaning tempdirs, that's as good as a success. Further, the prior + # approach here was using the `find` binary, which exits successfully + # if nothing is found. print(f"Error enumerating {base_dir}'s contents; skipping removal: {e}") return 0 @@ -81,8 +77,8 @@ def RemoveAllSubdirsMatchingPredicate( continue try: - # Take the stat here and use that later, so we only need to check for a - # nonexistent file once. + # Take the stat here and use that later, so we only need to check + # for a nonexistent file once. st = file.stat() except FileNotFoundError: # This was deleted while were checking; ignore it. @@ -108,21 +104,22 @@ def RemoveAllSubdirsMatchingPredicate( shutil.rmtree(file, onerror=OnError) - # Some errors can be other processes racing with us to delete things. Don't - # count those as an error which we complain loudly about. + # Some errors can be other processes racing with us to delete things. + # Don't count those as an error which we complain loudly about. if this_iteration_had_errors: if file.exists(): had_errors = True else: print( - f"Discarding removal errors for {file}; dir was still removed." + f"Discarding removal errors for {file}; dir was still " + "removed." ) return 1 if had_errors else 0 def IsChromeOsTmpDeletionCandidate(file_name: str): - """Returns whether the given basename can be deleted from a chroot's /tmp.""" + """Returns whether the given basename can be deleted from chroot's /tmp.""" name_prefixes = ( "test_that_", "cros-update", @@ -171,13 +168,13 @@ def CleanChromeOsImageFiles( try: shutil.rmtree(subdir_path) print( - "Successfully cleaned chromeos image autotest directories " - f"from {subdir_path!r}." + "Successfully cleaned chromeos image autotest " + f"directories from {subdir_path!r}." ) except OSError: print( - "Some image autotest directories were not removed from " - f'"{subdir_path}".' + "Some image autotest directories were not " + f'"removed from {subdir_path}".' ) errors += 1 -- cgit v1.2.3 From 4a3fac641ea7035f6403fb4e0b97a54ac9160e93 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Thu, 27 Jul 2023 11:36:12 -0600 Subject: auto_delete_nightly_test_data: use `|=` for return values follow-up given feedback on crrev.com/c/4723016 BUG=None TEST=Unittests Change-Id: I7f9236785f897dbb1f494fb4cef9baf851c56943 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4726282 Reviewed-by: Jordan Abrahams-Whitehead Commit-Queue: George Burgess Tested-by: George Burgess --- auto_delete_nightly_test_data.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/auto_delete_nightly_test_data.py b/auto_delete_nightly_test_data.py index ec459bef..06d02067 100755 --- a/auto_delete_nightly_test_data.py +++ b/auto_delete_nightly_test_data.py @@ -16,7 +16,7 @@ import stat import sys import time import traceback -from typing import Callable +from typing import Callable, List from cros_utils import command_executer from cros_utils import constants @@ -181,7 +181,7 @@ def CleanChromeOsImageFiles( return errors -def CleanChromeOsTmpAndImages(days_to_preserve=1, dry_run=False): +def CleanChromeOsTmpAndImages(days_to_preserve=1, dry_run=False) -> int: """Delete temporaries, images under crostc/chromeos.""" chromeos_chroot_tmp = os.path.join( constants.CROSTC_WORKSPACE, "chromeos", "out", "tmp" @@ -189,26 +189,26 @@ def CleanChromeOsTmpAndImages(days_to_preserve=1, dry_run=False): # Clean files in tmp directory rv = CleanChromeOsTmpFiles(chromeos_chroot_tmp, days_to_preserve, dry_run) # Clean image files in *-tryjob directories - rv += CleanChromeOsImageFiles( + rv |= CleanChromeOsImageFiles( chromeos_chroot_tmp, "-tryjob", days_to_preserve, dry_run ) # Clean image files in *-release directories - rv += CleanChromeOsImageFiles( + rv |= CleanChromeOsImageFiles( chromeos_chroot_tmp, "-release", days_to_preserve, dry_run ) # Clean image files in *-pfq directories - rv += CleanChromeOsImageFiles( + rv |= CleanChromeOsImageFiles( chromeos_chroot_tmp, "-pfq", days_to_preserve, dry_run ) # Clean image files in *-llvm-next-nightly directories - rv += CleanChromeOsImageFiles( + rv |= CleanChromeOsImageFiles( chromeos_chroot_tmp, "-llvm-next-nightly", days_to_preserve, dry_run ) return rv -def CleanOldCLs(days_to_preserve="1", dry_run=False): +def CleanOldCLs(days_to_preserve: str = "1", dry_run: bool = False) -> int: """Abandon old CLs created by automation tooling.""" ce = command_executer.GetCommandExecuter() chromeos_root = os.path.join(constants.CROSTC_WORKSPACE, "chromeos") @@ -245,7 +245,7 @@ def CleanChromeTelemetryTmpFiles(dry_run: bool) -> int: ) -def Main(argv): +def Main(argv: List[str]) -> int: """Delete nightly test data directories, tmps and test images.""" options = ProcessArguments(argv) ## Clean temporaries, images under crostc/chromeos @@ -254,14 +254,13 @@ def Main(argv): ) # Clean CLs that are not updated in last 2 weeks. - rv += CleanOldCLs("14", options.dry_run) + rv |= CleanOldCLs("14", options.dry_run) # Clean telemetry temporaries from chrome source tree inside chroot. - rv += CleanChromeTelemetryTmpFiles(options.dry_run) + rv |= CleanChromeTelemetryTmpFiles(options.dry_run) - return rv + return 1 if rv else 0 if __name__ == "__main__": - retval = Main(sys.argv[1:]) - sys.exit(retval) + sys.exit(Main(sys.argv[1:])) -- cgit v1.2.3 From 00b81cab572e1384caf8d92600c475db6d6bb8b2 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Wed, 26 Jul 2023 09:40:26 -0600 Subject: llvm_tools: use `Path`s for API which requires `Path`s UpdatePackages requires `Path`s now for `chroot_path`. BUG=b:292048757, b:292054306 TEST=Unittests Change-Id: I67a427e5be798bb24e3fab5551500662b182ae6d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4720509 Commit-Queue: Jordan Abrahams-Whitehead Reviewed-by: Jordan Abrahams-Whitehead Auto-Submit: George Burgess Tested-by: George Burgess --- llvm_tools/modify_a_tryjob.py | 3 ++- llvm_tools/update_packages_and_run_tests.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/llvm_tools/modify_a_tryjob.py b/llvm_tools/modify_a_tryjob.py index 7b292140..2f5fadbb 100755 --- a/llvm_tools/modify_a_tryjob.py +++ b/llvm_tools/modify_a_tryjob.py @@ -11,6 +11,7 @@ import argparse import enum import json import os +from pathlib import Path import sys import chroot @@ -144,7 +145,7 @@ def GetCLAfterUpdatingPackages( llvm_variant=update_chromeos_llvm_hash.LLVMVariant.next, git_hash=git_hash, svn_version=svn_version, - chroot_path=chroot_path, + chroot_path=Path(chroot_path), mode=failure_modes.FailureModes.DISABLE_PATCHES, git_hash_source=svn_option, extra_commit_msg=None, diff --git a/llvm_tools/update_packages_and_run_tests.py b/llvm_tools/update_packages_and_run_tests.py index 62befd62..c700b69f 100755 --- a/llvm_tools/update_packages_and_run_tests.py +++ b/llvm_tools/update_packages_and_run_tests.py @@ -11,6 +11,7 @@ import argparse import datetime import json import os +from pathlib import Path import subprocess import chroot @@ -464,7 +465,7 @@ def main(): llvm_variant=llvm_variant, git_hash=git_hash, svn_version=svn_version, - chroot_path=args_output.chroot_path, + chroot_path=Path(args_output.chroot_path), mode=failure_modes.FailureModes.DISABLE_PATCHES, git_hash_source=svn_option, extra_commit_msg=extra_commit_msg, -- cgit v1.2.3 From 556a8da985ea1f68e124312538afe0ac59fd714a Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Wed, 26 Jul 2023 09:46:00 -0600 Subject: llvm_tools: make modify_a_tryjob lint-clean BUG=None TEST=Preuploads Change-Id: Ie2533c17ec26bb1ef0974029413e1a7247c192ae Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4720510 Commit-Queue: Jordan Abrahams-Whitehead Auto-Submit: George Burgess Tested-by: George Burgess Reviewed-by: Jordan Abrahams-Whitehead --- llvm_tools/modify_a_tryjob.py | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/llvm_tools/modify_a_tryjob.py b/llvm_tools/modify_a_tryjob.py index 2f5fadbb..2ecca800 100755 --- a/llvm_tools/modify_a_tryjob.py +++ b/llvm_tools/modify_a_tryjob.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -# -*- coding: utf-8 -*- # 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. @@ -46,11 +45,12 @@ def GetCommandLineArgs(): parser.add_argument( "--status_file", required=True, - help="The absolute path to the JSON file that contains the tryjobs used " - "for bisecting LLVM.", + help="The absolute path to the JSON file that contains the tryjobs " + "used for bisecting LLVM.", ) - # Add argument that determines what action to take on the revision specified. + # Add argument that determines what action to take on the revision + # specified. parser.add_argument( "--modify_tryjob", required=True, @@ -67,7 +67,8 @@ def GetCommandLineArgs(): help="The revision to either remove or relaunch.", ) - # Add argument for other change lists that want to run alongside the tryjob. + # Add argument for other change lists that want to run alongside the + # tryjob. parser.add_argument( "--extra_change_lists", type=int, @@ -240,16 +241,17 @@ def PerformTryjobModification( """Removes, relaunches, or adds a tryjob. Args: - revision: The revision associated with the tryjob. - modify_tryjob: What action to take on the tryjob. - Ex: ModifyTryjob.REMOVE, ModifyTryjob.RELAUNCH, ModifyTryjob.ADD - status_file: The .JSON file that contains the tryjobs. - extra_cls: Extra change lists to be run alongside tryjob - options: Extra options to pass into 'cros tryjob'. - builder: The builder to use for 'cros tryjob'. - chroot_path: The absolute path to the chroot (used by 'cros tryjob' when - relaunching a tryjob). - verbose: Determines whether to print the contents of a command to `stdout`. + revision: The revision associated with the tryjob. + modify_tryjob: What action to take on the tryjob. + Ex: ModifyTryjob.REMOVE, ModifyTryjob.RELAUNCH, ModifyTryjob.ADD + status_file: The .JSON file that contains the tryjobs. + extra_cls: Extra change lists to be run alongside tryjob + options: Extra options to pass into 'cros tryjob'. + builder: The builder to use for 'cros tryjob'. + chroot_path: The absolute path to the chroot (used by 'cros tryjob' + when relaunching a tryjob). + verbose: Determines whether to print the contents of a command to + `stdout`. """ # Format of 'bisect_contents': @@ -263,7 +265,7 @@ def PerformTryjobModification( # {[TRYJOB_INFORMATION]} # ] # } - with open(status_file) as tryjobs: + with open(status_file, encoding="utf-8") as tryjobs: bisect_contents = json.load(tryjobs) if not bisect_contents["jobs"] and modify_tryjob != ModifyTryjob.ADD: @@ -316,8 +318,8 @@ def PerformTryjobModification( % (tryjob_index, status_file) ) - # Make sure the revision is within the bounds of the start and end of the - # bisection. + # Make sure the revision is within the bounds of the start and end of + # the bisection. elif bisect_contents["start"] < revision < bisect_contents["end"]: ( @@ -347,7 +349,7 @@ def PerformTryjobModification( 'Invalid "modify_tryjob" option provided: %s' % modify_tryjob ) - with open(status_file, "w") as update_tryjobs: + with open(status_file, "w", encoding="utf-8") as update_tryjobs: json.dump( bisect_contents, update_tryjobs, indent=4, separators=(",", ": ") ) -- cgit v1.2.3 From 8a149c1f04e941d409e0f51ee3f79760332b5a79 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Wed, 26 Jul 2023 09:49:35 -0600 Subject: llvm_tools: make update_packages_and_run_tests lint-clean BUG=None TEST=Preuploads Change-Id: If98425f5a8bf18984f66f1873008f273821d8e18 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4720511 Auto-Submit: George Burgess Reviewed-by: Jordan Abrahams-Whitehead Commit-Queue: Jordan Abrahams-Whitehead Tested-by: George Burgess --- llvm_tools/update_packages_and_run_tests.py | 97 ++++++++++++++--------------- 1 file changed, 48 insertions(+), 49 deletions(-) diff --git a/llvm_tools/update_packages_and_run_tests.py b/llvm_tools/update_packages_and_run_tests.py index c700b69f..598d9099 100755 --- a/llvm_tools/update_packages_and_run_tests.py +++ b/llvm_tools/update_packages_and_run_tests.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -# -*- coding: utf-8 -*- # 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. @@ -27,10 +26,10 @@ def GetCommandLineArgs(): """Parses the command line for the command line arguments. Returns: - The log level to use when retrieving the LLVM hash or google3 LLVM version, - the chroot path to use for executing chroot commands, - a list of a package or packages to update their LLVM next hash, - and the LLVM version to use when retrieving the LLVM hash. + The log level to use when retrieving the LLVM hash or google3 LLVM + version, the chroot path to use for executing chroot commands, + a list of a package or packages to update their LLVM next hash, + and the LLVM version to use when retrieving the LLVM hash. """ # Default path to the chroot if a path is not specified. @@ -68,8 +67,8 @@ def GetCommandLineArgs(): "Otherwise, update LLVM_HASH", ) - # Add argument for the absolute path to the file that contains information on - # the previous tested svn version. + # Add argument for the absolute path to the file that contains information + # on the previous tested svn version. parser.add_argument( "--last_tested", help="the absolute path to the file that contains the last tested " @@ -161,13 +160,13 @@ def UnchangedSinceLastRun(last_tested_file, arg_dict): """Gets the arguments used for last run Args: - last_tested_file: The absolute path to the file that contains the - arguments for the last run. - arg_dict: The arguments used for this run. + last_tested_file: The absolute path to the file that contains the + arguments for the last run. + arg_dict: The arguments used for this run. Returns: - Return true if the arguments used for last run exist and are the - same as the arguments used for this run. Otherwise return false. + Return true if the arguments used for last run exist and are the + same as the arguments used for this run. Otherwise return false. """ if not last_tested_file: @@ -176,7 +175,7 @@ def UnchangedSinceLastRun(last_tested_file, arg_dict): # Get the last tested svn version if the file exists. last_arg_dict = None try: - with open(last_tested_file) as f: + with open(last_tested_file, encoding="utf-8") as f: last_arg_dict = json.load(f) except (IOError, ValueError): @@ -198,12 +197,12 @@ def AddReviewers(cl, reviewers, chroot_path): def AddLinksToCL(tests, cl, chroot_path): """Adds the test link(s) to the CL as a comment.""" - # NOTE: Invoking `cros_sdk` does not make each tryjob link appear on its own - # line, so invoking the `gerrit` command directly instead of using `cros_sdk` - # to do it for us. + # NOTE: Invoking `cros_sdk` does not make each tryjob link appear on its + # own line, so invoking the `gerrit` command directly instead of using + # `cros_sdk` to do it for us. # - # FIXME: Need to figure out why `cros_sdk` does not add each tryjob link as a - # newline. + # FIXME: Need to figure out why `cros_sdk` does not add each tryjob link as + # a newline. gerrit_abs_path = os.path.join(chroot_path, "chromite/bin/gerrit") links = ["Started the following tests:"] @@ -224,15 +223,15 @@ def GetTryJobCommand(change_list, extra_change_lists, options, builder): """Constructs the 'tryjob' command. Args: - change_list: The CL obtained from updating the packages. - extra_change_lists: Extra change lists that would like to be run alongside - the change list of updating the packages. - options: Options to be passed into the tryjob command. - builder: The builder to be passed into the tryjob command. + change_list: The CL obtained from updating the packages. + extra_change_lists: Extra change lists that would like to be run + alongside the change list of updating the packages. + options: Options to be passed into the tryjob command. + builder: The builder to be passed into the tryjob command. Returns: - The 'tryjob' command with the change list of updating the packages and - any extra information that was passed into the command line. + The 'tryjob' command with the change list of updating the packages and + any extra information that was passed into the command line. """ tryjob_cmd = ["cros", "tryjob", "--yes", "--json", "-g", "%d" % change_list] @@ -253,20 +252,20 @@ def RunTryJobs(cl_number, extra_change_lists, options, builders, chroot_path): """Runs a tryjob/tryjobs. Args: - cl_number: The CL created by updating the packages. - extra_change_lists: Any extra change lists that would run alongside the CL - that was created by updating the packages ('cl_number'). - options: Any options to be passed into the 'tryjob' command. - builders: All the builders to run the 'tryjob' with. - chroot_path: The absolute path to the chroot. + cl_number: The CL created by updating the packages. + extra_change_lists: Any extra change lists that would run alongside the + CL that was created by updating the packages ('cl_number'). + options: Any options to be passed into the 'tryjob' command. + builders: All the builders to run the 'tryjob' with. + chroot_path: The absolute path to the chroot. Returns: - A list that contains stdout contents of each tryjob, where stdout is - information (a hashmap) about the tryjob. The hashmap also contains stderr - if there was an error when running a tryjob. + A list that contains stdout contents of each tryjob, where stdout is + information (a hashmap) about the tryjob. The hashmap also contains + stderr if there was an error when running a tryjob. Raises: - ValueError: Failed to submit a tryjob. + ValueError: Failed to submit a tryjob. """ # Contains the results of each builder. @@ -306,20 +305,20 @@ def StartRecipeBuilders( """Launch recipe builders. Args: - cl_number: The CL created by updating the packages. - extra_change_lists: Any extra change lists that would run alongside the CL - that was created by updating the packages ('cl_number'). - options: Any options to be passed into the 'tryjob' command. - builders: All the builders to run the 'tryjob' with. - chroot_path: The absolute path to the chroot. + cl_number: The CL created by updating the packages. + extra_change_lists: Any extra change lists that would run alongside the + CL that was created by updating the packages ('cl_number'). + options: Any options to be passed into the 'tryjob' command. + builders: All the builders to run the 'tryjob' with. + chroot_path: The absolute path to the chroot. Returns: - A list that contains stdout contents of each builder, where stdout is - information (a hashmap) about the tryjob. The hashmap also contains stderr - if there was an error when running a tryjob. + A list that contains stdout contents of each builder, where stdout is + information (a hashmap) about the tryjob. The hashmap also contains + stderr if there was an error when running a tryjob. Raises: - ValueError: Failed to start a builder. + ValueError: Failed to start a builder. """ # Contains the results of each builder. @@ -408,7 +407,7 @@ def main(): """Updates the packages' LLVM hash and run tests. Raises: - AssertionError: The script was run inside the chroot. + AssertionError: The script was run inside the chroot. """ chroot.VerifyOutsideChroot() @@ -423,8 +422,8 @@ def main(): svn_option ) - # There is no need to run tryjobs when all the key parameters remain unchanged - # from last time. + # There is no need to run tryjobs when all the key parameters remain + # unchanged from last time. # If --last_tested is specified, check if the current run has the same # arguments last time --last_tested is used. @@ -511,7 +510,7 @@ def main(): # If --last_tested is specified, record the arguments used if args_output.last_tested: - with open(args_output.last_tested, "w") as f: + with open(args_output.last_tested, "w", encoding="utf-8") as f: json.dump(arg_dict, f, indent=2) -- cgit v1.2.3 From a5e14c07a07387e30929e9c61a69ba5068669099 Mon Sep 17 00:00:00 2001 From: Denis Nikitin Date: Fri, 21 Jul 2023 11:22:03 -0700 Subject: update_kernel_afdo: Drop 4.19 kernel BUG=b:292253082 TEST=cq Change-Id: Ib753f74d288a40b9a873456d29f9f85d892533a3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4708685 Auto-Submit: Denis Nikitin Commit-Queue: George Burgess Tested-by: Denis Nikitin Reviewed-by: George Burgess --- afdo_tools/update_kernel_afdo | 2 +- afdo_tools/update_kernel_afdo.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/afdo_tools/update_kernel_afdo b/afdo_tools/update_kernel_afdo index 4c7afb38..6bfa53fa 100755 --- a/afdo_tools/update_kernel_afdo +++ b/afdo_tools/update_kernel_afdo @@ -194,7 +194,7 @@ do source "${config_file}" else # DON'T UPDATE THESE CONSTANTS HERE! - # Update config_file instead. + # Update ${config_file} instead. AMD_KVERS="4.14 4.19 5.4 5.10" ARM_KVERS="5.15" AMD_METADATA_FILE="afdo_metadata/kernel_afdo.json" diff --git a/afdo_tools/update_kernel_afdo.cfg b/afdo_tools/update_kernel_afdo.cfg index 66a6fd18..a196a0af 100644 --- a/afdo_tools/update_kernel_afdo.cfg +++ b/afdo_tools/update_kernel_afdo.cfg @@ -2,7 +2,7 @@ # All changes here won't affect kernel afdo update in branches. # WARNING: Changes must be submitted to have effect. -AMD_KVERS="4.14 4.19 5.4 5.10 5.15" +AMD_KVERS="4.14 5.4 5.10 5.15" ARM_KVERS="5.15" AMD_METADATA_FILE="afdo_metadata/kernel_afdo.json" ARM_METADATA_FILE="afdo_metadata/kernel_arm_afdo.json" -- cgit v1.2.3 From 5bc51440df9a09360b0e52677cc880893a1b100e Mon Sep 17 00:00:00 2001 From: mobiletc-prebuild Date: Fri, 28 Jul 2023 14:32:42 -0700 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update amd profile on chromeos-kernel-5.15 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: I0902aa9449edcd9da3ddd36aa91a6bc91d0c6a3c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4730591 Commit-Queue: George Burgess Reviewed-by: George Burgess Tested-by: George Burgess --- afdo_metadata/kernel_afdo.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index c3b2dc75..f54c6477 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -2,9 +2,6 @@ "chromeos-kernel-4_14": { "name": "R117-15509.27-1690191273" }, - "chromeos-kernel-4_19": { - "name": "R117-15509.20-1690191373" - }, "chromeos-kernel-5_4": { "name": "R117-15509.27-1690191102" }, -- cgit v1.2.3 From f208ba28a6d1ab77fae68e5ce0f35d5cfc3c4943 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Fri, 28 Jul 2023 09:39:59 -0600 Subject: llvm_tools: remove 4c scripts 4c was turned down, so these scripts no longer have a purpose. BUG=b:293166552 TEST=None Change-Id: Ic2589c5c31cd6f6fd1af7501669bd2c663322c09 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4729352 Commit-Queue: Ryan Beltran Tested-by: George Burgess Reviewed-by: Ryan Beltran Auto-Submit: George Burgess --- llvm_tools/bisect_clang_crashes.py | 157 ----------- llvm_tools/bisect_clang_crashes_unittest.py | 101 ------- llvm_tools/upload_lexan_crashes_to_forcey.py | 318 ---------------------- llvm_tools/upload_lexan_crashes_to_forcey_test.py | 207 -------------- 4 files changed, 783 deletions(-) delete mode 100755 llvm_tools/bisect_clang_crashes.py delete mode 100755 llvm_tools/bisect_clang_crashes_unittest.py delete mode 100755 llvm_tools/upload_lexan_crashes_to_forcey.py delete mode 100755 llvm_tools/upload_lexan_crashes_to_forcey_test.py diff --git a/llvm_tools/bisect_clang_crashes.py b/llvm_tools/bisect_clang_crashes.py deleted file mode 100755 index b2759051..00000000 --- a/llvm_tools/bisect_clang_crashes.py +++ /dev/null @@ -1,157 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright 2020 The ChromiumOS Authors -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Fetches and submits the artifacts from ChromeOS toolchain's crash bucket. -""" - -import argparse -import glob -import json -import logging -import os -import os.path -import shutil -import subprocess -import sys - -import chroot - - -def get_artifacts(pattern): - results = subprocess.check_output( - ["gsutil.py", "ls", pattern], stderr=subprocess.STDOUT, encoding="utf-8" - ) - return sorted(l.strip() for l in results.splitlines()) - - -def get_crash_reproducers(working_dir): - results = [] - for src in [ - f - for f in glob.glob("%s/*.c*" % working_dir) - if f.split(".")[-1] in ["c", "cc", "cpp"] - ]: - script = ".".join(src.split(".")[:-1]) + ".sh" - if not os.path.exists(script): - logging.warning("could not find the matching script of %s", src) - else: - results.append((src, script)) - return results - - -def submit_crash_to_forcey( - forcey: str, temporary_directory: str, buildbucket_id: str, url: str -) -> None: - dest_dir = os.path.join(temporary_directory, buildbucket_id) - dest_file = os.path.join(dest_dir, os.path.basename(url)) - logging.info("Downloading and submitting %r...", url) - subprocess.check_output( - ["gsutil.py", "cp", url, dest_file], stderr=subprocess.STDOUT - ) - subprocess.check_output(["tar", "-xJf", dest_file], cwd=dest_dir) - for src, script in get_crash_reproducers(dest_dir): - subprocess.check_output( - [ - forcey, - "reduce", - "-wait=false", - "-note", - "%s:%s" % (url, src), - "-sh_file", - script, - "-src_file", - src, - ] - ) - - -def main(argv): - chroot.VerifyOutsideChroot() - logging.basicConfig( - format="%(asctime)s: %(levelname)s: %(filename)s:%(lineno)d: %(message)s", - level=logging.INFO, - ) - cur_dir = os.path.dirname(os.path.abspath(__file__)) - parser = argparse.ArgumentParser(description=__doc__) - parser.add_argument( - "--4c", dest="forcey", required=True, help="Path to a 4c client binary" - ) - parser.add_argument( - "--state_file", - default=os.path.join(cur_dir, "chromeos-state.json"), - help="The path to the state file.", - ) - parser.add_argument( - "--nocleanup", - action="store_false", - dest="cleanup", - help="Keep temporary files created after the script finishes.", - ) - opts = parser.parse_args(argv) - - state_file = os.path.abspath(opts.state_file) - os.makedirs(os.path.dirname(state_file), exist_ok=True) - temporary_directory = "/tmp/bisect_clang_crashes" - os.makedirs(temporary_directory, exist_ok=True) - urls = get_artifacts( - "gs://chromeos-toolchain-artifacts/clang-crash-diagnoses" - "/**/*clang_crash_diagnoses.tar.xz" - ) - logging.info("%d crash URLs found", len(urls)) - - visited = {} - if os.path.exists(state_file): - buildbucket_ids = {url.split("/")[-2] for url in urls} - with open(state_file, encoding="utf-8") as f: - data = json.load(f) - visited = {k: v for k, v in data.items() if k in buildbucket_ids} - logging.info( - "Successfully loaded %d previously-submitted crashes", len(visited) - ) - - try: - for url in urls: - splits = url.split("/") - buildbucket_id = splits[-2] - # Skip the builds that has been processed - if buildbucket_id in visited: - continue - submit_crash_to_forcey( - forcey=opts.forcey, - temporary_directory=temporary_directory, - buildbucket_id=buildbucket_id, - url=url, - ) - visited[buildbucket_id] = url - - exception_in_flight = False - except: - exception_in_flight = True - raise - finally: - if exception_in_flight: - # This is best-effort. If the machine powers off or similar, we'll just - # resubmit the same crashes, which is suboptimal, but otherwise - # acceptable. - logging.error( - "Something went wrong; attempting to save our work..." - ) - else: - logging.info("Persisting state...") - - tmp_state_file = state_file + ".tmp" - with open(tmp_state_file, "w", encoding="utf-8") as f: - json.dump(visited, f, indent=2) - os.rename(tmp_state_file, state_file) - - logging.info("State successfully persisted") - - if opts.cleanup: - shutil.rmtree(temporary_directory) - - -if __name__ == "__main__": - sys.exit(main(sys.argv[1:])) diff --git a/llvm_tools/bisect_clang_crashes_unittest.py b/llvm_tools/bisect_clang_crashes_unittest.py deleted file mode 100755 index 22c9be19..00000000 --- a/llvm_tools/bisect_clang_crashes_unittest.py +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright 2020 The ChromiumOS Authors -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Tests for bisect_clang_crashes.""" - -import glob -import logging -import os.path -import subprocess -import unittest -import unittest.mock as mock - -import bisect_clang_crashes - - -class Test(unittest.TestCase): - """Tests for bisect_clang_crashes.""" - - class _SilencingFilter(object): - """Silences all log messages. - - Also collects info about log messages that would've been emitted. - """ - - def __init__(self): - self.messages = [] - - def filter(self, record): - self.messages.append(record.getMessage()) - return 0 - - @mock.patch.object(subprocess, "check_output") - def test_get_artifacts(self, mock_gsutil_ls): - pattern = ( - "gs://chromeos-toolchain-artifacts/clang-crash-diagnoses/" - "**/*clang_crash_diagnoses.tar.xz" - ) - mock_gsutil_ls.return_value = "artifact1\nartifact2\nartifact3" - results = bisect_clang_crashes.get_artifacts(pattern) - self.assertEqual(results, ["artifact1", "artifact2", "artifact3"]) - mock_gsutil_ls.assert_called_once_with( - ["gsutil.py", "ls", pattern], - stderr=subprocess.STDOUT, - encoding="utf-8", - ) - - @mock.patch.object(os.path, "exists") - @mock.patch.object(glob, "glob") - def test_get_crash_reproducers_succeed( - self, mock_file_search, mock_file_check - ): - working_dir = "SomeDirectory" - mock_file_search.return_value = ["a.c", "b.cpp", "c.cc"] - mock_file_check.side_effect = [True, True, True] - results = bisect_clang_crashes.get_crash_reproducers(working_dir) - mock_file_search.assert_called_once_with("%s/*.c*" % working_dir) - self.assertEqual(mock_file_check.call_count, 3) - self.assertEqual(mock_file_check.call_args_list[0], mock.call("a.sh")) - self.assertEqual(mock_file_check.call_args_list[1], mock.call("b.sh")) - self.assertEqual(mock_file_check.call_args_list[2], mock.call("c.sh")) - self.assertEqual( - results, [("a.c", "a.sh"), ("b.cpp", "b.sh"), ("c.cc", "c.sh")] - ) - - @mock.patch.object(os.path, "exists") - @mock.patch.object(glob, "glob") - def test_get_crash_reproducers_no_matching_script( - self, mock_file_search, mock_file_check - ): - def silence_logging(): - root = logging.getLogger() - filt = self._SilencingFilter() - root.addFilter(filt) - self.addCleanup(root.removeFilter, filt) - return filt - - log_filter = silence_logging() - working_dir = "SomeDirectory" - mock_file_search.return_value = ["a.c", "b.cpp", "c.cc"] - mock_file_check.side_effect = [True, False, True] - results = bisect_clang_crashes.get_crash_reproducers(working_dir) - mock_file_search.assert_called_once_with("%s/*.c*" % working_dir) - self.assertEqual(mock_file_check.call_count, 3) - self.assertEqual(mock_file_check.call_args_list[0], mock.call("a.sh")) - self.assertEqual(mock_file_check.call_args_list[1], mock.call("b.sh")) - self.assertEqual(mock_file_check.call_args_list[2], mock.call("c.sh")) - self.assertEqual(results, [("a.c", "a.sh"), ("c.cc", "c.sh")]) - self.assertTrue( - any( - "could not find the matching script of b.cpp" in x - for x in log_filter.messages - ), - log_filter.messages, - ) - - -if __name__ == "__main__": - unittest.main() diff --git a/llvm_tools/upload_lexan_crashes_to_forcey.py b/llvm_tools/upload_lexan_crashes_to_forcey.py deleted file mode 100755 index f52a27f4..00000000 --- a/llvm_tools/upload_lexan_crashes_to_forcey.py +++ /dev/null @@ -1,318 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright 2020 The ChromiumOS Authors -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. -"""Fetches and submits the latest test-cases from Lexan's crash bucket.""" - -import argparse -import contextlib -import datetime -import json -import logging -import os -import shutil -import subprocess -import sys -import tempfile -from typing import Generator, Iterable, List - - -gsurl_base = "gs://chrome-clang-crash-reports/v1" - - -def gsutil_ls(loc: str) -> List[str]: - results = subprocess.run( - ["gsutil.py", "ls", loc], - stdout=subprocess.PIPE, - check=True, - encoding="utf-8", - ) - return [l.strip() for l in results.stdout.splitlines()] - - -def gsurl_ls_last_numbers(url: str) -> List[int]: - return sorted(int(x.rstrip("/").split("/")[-1]) for x in gsutil_ls(url)) - - -def get_available_year_numbers() -> List[int]: - return gsurl_ls_last_numbers(gsurl_base) - - -def get_available_month_numbers(year: int) -> List[int]: - return gsurl_ls_last_numbers(f"{gsurl_base}/{year}") - - -def get_available_day_numbers(year: int, month: int) -> List[int]: - return gsurl_ls_last_numbers(f"{gsurl_base}/{year}/{month:02d}") - - -def get_available_test_case_urls(year: int, month: int, day: int) -> List[str]: - return gsutil_ls(f"{gsurl_base}/{year}/{month:02d}/{day:02d}") - - -def test_cases_on_or_after( - date: datetime.datetime, -) -> Generator[str, None, None]: - """Yields all test-cases submitted on or after the given date.""" - for year in get_available_year_numbers(): - if year < date.year: - continue - - for month in get_available_month_numbers(year): - if year == date.year and month < date.month: - continue - - for day in get_available_day_numbers(year, month): - when = datetime.date(year, month, day) - if when < date: - continue - - yield when, get_available_test_case_urls(year, month, day) - - -def to_ymd(date: datetime.date) -> str: - return date.strftime("%Y-%m-%d") - - -def from_ymd(date_str: str) -> datetime.date: - return datetime.datetime.strptime(date_str, "%Y-%m-%d").date() - - -def persist_state( - seen_urls: Iterable[str], state_file: str, current_date: datetime.date -): - tmp_state_file = state_file + ".tmp" - with open(tmp_state_file, "w", encoding="utf-8") as f: - json.dump( - { - "already_seen": sorted(seen_urls), - "most_recent_date": to_ymd(current_date), - }, - f, - ) - os.rename(tmp_state_file, state_file) - - -@contextlib.contextmanager -def temp_dir() -> Generator[str, None, None]: - loc = tempfile.mkdtemp("lexan-autosubmit") - try: - yield loc - finally: - shutil.rmtree(loc) - - -def fetch_gs_file_size(gs_url: str) -> int: - """Returns the size of the file at gs_url, in bytes.""" - du = subprocess.run( - ["gsutil.py", "du", gs_url], - check=True, - stdout=subprocess.PIPE, - encoding="utf-8", - ).stdout - - lines = du.splitlines() - assert len(lines) == 1, f"{lines}" - # Format is `size file_name`. - num_bytes = lines[0].lstrip().split(None, 1)[0] - return int(num_bytes) - - -def download_and_unpack_test_case(gs_url: str, tempdir: str) -> None: - suffix = os.path.splitext(gs_url)[1] - target_name = "test_case" + suffix - target = os.path.join(tempdir, target_name) - subprocess.run(["gsutil.py", "cp", gs_url, target], check=True) - subprocess.run(["tar", "xaf", target_name], check=True, cwd=tempdir) - os.unlink(target) - - -def submit_test_case(gs_url: str, cr_tool: str) -> None: - size_limit = 100 * 1024 - size_kb = fetch_gs_file_size(gs_url) // 1024 - if size_kb > size_limit: - logging.warning( - "Ignoring %s; it's %dKB, and the limit is %dKB", - gs_url, - size_kb, - size_limit, - ) - return - - logging.info("Downloading %s (%dKB)", gs_url, size_kb) - with temp_dir() as tempdir: - download_and_unpack_test_case(gs_url, tempdir) - - # Sometimes (e.g., in - # gs://chrome-clang-crash-reports/v1/2020/03/27/ - # chromium.clang-ToTiOS-12754-GTXToolKit-2bfcde.tgz) - # we'll get `.crash` files. Unclear why, but let's filter them out anyway. - repro_files = [ - os.path.join(tempdir, x) - for x in os.listdir(tempdir) - if not x.endswith(".crash") - ] - if len(repro_files) == 1 and repro_files[0].endswith(".tar"): - logging.info( - "Skipping submission of %s; it's a linker crash", gs_url - ) - return - - assert len(repro_files) == 2, repro_files - if repro_files[0].endswith(".sh"): - sh_file, src_file = repro_files - assert not src_file.endswith(".sh"), repro_files - else: - src_file, sh_file = repro_files - assert sh_file.endswith(".sh"), repro_files - - # Peephole: lexan got a crash upload with a way old clang. Ignore it. - with open(sh_file, encoding="utf-8") as f: - if "Crash reproducer for clang version 9.0.0" in f.read(): - logging.warning( - "Skipping upload for %s; seems to be with an old clang", - gs_url, - ) - return - - logging.info("Submitting %s", gs_url) - subprocess.run( - [ - cr_tool, - "reduce", - "-stream=false", - "-wait=false", - "-note", - gs_url, - "-sh_file", - os.path.join(tempdir, sh_file), - "-src_file", - os.path.join(tempdir, src_file), - ], - check=True, - ) - - -def submit_new_test_cases( - last_seen_test_cases: Iterable[str], - earliest_date_to_check: datetime.date, - forcey: str, - state_file_path: str, -) -> None: - """Submits new test-cases to forcey. - - This will persist state after each test-case is submitted. - - Args: - last_seen_test_cases: test-cases which have been submitted already, and - should be skipped if seen again. - earliest_date_to_check: the earliest date we should consider test-cases - from. - forcey: path to the forcey binary. - state_file_path: path to our state file. - """ - # `all_test_cases_seen` is the union of all test-cases seen on this and prior - # invocations. It guarantees, in all cases we care about, that we won't - # submit the same test-case twice. `test_cases_seen_this_invocation` is - # persisted as "all of the test-cases we've seen on this and prior - # invocations" if we successfully submit _all_ test-cases. - # - # Since you can visualize the test-cases this script considers as a sliding - # window that only moves forward, if we saw a test-case on a prior iteration - # but no longer see it, we'll never see it again (since it fell out of our - # sliding window by being too old). Hence, keeping it around is - # pointless. - # - # We only persist this minimized set of test-cases if _everything_ succeeds, - # since if something fails below, there's a chance that we haven't revisited - # test-cases that we've already seen. - all_test_cases_seen = set(last_seen_test_cases) - test_cases_seen_this_invocation = [] - most_recent_date = earliest_date_to_check - for date, candidates in test_cases_on_or_after(earliest_date_to_check): - most_recent_date = max(most_recent_date, date) - - for url in candidates: - test_cases_seen_this_invocation.append(url) - if url in all_test_cases_seen: - continue - - all_test_cases_seen.add(url) - submit_test_case(url, forcey) - - # Persisting on each iteration of this loop isn't free, but it's the - # easiest way to not resubmit test-cases, and it's good to keep in mind - # that: - # - the state file will be small (<12KB, since it only keeps a few days - # worth of test-cases after the first run) - # - in addition to this, we're downloading+unzipping+reuploading multiple - # MB of test-case bytes. - # - # So comparatively, the overhead here probably isn't an issue. - persist_state( - all_test_cases_seen, state_file_path, most_recent_date - ) - - persist_state( - test_cases_seen_this_invocation, state_file_path, most_recent_date - ) - - -def main(argv: List[str]): - logging.basicConfig( - format=">> %(asctime)s: %(levelname)s: %(filename)s:%(lineno)d: " - "%(message)s", - level=logging.INFO, - ) - - my_dir = os.path.dirname(os.path.abspath(__file__)) - - parser = argparse.ArgumentParser(description=__doc__) - parser.add_argument( - "--state_file", default=os.path.join(my_dir, "lexan-state.json") - ) - parser.add_argument( - "--last_date", - help="The earliest date that we care about. All test cases from here " - "on will be picked up. Format is YYYY-MM-DD.", - ) - parser.add_argument( - "--4c", dest="forcey", required=True, help="Path to a 4c client binary" - ) - opts = parser.parse_args(argv) - - forcey = opts.forcey - state_file = opts.state_file - last_date_str = opts.last_date - - os.makedirs(os.path.dirname(state_file), 0o755, exist_ok=True) - - if last_date_str is None: - with open(state_file, encoding="utf-8") as f: - data = json.load(f) - most_recent_date = from_ymd(data["most_recent_date"]) - submit_new_test_cases( - last_seen_test_cases=data["already_seen"], - # Note that we always subtract one day from this to avoid a race: - # uploads may appear slightly out-of-order (or builders may lag, or - # ...), so the last test-case uploaded for 2020/01/01 might appear - # _after_ the first test-case for 2020/01/02. Assuming that builders - # won't lag behind for over a day, the easiest way to handle this is to - # always check the previous and current days. - earliest_date_to_check=most_recent_date - - datetime.timedelta(days=1), - forcey=forcey, - state_file_path=state_file, - ) - else: - submit_new_test_cases( - last_seen_test_cases=(), - earliest_date_to_check=from_ymd(last_date_str), - forcey=forcey, - state_file_path=state_file, - ) - - -if __name__ == "__main__": - sys.exit(main(sys.argv[1:])) diff --git a/llvm_tools/upload_lexan_crashes_to_forcey_test.py b/llvm_tools/upload_lexan_crashes_to_forcey_test.py deleted file mode 100755 index 76e90e08..00000000 --- a/llvm_tools/upload_lexan_crashes_to_forcey_test.py +++ /dev/null @@ -1,207 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright 2020 The ChromiumOS Authors -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Tests for upload_lexan_crashes_to_forcey.""" - -import datetime -import os -import unittest -import unittest.mock - -import upload_lexan_crashes_to_forcey - - -class Test(unittest.TestCase): - """Tests for upload_lexan_crashes_to_forcey.""" - - def test_date_parsing_functions(self): - self.assertEqual( - datetime.date(2020, 2, 1), - upload_lexan_crashes_to_forcey.from_ymd("2020-02-01"), - ) - - @unittest.mock.patch( - "upload_lexan_crashes_to_forcey.test_cases_on_or_after", - return_value=( - ( - datetime.date(2020, 1, 1), - ("gs://test-case-1", "gs://test-case-1.1"), - ), - (datetime.date(2020, 1, 2), ("gs://test-case-2",)), - (datetime.date(2020, 1, 1), ("gs://test-case-3",)), - (datetime.date(2020, 1, 4), ("gs://test-case-4",)), - ), - ) - @unittest.mock.patch("upload_lexan_crashes_to_forcey.submit_test_case") - @unittest.mock.patch("upload_lexan_crashes_to_forcey.persist_state") - def test_new_test_case_submission_functions( - self, - persist_state_mock, - submit_test_case_mock, - test_cases_on_or_after_mock, - ): - forcey_path = "/path/to/4c" - real_state_file_path = "/path/to/state/file" - earliest_date = datetime.date(2020, 1, 1) - - persist_state_calls = [] - - # Since the set this gets is mutated, we need to copy it somehow. - def persist_state_side_effect( - test_cases_to_persist, state_file_path, most_recent_date - ): - self.assertEqual(state_file_path, real_state_file_path) - persist_state_calls.append( - (sorted(test_cases_to_persist), most_recent_date) - ) - - persist_state_mock.side_effect = persist_state_side_effect - - upload_lexan_crashes_to_forcey.submit_new_test_cases( - last_seen_test_cases=( - "gs://test-case-0", - "gs://test-case-1", - ), - earliest_date_to_check=earliest_date, - forcey=forcey_path, - state_file_path=real_state_file_path, - ) - - test_cases_on_or_after_mock.assert_called_once_with(earliest_date) - self.assertEqual( - submit_test_case_mock.call_args_list, - [ - unittest.mock.call("gs://test-case-1.1", forcey_path), - unittest.mock.call("gs://test-case-2", forcey_path), - unittest.mock.call("gs://test-case-3", forcey_path), - unittest.mock.call("gs://test-case-4", forcey_path), - ], - ) - - self.assertEqual( - persist_state_calls, - [ - ( - [ - "gs://test-case-0", - "gs://test-case-1", - "gs://test-case-1.1", - ], - datetime.date(2020, 1, 1), - ), - ( - [ - "gs://test-case-0", - "gs://test-case-1", - "gs://test-case-1.1", - "gs://test-case-2", - ], - datetime.date(2020, 1, 2), - ), - ( - [ - "gs://test-case-0", - "gs://test-case-1", - "gs://test-case-1.1", - "gs://test-case-2", - "gs://test-case-3", - ], - datetime.date(2020, 1, 2), - ), - ( - [ - "gs://test-case-0", - "gs://test-case-1", - "gs://test-case-1.1", - "gs://test-case-2", - "gs://test-case-3", - "gs://test-case-4", - ], - datetime.date(2020, 1, 4), - ), - ( - [ - "gs://test-case-1", - "gs://test-case-1.1", - "gs://test-case-2", - "gs://test-case-3", - "gs://test-case-4", - ], - datetime.date(2020, 1, 4), - ), - ], - ) - - @unittest.mock.patch( - "upload_lexan_crashes_to_forcey.download_and_unpack_test_case" - ) - @unittest.mock.patch("subprocess.run") - @unittest.mock.patch("upload_lexan_crashes_to_forcey.fetch_gs_file_size") - def test_test_case_submission_functions( - self, - fetch_gs_file_size_mock, - subprocess_run_mock, - download_and_unpack_mock, - ): - fetch_gs_file_size_mock.return_value = 1024 - mock_gs_url = "gs://foo/bar/baz" - - def side_effect(gs_url: str, tempdir: str) -> None: - self.assertEqual(gs_url, mock_gs_url) - - # All we need is an empty file here. - open(os.path.join(tempdir, "test_case.c"), "w").close() - with open( - os.path.join(tempdir, "test_case.sh"), "w", encoding="utf-8" - ) as f: - f.write("# Crash reproducer for clang version 9.0.0 (...)\n") - f.write("clang something or other\n") - - download_and_unpack_mock.side_effect = side_effect - upload_lexan_crashes_to_forcey.submit_test_case(mock_gs_url, "4c") - subprocess_run_mock.assert_not_called() - - @unittest.mock.patch("subprocess.run") - def test_file_size_getting_functions(self, subprocess_run_mock): - mock_gs_url = "gs://foo/bar/baz" - - def side_effect(cmd, **_kwargs) -> None: - self.assertEqual(cmd, ["gsutil.py", "du", mock_gs_url]) - result = unittest.mock.MagicMock() - result.stdout = f"1234 {mock_gs_url}" - return result - - subprocess_run_mock.side_effect = side_effect - size = upload_lexan_crashes_to_forcey.fetch_gs_file_size(mock_gs_url) - self.assertEqual(size, 1234) - subprocess_run_mock.assert_called_once() - - @unittest.mock.patch( - "upload_lexan_crashes_to_forcey.download_and_unpack_test_case" - ) - @unittest.mock.patch("subprocess.run") - @unittest.mock.patch("upload_lexan_crashes_to_forcey.fetch_gs_file_size") - def test_linker_tarballs_are_skipped( - self, - fetch_gs_file_size_mock, - subprocess_run_mock, - download_and_unpack_mock, - ): - fetch_gs_file_size_mock.return_value = 1024 - mock_gs_url = "gs://foo/bar/baz" - - def side_effect(gs_url: str, tempdir: str) -> None: - self.assertEqual(gs_url, mock_gs_url) - # All we need is an empty file here. - open(os.path.join(tempdir, "test_case.tar"), "w").close() - - download_and_unpack_mock.side_effect = side_effect - upload_lexan_crashes_to_forcey.submit_test_case(mock_gs_url, "4c") - subprocess_run_mock.assert_not_called() - - -if __name__ == "__main__": - unittest.main() -- cgit v1.2.3 From 62120eda485b8deed5112159471bb401894d8e9c Mon Sep 17 00:00:00 2001 From: mobiletc-prebuild Date: Wed, 2 Aug 2023 10:05:27 -0700 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update amd profile on chromeos-kernel-5.15 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: I88fa831a7faddf7de1986ed9c38fe010091710f2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4743699 Reviewed-by: Denis Nikitin Tested-by: Denis Nikitin Commit-Queue: Denis Nikitin --- afdo_metadata/kernel_afdo.json | 8 ++++---- afdo_metadata/kernel_arm_afdo.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index f54c6477..80ebf64a 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -1,14 +1,14 @@ { "chromeos-kernel-4_14": { - "name": "R117-15509.27-1690191273" + "name": "R117-15552.0-1690795911" }, "chromeos-kernel-5_4": { - "name": "R117-15509.27-1690191102" + "name": "R117-15552.0-1690795900" }, "chromeos-kernel-5_10": { - "name": "R117-15509.27-1690191159" + "name": "R117-15552.0-1690796009" }, "chromeos-kernel-5_15": { - "name": "R117-15509.27-1690191202" + "name": "R117-15553.0-1690796059" } } diff --git a/afdo_metadata/kernel_arm_afdo.json b/afdo_metadata/kernel_arm_afdo.json index 50113ce7..7d6cdce7 100644 --- a/afdo_metadata/kernel_arm_afdo.json +++ b/afdo_metadata/kernel_arm_afdo.json @@ -1,5 +1,5 @@ { "chromeos-kernel-5_15": { - "name": "R117-15509.27-1690191309" + "name": "R117-15552.0-1690796192" } } -- cgit v1.2.3 From 5b0cc55652a26e348512c40cffcfa526c2a031c5 Mon Sep 17 00:00:00 2001 From: Bob Haarman Date: Fri, 4 Aug 2023 23:55:23 +0000 Subject: pgo_rust: Download crate if necessary for benchmark-nopgo pgo_rust builds a crate for generating profile information and benchmarking non-PGO rustc vs. PGO rustc. This crate was previously being dowloaded as necessary for the "generate" and "benchmark-pgo" subcommands, but not the "benchmark-nopgo" subcommand. This CL fixes that. BUG=b:283927064 TEST=rm -fr /tmp/rust-pgo/crates; pgo_rust.py benchmark-nopgo Change-Id: I18e0016d6bbb523f9416ca69d71d3380130fe746 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4753097 Commit-Queue: Bob Haarman Reviewed-by: George Burgess Tested-by: Bob Haarman Reviewed-by: Jordan Abrahams-Whitehead --- pgo_tools_rust/pgo_rust.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pgo_tools_rust/pgo_rust.py b/pgo_tools_rust/pgo_rust.py index 10042f14..311caa8a 100755 --- a/pgo_tools_rust/pgo_rust.py +++ b/pgo_tools_rust/pgo_rust.py @@ -335,6 +335,7 @@ def upload_file( def maybe_download_crate(*, crate_name: str, crate_version: str): + """Downloads a crate if its download directory does not already exist.""" directory = LOCAL_BASE / "crates" / f"{crate_name}-{crate_version}" if directory.is_dir(): logging.info("Crate already downloaded") @@ -410,6 +411,10 @@ def generate(args): def benchmark_nopgo(args): + maybe_download_crate( + crate_name=args.bench_crate_name, crate_version=args.bench_crate_version + ) + logging.info("Building Rust, no PGO") build_rust() -- cgit v1.2.3 From ce26592c3544c9db2e8ce10bfb0ad5016b500702 Mon Sep 17 00:00:00 2001 From: mobiletc-prebuild Date: Wed, 9 Aug 2023 10:06:24 -0700 Subject: afdo_metadata: Publish the new kernel profiles Update amd profile on chromeos-kernel-4.14 Update amd profile on chromeos-kernel-5.4 Update amd profile on chromeos-kernel-5.10 Update amd profile on chromeos-kernel-5.15 Update arm profile on chromeos-kernel-5.15 BUG=None TEST=Verified in kernel-release-afdo-verify-orchestrator Change-Id: Icac55060fce1f4323f28247baa0b0d8fab36c3a5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4765892 Reviewed-by: George Burgess Commit-Queue: George Burgess Tested-by: George Burgess --- afdo_metadata/kernel_afdo.json | 8 ++++---- afdo_metadata/kernel_arm_afdo.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/afdo_metadata/kernel_afdo.json b/afdo_metadata/kernel_afdo.json index 80ebf64a..0d6cecc2 100644 --- a/afdo_metadata/kernel_afdo.json +++ b/afdo_metadata/kernel_afdo.json @@ -1,14 +1,14 @@ { "chromeos-kernel-4_14": { - "name": "R117-15552.0-1690795911" + "name": "R117-15563.0-1691400981" }, "chromeos-kernel-5_4": { - "name": "R117-15552.0-1690795900" + "name": "R117-15563.0-1691401051" }, "chromeos-kernel-5_10": { - "name": "R117-15552.0-1690796009" + "name": "R117-15563.0-1691400779" }, "chromeos-kernel-5_15": { - "name": "R117-15553.0-1690796059" + "name": "R117-15563.0-1691400946" } } diff --git a/afdo_metadata/kernel_arm_afdo.json b/afdo_metadata/kernel_arm_afdo.json index 7d6cdce7..c90edba4 100644 --- a/afdo_metadata/kernel_arm_afdo.json +++ b/afdo_metadata/kernel_arm_afdo.json @@ -1,5 +1,5 @@ { "chromeos-kernel-5_15": { - "name": "R117-15552.0-1690796192" + "name": "R117-15563.0-1691400899" } } -- cgit v1.2.3 From 8de83cdb69b13aaeb4acc81937bd726efd0048c7 Mon Sep 17 00:00:00 2001 From: Bob Haarman Date: Fri, 11 Aug 2023 17:36:23 +0000 Subject: pgo_rust: fix line-too-long pylint complaints A number of lines in pgo_rust triggered line-too-long complaints from pylint. This fixes those, with the exception of one URL which happens to be longer than the line length. Shortening the URL is possible, but would make it less clear, so I've opted to instead silence the complaint for that line. BUG=None TEST=repo upload # see that cros lint no longer complains Change-Id: Ia6433eae378f66376aa33031cb3cee66e42bb69c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4775778 Tested-by: Bob Haarman Reviewed-by: George Burgess Commit-Queue: Bob Haarman --- pgo_tools_rust/pgo_rust.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/pgo_tools_rust/pgo_rust.py b/pgo_tools_rust/pgo_rust.py index 311caa8a..532d1ef9 100755 --- a/pgo_tools_rust/pgo_rust.py +++ b/pgo_tools_rust/pgo_rust.py @@ -4,6 +4,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +# pylint: disable=line-too-long """Handle most aspects of creating and benchmarking PGO profiles for Rust. This is meant to be done at Rust uprev time. Ultimately profdata files need @@ -274,9 +275,10 @@ def build_rust( ): if use_frontend_profile or use_llvm_profile: - assert ( - not generate_frontend_profile and not generate_llvm_profile - ), "Can't build a compiler to both use profile information and generate it" + assert not generate_frontend_profile and not generate_llvm_profile, ( + "Can't build a compiler to both use profile information " + "and generate it" + ) assert ( not generate_frontend_profile or not generate_llvm_profile @@ -304,9 +306,9 @@ def build_rust( def merge_profdata(llvm_or_frontend, *, source_directory: Path, dest: Path): assert llvm_or_frontend in ("llvm", "frontend") - # The two `llvm-profdata` programs come from different LLVM versions, and may - # support different versions of the profdata format, so make sure to use the - # right one. + # The two `llvm-profdata` programs come from different LLVM versions, and + # may support different versions of the profdata format, so make sure to + # use the right one. llvm_profdata = ( "/usr/bin/llvm-profdata" if llvm_or_frontend == "llvm" @@ -586,7 +588,8 @@ def main(): parser_benchmark_nopgo.add_argument( "--suffix", default="", - help="Suffix to distinguish benchmarks and profdata with identical rustc versions", + help="Suffix to distinguish benchmarks and profdata with identical " + "rustc versions", ) parser_benchmark_pgo = subparsers.add_parser( @@ -619,7 +622,8 @@ def main(): parser_benchmark_pgo.add_argument( "--suffix", default="", - help="Suffix to distinguish benchmarks and profdata with identical rustc versions", + help="Suffix to distinguish benchmarks and profdata with identical " + "rustc versions", ) parser_upload_profdata = subparsers.add_parser( @@ -639,7 +643,8 @@ def main(): parser_upload_profdata.add_argument( "--suffix", default="", - help="Suffix to distinguish benchmarks and profdata with identical rustc versions", + help="Suffix to distinguish benchmarks and profdata with identical " + "rustc versions", ) args = parser.parse_args() -- cgit v1.2.3 From 5cd127ec243ed97614774237552530c133f91292 Mon Sep 17 00:00:00 2001 From: Bob Haarman Date: Thu, 10 Aug 2023 12:43:28 +0000 Subject: pgo_rust: make mypy type checking pass BUG=None TEST=mypy Change-Id: Id6d21424091ef6a97238ad374abc84675adecd45 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4769059 Commit-Queue: Bob Haarman Tested-by: Bob Haarman Reviewed-by: George Burgess --- pgo_tools_rust/pgo_rust.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pgo_tools_rust/pgo_rust.py b/pgo_tools_rust/pgo_rust.py index 532d1ef9..07cd8ac3 100755 --- a/pgo_tools_rust/pgo_rust.py +++ b/pgo_tools_rust/pgo_rust.py @@ -112,7 +112,7 @@ import re import shutil import subprocess import sys -from typing import Dict, List, Optional +from typing import cast, List, Mapping, Optional TARGET_TRIPLES = [ @@ -147,14 +147,14 @@ def run( args: List, *, indent: int = 4, - env: Optional[Dict[str, str]] = None, + env: Optional[Mapping[str, str]] = None, capture_stdout: bool = False, message: bool = True, ) -> Optional[str]: args = [str(arg) for arg in args] if env is None: - new_env = os.environ + new_env: Mapping[str, str] = os.environ else: new_env = os.environ.copy() new_env.update(env) @@ -200,8 +200,13 @@ def run( return ret +def get_command_output(args: List, **kwargs) -> str: + """Runs a command and returns its stdout and stderr as a string.""" + return cast(str, run(args, capture_stdout=True, **kwargs)) + + def get_rust_version() -> str: - s = run(["rustc", "--version"], capture_stdout=True) + s = get_command_output(["rustc", "--version"]) m = re.search(r"\d+\.\d+\.\d+", s) assert m is not None, repr(s) return m.group(0) -- cgit v1.2.3 From 6131a0adbb3c0ed059bff054cd72bc4ef006a545 Mon Sep 17 00:00:00 2001 From: Bob Haarman Date: Tue, 8 Aug 2023 19:36:09 +0000 Subject: rust_uprev: Fix type information so that mypy runs successfully BUG=None TEST=mypy rust_tools/rust_uprev.py && ./run_tests_for rust_tools/rust_uprev.py Change-Id: Ifdb515aae078b2d35145b80084ecd4f59f498471 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4760606 Reviewed-by: George Burgess Commit-Queue: Bob Haarman Tested-by: Bob Haarman --- rust_tools/rust_uprev.py | 142 ++++++++++++++++++++++++++++++------------ rust_tools/rust_uprev_test.py | 24 ++++--- 2 files changed, 120 insertions(+), 46 deletions(-) diff --git a/rust_tools/rust_uprev.py b/rust_tools/rust_uprev.py index 5bcb527d..d7a27bc9 100755 --- a/rust_tools/rust_uprev.py +++ b/rust_tools/rust_uprev.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -# -*- coding: utf-8 -*- # Copyright 2020 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -36,13 +35,45 @@ import re import shlex import shutil import subprocess -import sys -from typing import Any, Callable, Dict, List, NamedTuple, Optional, T, Tuple +from typing import ( + Any, + Callable, + Dict, + List, + NamedTuple, + Optional, + Protocol, + Tuple, + TypeVar, + Union, +) from llvm_tools import chroot from llvm_tools import git +T = TypeVar("T") +Command = List[Union[str, os.PathLike]] +PathOrStr = Union[str, os.PathLike] + + +class RunStepFn(Protocol): + """Protocol that corresponds to run_step's type. + + This can be used as the type of a function parameter that accepts + run_step as its value. + """ + + def __call__( + self, + step_name: str, + step_fn: Callable[[], T], + result_from_json: Optional[Callable[[Any], T]] = None, + result_to_json: Optional[Callable[[T], Any]] = None, + ) -> T: + ... + + EQUERY = "equery" GSUTIL = "gsutil.py" MIRROR_PATH = "gs://chromeos-localmirror/distfiles" @@ -50,20 +81,25 @@ EBUILD_PREFIX = Path("/mnt/host/source/src/third_party/chromiumos-overlay") RUST_PATH = Path(EBUILD_PREFIX, "dev-lang", "rust") -def get_command_output(command: List[str], *args, **kwargs) -> str: +def get_command_output(command: Command, *args, **kwargs) -> str: return subprocess.check_output( command, encoding="utf-8", *args, **kwargs ).strip() -def get_command_output_unchecked(command: List[str], *args, **kwargs) -> str: +def get_command_output_unchecked(command: Command, *args, **kwargs) -> str: + # pylint: disable=subprocess-run-check return subprocess.run( command, - check=False, - stdout=subprocess.PIPE, - encoding="utf-8", *args, - **kwargs, + **dict( + { + "check": False, + "stdout": subprocess.PIPE, + "encoding": "utf-8", + }, + **kwargs, + ), ).stdout.strip() @@ -109,6 +145,14 @@ class RustVersion(NamedTuple): ) +class PreparedUprev(NamedTuple): + """Container for the information returned by prepare_uprev.""" + + template_version: RustVersion + ebuild_path: Path + bootstrap_version: RustVersion + + def compute_rustc_src_name(version: RustVersion) -> str: return f"rustc-{version}-src.tar.gz" @@ -117,7 +161,7 @@ def compute_rust_bootstrap_prebuilt_name(version: RustVersion) -> str: return f"rust-bootstrap-{version}.tbz2" -def find_ebuild_for_package(name: str) -> os.PathLike: +def find_ebuild_for_package(name: str) -> str: """Returns the path to the ebuild for the named package.""" return get_command_output([EQUERY, "w", name]) @@ -303,7 +347,7 @@ def parse_commandline_args() -> argparse.Namespace: def prepare_uprev( rust_version: RustVersion, template: Optional[RustVersion] -) -> Optional[Tuple[RustVersion, str, RustVersion]]: +) -> Optional[PreparedUprev]: if template is None: ebuild_path = find_ebuild_for_package("rust") ebuild_name = os.path.basename(ebuild_path) @@ -329,11 +373,11 @@ def prepare_uprev( ) logging.info("rust-bootstrap version is %s", bootstrap_version) - return template_version, ebuild_path, bootstrap_version + return PreparedUprev(template_version, Path(ebuild_path), bootstrap_version) def create_ebuild( - template_ebuild: str, pkgatom: str, new_version: RustVersion + template_ebuild: PathOrStr, pkgatom: str, new_version: RustVersion ) -> str: filename = f"{Path(pkgatom).name}-{new_version}.ebuild" ebuild = EBUILD_PREFIX.joinpath(f"{pkgatom}/{filename}") @@ -344,9 +388,9 @@ def create_ebuild( def update_bootstrap_ebuild(new_bootstrap_version: RustVersion) -> None: old_ebuild = find_ebuild_path(rust_bootstrap_path(), "rust-bootstrap") - m = re.match(r"^rust-bootstrap-(\d+).(\d+).(\d+)", old_ebuild.name) + m = re.match(r"^rust-bootstrap-(\d+.\d+.\d+)", old_ebuild.name) assert m, old_ebuild.name - old_version = RustVersion(m.group(1), m.group(2), m.group(3)) + old_version = RustVersion.parse(m.group(1)) new_ebuild = old_ebuild.parent.joinpath( f"rust-bootstrap-{new_bootstrap_version}.ebuild" ) @@ -362,8 +406,9 @@ def update_bootstrap_ebuild(new_bootstrap_version: RustVersion) -> None: def update_bootstrap_version( - path: str, new_bootstrap_version: RustVersion + path: PathOrStr, new_bootstrap_version: RustVersion ) -> None: + # pylint: disable=consider-using-with contents = open(path, encoding="utf-8").read() contents, subs = re.subn( r"^BOOTSTRAP_VERSION=.*$", @@ -373,6 +418,7 @@ def update_bootstrap_version( ) if not subs: raise RuntimeError(f"BOOTSTRAP_VERSION not found in {path}") + # pylint: disable=consider-using-with open(path, "w", encoding="utf-8").write(contents) logging.info("Rust BOOTSTRAP_VERSION updated to %s", new_bootstrap_version) @@ -405,7 +451,7 @@ def fetch_distfile_from_mirror(name: str) -> None: """ mirror_file = MIRROR_PATH + "/" + name local_file = Path(get_distdir(), name) - cmd = [GSUTIL, "cp", mirror_file, local_file] + cmd: Command = [GSUTIL, "cp", mirror_file, local_file] logging.info("Running %r", cmd) rc = subprocess.call(cmd) if rc != 0: @@ -478,12 +524,12 @@ def fetch_rust_distfiles(version: RustVersion) -> None: fetch_distfile_from_mirror(compute_rustc_src_name(version)) -def get_distdir() -> os.PathLike: +def get_distdir() -> str: """Returns portage's distdir.""" return get_command_output(["portageq", "distdir"]) -def update_manifest(ebuild_file: os.PathLike) -> None: +def update_manifest(ebuild_file: PathOrStr) -> None: """Updates the MANIFEST for the ebuild at the given path.""" ebuild = Path(ebuild_file) ebuild_actions(ebuild.parent.name, ["manifest"]) @@ -575,28 +621,44 @@ def perform_step( return val -def prepare_uprev_from_json( - obj: Any, -) -> Optional[Tuple[RustVersion, str, RustVersion]]: +def prepare_uprev_from_json(obj: Any) -> Optional[PreparedUprev]: if not obj: return None version, ebuild_path, bootstrap_version = obj - return RustVersion(*version), ebuild_path, RustVersion(*bootstrap_version) + return PreparedUprev( + RustVersion(*version), + Path(ebuild_path), + RustVersion(*bootstrap_version), + ) + + +def prepare_uprev_to_json( + prepared_uprev: Optional[PreparedUprev], +) -> Optional[Tuple[RustVersion, str, RustVersion]]: + if prepared_uprev is None: + return None + return ( + prepared_uprev.template_version, + str(prepared_uprev.ebuild_path), + prepared_uprev.bootstrap_version, + ) def create_rust_uprev( rust_version: RustVersion, maybe_template_version: Optional[RustVersion], skip_compile: bool, - run_step: Callable[[], T], + run_step: RunStepFn, ) -> None: - template_version, template_ebuild, old_bootstrap_version = run_step( + prepared = run_step( "prepare uprev", lambda: prepare_uprev(rust_version, maybe_template_version), result_from_json=prepare_uprev_from_json, + result_to_json=prepare_uprev_to_json, ) - if template_ebuild is None: + if prepared is None: return + template_version, template_ebuild, old_bootstrap_version = prepared # The fetch steps will fail (on purpose) if the files they check for # are not available on the mirror. To make them pass, fetch the @@ -730,16 +792,16 @@ def rebuild_packages(version: RustVersion): raise -def remove_ebuild_version(path: os.PathLike, name: str, version: RustVersion): +def remove_ebuild_version(path: PathOrStr, name: str, version: RustVersion): """Remove the specified version of an ebuild. Removes {path}/{name}-{version}.ebuild and {path}/{name}-{version}-*.ebuild using git rm. Args: - path: The directory in which the ebuild files are. - name: The name of the package (e.g. 'rust'). - version: The version of the ebuild to remove. + path: The directory in which the ebuild files are. + name: The name of the package (e.g. 'rust'). + version: The version of the ebuild to remove. """ path = Path(path) pattern = f"{name}-{version}-*.ebuild" @@ -755,12 +817,13 @@ def remove_ebuild_version(path: os.PathLike, name: str, version: RustVersion): remove_files(m.name, path) -def remove_files(filename: str, path: str) -> None: +def remove_files(filename: PathOrStr, path: PathOrStr) -> None: subprocess.check_call(["git", "rm", filename], cwd=path) def remove_rust_bootstrap_version( - version: RustVersion, run_step: Callable[[], T] + version: RustVersion, + run_step: RunStepFn, ) -> None: run_step( "remove old bootstrap ebuild", @@ -776,7 +839,8 @@ def remove_rust_bootstrap_version( def remove_rust_uprev( - rust_version: Optional[RustVersion], run_step: Callable[[], T] + rust_version: Optional[RustVersion], + run_step: RunStepFn, ) -> None: def find_desired_rust_version() -> RustVersion: if rust_version: @@ -938,7 +1002,8 @@ def main() -> None: elif args.subparser_name == "remove-bootstrap": remove_rust_bootstrap_version(args.version, run_step) else: - # If you have added more subparser_name, please also add the handlers above + # If you have added more subparser_name, please also add the handlers + # above assert args.subparser_name == "roll" run_step("create new repo", lambda: create_new_repo(args.uprev)) if not args.skip_cross_compiler: @@ -947,10 +1012,9 @@ def main() -> None: args.uprev, args.template, args.skip_compile, run_step ) remove_rust_uprev(args.remove, run_step) - bootstrap_version = prepare_uprev_from_json( - completed_steps["prepare uprev"] - )[2] - remove_rust_bootstrap_version(bootstrap_version, run_step) + prepared = prepare_uprev_from_json(completed_steps["prepare uprev"]) + assert prepared is not None, "no prepared uprev decoded from JSON" + remove_rust_bootstrap_version(prepared.bootstrap_version, run_step) if not args.no_upload: run_step( "create rust uprev CL", lambda: create_new_commit(args.uprev) @@ -958,4 +1022,4 @@ def main() -> None: if __name__ == "__main__": - sys.exit(main()) + main() diff --git a/rust_tools/rust_uprev_test.py b/rust_tools/rust_uprev_test.py index c8ceeb7d..33dbc111 100755 --- a/rust_tools/rust_uprev_test.py +++ b/rust_tools/rust_uprev_test.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -# -*- coding: utf-8 -*- # Copyright 2020 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -240,7 +239,9 @@ class PrepareUprevTest(unittest.TestCase): f"rust-bootstrap-{self.bootstrap_version}.ebuild", ) mock_find_ebuild.return_value = bootstrap_ebuild_path - expected = (self.version_old, "/path/to/ebuild", self.bootstrap_version) + expected = rust_uprev.PreparedUprev( + self.version_old, Path("/path/to/ebuild"), self.bootstrap_version + ) actual = rust_uprev.prepare_uprev( rust_version=self.version_new, template=self.version_old ) @@ -280,7 +281,11 @@ class PrepareUprevTest(unittest.TestCase): f"rust-bootstrap-{self.bootstrap_version}.ebuild", ) mock_find_ebuild.return_value = bootstrap_ebuild_path - expected = (self.version_old, rust_ebuild_path, self.bootstrap_version) + expected = rust_uprev.PreparedUprev( + self.version_old, + Path(rust_ebuild_path), + self.bootstrap_version, + ) actual = rust_uprev.prepare_uprev( rust_version=self.version_new, template=None ) @@ -308,13 +313,17 @@ class PrepareUprevTest(unittest.TestCase): mock_exists.assert_not_called() def test_prepare_uprev_from_json(self): - ebuild_path = "/path/to/the/ebuild" + ebuild_path = Path("/path/to/the/ebuild") json_result = ( list(self.version_new), ebuild_path, list(self.bootstrap_version), ) - expected = (self.version_new, ebuild_path, self.bootstrap_version) + expected = rust_uprev.PreparedUprev( + self.version_new, + Path(ebuild_path), + self.bootstrap_version, + ) actual = rust_uprev.prepare_uprev_from_json(json_result) self.assertEqual(expected, actual) @@ -370,7 +379,8 @@ class UpdateBootstrapEbuildTest(unittest.TestCase): def test_update_bootstrap_ebuild(self): # The update should do two things: - # 1. Create a copy of rust-bootstrap's ebuild with the new version number. + # 1. Create a copy of rust-bootstrap's ebuild with the + # new version number. # 2. Add the old PV to RUSTC_RAW_FULL_BOOTSTRAP_SEQUENCE. with tempfile.TemporaryDirectory() as tmpdir_str, mock.patch.object( rust_uprev, "find_ebuild_path" @@ -394,7 +404,7 @@ some more text rust_uprev.update_bootstrap_ebuild(rust_uprev.RustVersion(1, 46, 0)) new_ebuild = bootstrapdir.joinpath("rust-bootstrap-1.46.0.ebuild") self.assertTrue(new_ebuild.exists()) - text = new_ebuild.read_text() + text = new_ebuild.read_text(encoding="utf-8") self.assertEqual( text, """ -- cgit v1.2.3 From 0eb892bf0e54f2f18174973ad31ec579cb5fa73f Mon Sep 17 00:00:00 2001 From: Bob Haarman Date: Fri, 11 Aug 2023 23:52:00 +0000 Subject: rust_uprev: use Path.{read,write}_text instead of open().{read,write} This replaces open(...).read(...) with Path(...).read_text() and open(...).write(...) with Path(...).write_text(...). This avoids cros lint complaining about wanting to wrap the code in a with statement. BUG=None TEST=cros lint; run rust_uprev_test.py Change-Id: Ic3763c09e5f84470aeb36377d0aed92480279a4d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4775699 Reviewed-by: George Burgess Tested-by: Bob Haarman Commit-Queue: Bob Haarman --- rust_tools/rust_uprev.py | 7 +++---- rust_tools/rust_uprev_test.py | 41 ++++++++++++++++++++++++++++++----------- 2 files changed, 33 insertions(+), 15 deletions(-) diff --git a/rust_tools/rust_uprev.py b/rust_tools/rust_uprev.py index d7a27bc9..6d6ca5a4 100755 --- a/rust_tools/rust_uprev.py +++ b/rust_tools/rust_uprev.py @@ -408,8 +408,8 @@ def update_bootstrap_ebuild(new_bootstrap_version: RustVersion) -> None: def update_bootstrap_version( path: PathOrStr, new_bootstrap_version: RustVersion ) -> None: - # pylint: disable=consider-using-with - contents = open(path, encoding="utf-8").read() + path = Path(path) + contents = path.read_text(encoding="utf-8") contents, subs = re.subn( r"^BOOTSTRAP_VERSION=.*$", 'BOOTSTRAP_VERSION="%s"' % (new_bootstrap_version,), @@ -418,8 +418,7 @@ def update_bootstrap_version( ) if not subs: raise RuntimeError(f"BOOTSTRAP_VERSION not found in {path}") - # pylint: disable=consider-using-with - open(path, "w", encoding="utf-8").write(contents) + path.write_text(contents, encoding="utf-8") logging.info("Rust BOOTSTRAP_VERSION updated to %s", new_bootstrap_version) diff --git a/rust_tools/rust_uprev_test.py b/rust_tools/rust_uprev_test.py index 33dbc111..271557e3 100755 --- a/rust_tools/rust_uprev_test.py +++ b/rust_tools/rust_uprev_test.py @@ -24,6 +24,23 @@ def _fail_command(cmd, *_args, **_kwargs): raise err +def start_mock(obj, *args, **kwargs): + """Creates a patcher, starts it, and registers a cleanup to stop it. + + Args: + obj: + the object to attach the cleanup to + *args: + passed to mock.patch() + **kwargs: + passsed to mock.patch() + """ + patcher = mock.patch(*args, **kwargs) + val = patcher.start() + obj.addCleanup(patcher.stop) + return val + + class FetchDistfileTest(unittest.TestCase): """Tests rust_uprev.fetch_distfile_from_mirror()""" @@ -338,26 +355,28 @@ BOOTSTRAP_VERSION="1.2.0" BOOTSTRAP_VERSION="1.3.6" """ + def setUp(self): + self.mock_read_text = start_mock(self, "pathlib.Path.read_text") + def test_success(self): - mock_open = mock.mock_open(read_data=self.ebuild_file_before) + self.mock_read_text.return_value = self.ebuild_file_before # ebuild_file and new bootstrap version are deliberately different ebuild_file = "/path/to/rust/cros-rustc.eclass" - with mock.patch("builtins.open", mock_open): + with mock.patch("pathlib.Path.write_text") as mock_write_text: rust_uprev.update_bootstrap_version( ebuild_file, rust_uprev.RustVersion.parse("1.3.6") ) - mock_open.return_value.__enter__().write.assert_called_once_with( - self.ebuild_file_after - ) + mock_write_text.assert_called_once_with( + self.ebuild_file_after, encoding="utf-8" + ) def test_fail_when_ebuild_misses_a_variable(self): - mock_open = mock.mock_open(read_data="") + self.mock_read_text.return_value = "" ebuild_file = "/path/to/rust/rust-1.3.5.ebuild" - with mock.patch("builtins.open", mock_open): - with self.assertRaises(RuntimeError) as context: - rust_uprev.update_bootstrap_version( - ebuild_file, rust_uprev.RustVersion.parse("1.2.0") - ) + with self.assertRaises(RuntimeError) as context: + rust_uprev.update_bootstrap_version( + ebuild_file, rust_uprev.RustVersion.parse("1.2.0") + ) self.assertEqual( "BOOTSTRAP_VERSION not found in /path/to/rust/rust-1.3.5.ebuild", str(context.exception), -- cgit v1.2.3 From 6ccb3a3afd4082dab90184794c875c852d66b557 Mon Sep 17 00:00:00 2001 From: Bob Haarman Date: Wed, 9 Aug 2023 13:54:32 +0000 Subject: rust_uprev: fetch Rust sources from upstream if not present on local mirror Previously, fetching sources from upstream, verifying their integrity, and uploading them to the local mirror was a manual process. With this change, this happens automatically. The integrity of the sources is verified using GPG, which checks that the sources have the expected checksum, that the checksum information was signed by the signing key used by the Rust project, and that the key and signature are current (that is, the key has not been revoked and the key and signature have not expired). The expected key is hardcoded in the script so that if we ever encounter sources signed by a different key, the verification will fail and we will have to manually verify that the new key is legitimate. BUG=b:271016462 TEST=unittest, use new script to create rust 1.71.1 uprev Change-Id: I9b2129ed82ca7de9f9aadfd275683f49cb72561a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4767736 Reviewed-by: George Burgess Tested-by: Bob Haarman Commit-Queue: Bob Haarman --- rust_tools/rust_uprev.py | 144 +++++++++++++++++++++++++++- rust_tools/rust_uprev_test.py | 218 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 361 insertions(+), 1 deletion(-) diff --git a/rust_tools/rust_uprev.py b/rust_tools/rust_uprev.py index 6d6ca5a4..ae425f93 100755 --- a/rust_tools/rust_uprev.py +++ b/rust_tools/rust_uprev.py @@ -47,6 +47,7 @@ from typing import ( TypeVar, Union, ) +import urllib.request from llvm_tools import chroot from llvm_tools import git @@ -75,10 +76,34 @@ class RunStepFn(Protocol): EQUERY = "equery" -GSUTIL = "gsutil.py" +GPG = "gpg" +GSUTIL = "gsutil" MIRROR_PATH = "gs://chromeos-localmirror/distfiles" EBUILD_PREFIX = Path("/mnt/host/source/src/third_party/chromiumos-overlay") +# Keyserver to use with GPG. Not all keyservers have Rust's signing key; +# this must be set to a keyserver that does. +GPG_KEYSERVER = "keyserver.ubuntu.com" RUST_PATH = Path(EBUILD_PREFIX, "dev-lang", "rust") +# This is the signing key used by upstream Rust as of 2023-08-09. +# If the project switches to a different key, this will have to be updated. +# We require the key to be updated manually so that we have an opportunity +# to verify that the key change is legitimate. +RUST_SIGNING_KEY = "85AB96E6FA1BE5FE" +RUST_SRC_BASE_URI = "https://static.rust-lang.org/dist/" + + +class SignatureVerificationError(Exception): + """Error that indicates verification of a downloaded file failed. + + Attributes: + message: explanation of why the verification failed. + path: the path to the file whose integrity was being verified. + """ + + def __init__(self, message: str, path: Path): + super(SignatureVerificationError, self).__init__() + self.message = message + self.path = path def get_command_output(command: Command, *args, **kwargs) -> str: @@ -523,11 +548,115 @@ def fetch_rust_distfiles(version: RustVersion) -> None: fetch_distfile_from_mirror(compute_rustc_src_name(version)) +def fetch_rust_src_from_upstream(uri: str, local_path: Path) -> None: + """Fetches Rust sources from upstream. + + This downloads the source distribution and the .asc file + containing the signatures. It then verifies that the sources + have the expected signature and have been signed by + the expected key. + """ + subprocess.run( + [GPG, "--keyserver", GPG_KEYSERVER, "--recv-keys", RUST_SIGNING_KEY], + check=True, + ) + subprocess.run( + [GPG, "--keyserver", GPG_KEYSERVER, "--refresh-keys", RUST_SIGNING_KEY], + check=True, + ) + asc_uri = uri + ".asc" + local_asc_path = Path(local_path.parent, local_path.name + ".asc") + logging.info("Fetching %s", uri) + urllib.request.urlretrieve(uri, local_path) + logging.info("%s fetched", uri) + + # Raise SignatureVerificationError if we cannot get the signature. + try: + logging.info("Fetching %s", asc_uri) + urllib.request.urlretrieve(asc_uri, local_asc_path) + logging.info("%s fetched", asc_uri) + except Exception as e: + raise SignatureVerificationError( + f"error fetching signature file {asc_uri}", + local_path, + ) from e + + # Raise SignatureVerificationError if verifying the signature + # failed. + try: + output = get_command_output( + [GPG, "--verify", "--status-fd", "1", local_asc_path] + ) + except subprocess.CalledProcessError as e: + raise SignatureVerificationError( + f"error verifying signature. GPG output:\n{e.stdout}", + local_path, + ) from e + + # Raise SignatureVerificationError if the file was not signed + # with the expected key. + if f"GOODSIG {RUST_SIGNING_KEY}" not in output: + message = f"GOODSIG {RUST_SIGNING_KEY} not found in output" + if f"REVKEYSIG {RUST_SIGNING_KEY}" in output: + message = "signing key has been revoked" + elif f"EXPKEYSIG {RUST_SIGNING_KEY}" in output: + message = "signing key has expired" + elif f"EXPSIG {RUST_SIGNING_KEY}" in output: + message = "signature has expired" + raise SignatureVerificationError( + f"{message}. GPG output:\n{output}", + local_path, + ) + + def get_distdir() -> str: """Returns portage's distdir.""" return get_command_output(["portageq", "distdir"]) +def mirror_has_file(name: str) -> bool: + """Checks if the mirror has the named file.""" + mirror_file = MIRROR_PATH + "/" + name + cmd: Command = [GSUTIL, "ls", mirror_file] + proc = subprocess.run( + cmd, + check=False, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + encoding="utf-8", + ) + if "URLs matched no objects" in proc.stdout: + return False + elif proc.returncode == 0: + return True + + raise Exception( + "Unexpected result from gsutil ls:" + f" rc {proc.returncode} output:\n{proc.stdout}" + ) + + +def mirror_rust_source(version: RustVersion) -> None: + """Ensures source code for a Rust version is on the local mirror. + + If the source code is not found on the mirror, it is fetched + from upstream, its integrity is verified, and it is uploaded + to the mirror. + """ + filename = compute_rustc_src_name(version) + if mirror_has_file(filename): + logging.info("%s is present on the mirror", filename) + return + uri = f"{RUST_SRC_BASE_URI}{filename}" + local_path = Path(get_distdir()) / filename + mirror_path = f"{MIRROR_PATH}/{filename}" + fetch_rust_src_from_upstream(uri, local_path) + subprocess.run( + [GSUTIL, "cp", "-a", "public-read", local_path, mirror_path], + check=True, + ) + + def update_manifest(ebuild_file: PathOrStr) -> None: """Updates the MANIFEST for the ebuild at the given path.""" ebuild = Path(ebuild_file) @@ -659,6 +788,19 @@ def create_rust_uprev( return template_version, template_ebuild, old_bootstrap_version = prepared + run_step( + "mirror bootstrap sources", + lambda: mirror_rust_source( + template_version, + ), + ) + run_step( + "mirror rust sources", + lambda: mirror_rust_source( + rust_version, + ), + ) + # The fetch steps will fail (on purpose) if the files they check for # are not available on the mirror. To make them pass, fetch the # required files yourself, verify their checksums, then upload them diff --git a/rust_tools/rust_uprev_test.py b/rust_tools/rust_uprev_test.py index 271557e3..7abe9d11 100755 --- a/rust_tools/rust_uprev_test.py +++ b/rust_tools/rust_uprev_test.py @@ -95,6 +95,151 @@ class FetchDistfileTest(unittest.TestCase): ) +class FetchRustSrcFromUpstreamTest(unittest.TestCase): + """Tests for rust_uprev.fetch_rust_src_from_upstream.""" + + def setUp(self) -> None: + self._mock_get_distdir = start_mock( + self, + "rust_uprev.get_distdir", + return_value="/fake/distfiles", + ) + + self._mock_gpg = start_mock( + self, + "subprocess.run", + side_effect=self.fake_gpg, + ) + + self._mock_urlretrieve = start_mock( + self, + "urllib.request.urlretrieve", + side_effect=self.fake_urlretrieve, + ) + + self._mock_rust_signing_key = start_mock( + self, + "rust_uprev.RUST_SIGNING_KEY", + "1234567", + ) + + @staticmethod + def fake_urlretrieve(src: str, dest: Path) -> None: + pass + + @staticmethod + def fake_gpg(cmd, **_kwargs): + val = mock.Mock() + val.returncode = 0 + val.stdout = "" + if "--verify" in cmd: + val.stdout = "GOODSIG 1234567" + return val + + def test_success(self): + with mock.patch("rust_uprev.GPG", "gnupg"): + rust_uprev.fetch_rust_src_from_upstream( + "fakehttps://rustc-1.60.3-src.tar.gz", + Path("/fake/distfiles/rustc-1.60.3-src.tar.gz"), + ) + self._mock_urlretrieve.has_calls( + [ + ( + "fakehttps://rustc-1.60.3-src.tar.gz", + Path("/fake/distfiles/rustc-1.60.3-src.tar.gz"), + ), + ( + "fakehttps://rustc-1.60.3-src.tar.gz.asc", + Path("/fake/distfiles/rustc-1.60.3-src.tar.gz.asc"), + ), + ] + ) + self._mock_gpg.has_calls( + [ + (["gnupg", "--refresh-keys", "1234567"], {"check": True}), + ] + ) + + def test_no_signature_file(self): + def _urlretrieve(src, dest): + if src.endswith(".asc"): + raise Exception("404 not found") + return self.fake_urlretrieve(src, dest) + + self._mock_urlretrieve.side_effect = _urlretrieve + + with self.assertRaises(rust_uprev.SignatureVerificationError) as ctx: + rust_uprev.fetch_rust_src_from_upstream( + "fakehttps://rustc-1.60.3-src.tar.gz", + Path("/fake/distfiles/rustc-1.60.3-src.tar.gz"), + ) + self.assertIn("error fetching signature file", ctx.exception.message) + + def test_key_expired(self): + def _gpg_verify(cmd, *args, **kwargs): + val = self.fake_gpg(cmd, *args, **kwargs) + if "--verify" in cmd: + val.stdout = "EXPKEYSIG 1234567" + return val + + self._mock_gpg.side_effect = _gpg_verify + + with self.assertRaises(rust_uprev.SignatureVerificationError) as ctx: + rust_uprev.fetch_rust_src_from_upstream( + "fakehttps://rustc-1.60.3-src.tar.gz", + Path("/fake/distfiles/rustc-1.60.3-src.tar.gz"), + ) + self.assertIn("key has expired", ctx.exception.message) + + def test_key_revoked(self): + def _gpg_verify(cmd, *args, **kwargs): + val = self.fake_gpg(cmd, *args, **kwargs) + if "--verify" in cmd: + val.stdout = "REVKEYSIG 1234567" + return val + + self._mock_gpg.side_effect = _gpg_verify + + with self.assertRaises(rust_uprev.SignatureVerificationError) as ctx: + rust_uprev.fetch_rust_src_from_upstream( + "fakehttps://rustc-1.60.3-src.tar.gz", + Path("/fake/distfiles/rustc-1.60.3-src.tar.gz"), + ) + self.assertIn("key has been revoked", ctx.exception.message) + + def test_signature_expired(self): + def _gpg_verify(cmd, *args, **kwargs): + val = self.fake_gpg(cmd, *args, **kwargs) + if "--verify" in cmd: + val.stdout = "EXPSIG 1234567" + return val + + self._mock_gpg.side_effect = _gpg_verify + + with self.assertRaises(rust_uprev.SignatureVerificationError) as ctx: + rust_uprev.fetch_rust_src_from_upstream( + "fakehttps://rustc-1.60.3-src.tar.gz", + Path("/fake/distfiles/rustc-1.60.3-src.tar.gz"), + ) + self.assertIn("signature has expired", ctx.exception.message) + + def test_wrong_key(self): + def _gpg_verify(cmd, *args, **kwargs): + val = self.fake_gpg(cmd, *args, **kwargs) + if "--verify" in cmd: + val.stdout = "GOODSIG 0000000" + return val + + self._mock_gpg.side_effect = _gpg_verify + + with self.assertRaises(rust_uprev.SignatureVerificationError) as ctx: + rust_uprev.fetch_rust_src_from_upstream( + "fakehttps://rustc-1.60.3-src.tar.gz", + Path("/fake/distfiles/rustc-1.60.3-src.tar.gz"), + ) + self.assertIn("1234567 not found", ctx.exception.message) + + class FindEbuildPathTest(unittest.TestCase): """Tests for rust_uprev.find_ebuild_path()""" @@ -159,6 +304,79 @@ class FindEbuildPathTest(unittest.TestCase): self.assertEqual(result, ebuild) +class MirrorHasFileTest(unittest.TestCase): + """Tests for rust_uprev.mirror_has_file.""" + + @mock.patch.object(subprocess, "run") + def test_no(self, mock_run): + mock_run.return_value = mock.Mock( + returncode=1, + stdout="CommandException: One or more URLs matched no objects.", + ) + self.assertFalse(rust_uprev.mirror_has_file("rustc-1.69.0-src.tar.gz")) + + @mock.patch.object(subprocess, "run") + def test_yes(self, mock_run): + mock_run.return_value = mock.Mock( + returncode=0, + # pylint: disable=line-too-long + stdout="gs://chromeos-localmirror/distfiles/rustc-1.69.0-src.tar.gz", + ) + self.assertTrue(rust_uprev.mirror_has_file("rustc-1.69.0-src.tar.gz")) + + +class MirrorRustSourceTest(unittest.TestCase): + """Tests for rust_uprev.mirror_rust_source.""" + + def setUp(self) -> None: + start_mock(self, "rust_uprev.GSUTIL", "gsutil") + start_mock(self, "rust_uprev.MIRROR_PATH", "fakegs://fakemirror/") + start_mock( + self, "rust_uprev.get_distdir", return_value="/fake/distfiles" + ) + self.mock_mirror_has_file = start_mock( + self, + "rust_uprev.mirror_has_file", + ) + self.mock_fetch_rust_src_from_upstream = start_mock( + self, + "rust_uprev.fetch_rust_src_from_upstream", + ) + self.mock_subprocess_run = start_mock( + self, + "subprocess.run", + ) + + def test_already_present(self): + self.mock_mirror_has_file.return_value = True + rust_uprev.mirror_rust_source( + rust_uprev.RustVersion.parse("1.67.3"), + ) + self.mock_fetch_rust_src_from_upstream.assert_not_called() + self.mock_subprocess_run.assert_not_called() + + def test_fetch_and_upload(self): + self.mock_mirror_has_file.return_value = False + rust_uprev.mirror_rust_source( + rust_uprev.RustVersion.parse("1.67.3"), + ) + self.mock_fetch_rust_src_from_upstream.called_once() + self.mock_subprocess_run.has_calls( + [ + ( + [ + "gsutil", + "cp", + "-a", + "public-read", + "/fake/distdir/rustc-1.67.3-src.tar.gz", + "fakegs://fakemirror/rustc-1.67.3-src.tar.gz", + ] + ), + ] + ) + + class RemoveEbuildVersionTest(unittest.TestCase): """Tests for rust_uprev.remove_ebuild_version()""" -- cgit v1.2.3 From a0db90250b8020c6710a1dab256932a51ac7d497 Mon Sep 17 00:00:00 2001 From: Bob Haarman Date: Tue, 8 Aug 2023 16:00:50 +0000 Subject: modified pgo_rust so that it can be invoked as a module This will be used by an upcoming change to rust_uprev to automatically generate and upload profile data for new Rust versions. BUG=b:271017864 TEST=use it to upgrade Rust Change-Id: I9e382e0bc3317bb1de9d4501391029f457afae82 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4775779 Tested-by: Bob Haarman Reviewed-by: George Burgess Commit-Queue: Bob Haarman --- pgo_tools_rust/pgo_rust.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pgo_tools_rust/pgo_rust.py b/pgo_tools_rust/pgo_rust.py index 07cd8ac3..fc693169 100755 --- a/pgo_tools_rust/pgo_rust.py +++ b/pgo_tools_rust/pgo_rust.py @@ -544,13 +544,13 @@ def upload_profdata(args): ) -def main(): +def main(argv: List[str]) -> int: logging.basicConfig( stream=sys.stdout, level=logging.NOTSET, format="%(message)s" ) parser = argparse.ArgumentParser( - prog=sys.argv[0], + prog=argv[0], description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter, ) @@ -652,7 +652,7 @@ def main(): "rustc versions", ) - args = parser.parse_args() + args = parser.parse_args(argv[1:]) (LOCAL_BASE / "crates").mkdir(parents=True, exist_ok=True) (LOCAL_BASE / "llvm-profraw").mkdir(parents=True, exist_ok=True) @@ -665,4 +665,4 @@ def main(): if __name__ == "__main__": - sys.exit(main()) + sys.exit(main(sys.argv)) -- cgit v1.2.3 From f7a63cc940e59a42f0f151616374faf56c50d376 Mon Sep 17 00:00:00 2001 From: Bob Haarman Date: Mon, 14 Aug 2023 16:47:42 +0000 Subject: githooks: shorten too-long lines Several lines were reported as exceeding the 80-character limit. This shortens them. BUG=None TEST=None Change-Id: I3ecd16eb637cc699991841f9f92c56eab21e608d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4778621 Commit-Queue: Bob Haarman Tested-by: Bob Haarman Reviewed-by: George Burgess --- toolchain_utils_githooks/check-presubmit.py | 40 ++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/toolchain_utils_githooks/check-presubmit.py b/toolchain_utils_githooks/check-presubmit.py index af8a360b..a1f2ecbd 100755 --- a/toolchain_utils_githooks/check-presubmit.py +++ b/toolchain_utils_githooks/check-presubmit.py @@ -58,7 +58,8 @@ def has_executable_on_path(exe: str) -> bool: def escape_command(command: t.Iterable[str]) -> str: """Returns a human-readable and copy-pastable shell command. - Only intended for use in output to users. shell=True is strongly discouraged. + Only intended for use in output to users. shell=True is strongly + discouraged. """ return " ".join(shlex.quote(x) for x in command) @@ -181,9 +182,9 @@ def check_black( toolchain_utils_root: str, black: Path, python_files: t.Iterable[str] ) -> CheckResult: """Subchecker of check_py_format. Checks python file formats with black""" - # Folks have been bitten by accidentally using multiple formatter versions in - # the past. This is an issue, since newer versions of black may format things - # differently. Make the version obvious. + # Folks have been bitten by accidentally using multiple formatter + # versions in the past. This is an issue, since newer versions of + # black may format things differently. Make the version obvious. command = [black, "--version"] exit_code, stdout_and_stderr = run_command_unchecked( command, cwd=toolchain_utils_root @@ -191,7 +192,8 @@ def check_black( if exit_code: return CheckResult( ok=False, - output=f"Failed getting black version; stdstreams: {stdout_and_stderr}", + output="Failed getting black version; " + f"stdstreams: {stdout_and_stderr}", autofix_commands=[], ) @@ -244,15 +246,16 @@ def check_black( err_str = "\n".join(errors) return CheckResult( ok=False, - output=f"Using {black_version!r} had the following errors:\n{err_str}", + output=f"Using {black_version!r} had the following errors:\n" + f"{err_str}", autofix_commands=[], ) autofix = black_invocation + bad_files return CheckResult( ok=False, - output=f"Using {black_version!r}, these file(s) have formatting errors: " - f"{bad_files}", + output=f"Using {black_version!r}, these file(s) have formatting " + f"errors: {bad_files}", autofix_commands=[autofix], ) @@ -421,11 +424,10 @@ def check_cros_lint( ["golint", "-set_exit_status"] + go_files ) - complaint = "\n".join( - ( - "WARNING: go linting disabled. golint is not on your $PATH.", - "Please either enter a chroot, or install go locally. Continuing.", - ) + complaint = ( + "WARNING: go linting disabled. golint is not on your $PATH.\n" + "Please either enter a chroot, or install go locally. " + "Continuing." ) return CheckResult( ok=True, @@ -435,13 +437,11 @@ def check_cros_lint( tasks.append(("golint", thread_pool.apply_async(run_golint))) - complaint = "\n".join( - ( - "WARNING: No ChromeOS checkout detected, and no viable CrOS tree", - "found; falling back to linting only python and go. If you have a", - "ChromeOS checkout, please either develop from inside of the source", - "tree, or set $CHROMEOS_ROOT_DIRECTORY to the root of it.", - ) + complaint = ( + "WARNING: No ChromeOS checkout detected, and no viable CrOS tree\n" + "found; falling back to linting only python and go. If you have a\n" + "ChromeOS checkout, please either develop from inside of the source\n" + "tree, or set $CHROMEOS_ROOT_DIRECTORY to the root of it." ) results = [(name, get_check_result_or_catch(task)) for name, task in tasks] -- cgit v1.2.3 From c12ea463f09b850db009f51d44a87b975fd5cd93 Mon Sep 17 00:00:00 2001 From: Bob Haarman Date: Mon, 14 Aug 2023 16:39:29 +0000 Subject: githooks: remove USE_PYTHON3 = True We should no longer need USE_PYTHON3 = True, so let's clean up a bit and remove it. BUG=chromium:1401441 TEST=None Change-Id: I396c7a14ff5ee2b43b5a961f02c20b92ef4b1032 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4776070 Commit-Queue: Bob Haarman Reviewed-by: George Burgess Tested-by: Bob Haarman --- toolchain_utils_githooks/check-presubmit.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/toolchain_utils_githooks/check-presubmit.py b/toolchain_utils_githooks/check-presubmit.py index a1f2ecbd..0d2f3b31 100755 --- a/toolchain_utils_githooks/check-presubmit.py +++ b/toolchain_utils_githooks/check-presubmit.py @@ -22,10 +22,6 @@ import traceback import typing as t -# TODO(crbug.com/1401441): remove this after Feb 2023. It's here so that -# external tooling realizes that this script is Py3. -USE_PYTHON3 = True - # This was originally had many packages in it (notably scipy) # but due to changes in how scipy is built, we can no longer install # it in the chroot. See b/284489250 -- cgit v1.2.3 From bba5a5cbfedfdac635827b82f02a927224baecee Mon Sep 17 00:00:00 2001 From: Ryan Beltran Date: Mon, 14 Aug 2023 20:40:18 +0000 Subject: compiler_wrapper: Fix findings from staticcheck This CL fixes the following staticcheck findings: clang_tidy_flag.go:235:6: func hasAtLeastOneSuffix is unused (U1000) command.go:96:13: error strings should not be capitalized (ST1005) compiler_wrapper.go:97:22: should use time.Since instead of time.Now().Sub (S1012) compiler_wrapper.go:154:3: this value of cSrcFile is never used (SA4006) compiler_wrapper.go:187:12: unnecessary use of fmt.Sprintf (S1039) env.go:148:5: var _env is unused (U1000) env_test.go:228:2: this value of err is never used (SA4006) iwyu_flag.go:18:7: const iwyuCrashSubstring is unused (U1000) BUG=b:295930281 TEST=go test Change-Id: I3d365243192f9041d12b9c8385d4bd8ff1bd5669 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4779192 Reviewed-by: George Burgess Commit-Queue: Ryan Beltran Tested-by: Ryan Beltran --- compiler_wrapper/clang_tidy_flag.go | 9 --------- compiler_wrapper/command.go | 2 +- compiler_wrapper/compiler_wrapper.go | 6 +++--- compiler_wrapper/env.go | 2 +- compiler_wrapper/env_test.go | 3 +++ compiler_wrapper/iwyu_flag.go | 2 -- compiler_wrapper/testutil_test.go | 1 - 7 files changed, 8 insertions(+), 17 deletions(-) diff --git a/compiler_wrapper/clang_tidy_flag.go b/compiler_wrapper/clang_tidy_flag.go index e3940825..9722b39e 100644 --- a/compiler_wrapper/clang_tidy_flag.go +++ b/compiler_wrapper/clang_tidy_flag.go @@ -231,12 +231,3 @@ func runClangTidy(env env, clangCmd *command, cSrcFile string, extraTidyFlags [] } return err } - -func hasAtLeastOneSuffix(s string, suffixes []string) bool { - for _, suffix := range suffixes { - if strings.HasSuffix(s, suffix) { - return true - } - } - return false -} diff --git a/compiler_wrapper/command.go b/compiler_wrapper/command.go index e2a5176d..d19c903a 100644 --- a/compiler_wrapper/command.go +++ b/compiler_wrapper/command.go @@ -93,7 +93,7 @@ func resolveAgainstPathEnv(env env, cmd string) (string, error) { return resolvedPath, nil } } - return "", fmt.Errorf("Couldn't find cmd %q in path", cmd) + return "", fmt.Errorf("couldn't find cmd %q in path", cmd) } func getAbsCmdPath(env env, cmd *command) string { diff --git a/compiler_wrapper/compiler_wrapper.go b/compiler_wrapper/compiler_wrapper.go index a299698c..bb144881 100644 --- a/compiler_wrapper/compiler_wrapper.go +++ b/compiler_wrapper/compiler_wrapper.go @@ -94,7 +94,7 @@ func runAndroidClangTidy(env env, cmd *command) error { if !errors.Is(err, context.DeadlineExceeded) { // When used time is over half of TIDY_TIMEOUT, give a warning. // These warnings allow users to fix slow jobs before they get worse. - usedSeconds := int(time.Now().Sub(startTime) / time.Second) + usedSeconds := int(time.Since(startTime) / time.Second) if usedSeconds > seconds/2 { warning := "%s:1:1: warning: clang-tidy used %d seconds.\n" fmt.Fprintf(env.stdout(), warning, getSourceFile(), usedSeconds) @@ -151,7 +151,7 @@ func callCompilerInternal(env env, cfg *config, inputCmd *command) (exitCode int return 0, newErrorwithSourceLocf("unsupported compiler: %s", mainBuilder.target.compiler) } } else { - cSrcFile, tidyFlags, tidyMode := processClangTidyFlags(mainBuilder) + _, tidyFlags, tidyMode := processClangTidyFlags(mainBuilder) cSrcFile, iwyuFlags, iwyuMode := processIWYUFlags(mainBuilder) if mainBuilder.target.compilerType == clangType { err := prepareClangCommand(mainBuilder) @@ -184,7 +184,7 @@ func callCompilerInternal(env env, cfg *config, inputCmd *command) (exitCode int if iwyuMode != iwyuModeNone { if iwyuMode == iwyuModeError { - panic(fmt.Sprintf("Unknown IWYU mode")) + panic("Unknown IWYU mode") } allowCCache = false diff --git a/compiler_wrapper/env.go b/compiler_wrapper/env.go index 2dad6115..38f07cab 100644 --- a/compiler_wrapper/env.go +++ b/compiler_wrapper/env.go @@ -145,7 +145,7 @@ type printingEnv struct { env } -var _env = (*printingEnv)(nil) +var _ env = (*printingEnv)(nil) func (env *printingEnv) exec(cmd *command) error { printCmd(env, cmd) diff --git a/compiler_wrapper/env_test.go b/compiler_wrapper/env_test.go index 6b00a8b5..c10942de 100644 --- a/compiler_wrapper/env_test.go +++ b/compiler_wrapper/env_test.go @@ -226,6 +226,9 @@ func TestNewProcessEnvResolvesPwdAwayProperly(t *testing.T) { os.Unsetenv(envPwd) initialWd, err := os.Getwd() + if err != nil { + t.Fatalf("Failed getting working directory: %v", err) + } if initialWd == "/proc/self/cwd" { t.Fatalf("Working directory should never be %q when env is unset", initialWd) } diff --git a/compiler_wrapper/iwyu_flag.go b/compiler_wrapper/iwyu_flag.go index 6194bf40..5788d8c7 100644 --- a/compiler_wrapper/iwyu_flag.go +++ b/compiler_wrapper/iwyu_flag.go @@ -15,8 +15,6 @@ import ( type useIWYUMode int -const iwyuCrashSubstring = "PLEASE submit a bug report" - const ( iwyuModeNone useIWYUMode = iota iwyuModeAll diff --git a/compiler_wrapper/testutil_test.go b/compiler_wrapper/testutil_test.go index 74e05a63..8bac479b 100644 --- a/compiler_wrapper/testutil_test.go +++ b/compiler_wrapper/testutil_test.go @@ -39,7 +39,6 @@ type testContext struct { tempDir string env []string cfg *config - inputCmd *command lastCmd *command cmdCount int cmdMock func(cmd *command, stdin io.Reader, stdout io.Writer, stderr io.Writer) error -- cgit v1.2.3 From c0306cc96bf91a8e926ae79240d7639b942de74a Mon Sep 17 00:00:00 2001 From: Ryan Beltran Date: Mon, 14 Aug 2023 20:42:40 +0000 Subject: compiler_wrapper: Fix infinite recursion in runWithTimeout This CL fixes a staticanalyzer result: env.go:126:9: infinite recursive call (SA5007) BUG=b:295930281 TEST=go test Change-Id: Id7d152afe658e8e104edd4730be9890c359d2b04 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4779193 Commit-Queue: Ryan Beltran Reviewed-by: George Burgess Tested-by: Ryan Beltran --- compiler_wrapper/env.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler_wrapper/env.go b/compiler_wrapper/env.go index 38f07cab..5ec8ea03 100644 --- a/compiler_wrapper/env.go +++ b/compiler_wrapper/env.go @@ -123,7 +123,7 @@ func (env *commandRecordingEnv) exec(cmd *command) error { } func (env *commandRecordingEnv) runWithTimeout(cmd *command, duration time.Duration) error { - return env.runWithTimeout(cmd, duration) + return runCmdWithTimeout(env, cmd, duration) } func (env *commandRecordingEnv) run(cmd *command, stdin io.Reader, stdout io.Writer, stderr io.Writer) error { -- cgit v1.2.3 From 43244d82873f1d0e9b7531f141ed3ac06ad452c7 Mon Sep 17 00:00:00 2001 From: Ryan Beltran Date: Mon, 14 Aug 2023 23:34:03 +0000 Subject: compiler_wrapper: Apply go fmt changes This CL applies the changes generated by go fmt. Mostly they are just changing the formatting of comments because go fmt seems to care about that. BUG=None TEST=go fmt Change-Id: I8162940a4e64735817b8718c42b4d36dff3ab600 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4777948 Reviewed-by: George Burgess Commit-Queue: Ryan Beltran Tested-by: Ryan Beltran --- compiler_wrapper/main.go | 16 ++++++++-------- compiler_wrapper/rusage_flag.go | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/compiler_wrapper/main.go b/compiler_wrapper/main.go index 8cfa4364..7d1e3f49 100644 --- a/compiler_wrapper/main.go +++ b/compiler_wrapper/main.go @@ -3,22 +3,22 @@ // found in the LICENSE file. // This binary requires the following linker variables: -// - main.UseCCache: Whether to use ccache. -// - main.ConfigName: Name of the configuration to use. -// See config.go for the supported values. +// - main.UseCCache: Whether to use ccache. +// - main.ConfigName: Name of the configuration to use. +// See config.go for the supported values. // // The script ./build simplifies the call to `go build`. // E.g. ./build --use_ccache=true --config=cros.hardened will build a // binary that uses the ccache for ChromeOS with hardened flags. // // Test arguments: -// - updategolden: To update the golden results for the wrapper. Without it, -// the tests will verify that the wrapper output matches the goldens. -// - rungolden: To filter the golden tests by a regex for the wrapper env, path and args. +// - updategolden: To update the golden results for the wrapper. Without it, +// the tests will verify that the wrapper output matches the goldens. +// - rungolden: To filter the golden tests by a regex for the wrapper env, path and args. // // Examples: -// - run all tests in isolation: -// go test third_party/toolchain-utils/compiler_wrapper/ -v +// - run all tests in isolation: +// go test third_party/toolchain-utils/compiler_wrapper/ -v package main import ( diff --git a/compiler_wrapper/rusage_flag.go b/compiler_wrapper/rusage_flag.go index ed59b11e..899e4da8 100644 --- a/compiler_wrapper/rusage_flag.go +++ b/compiler_wrapper/rusage_flag.go @@ -62,7 +62,7 @@ func removeRusageFromCommand(compilerCmd *command) *command { } // maybeCaptureRusage captures rusage for execution of action() -// unless action returns an error or logFileName is "" +// unless action returns an error or logFileName is "" // a function is returned which saves the rusage log data at logFileName unless logFileName is "" // an error is returned if action returns an error, or rusage commands in syscall fails func maybeCaptureRusage(env env, compilerCmd *command, action func(willLogRusage bool) error) (maybeCommitToFile func(exitCode int) error, err error) { -- cgit v1.2.3 From 7f833f357ecdeec7948782f391b131d6a375f095 Mon Sep 17 00:00:00 2001 From: Bob Haarman Date: Tue, 8 Aug 2023 15:50:59 +0000 Subject: rust_uprev: generate profile data This change modifies rust_uprev so that it automatically generates profile data for new Rust versions as part of the upgrade process. Specifically, it performs the following steps: 1. Edit cros-rustc.eclass so that profile data is not listed in SRC_URI. 2. Generate manifests for the new rust and rust-host ebuilds, including the new sources, but not yet the profile data (which does not exist yet). 3. Invoke pgo_rust to generate and upload profile data. 4. Undo the previous change to cros-rustc.eclass so that SRC_URI includes profile data again. 5. Generate new manifests for the rust and rust-host ebuilds, this time including the new profile data. BUG=b:271017864 TEST=rust_uprev_test, perform a Rust upgrade with the new script Change-Id: I1672b8d62e148503bfcf6ab7bdde83b08f529fe0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4775780 Tested-by: Bob Haarman Commit-Queue: Bob Haarman Reviewed-by: George Burgess --- rust_tools/rust_uprev.py | 57 ++++++++++++++++++++++++++++++++++++++++--- rust_tools/rust_uprev_test.py | 55 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+), 3 deletions(-) diff --git a/rust_tools/rust_uprev.py b/rust_tools/rust_uprev.py index ae425f93..4823e35e 100755 --- a/rust_tools/rust_uprev.py +++ b/rust_tools/rust_uprev.py @@ -51,6 +51,7 @@ import urllib.request from llvm_tools import chroot from llvm_tools import git +from pgo_tools_rust import pgo_rust T = TypeVar("T") @@ -80,6 +81,7 @@ GPG = "gpg" GSUTIL = "gsutil" MIRROR_PATH = "gs://chromeos-localmirror/distfiles" EBUILD_PREFIX = Path("/mnt/host/source/src/third_party/chromiumos-overlay") +CROS_RUSTC_ECLASS = EBUILD_PREFIX / "eclass/cros-rustc.eclass" # Keyserver to use with GPG. Not all keyservers have Rust's signing key; # this must be set to a keyserver that does. GPG_KEYSERVER = "keyserver.ubuntu.com" @@ -411,6 +413,33 @@ def create_ebuild( return str(ebuild) +def set_include_profdata_src(ebuild_path: os.PathLike, include: bool) -> None: + """Changes an ebuild file to include or omit profile data from SRC_URI. + + If include is True, the ebuild file will be rewritten to include + profile data in SRC_URI. + + If include is False, the ebuild file will be rewritten to omit profile + data from SRC_URI. + """ + if include: + old = "" + new = "yes" + else: + old = "yes" + new = "" + contents = Path(ebuild_path).read_text(encoding="utf-8") + contents, subs = re.subn( + f"^INCLUDE_PROFDATA_IN_SRC_URI={old}$", + f"INCLUDE_PROFDATA_IN_SRC_URI={new}", + contents, + flags=re.MULTILINE, + ) + # We expect exactly one substitution. + assert subs == 1, "Failed to update INCLUDE_PROFDATA_IN_SRC_URI" + Path(ebuild_path).write_text(contents, encoding="utf-8") + + def update_bootstrap_ebuild(new_bootstrap_version: RustVersion) -> None: old_ebuild = find_ebuild_path(rust_bootstrap_path(), "rust-bootstrap") m = re.match(r"^rust-bootstrap-(\d+.\d+.\d+)", old_ebuild.name) @@ -826,9 +855,11 @@ def create_rust_uprev( ) run_step( "update bootstrap version", - lambda: update_bootstrap_version( - EBUILD_PREFIX.joinpath("eclass/cros-rustc.eclass"), template_version - ), + lambda: update_bootstrap_version(CROS_RUSTC_ECLASS, template_version), + ) + run_step( + "turn off profile data sources in cros-rustc.eclass", + lambda: set_include_profdata_src(CROS_RUSTC_ECLASS, include=False), ) template_host_ebuild = EBUILD_PREFIX.joinpath( f"dev-lang/rust-host/rust-host-{template_version}.ebuild" @@ -851,6 +882,26 @@ def create_rust_uprev( "update target manifest to add new version", lambda: update_manifest(Path(target_file)), ) + run_step( + "generate profile data for rustc", + lambda: pgo_rust.main(["pgo_rust", "generate"]), + ) + run_step( + "upload profile data for rustc", + lambda: pgo_rust.main(["pgo_rust", "upload-profdata"]), + ) + run_step( + "turn on profile data sources in cros-rustc.eclass", + lambda: set_include_profdata_src(CROS_RUSTC_ECLASS, include=True), + ) + run_step( + "update host manifest to add profile data", + lambda: update_manifest(Path(host_file)), + ) + run_step( + "update target manifest to add profile data", + lambda: update_manifest(Path(target_file)), + ) if not skip_compile: run_step("build packages", lambda: rebuild_packages(rust_version)) run_step( diff --git a/rust_tools/rust_uprev_test.py b/rust_tools/rust_uprev_test.py index 7abe9d11..3f8c829c 100755 --- a/rust_tools/rust_uprev_test.py +++ b/rust_tools/rust_uprev_test.py @@ -563,6 +563,61 @@ class PrepareUprevTest(unittest.TestCase): self.assertEqual(expected, actual) +class ToggleProfileData(unittest.TestCase): + """Tests functionality to include or exclude profile data from SRC_URI.""" + + ebuild_with_profdata = """ +# Some text here. +INCLUDE_PROFDATA_IN_SRC_URI=yes +some code here +""" + + ebuild_without_profdata = """ +# Some text here. +INCLUDE_PROFDATA_IN_SRC_URI= +some code here +""" + + ebuild_unexpected_content = """ +# Does not contain OMIT_PROFDATA_FROM_SRC_URI assignment +""" + + def setUp(self): + self.mock_read_text = start_mock(self, "pathlib.Path.read_text") + + def test_turn_off_profdata(self): + # Test that a file with profdata on is rewritten to a file with + # profdata off. + self.mock_read_text.return_value = self.ebuild_with_profdata + ebuild_file = "/path/to/eclass/cros-rustc.eclass" + with mock.patch("pathlib.Path.write_text") as mock_write_text: + rust_uprev.set_include_profdata_src(ebuild_file, include=False) + mock_write_text.assert_called_once_with( + self.ebuild_without_profdata, encoding="utf-8" + ) + + def test_turn_on_profdata(self): + # Test that a file with profdata off is rewritten to a file with + # profdata on. + self.mock_read_text.return_value = self.ebuild_without_profdata + ebuild_file = "/path/to/eclass/cros-rustc.eclass" + with mock.patch("pathlib.Path.write_text") as mock_write_text: + rust_uprev.set_include_profdata_src(ebuild_file, include=True) + mock_write_text.assert_called_once_with( + self.ebuild_with_profdata, encoding="utf-8" + ) + + def test_turn_on_profdata_fails_if_no_assignment(self): + # Test that if the string the code expects to find is not found, + # this causes an exception and the file is not overwritten. + self.mock_read_text.return_value = self.ebuild_unexpected_content + ebuild_file = "/path/to/eclass/cros-rustc.eclass" + with mock.patch("pathlib.Path.write_text") as mock_write_text: + with self.assertRaises(Exception): + rust_uprev.set_include_profdata_src(ebuild_file, include=False) + mock_write_text.assert_not_called() + + class UpdateBootstrapVersionTest(unittest.TestCase): """Tests for update_bootstrap_version step in rust_uprev""" -- cgit v1.2.3 From 2942bd8023e3e0a79ed78fd4fff22c1f961e9f73 Mon Sep 17 00:00:00 2001 From: Bob Haarman Date: Fri, 11 Aug 2023 16:28:52 +0000 Subject: rust_uprev: remove obsolete step "remove patches" Previously, patches had the version number they apply to encoded in their filename. Because of this, patches corresponding to Rust versions whose ebuilds were being removed also needed to be removed. Nowadays, we don't include the Rust version in the patch filename anymore and we want to keep the patches from version to version. Thus, we don't need this step anymore. BUG=b:294547321 TEST=Upgrade Rust with the new script Change-Id: I95cf45a7fb2c0a6aa44999040ff5e3263d85cc74 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4775781 Reviewed-by: George Burgess Tested-by: Bob Haarman Commit-Queue: Bob Haarman --- rust_tools/rust_uprev.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/rust_tools/rust_uprev.py b/rust_tools/rust_uprev.py index 4823e35e..e9113ea7 100755 --- a/rust_tools/rust_uprev.py +++ b/rust_tools/rust_uprev.py @@ -1047,10 +1047,6 @@ def remove_rust_uprev( find_desired_rust_version, result_from_json=find_desired_rust_version_from_json, ) - run_step( - "remove patches", - lambda: remove_files(f"files/rust-{delete_version}-*.patch", RUST_PATH), - ) run_step( "remove target ebuild", lambda: remove_ebuild_version(RUST_PATH, "rust", delete_version), -- cgit v1.2.3