From 46039d3632e32d9a404c1f18cf55f14c894e4627 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 3 Oct 2021 11:27:35 -0400 Subject: [PATCH] sim: ppc: fallback when ln is not available [PR sim/18864] Not all systems have easy access to hard links or symlinks, so add fallback logic to the run->psim build code to handle those. Bug: https://sourceware.org/PR18864 --- sim/arch-subdir.mk.in | 1 + sim/ppc/Makefile.in | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sim/arch-subdir.mk.in b/sim/arch-subdir.mk.in index efd91e76b1c..96b481a97e2 100644 --- a/sim/arch-subdir.mk.in +++ b/sim/arch-subdir.mk.in @@ -26,6 +26,7 @@ EXEEXT = @EXEEXT@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ +LN_S = @LN_S@ CC = @CC@ C_DIALECT = @C_DIALECT@ diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in index 9d892ee5999..c230f29d688 100644 --- a/sim/ppc/Makefile.in +++ b/sim/ppc/Makefile.in @@ -522,8 +522,8 @@ psim$(EXEEXT): $(TARGETLIB) main.o $(LIBIBERTY_LIB) $(BFD_LIB) $(LIBINTL_DEP) $(CC) $(CFLAGS) $(LDFLAGS) -o psim$(EXEEXT) main.o $(TARGETLIB) $(BFD_LIB) $(ZLIB) $(LIBINTL) $(LIBIBERTY_LIB) $(LIBS) run$(EXEEXT): psim$(EXEEXT) - rm -f run$(EXEEXT) - ln psim$(EXEEXT) run$(EXEEXT) + rm -f $@ + ln $< $@ 2>/dev/null || $(LN_S) $< $@ 2>/dev/null || cp -p $< $@ $(TARGETLIB): tmp-igen tmp-dgen tmp-hw tmp-pk tmp-defines $(LIB_OBJ) $(GDB_OBJ) rm -f $(TARGETLIB) -- 2.30.2