From a2831c59de5f965c3505ce2e662b9a5e6a33b305 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Wed, 26 Aug 2015 12:09:40 -0700 Subject: Fix toolchain location. Apparently we've been packing an empty tarball of the toolchain since I split up the toolchain build because the script defines the install path in a few different places. Fix the toolchain install path to match the format we expect (toolchains/$HOST/$TOOLCHAIN/prebuilt), improve logging, and actually fail the build if we can't package the toolchain. Change-Id: I093ca747af13b5ed093cb43499ea1fdb9aed0430 (cherry picked from commit dd4155a395690bbe0372cf9ec63dd2ed85e7b81c) --- build-gcc.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'build-gcc.sh') diff --git a/build-gcc.sh b/build-gcc.sh index f9b52f60f..b2be6d86b 100755 --- a/build-gcc.sh +++ b/build-gcc.sh @@ -218,7 +218,15 @@ TOOLCHAIN_LICENSES=$ANDROID_NDK_ROOT/build/tools/toolchain-licenses # 3) The path exists but not accessible, which crashes GCC! # For canadian build --with-sysroot has to be sub-directory of --prefix. -TOOLCHAIN_INSTALL_PATH=$PACKAGE_DIR/gcc +if [ -z "$HOST_TAG" ]; then + echo "Error: HOST_TAG not set!" + exit 1 +fi + +TOOLCHAIN_SUBDIR=toolchains/$HOST_TAG/$TOOLCHAIN/prebuilt +TOOLCHAIN_INSTALL_PATH=$PACKAGE_DIR/$TOOLCHAIN_SUBDIR +dump "Using TOOLCHAIN_INSTALL_PATH=$TOOLCHAIN_INSTALL_PATH" +dump "Using TOOLCHAIN_SUBDIR=$TOOLCHAIN_SUBDIR" TOOLCHAIN_BUILD_SYSROOT=$TOOLCHAIN_INSTALL_PATH/sysroot dump "Sysroot : Copying: $SYSROOT --> $TOOLCHAIN_BUILD_SYSROOT" mkdir -p $TOOLCHAIN_BUILD_SYSROOT && (cd $SYSROOT && tar chf - *) | (cd $TOOLCHAIN_BUILD_SYSROOT && tar xf -) @@ -633,9 +641,10 @@ fi if [ "$PACKAGE_DIR" ]; then ARCHIVE="$TOOLCHAIN-$HOST_TAG.tar.bz2" - SUBDIR=$(get_toolchain_install_subdir $TOOLCHAIN $HOST_TAG) - dump "Packaging $ARCHIVE" - pack_archive "$PACKAGE_DIR/$ARCHIVE" "$NDK_DIR" "$SUBDIR" + dump "Packaging $ARCHIVE from $PACKAGE_DIR/$TOOLCHAIN_SUBDIR" + pack_archive "$PACKAGE_DIR/$ARCHIVE" "$PACKAGE_DIR" "$TOOLCHAIN_SUBDIR" + fail_panic "Could not package $TOOLCHAIN GCC!" + # package libgccunwind.a ABIS=$(commas_to_spaces $(convert_archs_to_abis $ARCH)) if [ "$HOST_OS" = "linux" -a "$GCC_VERSION" = "$DEFAULT_GCC_VERSION" ]; then -- cgit v1.2.3