Auto merge of #122613 - Zalathar:profiler, r=nnethercote
Don't build a broken/untested profiler runtime on mingw targets Context: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Why.20build.20a.20broken.2Funtested.20profiler.20runtime.20on.20mingw.3F #75872 added `--enable-profiler` to the `x86_64-mingw` job (to cause some additional tests to run), but had to also add `//@ ignore-windows-gnu` to all of the tests that rely on the profiler runtime actually *working*, because it's broken on that target. We can achieve a similar outcome by going through all the `//@ needs-profiler-support` tests that don't actually need to produce/run a binary, and making them use `-Zno-profiler-runtime` instead, so that they can run even in configurations that don't have the profiler runtime available. Then we can remove `--enable-profiler` from `x86_64-mingw`, and still get the same amount of testing. This PR also removes `--enable-profiler` from the mingw dist builds, since it is broken/untested on that target. Those builds have had that flag for a very long time.
This commit is contained in:
commit
3fc81daffd
18 changed files with 12 additions and 46 deletions
|
@ -390,9 +390,7 @@ auto:
|
||||||
- image: x86_64-mingw
|
- image: x86_64-mingw
|
||||||
env:
|
env:
|
||||||
SCRIPT: make ci-mingw
|
SCRIPT: make ci-mingw
|
||||||
RUST_CONFIGURE_ARGS: >-
|
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu
|
||||||
--build=x86_64-pc-windows-gnu
|
|
||||||
--enable-profiler
|
|
||||||
# We are intentionally allowing an old toolchain on this builder (and that's
|
# We are intentionally allowing an old toolchain on this builder (and that's
|
||||||
# incompatible with LLVM downloads today).
|
# incompatible with LLVM downloads today).
|
||||||
NO_DOWNLOAD_CI_LLVM: 1
|
NO_DOWNLOAD_CI_LLVM: 1
|
||||||
|
@ -440,7 +438,6 @@ auto:
|
||||||
RUST_CONFIGURE_ARGS: >-
|
RUST_CONFIGURE_ARGS: >-
|
||||||
--build=i686-pc-windows-gnu
|
--build=i686-pc-windows-gnu
|
||||||
--enable-full-tools
|
--enable-full-tools
|
||||||
--enable-profiler
|
|
||||||
# We are intentionally allowing an old toolchain on this builder (and that's
|
# We are intentionally allowing an old toolchain on this builder (and that's
|
||||||
# incompatible with LLVM downloads today).
|
# incompatible with LLVM downloads today).
|
||||||
NO_DOWNLOAD_CI_LLVM: 1
|
NO_DOWNLOAD_CI_LLVM: 1
|
||||||
|
@ -454,7 +451,6 @@ auto:
|
||||||
RUST_CONFIGURE_ARGS: >-
|
RUST_CONFIGURE_ARGS: >-
|
||||||
--build=x86_64-pc-windows-gnu
|
--build=x86_64-pc-windows-gnu
|
||||||
--enable-full-tools
|
--enable-full-tools
|
||||||
--enable-profiler
|
|
||||||
# We are intentionally allowing an old toolchain on this builder (and that's
|
# We are intentionally allowing an old toolchain on this builder (and that's
|
||||||
# incompatible with LLVM downloads today).
|
# incompatible with LLVM downloads today).
|
||||||
NO_DOWNLOAD_CI_LLVM: 1
|
NO_DOWNLOAD_CI_LLVM: 1
|
||||||
|
|
|
@ -1023,9 +1023,6 @@ fn iter_header(
|
||||||
if mode == Mode::CoverageRun {
|
if mode == Mode::CoverageRun {
|
||||||
let extra_directives: &[&str] = &[
|
let extra_directives: &[&str] = &[
|
||||||
"needs-profiler-support",
|
"needs-profiler-support",
|
||||||
// FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
|
|
||||||
// properly. Since we only have GCC on the CI ignore the test for now.
|
|
||||||
"ignore-windows-gnu",
|
|
||||||
// FIXME(pietroalbini): this test currently does not work on cross-compiled
|
// FIXME(pietroalbini): this test currently does not work on cross-compiled
|
||||||
// targets because remote-test is not capable of sending back the *.profraw
|
// targets because remote-test is not capable of sending back the *.profraw
|
||||||
// files generated by the LLVM instrumentation.
|
// files generated by the LLVM instrumentation.
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
// Test that `-Cinstrument-coverage=off` does not add coverage instrumentation to LLVM IR.
|
// Test that `-Cinstrument-coverage=off` does not add coverage instrumentation to LLVM IR.
|
||||||
|
|
||||||
|
//@ compile-flags: -Zno-profiler-runtime
|
||||||
//@ revisions: n no off false_ zero
|
//@ revisions: n no off false_ zero
|
||||||
//@ [n] compile-flags: -Cinstrument-coverage=n
|
//@ [n] compile-flags: -Cinstrument-coverage=n
|
||||||
//@ [no] compile-flags: -Cinstrument-coverage=no
|
//@ [no] compile-flags: -Cinstrument-coverage=no
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Test that `-Cinstrument-coverage` creates expected __llvm_profile_filename symbol in LLVM IR.
|
// Test that `-Cinstrument-coverage` creates expected __llvm_profile_filename symbol in LLVM IR.
|
||||||
|
|
||||||
//@ needs-profiler-support
|
//@ compile-flags: -Zno-profiler-runtime
|
||||||
//@ revisions: default y yes on true_ all
|
//@ revisions: default y yes on true_ all
|
||||||
//@ [default] compile-flags: -Cinstrument-coverage
|
//@ [default] compile-flags: -Cinstrument-coverage
|
||||||
//@ [y] compile-flags: -Cinstrument-coverage=y
|
//@ [y] compile-flags: -Cinstrument-coverage=y
|
||||||
|
@ -9,8 +9,8 @@
|
||||||
//@ [true_] compile-flags: -Cinstrument-coverage=true
|
//@ [true_] compile-flags: -Cinstrument-coverage=true
|
||||||
//@ [all] compile-flags: -Cinstrument-coverage=all
|
//@ [all] compile-flags: -Cinstrument-coverage=all
|
||||||
|
|
||||||
// CHECK: @__llvm_profile_filename = {{.*}}"default_%m_%p.profraw\00"{{.*}}
|
// CHECK-DAG: @__llvm_coverage_mapping
|
||||||
// CHECK: @__llvm_coverage_mapping
|
// CHECK-DAG: @__llvm_profile_filename = {{.*}}"default_%m_%p.profraw\00"{{.*}}
|
||||||
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
//@ edition: 2021
|
//@ edition: 2021
|
||||||
//@ needs-profiler-support
|
//@ compile-flags: -Zno-profiler-runtime
|
||||||
//@ compile-flags: -Cinstrument-coverage -Copt-level=0
|
//@ compile-flags: -Cinstrument-coverage -Copt-level=0
|
||||||
//@ revisions: LINUX DARWIN WINDOWS
|
//@ revisions: LINUX DARWIN WINDOWS
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// Regression test for issue #105170.
|
// Regression test for issue #105170.
|
||||||
//
|
//
|
||||||
//@ needs-asm-support
|
//@ needs-asm-support
|
||||||
//@ needs-profiler-support
|
//@ compile-flags: -Zno-profiler-runtime
|
||||||
//@ compile-flags: -Cinstrument-coverage
|
//@ compile-flags: -Cinstrument-coverage
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
#![feature(naked_functions)]
|
#![feature(naked_functions)]
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
//@ ignore-apple -runtime-counter-relocation not honored on Mach-O
|
//@ ignore-apple -runtime-counter-relocation not honored on Mach-O
|
||||||
//@ compile-flags: -Cprofile-generate -Cllvm-args=-runtime-counter-relocation -Clto=fat
|
//@ compile-flags: -Cprofile-generate -Cllvm-args=-runtime-counter-relocation -Clto=fat
|
||||||
//@ needs-profiler-support
|
//@ compile-flags: -Zno-profiler-runtime
|
||||||
//@ no-prefer-dynamic
|
//@ no-prefer-dynamic
|
||||||
|
|
||||||
// CHECK: @__llvm_profile_counter_bias = {{.*}}global
|
// CHECK: @__llvm_profile_counter_bias = {{.*}}global
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Test that `-Cprofile-generate` creates expected instrumentation artifacts in LLVM IR.
|
// Test that `-Cprofile-generate` creates expected instrumentation artifacts in LLVM IR.
|
||||||
|
|
||||||
//@ needs-profiler-support
|
//@ compile-flags: -Zno-profiler-runtime
|
||||||
//@ compile-flags: -Cprofile-generate -Ccodegen-units=1
|
//@ compile-flags: -Cprofile-generate -Ccodegen-units=1
|
||||||
|
|
||||||
// CHECK: @__llvm_profile_raw_version =
|
// CHECK: @__llvm_profile_raw_version =
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
# needs-profiler-support
|
# needs-profiler-support
|
||||||
# ignore-windows-gnu
|
|
||||||
# ignore-cross-compile
|
# ignore-cross-compile
|
||||||
|
|
||||||
# FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
|
|
||||||
# properly. Since we only have GCC on the CI ignore the test for now.
|
|
||||||
|
|
||||||
include ../tools.mk
|
include ../tools.mk
|
||||||
|
|
||||||
PROFILE_DIR=$(TMPDIR)/profiles
|
PROFILE_DIR=$(TMPDIR)/profiles
|
||||||
|
|
|
@ -10,10 +10,6 @@
|
||||||
//@ needs-profiler-support
|
//@ needs-profiler-support
|
||||||
//@ ignore-cross-compile
|
//@ ignore-cross-compile
|
||||||
|
|
||||||
// FIXME(Oneirical): This test has problems generating profdata on mingw.
|
|
||||||
// For more information, see https://github.com/rust-lang/rust/pull/122613
|
|
||||||
//@ ignore-windows-gnu
|
|
||||||
|
|
||||||
use run_make_support::{fs_wrapper, llvm_filecheck, llvm_profdata, run_with_args, rustc};
|
use run_make_support::{fs_wrapper, llvm_filecheck, llvm_profdata, run_with_args, rustc};
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
# needs-profiler-support
|
# needs-profiler-support
|
||||||
# ignore-windows-gnu
|
|
||||||
# ignore-cross-compile
|
# ignore-cross-compile
|
||||||
|
|
||||||
# FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
|
|
||||||
# properly. Since we only have GCC on the CI ignore the test for now.
|
|
||||||
|
|
||||||
include ../tools.mk
|
include ../tools.mk
|
||||||
|
|
||||||
COMPILE_FLAGS=-Copt-level=3 -Clto=fat -Cprofile-generate="$(TMPDIR)"
|
COMPILE_FLAGS=-Copt-level=3 -Clto=fat -Cprofile-generate="$(TMPDIR)"
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
# needs-profiler-support
|
|
||||||
|
|
||||||
include ../tools.mk
|
include ../tools.mk
|
||||||
|
|
||||||
COMPILE_FLAGS=-O -Ccodegen-units=1 -Cprofile-generate="$(TMPDIR)"
|
COMPILE_FLAGS=-O -Ccodegen-units=1 -Cprofile-generate="$(TMPDIR)" -Zno-profiler-runtime
|
||||||
|
|
||||||
all:
|
all:
|
||||||
$(RUSTC) $(COMPILE_FLAGS) --emit=llvm-ir test.rs
|
$(RUSTC) $(COMPILE_FLAGS) --emit=llvm-ir test.rs
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
# needs-profiler-support
|
# needs-profiler-support
|
||||||
# ignore-windows-gnu
|
|
||||||
# ignore-cross-compile
|
# ignore-cross-compile
|
||||||
|
|
||||||
# FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
|
|
||||||
# properly. Since we only have GCC on the CI ignore the test for now.
|
|
||||||
|
|
||||||
include ../tools.mk
|
include ../tools.mk
|
||||||
|
|
||||||
COMPILE_FLAGS=-g -Cprofile-generate="$(TMPDIR)"
|
COMPILE_FLAGS=-g -Cprofile-generate="$(TMPDIR)"
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
# needs-profiler-support
|
# needs-profiler-support
|
||||||
# ignore-windows-gnu
|
|
||||||
# ignore-cross-compile
|
# ignore-cross-compile
|
||||||
|
|
||||||
# FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
|
|
||||||
# properly. Since we only have GCC on the CI ignore the test for now.
|
|
||||||
|
|
||||||
include ../tools.mk
|
include ../tools.mk
|
||||||
|
|
||||||
all:
|
all:
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
# needs-profiler-support
|
# needs-profiler-support
|
||||||
# ignore-windows-gnu
|
|
||||||
# ignore-cross-compile
|
# ignore-cross-compile
|
||||||
|
|
||||||
# FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
|
|
||||||
# properly. Since we only have GCC on the CI ignore the test for now.
|
|
||||||
|
|
||||||
include ../tools.mk
|
include ../tools.mk
|
||||||
|
|
||||||
# This test makes sure that PGO profiling data leads to cold functions being
|
# This test makes sure that PGO profiling data leads to cold functions being
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
# needs-profiler-support
|
# needs-profiler-support
|
||||||
# ignore-windows-gnu
|
|
||||||
|
|
||||||
include ../tools.mk
|
include ../tools.mk
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
//@ needs-profiler-support
|
|
||||||
//@ revisions: block branch condition mcdc bad
|
//@ revisions: block branch condition mcdc bad
|
||||||
//@ compile-flags -Cinstrument-coverage
|
//@ compile-flags -Cinstrument-coverage -Zno-profiler-runtime
|
||||||
|
|
||||||
//@ [block] check-pass
|
//@ [block] check-pass
|
||||||
//@ [block] compile-flags: -Zcoverage-options=block
|
//@ [block] compile-flags: -Zcoverage-options=block
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
//@ check-pass
|
//@ check-pass
|
||||||
//@ needs-profiler-support
|
//@ compile-flags: -Zno-profiler-runtime
|
||||||
//@ revisions: default y yes on true_ all
|
//@ revisions: default y yes on true_ all
|
||||||
//@ [default] compile-flags: -Cinstrument-coverage
|
//@ [default] compile-flags: -Cinstrument-coverage
|
||||||
//@ [y] compile-flags: -Cinstrument-coverage=y
|
//@ [y] compile-flags: -Cinstrument-coverage=y
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue