fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #71868 - Mark-Simulacrum:stable-1.43.1, r=pietroalbini8d69840ab92

1.43.1
982 B32 linesraw
1-include ../tools.mk
2
3# ignore windows due to libLLVM being present in PATH and the PATH and library path being the same
4# (so fixing it is harder). See #57765 for context
5ifndef IS_WINDOWS
6
7# This test makes sure that we don't loose upstream object files when compiling
8# staticlibs with -C linker-plugin-lto
9
10all: staticlib.rs upstream.rs
11	$(RUSTC) upstream.rs -C linker-plugin-lto -Ccodegen-units=1
12
13	# Check No LTO
14	$(RUSTC) staticlib.rs -C linker-plugin-lto -Ccodegen-units=1 -L. -o $(TMPDIR)/staticlib.a
15	(cd $(TMPDIR); "$(LLVM_BIN_DIR)"/llvm-ar x ./staticlib.a)
16	# Make sure the upstream object file was included
17	ls $(TMPDIR)/upstream.*.rcgu.o
18
19	# Cleanup
20	rm $(TMPDIR)/*
21
22	# Check ThinLTO
23	$(RUSTC) upstream.rs -C linker-plugin-lto -Ccodegen-units=1 -Clto=thin
24	$(RUSTC) staticlib.rs -C linker-plugin-lto -Ccodegen-units=1 -Clto=thin -L. -o $(TMPDIR)/staticlib.a
25	(cd $(TMPDIR); "$(LLVM_BIN_DIR)"/llvm-ar x ./staticlib.a)
26	ls $(TMPDIR)/upstream.*.rcgu.o
27
28else
29
30all:
31
32endif