• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

testdata/23-Nov-2023-17,54917,491

README.mdD23-Nov-20232.7 KiB8462

android_config_test.goD23-Nov-20233.2 KiB133121

android_llvm_next_flags.goD01-Jan-19700

bisect_flag.goD23-Nov-20231.8 KiB7864

bisect_flag_test.goD23-Nov-20235.7 KiB185164

build.pyD23-Nov-20233 KiB10372

bundle.READMED23-Nov-2023605 1913

bundle.pyD23-Nov-20232 KiB6945

ccache_flag.goD23-Nov-20231.7 KiB4925

ccache_flag_test.goD23-Nov-20234.5 KiB163141

clang_flags.goD23-Nov-20236.8 KiB209139

clang_flags_test.goD23-Nov-20239.1 KiB303275

clang_syntax_flag.goD23-Nov-20231.1 KiB3829

clang_syntax_flag_test.goD23-Nov-20235.3 KiB181163

clang_tidy_flag.goD23-Nov-20236.9 KiB244196

clang_tidy_flag_test.goD23-Nov-202312.3 KiB452413

command.goD23-Nov-20236.4 KiB261222

command_test.goD23-Nov-20231.2 KiB4033

compile_with_fallback.goD23-Nov-20233.7 KiB11088

compile_with_fallback_test.goD23-Nov-20238.7 KiB302275

compiler_wrapper.goD23-Nov-20239 KiB298259

compiler_wrapper_test.goD23-Nov-20235.7 KiB201177

config.goD23-Nov-20237.3 KiB242177

config_test.goD23-Nov-20233 KiB14793

cros_hardened_config_test.goD23-Nov-202314.9 KiB552519

cros_host_config_test.goD23-Nov-20232.4 KiB9576

cros_llvm_next_flags.goD23-Nov-2023750 193

cros_nonhardened_config_test.goD23-Nov-2023639 2617

disable_werror_flag.goD23-Nov-20238.9 KiB280208

disable_werror_flag_test.goD23-Nov-202315.8 KiB568515

env.goD23-Nov-20233.8 KiB153114

env_test.goD23-Nov-20237.2 KiB290246

errors.goD23-Nov-20232.2 KiB8769

errors_test.goD23-Nov-20232 KiB7360

gcc_flags.goD23-Nov-2023912 3423

gcc_flags_test.goD23-Nov-20231.7 KiB6655

go_exec.goD23-Nov-2023621 2411

goldenutil_test.goD23-Nov-20235.9 KiB201175

gomacc_flag.goD23-Nov-2023924 4235

gomacc_flag_test.goD23-Nov-20232.8 KiB9579

install_compiler_wrapper.shD23-Nov-20231.8 KiB4129

libc_exec.goD23-Nov-20232.5 KiB8935

main.goD23-Nov-20231.3 KiB4316

pie_flags.goD23-Nov-20231.3 KiB4435

pie_flags_test.goD23-Nov-20232.2 KiB8573

print_cmdline_flag.goD23-Nov-2023469 2014

print_cmdline_flag_test.goD23-Nov-20232.6 KiB8672

print_config_flag.goD23-Nov-2023523 2215

print_config_flag_test.goD23-Nov-2023832 2921

rusage_flag.goD23-Nov-20233.4 KiB10583

rusage_flag_test.goD23-Nov-20235.7 KiB171144

sanitizer_flags.goD23-Nov-20231.8 KiB5944

sanitizer_flags_test.goD23-Nov-20235 KiB153129

stackprotector_flags.goD23-Nov-2023774 3023

stackprotector_flags_test.goD23-Nov-20231.7 KiB5847

sysroot_flag.goD23-Nov-2023750 3224

sysroot_flag_test.goD23-Nov-20232.4 KiB8471

testutil_test.goD23-Nov-20237.7 KiB299256

thumb_flags.goD23-Nov-2023897 2816

thumb_flags_test.goD23-Nov-20233.1 KiB11493

unsupported_flags.goD23-Nov-2023388 159

unsupported_flags_test.goD23-Nov-2023549 2114

x64_flags.goD23-Nov-2023522 2213

x64_flags_test.goD23-Nov-20231 KiB4031

