1 -include ../../run-make-fulldeps/tools.mk
5 # Make sure rlib format with -Zpacked_bundled_libs is correct.
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 NM = "$(LLVM_BIN_DIR)"/llvm-nm
11 all: $(call NATIVE_STATICLIB,native_dep_1) $(call NATIVE_STATICLIB,native_dep_2) $(call NATIVE_STATICLIB,native_dep_3)
12 $(RUSTC) rust_dep_up.rs --crate-type=rlib -Zpacked_bundled_libs
13 $(NM) $(TMPDIR)/librust_dep_up.rlib | $(CGREP) -e "U.*native_f2"
14 $(NM) $(TMPDIR)/librust_dep_up.rlib | $(CGREP) -e "U.*native_f3"
15 $(NM) $(TMPDIR)/librust_dep_up.rlib | $(CGREP) -e "T.*rust_dep_up"
16 $(AR) t $(TMPDIR)/librust_dep_up.rlib | $(CGREP) "native_dep_2"
17 $(AR) t $(TMPDIR)/librust_dep_up.rlib | $(CGREP) "native_dep_3"
18 $(RUSTC) rust_dep_local.rs --extern rlib=$(TMPDIR)/librust_dep_up.rlib -Zpacked_bundled_libs --crate-type=rlib
19 $(NM) $(TMPDIR)/librust_dep_local.rlib | $(CGREP) -e "U.*native_f1"
20 $(NM) $(TMPDIR)/librust_dep_local.rlib | $(CGREP) -e "T.*rust_dep_local"
21 $(AR) t $(TMPDIR)/librust_dep_local.rlib | $(CGREP) "native_dep_1"
23 # Make sure compiler doesn't use files, that it shouldn't know about.
24 rm $(TMPDIR)/*native_dep_*
26 $(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"
29 $(NM) $(TMPDIR)/main.exe | $(CGREP) -e "T.*native_f1"
30 $(NM) $(TMPDIR)/main.exe | $(CGREP) -e "T.*native_f2"
31 $(NM) $(TMPDIR)/main.exe | $(CGREP) -e "T.*native_f3"
32 $(NM) $(TMPDIR)/main.exe | $(CGREP) -e "T.*rust_dep_local"
33 $(NM) $(TMPDIR)/main.exe | $(CGREP) -e "T.*rust_dep_up"