about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2024-12-10 13:51:09 +0100
committerGitHub <noreply@github.com>2024-12-10 13:51:09 +0100
commitceaca6be471dffee50c5ded5fe923ec74395446a (patch)
tree46d8513a6544014ecb38751482faab289dab5a34
parent0ff8ee6d7e2fefabbe4a4a3c241513d5f1e52a28 (diff)
parentab2ee7aa2f0eb8906b5d04104c93050e703b3936 (diff)
downloadrust-ceaca6be471dffee50c5ded5fe923ec74395446a.tar.gz
rust-ceaca6be471dffee50c5ded5fe923ec74395446a.zip
Rollup merge of #133980 - xingxue-ibm:ln-option-aix, r=jieyouxu
[AIX] Remove option "-n" from AIX "ln" command

The option `-n` for the AIX `ln` command has a different purpose than it does on Linux. On Linux, the `-n` option is used to treat the destination path as normal file if it is a symbolic link to a directory, which is the default behavior of the AIX `ln` command.
-rw-r--r--tests/run-make/libs-through-symlinks/Makefile12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/run-make/libs-through-symlinks/Makefile b/tests/run-make/libs-through-symlinks/Makefile
index 592eae663a4..c6ff566a0e8 100644
--- a/tests/run-make/libs-through-symlinks/Makefile
+++ b/tests/run-make/libs-through-symlinks/Makefile
@@ -3,10 +3,20 @@ include ../tools.mk
 
 # ignore-windows
 
+# The option -n for the AIX ln command has a different purpose than it does
+# on Linux. On Linux, the -n option is used to treat the destination path as
+# normal file if it is a symbolic link to a directory, which is the default
+# behavior of the AIX ln command.
+ifeq ($(UNAME),AIX)
+LN_FLAGS := -sf
+else
+LN_FLAGS := -nsf
+endif
+
 NAME := $(shell $(RUSTC) --print file-names foo.rs)
 
 all:
 	mkdir -p $(TMPDIR)/outdir
 	$(RUSTC) foo.rs -o $(TMPDIR)/outdir/$(NAME)
-	ln -nsf outdir/$(NAME) $(TMPDIR)
+	ln $(LN_FLAGS) outdir/$(NAME) $(TMPDIR)
 	RUSTC_LOG=rustc_metadata::loader $(RUSTC) bar.rs