aboutsummaryrefslogtreecommitdiff
path: root/compiler_wrapper/config.go
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-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-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-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-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-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>
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>
2020-09-22toolchain-utils: Update compiler wrapper to disable warning.Caroline Tice
This CL updates toolchain-utils to match recent compiler wrapper changes in sys-devel/llvm/files. It's purpose is to disable the new warning -Wcompound-token-split-by-space. Also update golden tests appropriately. BUG=chromium:1130080 TEST=Previous CL already tessted/committed. Change-Id: I261250dc7ed6f1be7c3aa4652d793c924e1dc18d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2423619 Commit-Queue: Caroline Tice <cmtice@chromium.org> Commit-Queue: George Burgess <gbiv@chromium.org> Tested-by: Caroline Tice <cmtice@chromium.org> Auto-Submit: Caroline Tice <cmtice@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
2020-08-10compiler_wrapper: use crashArtifactsDir to apply clang optsGeorge Burgess IV
Since we now have crashArtifactsDir as a more abstract concept, it seems good to apply '-fcrash-diagnostics-dir=' based on that, rather than having it as an explicit clang flag. BUG=chromium:1113442 TEST=FIXME Change-Id: I147779d7cf8806b3bc712c2998446158e87ec967 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2343975 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2020-08-10compiler_wrapper: dump tricium clang-tidy crash informationGeorge Burgess IV
This CL has us dump extra info when we observe a crash while using `WITH_TIDY=tricium`. In particular: - We'll now try to generate a -E'ed source file, and stash that in a subdirectory of our general crash_diagnostics directory. - Our JSON object that represents clang-tidy output has metadata about the aforementioned crash file, if it was generated. BUG=chromium:1113442 TEST=`go test`; ran locally with a crashy clang-tidy Change-Id: I577e5ec8e990af3b7cf1d8a9fea347582d5b227b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2343974 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2020-07-30compiler_wrapper: add -fexperimental-new-pass-managerJian Cai
LLVM is currently build with DENABLE_EXPERIMENTAL_NEW_PASS_MANAGER=ON on Chrome OS. This is however not reflected in clang crash diagnoses. Adding -fexperimental-new-pass-manager to help with reproducibility on 4c. BUG=chromium:1111103 TEST=CQ tests. Change-Id: Ie01431dff397e982469e29c9132e21374354762d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2327414 Reviewed-by: George Burgess <gbiv@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Jian Cai <jiancai@google.com>
2020-07-14compiler_wrapper: remove -grecord-gcc-switchesBob Haarman
-grecord-gcc-switches causes the compiler and compiler flags to be stored in the produced debug information. This causes Goma builds to be non-deterministic, because the compiler path differs depending on whether the compiler was run locally or on Goma. This, in turn, causes cache pollution and needless work. Since we are not in fact using the information stored by -grecord-gcc-switches, this change disables it. We can re-enable it when we want to start using the information, provided we come up with another way to avoid the issues described earlier. BUG=chromium:1103065 TEST=Build an object file in chromeos-chrome and check that info is absent Change-Id: Ib8022a3a1baf2e4b5d3d9d1453deb67f539baff4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2290624 Commit-Queue: Bob Haarman <inglorion@chromium.org> Tested-by: Bob Haarman <inglorion@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org> Reviewed-by: Tiancong Wang <tcwang@google.com>
2020-06-26compiler_wrapper: redirect clang crash dignosesJian Cai
Redirect all diagnoses of clang crashes to a dedicated directory using fcrash-diagnostics-dir so we can upload these files to the cloud. The flag was added to clangPostFlags to overwite redirection done on package level. BUG=chromium:1056904 TEST=None Change-Id: I78bfc77d7f3af8556b4308f2e71407d627627747 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2251038 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Commit-Queue: Jian Cai <jiancai@google.com> Tested-by: Jian Cai <jiancai@google.com>
2020-06-24wrapper: add support for Tricium clang-tidyGeorge Burgess IV
This adds a special `WITH_TIDY` mode that's specifically for use with Tricium. Crucially, this has us dump diagnostics as YAML, and stash a fair amount of information about each clang-tidy invocation in the same place where we dump YAML. These bits are intended to be used by the script added in I54ecc88d38faa4bfd502d632d3fd5c74734dabc0. BUG=chromium:1035951 TEST=Ran on all platform2 packages `emerge`able on amd64-generic. Change-Id: I63ef06dc6ddc016ebb6ba0c4a0cea8320fef7415 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2245785 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2020-06-19wrapper: print android-llvm@ when using the Android wrapper.George Burgess IV
Otherwise, the wrapper might say: ``` Internal error. Please report to chromeos-toolchain@google.com. ``` to Android developers in some cases. BUG=b:159291805 TEST=`go test` Change-Id: I9a96068f02a2c6ce5e251c8754e267dfb1a30db1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2252553 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2020-06-15wrapper: allow Android to specify their own llvm-flagsGeorge Burgess IV
Given the discussion on https://android-review.googlesource.com/c/platform/external/toolchain-utils/+/1330695, it sounds like our Android friends want to be able to tweak llvm-next flags without going through chromium-review + having to pull their changes back into Android. This CL allows them to make changes to their llvm-next flags entirely locally, and isolates CrOS' llvm-next flags from Android's. BUG=None TEST=Built the wrapper for CrOS and Android. Change-Id: If1bcfe762a4f368db9816557752651edc877f497 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2247003 Reviewed-by: Pirama Arumuga Nainar <pirama@google.com> Reviewed-by: Tiancong Wang <tcwang@google.com> Tested-by: George Burgess <gbiv@chromium.org>
2020-05-04Revert "wrapper: Temporarily disable -Wmax-tokens"Tiancong Wang
This reverts commit 3b2358092e00ab7904a873b516ac6aac832c2277. According to crrev.com/c/2171058, the fix in chromium could work. Will wait till the patch submitted in chromium and CrOS uprevs to merge the change into CrOS. Reason for revert: The workaround is not needed anymore. Original change's description: > wrapper: Temporarily disable -Wmax-tokens > > As reported in crbug.com/1072209, -Wmax-tokens is causing latest > chrome fail to build. While we are blocked by Chrome uprevs, we > want to update the compiler by disabling the warning, until it's > fixed properly on upstream Chrome. > > BUG=chromium:1072209 > TEST=Local testing in CrOS > > Change-Id: I082dd342a802e80250d0fca7c4b15afb4e972e7e > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2161770 > Commit-Queue: Tiancong Wang <tcwang@google.com> > Tested-by: Tiancong Wang <tcwang@google.com> > Reviewed-by: George Burgess <gbiv@chromium.org> Bug: chromium:1072209 Change-Id: I904fb3c4f7d125579667bef675be654a5465fad9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2173949 Tested-by: Tiancong Wang <tcwang@google.com> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Commit-Queue: Tiancong Wang <tcwang@google.com>
2020-04-22wrapper: Temporarily disable -Wmax-tokensTiancong Wang
As reported in crbug.com/1072209, -Wmax-tokens is causing latest chrome fail to build. While we are blocked by Chrome uprevs, we want to update the compiler by disabling the warning, until it's fixed properly on upstream Chrome. BUG=chromium:1072209 TEST=Local testing in CrOS Change-Id: I082dd342a802e80250d0fca7c4b15afb4e972e7e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2161770 Commit-Queue: Tiancong Wang <tcwang@google.com> Tested-by: Tiancong Wang <tcwang@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
2020-03-13compiler_wrapper: Add "-fcommon" to clang invocationsManoj Gupta
Clang ToT has switched to "-fno-common" as default to match GCC 10 which breaks many packages. Upgrading to ToT versions of many packages does not fix the problem as packages upstream have not fixed them yet. Pass "-fcommon" in compiler wrapper to workaround this for now. This does not change the current clang behavior which defaults to "-fcommon" so this is a NFC. BUG=chromium:1060413 TEST=packages build with ToT clang; NFC for current clang Change-Id: I5a40e502db201615f45a7e4720105bebef2f2b0a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2102905 Reviewed-by: George Burgess <gbiv@chromium.org> Commit-Queue: Manoj Gupta <manojgupta@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org>
2020-03-04compiler_wrapper: Stop disabling two warnings.Manoj Gupta
Chrome OS code now is clean of following warnings: "-Wreorder-init-list" and "-return-stack-address" so stop disabling them. BUG=chromium:1057384 TEST=warnings tested by CL:1898670 Change-Id: I568cf93a9e836ba936ea976312e9a78b5c473157 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2081707 Tested-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
2020-02-28Change behavior of doubleBuildWithWNoError for AndroidPirama Arumuga Nainar
"Double build with -Wno-error" is always on in the Android useLlvmNext wrapper and always off in the production wrapper. The warnings JSON is written to $OUT_DIR/warnings_reports. NFC for the ChromeOS configs. Originally reviewed in https://android-review.googlesource.com/c/1242126. BUG=b:149836702 TEST=go test Change-Id: I5f1a43524772d991b5c64422189643cde61c3826 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2079547 Tested-by: Pirama Arumuga Nainar <pirama@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
2019-11-01toolchain_utils: Remove comparison to old wrapper from compiler_wrapper.Tobias Bosch
BUG=chromium:773875 TEST='go test' passes Change-Id: Iecbe15067bf37fd86fbb8a907d42df32288821d6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1884701 Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Tobias Bosch <tbosch@google.com>
2019-10-31toolchain_utils: Upgrade compiler wrapper for llvm r370808.Caroline Tice
BUG=chromium:1001317 TEST=In progress Change-Id: I78481d2ca3f555d670e7e5972e547f94d2be22a8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1888745 Reviewed-by: George Burgess <gbiv@chromium.org> Reviewed-by: Tobias Bosch <tbosch@google.com> Commit-Queue: Caroline Tice <cmtice@chromium.org> Tested-by: Caroline Tice <cmtice@chromium.org>
2019-10-29toolchain_utils: Add post-user flags to compiler_wrapper.Caroline Tice
This adds the ability to add flags to the compiler command that cannot be overridden by the user (e.g. when we MUST turn off a warning). It adds '-Wno-implicit-int-float-conversion as such a flag for llvm-next. BUG=chromium:1018778 TEST='go test' passes Change-Id: Ic57747be9719be83d3c5f7d7b4f4263f69f4de61 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1881725 Reviewed-by: Tobias Bosch <tbosch@google.com> Reviewed-by: George Burgess <gbiv@chromium.org> Commit-Queue: Caroline Tice <cmtice@chromium.org> Tested-by: Caroline Tice <cmtice@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
2019-10-10toolchain-utils: Enable poison system warning in llvm-nextDenis Nikitin
Add "poison-system-directories" warning in llvm-next builds. Treat as an error. BUG=None TEST=not tested Change-Id: Iaca80da6f38d27fe8e98a67c6701a7884d2ca5b2 Reviewed-on: https://chromium-review.googlesource.com/1839120 Tested-by: Denis Nikitin <denik@chromium.org> Commit-Ready: Denis Nikitin <denik@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Tobias Bosch <tbosch@google.com>
2019-09-30Initial support for the android wrapper.Tobias Bosch
BUG=chromium:773875 TEST=golden tests and comparison against old andorid wrapper. Change-Id: Ic11be4bc1399adcbf9c50134928aceda45e936ca Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1831787 Tested-by: Tobias Bosch <tbosch@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
2019-09-26Support extra args for llvm next.Tobias Bosch
Also removes the capability of defining the old wrapper path now that we are getting close to landing it. BUG=chromium:773875 TEST=golden tests and comparison against old wrapper. Change-Id: I543ddb1651edf2a269917f8afb5a667129bc3561 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1826986 Tested-by: Tobias Bosch <tbosch@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
2019-09-16clang wrappers: Use LLD as the default linker.Manoj Gupta
Match the changes to python wrapper in CL:1686078. Also add small fix for echo path, it should be /bin/echo instead of /usr/bin/echo. BUG=chromium:979909 TEST=go test Change-Id: I5e626febd5abab4f9824aba1e158f264bf75be9e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1803778 Tested-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Tobias Bosch <tbosch@google.com>
2019-08-19Store change id as version in the config.Tobias Bosch
This helps in debugging the wrapper. The version can be printed via the -print-config command. BUG=chromium:773875 TEST=unit test Change-Id: Ic6f84b4ccaa4a201473c408022d80c73f6ee7899 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1760971 Tested-by: Tobias Bosch <tbosch@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
2019-08-15Pass the old wrapper path as a linker argumentTobias Bosch
BUG=chromium:773875 TEST=unit test and comparison to old wrapper Change-Id: I97cff81f2b42a01f82ba66668693b17a27c14672 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1754130 Tested-by: Tobias Bosch <tbosch@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
2019-07-22Support gcc host wrapper.Tobias Bosch
This change adds support for the gcc host wrapper. The implementation is verified via comparing to the old gcc host wrapper in the golden tests. BUG=chromium:773875 TEST=unit test Change-Id: I3af98b81dba6d9299183db01e967003be860972c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1710537 Tested-by: Tobias Bosch <tbosch@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
2019-07-22Support clang host wrapper.Tobias Bosch
This change adds support for the clang host wrapper. The implementation is verified via comparing to the old clang host wrapper in the golden tests. BUG=chromium:773875 TEST=unit test Change-Id: I48284736014ab4b66bfd7e31e88ffd23956007bb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1708750 Tested-by: Tobias Bosch <tbosch@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
2019-07-22Sync with recent changes to old wrapper.Tobias Bosch
Old wrapper changes: https://chromium.git.corp.google.com/chromiumos/overlays/chromiumos-overlay/+/bebf19ee4322c26d7cb548c8f4419dfe1c6e3c11 https://chromium.git.corp.google.com/chromiumos/overlays/chromiumos-overlay/+/cc6e225d3894f99b320584b2f41ff6a68f76d6a7 BUG=chromium:773875 TEST=unit test Change-Id: I927bcb6082d1b67ca9efde0001e43e0a0a36c3b4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1710403 Tested-by: Tobias Bosch <tbosch@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
2019-07-22Add license headers to all go files.Tobias Bosch
Required as of https://chromium.git.corp.google.com/chromiumos/repohooks/+/9732e38a5551e4bbcd222d2bbb89ee0fc5c95dee BUG=chromium:773875 TEST=unit test Change-Id: I8dfed85b0fbd528084ff2e585bbf3624ac358135 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1710404 Tested-by: Tobias Bosch <tbosch@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
2019-07-18Create golden tests for sysroot wrapper.Tobias Bosch
- Golden files can be updated via the new "-updategolden" test flag. - Golden files contain the wrapper command, commands executed by the wrapper stdout, stderr, exitcode of the wrapper - The commands in the golden files are also compared to the old wrapper to make sure they are correct. We are also mocking less things in the old wrapper now, allowing to compare against differnet wrappers via golden tests in the future (e.g. clang_host_wrapper). - Unit tests are no longer diffing against the old wrapper. BUG=chromium:773875 TEST=unit test Change-Id: I0755bfe11cd499474820c9354412d39a0fa04401 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1702633 Tested-by: Tobias Bosch <tbosch@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
2019-07-18Fix minor bugsTobias Bosch
These bugs were detected while creating golden tests and comparing them to the old wrapper (see next commit). Also makes flag order in old wrapper deterministic by replacing sets with a SetList class that is based on a list. BUG=chromium:773875 TEST=unit test Change-Id: I8e2680f732577f1f590042f1ccd589dfedadd6ce Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1706791 Tested-by: Tobias Bosch <tbosch@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
2019-07-10Support second execution of the compiler with -Wno-errorTobias Bosch
BUG=chromium:773875 TEST=unit test Change-Id: Ib77fd7c166a13acb733a1dbdfd88129141c4227a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1692969 Reviewed-by: Tobias Bosch <tbosch@google.com> Tested-by: Tobias Bosch <tbosch@google.com>
2019-06-28Introduce infrastructure for calling and testing nestedTobias Bosch
commands, error messages and exit codes. Also: - implements the -Xclang-path= flag as use case of calling a nested command. - adds tests for forwarding errors, comparing against the old wrapper, and exit codes. - captures the source locations of errors in error messages. - compares exit codes of new wrapper and old wrapper. BUG=chromium:773875 TEST=unit test Change-Id: I919e58091d093d68939809f676f799a68ec7a34e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1676833 Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Tobias Bosch <tbosch@google.com>
2019-06-25Allow to pass in the use_ccache via go build.Tobias Bosch
Removes usage of go build tags in favor of passing in configuration via -ldflags -X ... BUG=chromium:773875 TEST=unit test Change-Id: I4e8a58e1679b2858e9d4620d6b9c7a35ad08a6ee Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1670987 Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Tobias Bosch <tbosch@google.com>
2019-06-20Initial version of a go version of the compiler wrapper.Tobias Bosch
Still calls the old wrapper if one of the following flags is given: - Xclang-path - clang-syntax - env WITH_TIDY - env FORCE_DISABLE_WERROR - env GETRUSAGE - env BISECT_STAGE BUG=chromium:773875 TEST=Unit tests that also verify the produced command against the TEST=existing compiler wrapper. Change-Id: I1e0a720ce9f485d8015deefb2682f2cb760d82e4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1652057 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Tobias Bosch <tbosch@google.com> Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Tobias Bosch <tbosch@google.com> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>