toolchain-utils: Add a tool to create llvm-extra ebuild.

llvm-extra ebuild is a slotted llvm compiler ebuild
that can be installed in parallel to the regualr llvm compiler.
Use of llvm-extra package is to provide an alternate clang in case
the normal clang compiler binary can't be used.

e.g. After a llvm upgrade, some package foo is miscompiled.
To avoid the miscompilation, we can use llvm-extra ebuild to install
the previous clang.

To use the clang installed by llvm-extra, modify the CFLAGS and
LDFLAGS to pass the patch of the clang binary installed by llvm-extra
package.
e.g. append-flags -Xclang-path=/usr/llvm-extra/version/clang
     append-ldflags -Xclang-path=/usr/llvm-extra/version/clang

This CL only adds the tool that can generate the llvm-extra
ebuilds from a given llvm ebuild.

BUG=chromium:773887
TEST= ./create_llvm_extra.sh /path/to/llvm/llvm-7.0_pre331547_p20180529-r8.ebuild
worked. A new llvm-extra ebuild was generated.

Change-Id: I7e3e20a2740f5e7135dbcd252cc271945c6ddd34
Reviewed-on: https://chromium-review.googlesource.com/1161213
Commit-Ready: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Caroline Tice <cmtice@chromium.org>
2 files changed