public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] sim: ppc: fallback when ln is not available [PR sim/18864]
@ 2021-10-03 15:37 Mike Frysinger
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2021-10-03 15:37 UTC (permalink / raw)
  To: gdb-patches

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 efd91e76b1c3..96b481a97e25 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 9d892ee5999f..c230f29d6883 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.33.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-03 15:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-03 15:37 [PATCH] sim: ppc: fallback when ln is not available [PR sim/18864] Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).