README.md

1# Compiler wrapper
2
3See the comments on the top of main.go.
4Build is split into 2 steps via separate commands:
5- bundle: copies the sources and the `build.py` file into
6  a folder.
7- build: builds the actual go binary, assuming it is executed
8  from the folder created by `bundle.py`.
9
10This allows to copy the sources to a Chrome OS / Android
11package, including the build script, and then
12build from there without a dependency on toolchain-utils
13itself.
14
15## Testing Inside the Chroot
16
17To test updates to the wrapper locally:
18
19Run `install_compiler_wrapper.sh` to install the new wrapper in the chroot:
20```
21(chroot) ~/trunk/src/third_party/toolchain-utils/compiler_wrapper/install_compiler_wrapper.sh
22```
23
24Then perform the tests, e.g. build with the new compiler.
25
26
27## Updating the Wrapper for Chrome OS
28
29To update the wrapper for everyone, the new wrapper configuration must be copied
30into chromiumos-overlay, and new revisions of the gcc and llvm ebuilds must be
31created.
32
33Copy over sources and `build.py` to chromiumos-overlay:
34```
35(chroot) /mnt/host/source/src/third_party/chromiumos-overlay/sys-devel/llvm/files/update_compiler_wrapper.sh
36```
37
38Rename chromiumos-overlay/sys-devel/llvm/llvm-${VERSION}.ebuild to the next
39revision number. For example, if the current version is
4011.0_pre394483_p20200618-r2:
41```
42(chroot) cd ~/trunk/src/third_party/chromiumos-overlay
43(chroot) git mv llvm-11.0_pre394483_p20200618-r2.ebuild llvm-11.0_pre394483_p20200618-r3.ebuild
44```
45
46Rename chromiumos-overlay/sys-devel/gcc/gcc-${VERSION}.ebuild to the next
47revision number.  For example, if the current version is 4.9.2-r254:
48```
49(chroot) cd ~/trunk/src/third_party/chromiumos-overlay
50(chroot) git mv sys-devel/gcc/gcc-4.9.2-r254.ebuild sys-devel/gcc/gcc-4.9.2-r255.ebuild
51```
52
53Edit the new ebuild file and change the number at the end to match the new revision:
54```
55-# If you need to force a cros_workon uprev, change this number (you can use next
56-# uprev): 254
57+# If you need to force a cros_workon uprev, change this number (you can use next
58+# uprev): 255
59```
60
61Commit those changes together with the changes made by
62`update_compiler_wrapper.sh`.
63
64The changes can then be reviewed and submitted through the normal process.
65
66
67## Paths
68
69`build.py` is called by these ebuilds:
70
71- third_party/chromiumos-overlay/sys-devel/llvm/llvm-*.ebuild
72- third_party/chromiumos-overlay/sys-devel/gcc/gcc-*.ebuild
73
74Generated wrappers are stored here:
75
76- Sysroot wrapper with ccache:
77  `/usr/x86_64-pc-linux-gnu/<arch>/gcc-bin/4.9.x/sysroot_wrapper.hardened.ccache`
78- Sysroot wrapper without ccache:
79  `/usr/x86_64-pc-linux-gnu/<arch>/gcc-bin/4.9.x/sysroot_wrapper.hardened.noccache`
80- Clang host wrapper:
81  `/usr/bin/clang_host_wrapper`
82- Gcc host wrapper:
83  `/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.x/host_wrapper`
84

bundle.README

1Copyright 2019 The Chromium OS Authors. All rights reserved.
2Use of this source code is governed by a BSD-style license that can be
3found in the LICENSE file.
4
5Toolchain utils compiler wrapper sources.
6
7Build the wrapper:
8./build --config=<config name> --use_ccache=<bool> \
9  --use_llvm_next=<bool> --output_file=<file>
10
11ATTENTION:
12The files in this folder are generated. Do not modify manually!
13
14To update:
15- modify third_party/toolchain_utils/compiler_wrapper
16- run third_party/toolchain_utils/compiler_wrapper/bundle.py --output_dir=...
17
18Source: https://chromium-review.googlesource.com/q/{change_id}
19