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.
This commit is contained in:
León Orell Valerian Liehr 2024-12-10 13:51:09 +01:00 committed by GitHub
commit ceaca6be47
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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