summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2020-12-21 00:11:54 +0100
committerPatrick Georgi <pgeorgi@google.com>2021-02-27 22:20:06 +0000
commite87fcd4db3084833a5af697bb930c671fbd353b7 (patch)
treed044d3026ef5b48253c2c642334f7fe19ca6dd3c /util
parentd7c31d1dbe89a54db8e244c2b0d746f58a1bd8ad (diff)
downloadcoreboot-e87fcd4db3084833a5af697bb930c671fbd353b7.tar.xz
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>
Diffstat (limited to 'util')
-rwxr-xr-xutil/crossgcc/buildgcc1
1 files changed, 1 insertions, 0 deletions
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