buildgcc: Reorder main program
This groups all tasks happening in the main program, orders them according to their dependencies and adds comments on the various tasks. Change-Id: Ib62bd213977cbc3307ef62e9a7e64515563968c1 Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: http://review.coreboot.org/10490 Reviewed-by: Alexander Couzens <lynxis@fe80.eu> Tested-by: build bot (Jenkins)
This commit is contained in:
@@ -530,17 +530,15 @@ case "$TARGETARCH" in
|
|||||||
*) printf "${red}WARNING: Unsupported architecture $TARGETARCH.${NC}\n\n"; ;;
|
*) printf "${red}WARNING: Unsupported architecture $TARGETARCH.${NC}\n\n"; ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ "$BUILDCLANG" -eq 0 ]; then
|
# Figure out which packages to build
|
||||||
echo "Target architecture is now $TARGETARCH"
|
|
||||||
NAME="${TARGETARCH} cross"
|
|
||||||
PACKAGES="GMP MPFR MPC LIBELF BINUTILS GCC IASL"
|
|
||||||
else
|
|
||||||
NAME=clang
|
|
||||||
PACKAGES="LLVM CFE CRT CTE"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$clean" = "1" ]; then
|
if [ "$BUILDCLANG" -eq 0 ]; then
|
||||||
cleanup
|
echo "Target architecture is now $TARGETARCH"
|
||||||
|
NAME="${TARGETARCH} cross"
|
||||||
|
PACKAGES="GMP MPFR MPC LIBELF BINUTILS GCC IASL"
|
||||||
|
else
|
||||||
|
NAME=clang
|
||||||
|
PACKAGES="LLVM CFE CRT CTE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $SKIPGDB -eq 1 ]; then
|
if [ $SKIPGDB -eq 1 ]; then
|
||||||
@@ -556,23 +554,13 @@ else
|
|||||||
PACKAGES="$PACKAGES GDB"
|
PACKAGES="$PACKAGES GDB"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# coreboot does not like the GOLD linker
|
# This initial cleanup is useful when updating the toolchain script.
|
||||||
# USE_GOLD="--enable-gold"
|
|
||||||
USE_GOLD=""
|
|
||||||
GCC_OPTIONS="--enable-lto"
|
|
||||||
|
|
||||||
printf "Downloading tar balls ... \n"
|
if [ "$clean" = "1" ]; then
|
||||||
mkdir -p tarballs
|
cleanup
|
||||||
for P in $PACKAGES; do
|
fi
|
||||||
download $P
|
|
||||||
done
|
|
||||||
printf "Downloaded tar balls ... ${green}ok${NC}\n"
|
|
||||||
|
|
||||||
printf "Unpacking and patching ... \n"
|
# Set up host compiler and flags needed for various OSes
|
||||||
for P in $PACKAGES; do
|
|
||||||
unpack_and_patch $P || exit 1
|
|
||||||
done
|
|
||||||
printf "Unpacked and patched ... ${green}ok${NC}\n"
|
|
||||||
|
|
||||||
if [[ "$PACKAGES" == *GCC* ]]; then
|
if [[ "$PACKAGES" == *GCC* ]]; then
|
||||||
CC=cc
|
CC=cc
|
||||||
@@ -603,12 +591,36 @@ if [ "$USECCACHE" = 1 ]; then
|
|||||||
CC="ccache $CC"
|
CC="ccache $CC"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# coreboot does not like the GOLD linker
|
||||||
|
# USE_GOLD="--enable-gold"
|
||||||
|
USE_GOLD=""
|
||||||
|
GCC_OPTIONS="--enable-lto"
|
||||||
|
|
||||||
|
# Prepare target directory for building GCC
|
||||||
|
# (dependencies must be in the PATH)
|
||||||
mkdir -p $DESTDIR$TARGETDIR/bin
|
mkdir -p $DESTDIR$TARGETDIR/bin
|
||||||
export PATH=$DESTDIR$TARGETDIR/bin:$PATH
|
export PATH=$DESTDIR$TARGETDIR/bin:$PATH
|
||||||
|
|
||||||
|
# Download, unpack, patch and build all packages
|
||||||
|
|
||||||
|
printf "Downloading tar balls ... \n"
|
||||||
|
mkdir -p tarballs
|
||||||
|
for P in $PACKAGES; do
|
||||||
|
download $P
|
||||||
|
done
|
||||||
|
printf "Downloaded tar balls ... ${green}ok${NC}\n"
|
||||||
|
|
||||||
|
printf "Unpacking and patching ... \n"
|
||||||
|
for P in $PACKAGES; do
|
||||||
|
unpack_and_patch $P || exit 1
|
||||||
|
done
|
||||||
|
printf "Unpacked and patched ... ${green}ok${NC}\n"
|
||||||
|
|
||||||
|
printf "Building packages ... \n"
|
||||||
for package in $PACKAGES; do
|
for package in $PACKAGES; do
|
||||||
build $package
|
build $package
|
||||||
done
|
done
|
||||||
|
printf "Packages built ... ${green}ok${NC}\n"
|
||||||
|
|
||||||
# Adding git information of current tree to target directory
|
# Adding git information of current tree to target directory
|
||||||
# for reproducibility
|
# for reproducibility
|
||||||
|
Reference in New Issue
Block a user