fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.8 KiB39 linesraw
1include ../tools.mk
2
3# ignore-cross-compile
4
5# Make sure rlib format with -Zpacked_bundled_libs is correct.
6
7# We're using the llvm-nm instead of the system nm to ensure it is compatible
8# with the LLVM bitcode generated by rustc.
9# Except on Windows where piping/IO redirection under MSYS2 is wonky with llvm-nm.
10ifndef IS_WINDOWS
11NM = "$(LLVM_BIN_DIR)"/llvm-nm
12else
13NM = nm
14endif
15
16all: $(call NATIVE_STATICLIB,native_dep_1) $(call NATIVE_STATICLIB,native_dep_2) $(call NATIVE_STATICLIB,native_dep_3)
17	$(RUSTC) rust_dep_up.rs --crate-type=rlib -Zpacked_bundled_libs
18	$(NM) $(TMPDIR)/librust_dep_up.rlib | $(CGREP) -e "U.*native_f2"
19	$(NM) $(TMPDIR)/librust_dep_up.rlib | $(CGREP) -e "U.*native_f3"
20	$(NM) $(TMPDIR)/librust_dep_up.rlib | $(CGREP) -e "T.*rust_dep_up"
21	$(AR) t $(TMPDIR)/librust_dep_up.rlib | $(CGREP) "native_dep_2"
22	$(AR) t $(TMPDIR)/librust_dep_up.rlib | $(CGREP) "native_dep_3"
23	$(RUSTC) rust_dep_local.rs --extern rlib=$(TMPDIR)/librust_dep_up.rlib -Zpacked_bundled_libs --crate-type=rlib
24	$(NM) $(TMPDIR)/librust_dep_local.rlib | $(CGREP) -e "U.*native_f1"
25	$(NM) $(TMPDIR)/librust_dep_local.rlib | $(CGREP) -e "T.*rust_dep_local"
26	$(AR) t $(TMPDIR)/librust_dep_local.rlib | $(CGREP) "native_dep_1"
27
28	# Make sure compiler doesn't use files, that it shouldn't know about.
29	rm $(TMPDIR)/*native_dep_*
30
31	$(RUSTC) main.rs --extern lib=$(TMPDIR)/librust_dep_local.rlib -o $(TMPDIR)/main.exe -Zpacked_bundled_libs --print link-args | $(CGREP) -e "native_dep_1.*native_dep_2.*native_dep_3"
32
33ifndef IS_MSVC
34	$(NM) $(TMPDIR)/main.exe | $(CGREP) -e "T.*native_f1"
35	$(NM) $(TMPDIR)/main.exe | $(CGREP) -e "T.*native_f2"
36	$(NM) $(TMPDIR)/main.exe | $(CGREP) -e "T.*native_f3"
37	$(NM) $(TMPDIR)/main.exe | $(CGREP) -e "T.*rust_dep_local"
38	$(NM) $(TMPDIR)/main.exe | $(CGREP) -e "T.*rust_dep_up"
39endif