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

Compiler wrapper

See the comments on the top of main.go. Build is split into 2 steps via separate commands:

  • bundle: copies the sources and the build.py file into a folder.
  • build: builds the actual go binary, assuming it is executed from the folder created by bundle.py.

This allows to copy the sources to a Chrome OS / Android package, including the build script, and then build from there without a dependency on toolchain-utils itself.

Update Chrome OS

Copy over sources and build.py to Chrome OS:

(chroot) /mnt/host/source/src/third_party/chromiumos-overlay/sys-devel/llvm/files/update_compiler_wrapper.sh

build.py is called by these ebuilds:

  • third_party/chromiumos-overlay/sys-devel/llvm/llvm-9.0_pre361749_p20190714.ebuild
  • third_party/chromiumos-overlay/sys-devel/gcc/gcc-*.ebuild

Generated wrappers are stored here:

  • Sysroot wrapper with ccache: /usr/x86_64-pc-linux-gnu/<arch>/gcc-bin/4.9.x/sysroot_wrapper.hardened.ccache
  • Sysroot wrapper without ccache: /usr/x86_64-pc-linux-gnu/<arch>/gcc-bin/4.9.x/sysroot_wrapper.hardened.noccache
  • Clang host wrapper: /usr/bin/clang_host_wrapper
  • Gcc host wrapper: /usr/x86_64-pc-linux-gnu/gcc-bin/4.9.x/host_wrapper