aboutsummaryrefslogtreecommitdiff
path: root/compiler_wrapper
AgeCommit message (Collapse)Author
2021-12-06compiler_wrapper: add missing unused-but-set-varRyan Beltran
This CL adds a Wno-unused-but-set-var flag that was accidentally missing in a clangPostFlags field. THis is already present in the llvm repo, must have been fixed in there without mirroring it. BUG=b:195433889 TEST=None Change-Id: I23fcc91aee7b316cd70652f0119177d5ebdf7bbd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3319338 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org> Tested-by: Ryan Beltran <ryanbeltran@chromium.org>
2021-10-28Replace non-inclusive languageJordan R Abrahams
Wherever possible, this commit removes non-inclusive languages as per COIL policy. Some of this language exists in dead code, so this commit also removes confirmed dead code. Also some minor lint fixes to get the code past the lint checks. BUG=b:204057159 TEST=Presubmit tests Change-Id: I299bfbe5dfcbe761efc5dcb29caea2337abe3f30 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3243940 Tested-by: Jordan R Abrahams <ajordanr@google.com> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
2021-10-20compiler_wrapper: ignore unused_but_set_variableRyan Beltran
This CL adds -Wno-unused-but-set-variable to clang post flags to prevent these warnings from blocking the LLVM uprev. BUG=b:195433889 TEST=cq Change-Id: I5195412183e2684aecd20b6ff2c3345f8b8b9dfb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3235575 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org> Tested-by: Ryan Beltran <ryanbeltran@chromium.org>
2021-10-08compiler_wrapper: move llvmnext flag to post flagsRyan Beltran
This CL moves flags added for LLVM Next that disabled variable_unused_but_set warnings to PostFlags in order to make sure it gets added after Wall and Wextra. BUG=b:195433889 TEST=reran package tests Change-Id: Icdd2cbe3ced7b8427257c87f9e527b0d0e8da57d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3214640 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org> Tested-by: Ryan Beltran <ryanbeltran@chromium.org>
2021-10-05compiler_wrapper: android clang-tidy warnings on used secondsChih-Hung Hsieh
Give a warning if clang-tidy used more than TIDY_TIMEOUT/2 seconds. Users can fix it before it gets worse and times out. BUG=b:199451930 TEST=Use a fake Android clang-tidy.real binary, TEST=to dump passed environment variables and run for required time. Change-Id: I8df7e4e3bb621cbf40094c7b97494e5978d7c6a2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3200220 Reviewed-by: Chih-Hung Hsieh <chh@google.com> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: George Burgess <gbiv@chromium.org> Commit-Queue: George Burgess <gbiv@chromium.org>
2021-09-15compiler_wrapper: Handle TIDY_TIMEOUT for Android clang-tidyChih-Hung Hsieh
* To check in upstream chromeos tools. * In Android mode, for clang-tidy, call runAndroidClangTidy to handle TIDY_TIMEOUT * Add runWithTimeout to env.go and runCmdWithTimeouit to command.go. BUG=b:199451930 TEST=Use a fake Android clang-tidy.real binary, TEST=to dump passed environment variables and run for required time. Change-Id: I629ae372251c034595011ef70559f8b12ed8568c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3162668 Reviewed-by: Chih-Hung Hsieh <chh@google.com> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: George Burgess <gbiv@chromium.org> Commit-Queue: George Burgess <gbiv@chromium.org>
2021-09-15compiler_wrapper: fix use-llvm-next testGeorge Burgess IV
The history of this test looks weird. We've had it intermittently enabled/disabled depending on whether we're passing flags specifically to llvm-next versions of clang. At the moment, it's failing due to a lack of `-Wl,-z,nostart-stop-gc`, which was removed in a previous CL. BUG=None TEST=go test Change-Id: I4b1ab9e5d39ba0e5575f89f51e4e83afba24a025 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3162667 Reviewed-by: Ryan Beltran <ryanbeltran@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Commit-Queue: George Burgess <gbiv@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2021-09-15compiler_wrapper: update golden filesGeorge Burgess IV
Tests are failing at HEAD; looks like prior changes forgot to update these. BUG=None TEST=go test Change-Id: Ia88b182ba0a922807f0857d8dc3df96de4528aa7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3162666 Reviewed-by: Ryan Beltran <ryanbeltran@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Commit-Queue: George Burgess <gbiv@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2021-09-09compiler_wrapper: disable unused-but-set warningsRyan Beltran
This CL disables no-unused-but-set-variable warnings globally in the compiler wrapper. A seperate CL will specifically reenable this warning for platform2. This prevents breakage do to unised variables in third_party. BUG=None TEST=None Change-Id: I2ea44b6249715d3b036843b13d668d50b9b7669d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3150656 Tested-by: Ryan Beltran <ryanbeltran@chromium.org> Auto-Submit: Ryan Beltran <ryanbeltran@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Commit-Queue: Manoj Gupta <manojgupta@chromium.org>
2021-08-25compiler_wrapper: support -W[no-]unused-set-variableJian Cai
BUG=b:194845241 TEST=emerge-atlas harfbuzz Change-Id: I262883ee20ed0fc69fcc3bf119d3068f4cf7729b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3061363 Tested-by: Jian Cai <jiancai@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
2021-08-07compiler_wrapper: Update install scriptManoj Gupta
Update wrapper installation script now that we have separate clang and gcc wrappers. BUG=b:186803617 TEST=run install_compiler_wrapper.sh Change-Id: I14ee2ffc6f74adb9699066a54dbead98e2f2e220 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3078693 Commit-Queue: Manoj Gupta <manojgupta@chromium.org> Commit-Queue: George Burgess <gbiv@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org> Auto-Submit: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org> Reviewed-by: Jian Cai <jiancai@google.com>
2021-08-04compiler_wrapper: Fix static libgcc handlingManoj Gupta
Do not add static-libgcc to compiler command line if user is passing {shared|static}-libgcc. BUG=b:187794119 TEST=CQ Change-Id: Iecd969dd11632837013bea71df9547bd08bbf30c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3064572 Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: George Burgess <gbiv@chromium.org> Auto-Submit: Manoj Gupta <manojgupta@chromium.org>
2021-07-24compiler_wrapper: Update for gcc -> llvm ebuild migrationManoj Gupta
Update compiler wrapper for migrating the wrappers from gcc to llvm ebuild. This assumes that clang wrappers now live in /usr/bin/ instead of /usr/x86-64-pc-linux-gnu/... and is no longer co-located with gcc wrappers. BUG=b:186803617 TEST=CQ, SDK tryjobs Change-Id: I60082913dbf5a3c6ce992ea951955086b280af43 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3046721 Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org>
2021-07-21Temporarily disable -Wdeprecated-copy and -Wdeprecated-declarations.Luis Lozano
BUG=b:191618957 TEST=wrapper test Change-Id: I4340173ae681a6c5f022a3b1f1e890d2c9ee8b99 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3036676 Commit-Queue: Luis Lozano <llozano@chromium.org> Commit-Queue: Manoj Gupta <manojgupta@chromium.org> Tested-by: Luis Lozano <llozano@chromium.org> Auto-Submit: Luis Lozano <llozano@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
2021-07-09compiler_wrapper: bundle.py default output dirRyan Beltran
This CL implements defaulting the output directory for bundle.py to the location of compiler wrapper files in third_party/chromiumos-overlay. This also prevents bundle.py from creating directories unless a new --create flag is specified. BUG=None TEST=Manually tested Change-Id: I64d055a73332d3faafad730beda30886212346ee Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3016910 Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org> Tested-by: Ryan Beltran <ryanbeltran@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
2021-06-18compiler_wrapper: add --rewrapper-path supportGeorge Burgess IV
This CL adds --rewrapper-path support to the compiler, as requested in the linked bug. The use of this is mutually exclusive with that of --gomacc-path. We currently look for either a `--gomacc-path` flag or a `GOMACC_PATH` env var to enable goma. If any rewrapper flag is specified, this disables our checking of `GOMACC_PATH` for the purposes of mutual exclusivity checking. BUG=b:190741226 TEST=go test, a few manual invocations Change-Id: I03dd2835a313806a9700c49c47c82fecf19a4b7f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2956696 Reviewed-by: Ryan Beltran <ryanbeltran@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2021-06-18compiler_wrapper: refactor goma => "remote compile"George Burgess IV
This is intended to be no functional change. In most places, we use "goma" as a way of saying "remote compilation;" this CL clarifies which is which. BUG=b:190741226 TEST=go test Change-Id: Ia03c1a05486c907cd6f7bc33b59a56c98db5d527 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2956695 Reviewed-by: Ryan Beltran <ryanbeltran@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2021-06-18compiler_wrapper: refactor goma flag parsingGeorge Burgess IV
This is in preparation for adding more flag parsing of this type. BUG=b:190741226 TEST=go test Change-Id: Ief431a6e30b6ba22767cdd46247e362508addd4b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2956694 Reviewed-by: Ryan Beltran <ryanbeltran@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2021-06-18compiler_wrapper: make goma testing use its own functionGeorge Burgess IV
this logic was repetitive, and we're adding more functions where we need it. BUG=b:190741226 TEST=go test Change-Id: I9736142ec59b22d58776d35357a7aa380365a228 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2956693 Reviewed-by: Ryan Beltran <ryanbeltran@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2021-06-18compiler_wrapper: fix flaky testsGeorge Burgess IV
We're running many tests in parallel that have dependencies on the `umask` global. We shouldn't be running these in parallel with each other, since they may read values for this that're set by other goroutines. Since these are difficult to spot, this CL does two things: - Requiring that all tests mark themselves as either readers of or writers to umask. Any test that does this gets run in serial with other tests that do it. - Requires code that modifies/reads the umask to go through `env.umask`, rather than `syscall.Umask`. This allows us to cheaply and accurately verify that a test's dependency on the process' umask was stated. BUG=b:186801841 TEST=`go test -count=100` passed Change-Id: Ifa871cfa48c005646499b21c1bfa1a4799ca641b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2956692 Reviewed-by: Ryan Beltran <ryanbeltran@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2021-06-08[compiler_wrapper] explicitly enables `libgcc` as the unwindlibChristopher Di Bella
This is in preparation for our migration to libunwind. BUG=b:187785190 TEST=Tested locally and on CQ Disallow-Recycled-Builds: test-failures Change-Id: I1b11d54de3d9550086ead05c3880f149e2e2f839 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2945100 Tested-by: Christopher Di Bella <cjdb@google.com> Tested-by: Luis Lozano <llozano@chromium.org> Auto-Submit: Christopher Di Bella <cjdb@google.com> Commit-Queue: Luis Lozano <llozano@chromium.org> Reviewed-by: Luis Lozano <llozano@chromium.org>
2021-06-08llvm-next: add nostart-stop-gc to the list of flags.Luis Lozano
This functionality causes problems for several packages and it seems to be only of importance for instrumented profiling which we don't use. BUG=b:187743526 TEST=CQ Change-Id: I441b96223dc8e09eb113608b85cde918faf2753f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2943079 Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: George Burgess <gbiv@chromium.org> Tested-by: Luis Lozano <llozano@chromium.org> Commit-Queue: Luis Lozano <llozano@chromium.org> Auto-Submit: Luis Lozano <llozano@chromium.org>
2021-05-06compiler_wrapper: remove LD_ARGV0 flagRyan Beltran
This CL removes support for using the LD_ARGV0 flag in the compiler wrapper to set arg[0]. BUG=b:187069257 TEST=Rebuilt aarch64-cros-linux-gnu toolchain and verified clang++ called correctly (https://paste.googleplex.com/5669729663451136) Change-Id: I3055a8b1e978f9e5f1eaae91dbc6008f86206246 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2876078 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org> Tested-by: Ryan Beltran <ryanbeltran@chromium.org>
2021-04-21compiler_wrapper: disable rusage when goma enabledRyan Beltran
This disables rusage logging when Goma is enabled as goma makes the resulting logs meaningless. BUG=None TEST=Updated and ran go tests Change-Id: If55a820676faa6b40d471db48749d384b7e2c671 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2840684 Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Ryan Beltran <ryanbeltran@chromium.org>
2021-04-20compiler_wrapper: remove useless gomaEnabled varRyan Beltran
This CL addresses a comment on CL:2780051 which reenabled Goma with Rusage. Since 2780051 there was an extraneous variable left over. This also removes a now obsolete test. BUG=None TEST=Ran all package go tests Change-Id: I784c1d93fc94333e098bf30a8777469379bfef71 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2823244 Reviewed-by: George Burgess <gbiv@chromium.org> Reviewed-by: Denis Nikitin <denik@chromium.org> Tested-by: Ryan Beltran <ryanbeltran@chromium.org>
2021-03-29compiler_wrapper: reenable goma w/ rusageRyan Beltran
It was determined that INFRA_FAILUREs in unstable builders were caused by timeouts due to disabling Goma with ruage. This CL remedies that by reenabling Goma. BUG=chromium:1193733 TEST=Tested with bb add Change-Id: Id8c2b175da1634916baadd865bb55331fa2dd99b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2780051 Tested-by: Ryan Beltran <ryanbeltran@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org> Reviewed-by: Denis Nikitin <denik@chromium.org>
2021-02-27toolchain-utils: compiler_wrapper: Update instructionsDenis Nikitin
Update steps with gcc. BUG=None TEST=None Change-Id: I41a0f22d1c161aa81bbb47c1a9eec7a3436457a0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2718654 Reviewed-by: Caroline Tice <cmtice@chromium.org> Reviewed-by: Jian Cai <jiancai@google.com> Tested-by: Denis Nikitin <denik@chromium.org> Commit-Queue: Denis Nikitin <denik@chromium.org>
2021-02-26compiler_wrapper: pass --prefix argument to clangManoj Gupta
ToT clang needs --prefix is needed to find the correct tools. BUG=chromium:1182224 TEST=Updated compiler wrapper in SimpleChrome, nacl builds. Change-Id: I8073e1a5482a23f38bb1e0d88e2b31ee2d97fa6e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2721199 Tested-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
2021-02-24compiler_wrapper: gofmt gcc_flags.goRyan Beltran
There was a small formatting error in gcc_flags.go. This caused a minor issue when running bundle.py since the result was not accepted as is by the presubmit. BUG=None TEST=None Change-Id: I47709e5fdfe1e0f8b7cbc731e70b734196bd0ccc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2717925 Tested-by: Ryan Beltran <ryanbeltran@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
2021-02-24compiler_wrapper: disable goma, ccache w/ rusageRyan Beltran
Disables Goma and CCahce when rusage monitoring is requested. This allows for usable metrics to be produced for more packages. BUG=chromium:1156314 TEST=Modified and ran unit tests Change-Id: I36415b4df6ce033b23ff8055e900233886e1889d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2713228 Tested-by: Ryan Beltran <ryanbeltran@chromium.org> Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org> Reviewed-by: Denis Nikitin <denik@chromium.org>
2021-02-11gcc: Remove deprecated conversionsMichael Cheng
Recent update to gcc 10 supports up to tigerlake. This CL removes depcreated march conversions BUG=chromium:1167265 TEST=Verify unit tests pass Change-Id: Ic20c9901963deb0e9985f4bcd57c7651cb8aeb3b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2691128 Commit-Queue: Michael Cheng <michael.cheng@intel.com> Tested-by: Michael Cheng <michael.cheng@intel.com> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
2021-02-11gcc: Map Alderlake to SkylakeMichael Cheng
GCC 10 does not support march=alderlake. This CL maps alderlake to skylake BUG=chromium:1167265 TEST=Verify unit tests pass Change-Id: I8fc694650fe0cb883628fb566d0536d1d550df43 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2689623 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org>
2021-02-09toolchain-utils: Make DWARF v5 the default.Caroline Tice
Also update the golden tests appropriately. BUG=chromium:924760 TEST=Already tested/committed in llvm/files/compiler-wrapper. Change-Id: I0cac1f60874d7c473a3a79e37c0eddbe3e5dfed5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2683254 Reviewed-by: George Burgess <gbiv@chromium.org> Commit-Queue: Caroline Tice <cmtice@chromium.org> Tested-by: Caroline Tice <cmtice@chromium.org>
2021-02-05compiler_wrapper: make a loop c89-compatibleGeorge Burgess IV
building this on the CQ is failing because this loop uses the c99 feature declaring something in the first clause of a for loop. BUG=None TEST=CQ Change-Id: I92729d30bd392c46e2b1183b92874212bdc59d6f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2676930 Tested-by: George Burgess <gbiv@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
2021-02-04compiler_wrapper: add go.modGeorge Burgess IV
In order to build this outside of the chroot, we apparently now need a go.mod file. This is autogenerated by the `go` tool. BUG=None TEST=Built inside and outside of the chroot Change-Id: I185cb9b626c8b3655ce5cc72524ef2511c7f575e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2676607 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2021-02-04compiler_wrapper: add a script to restore us to a working wrapperGeorge Burgess IV
Sometimes, I'm guilty of using ./install_compiler_wrapper.sh on broken sources. Restoring the world to a working state requires knowing/remembering a command. Seems better to provide that knowledge in executable form. BUG=None TEST=Ran the script Change-Id: I772b19a0b8bebdf6af78b822b710ce6e880c7388 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2676601 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2021-02-01compiler_wrapper: Remove "-m32/movbe" from i686 handlingManoj Gupta
Clang handles "-i686" tuple fine linking i386 libraries if needed. "-mnomovbe" is also understood by current clang. BUG=None TEST=go test Change-Id: I0d5058ebe3cadca297af1c01030480cc25194955 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2665028 Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org>
2021-01-29compiler_wrapper: work around gcc failing due to a kernel bugGeorge Burgess IV
Very rarely on old GCCs, we'll complaints about GCC itself being handed ERESTARTSYS. Retry the compilation in those cases. Similarly, we'll sometimes see `run()` give us random errors with things like `waitid()`, so handle those. BUG=chromium:1166017 TEST=CQ Change-Id: If9b6fdc523f60719608739da0eefa94c82164ae7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2648090 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2021-01-29compiler_wrapper: disable force-disable-werror with GCCGeorge Burgess IV
Enabling this functionality with GCC is pointless -- we don't roll it, so we don't want to catch new -Werrors with it. We're having some GCC-specific functionality coming in soon; disabling this simplifies things some. BUG=chromium:1166017 TEST=CQ Change-Id: I3f73a8124ea85a2f14fd5c909a9bbed2b46f28f4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2648431 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2021-01-29compiler_wrapper: loop in exec on ERESTARTSYSGeorge Burgess IV
Very rarely on old GCCs, we'll see an ERESTARTSYS that fails builders. Kernel documentation indicates that users should never see ERESTARTSYS, but it's unclear how to fix this, so try to work around it for now. BUG=chromium:1166017 TEST=CQ Change-Id: I5a1ca6ce722f929523feb45aeafffcc30dfda05a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2647869 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2021-01-29compiler_wrapper: fix a bug where we won't log rusage on compilationGeorge Burgess IV
env.exec, outside of tests and "print command" configurations, never returns if it executed successfully (since it turns into an actual call to execve()). Since we want to write rusage logs after the compiler is finished, we need to not exec in that case. BUG=None TEST=CQ Change-Id: If19ffb5c590868bc03431301514de875d60f7af5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2648089 Reviewed-by: Ryan Beltran <ryanbeltran@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2021-01-29compiler_wrapper: Fix gcc host wrapper configManoj Gupta
GCC host wrapper was not calling the code to add common flags for no clear reason. Add it so that "-fcommon" is now passed to GCC host compiler invocations. BUG=chromium:1171833 TEST=go test Change-Id: Id354b65ff0a08d0b25f895bb95cd4e99412b856b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2657585 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org>
2021-01-28compiler_wrapper: Add "-fcommon" to GCCManoj Gupta
pass "-fcommon" to GCC to match clang. This is needed since GCC 10 defaults to "-fno-common". BUG=chromium:1171833 TEST=go test Change-Id: Iceac503c8cc14afc1837c6952100189f45d2b567 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2657043 Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org>
2021-01-22compiler_wrapper: refactor rusage_flagRyan Beltran
Refactors rusage_flag and its usage in compiler_wrapper to support the use of TOOLCHAIN_RUSAGE_OUTPUT with either FORCE_DISABLE_WERROR. BUG=chromium:1167958 TEST=Modified and ran unit tests Change-Id: I9a643ceabbbeca3bf3a94270d4f4b4d814812f93 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2635451 Tested-by: Ryan Beltran <ryanbeltran@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
2021-01-20compiler_wrapper: add working dir to rusage logsRyan Beltran
Adds current working directory as a new field in rusage logs. This is useful for determining what package was being compiled. BUG=chromium:1156314 TEST=Modified and ran unit tests Change-Id: I58d7040c90fbd7d9b81532d0114862cbf4b23f88 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2636450 Tested-by: Ryan Beltran <ryanbeltran@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
2020-12-29compiler_wrapper: remove "-pass-exit-codes" in wrapperManoj Gupta
Handling(ignoring) of "-pass-exit-codes" flag is no longer needed in compiler wrapper. BUG=chromium:979911 TEST=CL:2597389 passed CQ/SDK tests Change-Id: I0114b745eed6d5dbcba10e2ecfb13d1882df32bf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2597141 Tested-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Commit-Queue: Manoj Gupta <manojgupta@chromium.org>
2020-12-17compiler_wrapper: Fix rusage_flag permission errorRyan Beltran
Seeing permission errors in builder bots that create rusage_flags. We need to set the Umask to 0 during creation of the directory. BUG=chromium:1156314 TEST=None Change-Id: I667d922762c2cb090adbb3abac2d4782bc48b87d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2597478 Reviewed-by: George Burgess <gbiv@chromium.org> Reviewed-by: Tiancong Wang <tcwang@google.com> Tested-by: Ryan Beltran <ryanbeltran@chromium.org> Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org>
2020-12-16compiler_wrapper: rename GETRUSAGE flagRyan Beltran
GETRUSAGE has been renamed TOOLCHAIN_RUSAGE_OUTPUT for clarity. BUG=chromium:1156314 TEST=Reran unit tests for package main Change-Id: I4588b4138f0dd4e4938762250e5caa6b4026e3f2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2594261 Reviewed-by: George Burgess <gbiv@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Ryan Beltran <ryanbeltran@chromium.org> Commit-Queue: Ryan Beltran <ryanbeltran@chromium.org>
2020-12-14compiler_wrapper: make rusage logs jsonRyan Beltran
Modified rusage logs generated by GETRUSAGE flag. Output from each entry is now in json format. BUG=chromium:1156314 TEST=Modified and ran unit tests Change-Id: Ia2cac4af201854de6d4a2c57e6cd8a4585f0931f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2585911 Tested-by: Ryan Beltran <ryanbeltran@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
2020-11-26compiler_wrapper: move llvm-next options to clang optionsinglorion
The new Clang version has a number of new warnings which we disable. This CL makes those apply to llvm (current) as well as llvm-next. BUG=None TEST=go test Change-Id: I1f4929580953003d21676e7e72af4577592fb217 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2561725 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org> Commit-Queue: Manoj Gupta <manojgupta@chromium.org>