diff options
author | inglorion <inglorion@chromium.org> | 2020-07-17 17:17:14 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-07-24 20:12:40 +0000 |
commit | e8ef27352c43229116188d2df87e5b236713cb3e (patch) | |
tree | 91d6b923df9875427b65d3faaada34d388bc48f1 | |
parent | 120da3fec7feb6e2f85c0443406cbf753b16b448 (diff) | |
download | toolchain-utils-e8ef27352c43229116188d2df87e5b236713cb3e.tar.gz |
compiler_wrapper: Updated instructions for updating the wrapper
This change adds some more details on how to test and commit
changes to the compiler wrapper.
BUG=None
TEST=Followed the steps locally to verify that they work.
Change-Id: I5a3d644e92fd94ed3792a59a30f39db08053390d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2305371
Commit-Queue: Bob Haarman <inglorion@chromium.org>
Tested-by: Bob Haarman <inglorion@chromium.org>
Reviewed-by: George Burgess <gbiv@chromium.org>
Reviewed-by: Jian Cai <jiancai@google.com>
-rw-r--r-- | compiler_wrapper/README.md | 69 |
1 files changed, 55 insertions, 14 deletions
diff --git a/compiler_wrapper/README.md b/compiler_wrapper/README.md index e64f01b6..e55bb669 100644 --- a/compiler_wrapper/README.md +++ b/compiler_wrapper/README.md @@ -12,31 +12,72 @@ package, including the build script, and then build from there without a dependency on toolchain-utils itself. -## Update source files +## Testing Inside the Chroot -Copy over sources and `build.py` to Chrome OS: +To test updates to the wrapper locally: + +Run `install_compiler_wrapper.sh` to install the new wrapper in the chroot: ``` -(chroot) /mnt/host/source/src/third_party/chromiumos-overlay/sys-devel/llvm/files/update\_compiler\_wrapper.sh +(chroot) ~/trunk/src/third_party/toolchain-utils/compiler_wrapper/install_compiler_wrapper.sh ``` -`build.py` is called by these ebuilds: +Then perform the tests, e.g. build with the new compiler. + + +## Updating the Wrapper for Chrome OS + +To update the wrapper for everyone, the new wrapper configuration must be copied +into chromiumos-overlay, and new revisions of the gcc and llvm ebuilds must be +created. + +Copy over sources and `build.py` to chromiumos-overlay: +``` +(chroot) /mnt/host/source/src/third_party/chromiumos-overlay/sys-devel/llvm/files/update_compiler_wrapper.sh +``` -- third_party/chromiumos-overlay/sys-devel/llvm/llvm-11.0\_pre394483\_p20200618-r3.ebuild -- third_party/chromiumos-overlay/sys-devel/gcc/gcc-\*.ebuild +Rename chromiumos-overlay/sys-devel/llvm/llvm-${VERSION}.ebuild to the next +revision number. For example, if the current version is +11.0_pre394483_p20200618-r2: +``` +(chroot) cd ~/trunk/src/third_party/chromiumos-overlay +(chroot) git mv llvm-11.0_pre394483_p20200618-r2.ebuild llvm-11.0_pre394483_p20200618-r3.ebuild +``` -## Update compiler wrappers +Rename chromiumos-overlay/sys-devel/gcc/gcc-${VERSION}.ebuild to the next +revision number. For example, if the current version is 4.9.2-r254: +``` +(chroot) cd ~/trunk/src/third_party/chromiumos-overlay +(chroot) git mv sys-devel/gcc/gcc-4.9.2-r254.ebuild sys-devel/gcc/gcc-4.9.2-r255.ebuild ``` -(chroot) /mnt/host/source/src/third|_party/toolchain-utils/compiler\_wrapper/install\_compiler\_wrapper.sh + +Edit the new ebuild file and change the number at the end to match the new revision: ``` +-# If you need to force a cros_workon uprev, change this number (you can use next +-# uprev): 254 ++# If you need to force a cros_workon uprev, change this number (you can use next ++# uprev): 255 +``` + +Commit those changes together with the changes made by +`update_compiler_wrapper.sh`. + +The changes can then be reviewed and submitted through the normal process. + + +## Paths + +`build.py` is called by these ebuilds: + +- third_party/chromiumos-overlay/sys-devel/llvm/llvm-*.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` + `/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` + `/usr/x86_64-pc-linux-gnu/<arch>/gcc-bin/4.9.x/sysroot_wrapper.hardened.noccache` - Clang host wrapper: - `/usr/bin/clang\_host\_wrapper` + `/usr/bin/clang_host_wrapper` - Gcc host wrapper: - `/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.x/host\_wrapper` - - + `/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.x/host_wrapper` |