]> git.lizzy.rs Git - rust.git/blob - tests/run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile
Auto merge of #107303 - compiler-errors:intern-canonical-var-values, r=lcnr
[rust.git] / tests / run-make-fulldeps / cross-lang-lto-upstream-rlibs / Makefile
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
5 ifndef 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
10 all: 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
28 else
29
30 all:
31
32 endif