From e87fcd4db3084833a5af697bb930c671fbd353b7 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Mon, 21 Dec 2020 00:11:54 +0100 Subject: [PATCH] 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/48776 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- util/crossgcc/buildgcc | 1 + 1 file changed, 1 insertion(+) diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc index 96256cdfb1..92b4712f64 100755 --- a/util/crossgcc/buildgcc +++ b/util/crossgcc/buildgcc @@ -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