From 5f2680086b7622cc877c82aafe3c973134a20ad4 Mon Sep 17 00:00:00 2001 From: Yunlian Jiang Date: Thu, 22 Sep 2016 14:31:58 -0700 Subject: gcc: add a python wrapper for gcc. This add a python wrapper for gcc to make goma do not need to hand gcc and clang separately. BUG 31444867 TEST= build new gcc. Call arm-linux-androideabi-c++ -v and arm-linux-androideabi-g++ -v in/out the directory of the gcc binary, it works. Change-Id: Ib02cff8f33306b089e13ade51033a3b0927b4308 --- build-gcc.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'build-gcc.sh') diff --git a/build-gcc.sh b/build-gcc.sh index 4893461cf..c21accf17 100755 --- a/build-gcc.sh +++ b/build-gcc.sh @@ -569,8 +569,26 @@ do_relink_bin () { $ABI_CONFIGURE_TARGET-$DST_FILE$HOST_EXE } +# $1: The file to be replaced by wrapper. +do_install_gcc_wrapper() { + WRAPPER=$SRC_DIR/gcc/compiler_wrapper + local DST_FILE=$TOOLCHAIN_INSTALL_PATH/bin/$ABI_CONFIGURE_TARGET-$1 + local REAL_DST_FILE=$TOOLCHAIN_INSTALL_PATH/bin/real-$ABI_CONFIGURE_TARGET-$1 + if [ ! -f "$WRAPPER" ]; then + echo "ERROR: Can't install wrapper because $WRAPPER doesn't exist" + exit 1 + fi + if [ ! -f "$DST_FILE$HOST_EXE" ]; then + echo "ERROR: Can't install wrapper because $DST_FILE$HOST_EXE doesn't exist" + fi + mv $DST_FILE$HOST_EXE $REAL_DST_FILE + cp -p $WRAPPER $DST_FILE$HOST_EXE +} + do_relink_bin c++ g++ do_relink_bin gcc-$GCC_VERSION gcc +do_install_gcc_wrapper gcc +do_install_gcc_wrapper g++ # symlink ld to either ld.gold or ld.bfd case "$TOOLCHAIN" in aarch64*) -- cgit v1.2.3