fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1# needs-profiler-support 2# ignore-windows-gnu 3 4include ../tools.mk 5 6# FIXME(eddyb) provide `HOST_RUSTC` and `TARGET_RUSTC` 7# instead of hardcoding them everywhere they're needed. 8ifeq ($(IS_MUSL_HOST),1) 9ADDITIONAL_ARGS := $(RUSTFLAGS) 10endif 11 12all: 13 # Generate PGO profiles 14 $(BARE_RUSTC) $(ADDITIONAL_ARGS) -Cprofile-generate=$(TMPDIR)/profiles --out-dir $(TMPDIR) main.rs 15 $(TMPDIR)/main 16 17 # Merge profiles 18 "$(LLVM_BIN_DIR)/llvm-profdata" merge \ 19 -o "$(TMPDIR)/merged.profdata" \ 20 "$(TMPDIR)/profiles" || exit 1 21 22 # Use the profile 23 $(RUSTC) -Cprofile-use=$(TMPDIR)/merged.profdata --emit dep-info main.rs 24 25 # Check that profile file is in depinfo 26 $(CGREP) "merged.profdata" < $(TMPDIR)/main.d