aboutsummaryrefslogtreecommitdiffstats
path: root/build-gcc.sh
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2015-08-26 19:09:40 (GMT)
committerDan Albert <danalbert@google.com>2015-08-27 21:42:23 (GMT)
commita2831c59de5f965c3505ce2e662b9a5e6a33b305 (patch)
tree7b14c9e32af85f52cdfc746627b56a1e1f06f275 /build-gcc.sh
parent132d1b5317e6cb2b880cdf146a293d0ffd8d4cfa (diff)
downloadtoolchain_gcc-a2831c59de5f965c3505ce2e662b9a5e6a33b305.zip
toolchain_gcc-a2831c59de5f965c3505ce2e662b9a5e6a33b305.tar.gz
toolchain_gcc-a2831c59de5f965c3505ce2e662b9a5e6a33b305.tar.bz2
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)
Diffstat (limited to 'build-gcc.sh')
-rwxr-xr-xbuild-gcc.sh17
1 files changed, 13 insertions, 4 deletions
diff --git a/build-gcc.sh b/build-gcc.sh
index f9b52f6..b2be6d8 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