aboutsummaryrefslogtreecommitdiff
path: root/compiler_wrapper
AgeCommit message (Collapse)Author
2023-08-17Upgrade toolchain-utils to 2942bd8023e3e0a79ed78fd4fff22c1f961e9f73Yabin Cui
This project was upgraded with external_updater. Usage: tools/external_updater/updater.sh update toolchain-utils For more info, check https://cs.android.com/android/platform/superproject/+/main:tools/external_updater/README.md Bug: 296418126 Test: TreeHugger Change-Id: Ic02579672a1236629f437f587a056b9753519d1e
2023-08-15compiler_wrapper: Apply go fmt changesRyan Beltran
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 <gbiv@chromium.org> Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org> Tested-by: Ryan Beltran <ryanbeltran@chromium.org>
2023-08-14compiler_wrapper: Fix infinite recursion in runWithTimeoutRyan Beltran
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 <ryanbeltran@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Ryan Beltran <ryanbeltran@chromium.org>
2023-08-14compiler_wrapper: Fix findings from staticcheckRyan Beltran
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 <gbiv@chromium.org> Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org> Tested-by: Ryan Beltran <ryanbeltran@chromium.org>
2023-07-25compiler_wrapper: disable _FORTIFY_SOURCE=3 for sanitizersGeorge Burgess IV
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 <ajordanr@google.com> Commit-Queue: George Burgess <gbiv@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2023-07-25compiler_wrapper: manually apply -D_FORTIFY_SOURCE=2George Burgess IV
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 <gbiv@chromium.org> Reviewed-by: Jordan Abrahams-Whitehead <ajordanr@google.com> Commit-Queue: George Burgess <gbiv@chromium.org>
2023-07-12compiler_wrapper: add flag to skip automatic sysroot logicGeorge Burgess IV
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 <ajordanr@google.com> Tested-by: George Burgess <gbiv@chromium.org> Commit-Queue: George Burgess <gbiv@chromium.org>
2023-05-08compiler_wrapper: Suppress gnu-offsetof-extensionsDenis Nikitin
[-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 <manojgupta@chromium.org> Commit-Queue: Denis Nikitin <denik@chromium.org> Tested-by: Denis Nikitin <denik@chromium.org>
2023-05-04compiler_wrapper: ignore gomacc-path for tidyRyan Beltran
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 <ryanbeltran@chromium.org> Commit-Queue: Manoj Gupta <manojgupta@chromium.org> Tested-by: Ryan Beltran <ryanbeltran@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
2023-02-02compiler_wrapper: add size checking to build.pyGeorge Burgess IV
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 <gbiv@chromium.org> Reviewed-by: Jordan Abrahams-Whitehead <ajordanr@google.com> Commit-Queue: George Burgess <gbiv@chromium.org>
2023-01-09compiler wrapper: Move LLVM Next Flags to CurrentRyan Beltran
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 <ryanbeltran@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Ryan Beltran <ryanbeltran@chromium.org>
2023-01-05compiler_wrapper: ignore -avoid-version clang flagRyan Beltran
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 <manojgupta@chromium.org> Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org> Tested-by: Ryan Beltran <ryanbeltran@chromium.org>
2023-01-03compiler_wrapper: Filter -Xcompiler from clangManoj Gupta
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 <manojgupta@chromium.org> Auto-Submit: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Ryan Beltran <ryanbeltran@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org> Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org>
2022-12-29compiler_wrapper: Filter "-z,defs" from linker thoroughlyManoj Gupta
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 <ryanbeltran@chromium.org> Auto-Submit: Manoj Gupta <manojgupta@chromium.org> Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org>
2022-12-29compiler wrapper: Move array param to post flagsRyan Beltran
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 <manojgupta@chromium.org> Tested-by: Ryan Beltran <ryanbeltran@chromium.org> Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org>
2022-12-22compiler_wrapper: temporarily reenable removed c++ featuresRyan Beltran
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 <manojgupta@chromium.org> Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org> Tested-by: Ryan Beltran <ryanbeltran@chromium.org>
2022-12-22compiler wrapper: disable -Warray-parameterRyan Beltran
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 <ryanbeltran@chromium.org> Tested-by: Ryan Beltran <ryanbeltran@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
2022-12-15werror reports: don't use /tmp in ebuildsGeorge Burgess IV
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 <gbiv@chromium.org> Tested-by: George Burgess <gbiv@chromium.org> Reviewed-by: Ryan Beltran <ryanbeltran@chromium.org>
2022-12-13compiler_wrapper: add new LLVM flag for LLVM NextRyan Beltran
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 <manojgupta@chromium.org> Tested-by: Ryan Beltran <ryanbeltran@chromium.org> Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org>
2022-12-13compiler wrapper: disable new warningRyan Beltran
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 <manojgupta@chromium.org> Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org> Tested-by: Ryan Beltran <ryanbeltran@chromium.org>
2022-12-10compiler wrapper: tidy lints don't go to /tmpRyan Beltran
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 <gbiv@chromium.org> Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org> Tested-by: Ryan Beltran <ryanbeltran@chromium.org>
2022-12-08compiler_wrapper: Treat invocations with "-" as CRyan Beltran
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 <ryanbeltran@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Auto-Submit: Ryan Beltran <ryanbeltran@chromium.org> Commit-Queue: Manoj Gupta <manojgupta@chromium.org>
2022-12-06compiler wrapper: Disable c++ only flags with -x cRyan Beltran
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 <manojgupta@chromium.org> Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org> Tested-by: Ryan Beltran <ryanbeltran@chromium.org>
2022-12-06compiler_wrapper: add -std=gnu++14 flagRyan Beltran
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 <ryanbeltran@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org>
2022-12-05compiler_wrapper: remove unneeded flag for zero initRyan Beltran
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 <manojgupta@chromium.org> Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org> Tested-by: Ryan Beltran <ryanbeltran@chromium.org>
2022-12-05compiler_wrapper: Add -Wno-enum-constexpr-conversionRyan Beltran
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 <ryanbeltran@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Ryan Beltran <ryanbeltran@chromium.org>
2022-12-05compiler_wrapper: Add -Wno-incompatible-function-pointer-typesRyan Beltran
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 <manojgupta@chromium.org> Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org> Tested-by: Ryan Beltran <ryanbeltran@chromium.org>
2022-12-01compiler_wrapper: Add Wno-int-conversionRyan Beltran
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 <manojgupta@chromium.org> Tested-by: Ryan Beltran <ryanbeltran@chromium.org> Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org>
2022-11-29compiler_wrapper: reword instructions for using crash_builds.goBob Haarman
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 <inglorion@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org> Commit-Queue: Bob Haarman <inglorion@chromium.org>
2022-11-29compiler_wrapper: update paths ~/trunk -> ~/chromiumosBob Haarman
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 <inglorion@chromium.org> Reviewed-by: Ryan Beltran <ryanbeltran@chromium.org> Commit-Queue: Bob Haarman <inglorion@chromium.org>
2022-11-28compiler_wrapper: remove -fexperimental-new-pass-managerBob Haarman
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 <inglorion@chromium.org> Tested-by: Bob Haarman <inglorion@chromium.org> Reviewed-by: Ryan Beltran <ryanbeltran@chromium.org>
2022-11-21compiler_wrapper: flush output buffer for IWYURyan Beltran
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 <cjdb@google.com> Tested-by: Ryan Beltran <ryanbeltran@chromium.org> Commit-Queue: Christopher Di Bella <cjdb@google.com> Auto-Submit: Ryan Beltran <ryanbeltran@chromium.org>
2022-11-17compiler wrapper: update testsGeorge Burgess IV
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 <gbiv@chromium.org> Commit-Queue: Adrian Dole <adriandole@google.com> Reviewed-by: Adrian Dole <adriandole@google.com> Auto-Submit: George Burgess <gbiv@chromium.org>
2022-11-16compiler_wrapper: IWYU Writes to fileRyan Beltran
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 <ryanbeltran@chromium.org> Reviewed-by: Christopher Di Bella <cjdb@google.com> Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org>
2022-11-08Upgrade toolchain-utils to 2c474af4f370b143032144aff1ff1985f789e20fSadaf Ebrahimi
This project was upgraded with external_updater. Usage: tools/external_updater/updater.sh update toolchain-utils For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md Test: TreeHugger Change-Id: I60dd39f019e1287ea42fe48435ff3da44796c633
2022-11-03Revert "Revert "compiler-wrapper: adds an IWYU component""Ryan Beltran
This reverts commit 537f2ecfe7bc9eb996cd4abedae26bf699ab54dd. It also fixes the logic bug which caused the reert in the first place. IWYU flag prcessing was removing the file names if IWYU was not needed, which meant clang tidy calls were not getting the file names added to the back of the command. It also fixes the header to the most recent style guidance and updates some golang variable names to make sure we pass go lint. BUG=b:237320348 TEST=go test Change-Id: I14885fb90f97d2fb483ae1a01e14c44050852dc3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3997486 Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org> Reviewed-by: Ryan Beltran <ryanbeltran@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Ryan Beltran <ryanbeltran@chromium.org>
2022-11-02compiler_wrapper: build with zero initializationAdrian Dole
See go/chromeos-zero-init BUG=b:234642720 TEST=CQ Change-Id: Icbcb9e9b3928b46875c78c99727b1ec9839f27c3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3999814 Reviewed-by: Adrian Dole <adriandole@google.com> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Adrian Dole <adriandole@google.com> Auto-Submit: Adrian Dole <adriandole@google.com> Commit-Queue: Manoj Gupta <manojgupta@chromium.org>
2022-11-01Revert "compiler-wrapper: adds an IWYU component"Manoj Gupta
This reverts commit 6b285afc5e9caadeb6741efe872981ffdbb3bfe1. Reason for revert: Likely erroneous change. Original change's description: > compiler-wrapper: adds an IWYU component > > This first patch makes it possible to run IWYU as a part of the build > process. It's not currently possible for us to make changes to packages: > this functionality will appear in a later CL. > > BUG=b:237320348 > TEST=Tested locally > > Change-Id: I00610284143cf478b242b2c0ca1c05e2c8d43de4 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3820351 > Reviewed-by: Ryan Beltran <ryanbeltran@chromium.org> > Auto-Submit: Christopher Di Bella <cjdb@google.com> > Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org> > Tested-by: Christopher Di Bella <cjdb@google.com> Bug: b:237320348 Change-Id: Ia563382c3302b2a4c69942db95d315088763f97c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3995401 Auto-Submit: Manoj Gupta <manojgupta@chromium.org> Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: Ryan Beltran <ryanbeltran@chromium.org>
2022-11-01compiler-wrapper: adds an IWYU componentChristopher Di Bella
This first patch makes it possible to run IWYU as a part of the build process. It's not currently possible for us to make changes to packages: this functionality will appear in a later CL. BUG=b:237320348 TEST=Tested locally Change-Id: I00610284143cf478b242b2c0ca1c05e2c8d43de4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3820351 Reviewed-by: Ryan Beltran <ryanbeltran@chromium.org> Auto-Submit: Christopher Di Bella <cjdb@google.com> Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org> Tested-by: Christopher Di Bella <cjdb@google.com>
2022-10-03command: fix flaky testGeorge Burgess IV
If `exec` times out, we need to wrap the error it died with, rather than embedding it in another error. This allows `TestRunWithTimeoutReturnsErrorOnTimeout`'s `errors.Is` to correctly detect that `err` is a `context.DeadlineExceeded`. BUG=None TEST=ran this test 1000x Change-Id: I69e0dcea25dfd0cb01ac5ec0a2e8ce2f116deff7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3932869 Auto-Submit: George Burgess <gbiv@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Commit-Queue: George Burgess <gbiv@chromium.org> Tested-by: George Burgess <gbiv@chromium.org> Commit-Queue: Manoj Gupta <manojgupta@chromium.org>
2022-09-13Update license boilerplate text in source code filesMike Frysinger
Normally we don't do this, but enough changes have accumulated that we're doing a tree-wide one-off update of the name & style. BUG=chromium:1098010 TEST=`repo upload` works Change-Id: Icb42e5012a87920c2cd13b666fb3e55e7e4fb3b8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3891080 Auto-Submit: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Commit-Queue: George Burgess <gbiv@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
2022-09-07remove `from __future__ import ...` directivesGeorge Burgess IV
These are only useful when we're running code in a Python 2.7 interpreter. Since we no longer support python2, drop these. BUG=b:244644217 TEST=run_tests_for.py shows no new failures Change-Id: Ief9a12b87a560ab38ca71668636874bcb434a0b3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3877339 Reviewed-by: Ryan Beltran <ryanbeltran@chromium.org> Commit-Queue: George Burgess <gbiv@chromium.org> Reviewed-by: Jordan Abrahams-Whitehead <ajordanr@google.com> Tested-by: George Burgess <gbiv@chromium.org>
2022-09-07Autoformat all Python codeGeorge Burgess IV
This autoformats all Python code with our new Python formatter, `black`. BUG=b:244644217 TEST=None Change-Id: I15ee49233d98fb6295c0c53c129bbf8e78e0d9ff Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3877337 Tested-by: George Burgess <gbiv@chromium.org> Reviewed-by: Jordan Abrahams-Whitehead <ajordanr@google.com> Commit-Queue: George Burgess <gbiv@chromium.org>
2022-09-01compiler_wrapper: redisable unused-but-set-varRyan Beltran
This CL add the Wno-unused-but-set-variable flag back into the compiler wrapper. It was previously removed, but there are still occurances of the warning and so we were never able to bundle that change into chromoumos-overlay/llvm. An attempt to revert the original CL failed due to a merge conflict. BUG=b:227655984 TEST=None Change-Id: Ic148a6ae577d5e4394249693ce9b09b95cb9df16 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3868978 Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Ryan Beltran <ryanbeltran@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
2022-06-29compiler_wrapper: add autocrash logicGeorge Burgess IV
As outlined in the attached bug, we want to be able to crash the compiler based on a handful of heuristics. Crashing Clang helps get us self-contained reproducers fairly easily. This CL provides (off-by-default) functionality to do the above. The expectation is that a SWE will hack at it to make it work as they need to. BUG=b:236736327 TEST=Installed the new wrapper; observed autocrashes. Change-Id: I76ec753ec37baa5e9b6dab92668081fa7c605725 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3714885 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Jordan Abrahams-Whitehead <ajordanr@google.com> Commit-Queue: George Burgess <gbiv@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2022-06-23compiler_wrapper: Stop managing pie flagsManoj Gupta
With CL:3710850, pie will be defaults for clang and GCC (cross-compiles). No need to manage them separately. BUG=b:190047257 TEST=go test Change-Id: Icf8e74d6a31c5de678ec9a6a5c321a17a0154d37 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3722436 Reviewed-by: Jordan Abrahams-Whitehead <ajordanr@google.com> Reviewed-by: George Burgess <gbiv@chromium.org> Auto-Submit: Manoj Gupta <manojgupta@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org> Commit-Queue: George Burgess <gbiv@chromium.org>
2022-06-10compiler_wrapper: add a --version_suffix flag to build.pyGeorge Burgess IV
This allows us to provide more information about the compiler being wrapped to the wrapper. The intended use of this is to embed hashes of the compiler being wrapped into the wrapper itself, so as the compiler changes, the wrapper's SHA changes with it. While I'm in the area, fix up a comment, and apply this flag to our manual wrapper installation script. BUG=b:222321317 TEST=`emerge llvm` Change-Id: I20380722e1e539d51fe7ea708c63dad696d84c87 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3696434 Reviewed-by: Denis Nikitin <denik@chromium.org> Tested-by: George Burgess <gbiv@chromium.org> Commit-Queue: George Burgess <gbiv@chromium.org>
2022-06-07compiler_wrapper: include header lints for tidyRyan Beltran
This CL adds a flag to clang tidy invocations to prevent supressed lints in header files. BUG=b:187790543 TEST=None Change-Id: I9977818894899fc6c28f0c3d4121326ca854e1b3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3694553 Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org> Tested-by: Ryan Beltran <ryanbeltran@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
2022-05-16compiler_wrapper: keep FORTIFY if sanitizer is trivialGeorge Burgess IV
For sanitizers like `return`, `builtin`, etc., we have no reason to also drop FORTIFY checks. BUG=b:231357370 TEST=`go test` Change-Id: I1e349a4f6743e549b7bc0899a307b10683bb42e9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3651188 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Commit-Queue: George Burgess <gbiv@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2022-05-16compiler_wrapper: fix testGeorge Burgess IV
`-Wl,-z -Wl,defs` should be passed as separate flags. BUG=b:231357370 TEST=go test Change-Id: Iacd0be0c74df0cc7bd8607473a859c36c5ef4f06 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3651187 Commit-Queue: Manoj Gupta <manojgupta@chromium.org> Auto-Submit: George Burgess <gbiv@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>