tree: cd78ad8483920548b8ccae4173983fe43f9faa44 [path history] [tgz]
  1. testdata/
  2. android_config_test.go
  3. bisect_flag.go
  4. bisect_flag_test.go
  5. build.py
  6. ccache_flag.go
  7. ccache_flag_test.go
  8. clang_flags.go
  9. clang_flags_test.go
  10. clang_syntax_flag.go
  11. clang_syntax_flag_test.go
  12. clang_tidy_flag.go
  13. clang_tidy_flag_test.go
  14. command.go
  15. command_test.go
  16. compile_with_fallback.go
  17. compile_with_fallback_test.go
  18. compiler_wrapper.go
  19. compiler_wrapper_test.go
  20. config.go
  21. config_test.go
  22. crash_builds.go
  23. crash_builds_test.go
  24. crash_dump_test.go
  25. cros_hardened_config_test.go
  26. cros_host_config_test.go
  27. cros_llvm_next_flags.go
  28. cros_nonhardened_config_test.go
  29. disable_werror_flag.go
  30. disable_werror_flag_test.go
  31. env.go
  32. env_test.go
  33. errors.go
  34. errors_test.go
  35. gcc_flags.go
  36. gcc_flags_test.go
  37. go.mod
  38. go_exec.go
  39. goldenutil_test.go
  40. install_compiler_wrapper.sh
  41. kernel_bug.go
  42. kernel_bug_test.go
  43. libc_exec.go
  44. libgcc_flags.go
  45. libgcc_flags_test.go
  46. main.go
  47. print_cmdline_flag.go
  48. print_cmdline_flag_test.go
  49. print_config_flag.go
  50. print_config_flag_test.go
  51. README.md
  52. remote_build_flag_test.go
  53. remote_build_flags.go
  54. reset_compiler_wrapper.sh
  55. rusage_flag.go
  56. rusage_flag_test.go
  57. sanitizer_flags.go
  58. sanitizer_flags_test.go
  59. stackprotector_flags.go
  60. stackprotector_flags_test.go
  61. sysroot_flag.go
  62. sysroot_flag_test.go
  63. testutil_test.go
  64. thumb_flags.go
  65. thumb_flags_test.go
  66. unsupported_flags.go
  67. unsupported_flags_test.go
  68. x64_flags.go
  69. x64_flags_test.go
compiler_wrapper/README.md

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.

What

Toolchain utils compiler wrapper sources.

Please note that there‘s a regular syncing operation between chromiumos-overlay/sys-devel/llvm/files/compiler_wrapper and toolchain-utils/compiler_wrapper. This sync is one way (from chromiumos-overlay to toolchain-utils). Syncing in this way helps the Android toolchain keep up-to-date with our wrapper easily, as they’re a downstream consumer of it. For this reason, please be sure to land all actual changes in chromeos-overlay.

Build + Run Tests

  1. Install the wrapper locally in chroot (builds as well)
(chroot) ./install_compiler_wrapper.sh

Running a manual test

Test a manual build command with -print-cmdline

(chroot) x86_64-cros-linux-gnu-clang++ -o test_exec -f<some_flag_to_add>='some_value' -print-cmdline test.cc
  • test.cc doesn't actually have to exist.
  • The command above will output the additional build flags that are added in by the wrapper.

Testing your changes

  1. Add tests to your wrapper changes
  2. Run all the tests via:
go test -vet=all

Build Only

This is handy if you just want to test that the build works.

Build the wrapper:

./build.py --config=<config name> --use_ccache=<bool> \
  --use_llvm_next=<bool> --output_file=<file>