aboutsummaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-10-03 11:27:35 -0400
committerMike Frysinger <vapier@gentoo.org>2021-10-03 11:36:30 -0400
commit46039d3632e32d9a404c1f18cf55f14c894e4627 (patch)
treed9dfd3842b03b67e4b904c8b4554d2c69dcafe68 /sim
parent0a9bddab0f47d7a09c67528a976022c2196d2dce (diff)
downloadgdb-46039d3632e32d9a404c1f18cf55f14c894e4627.zip
gdb-46039d3632e32d9a404c1f18cf55f14c894e4627.tar.gz
gdb-46039d3632e32d9a404c1f18cf55f14c894e4627.tar.bz2
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
Diffstat (limited to 'sim')
-rw-r--r--sim/arch-subdir.mk.in1
-rw-r--r--sim/ppc/Makefile.in4
2 files changed, 3 insertions, 2 deletions
diff --git a/sim/arch-subdir.mk.in b/sim/arch-subdir.mk.in
index efd91e7..96b481a 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 9d892ee..c230f29 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)