crossgcc: Delete conflicting, stale symbolic link

If a previous build failed or the build dir is still around for other
reasons (e.g. buildgcc's `-t`) the symbolic link to our `bin` dir we
create there is also still around and can't be created again without
removing it first. Attempts to use `ln -f` also fail as the existing
destination is treated as directory and a new symbolic link would be
created inside.

Change-Id: I7a2720b0286e33d1ba26ea01f323dbf4f8afaea0
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/48776
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Nico Huber 2020-12-21 00:11:54 +01:00 committed by Patrick Georgi
parent d7c31d1dbe
commit e87fcd4db3
1 changed files with 1 additions and 0 deletions

View File

@ -777,6 +777,7 @@ build_cross_GCC() {
--with-pkgversion="coreboot toolchain v$CROSSGCC_VERSION $CROSSGCC_DATE" \
&& \
mkdir -p gcc/$TARGETARCH && \
rm -f "gcc/$TARGETARCH/$GCC_VERSION" && \
ln -s "$DESTDIR$TARGETDIR/$TARGETARCH/bin" "gcc/$TARGETARCH/$GCC_VERSION" && \
$MAKE $JOBS CFLAGS_FOR_BUILD="$HOSTCFLAGS" all-gcc && \
$MAKE install-gcc DESTDIR="$DESTDIR" || touch .failed