Skip to content

Commit

Permalink
Auto merge of #75872 - mati865:pgo-tests, r=petrochenkov
Browse files Browse the repository at this point in the history
Enable some of profiler tests on Windows-gnu

CC #61266

Because of force-push GitHub didn't let me reopen #75184

Because of the GCC miscompilation, generated binaries either segfault or `.profraw` is malformed. Clang works fine but we can't use it on the CI.
However we can still test the IR for the proper instrumentation so let's do it.
  • Loading branch information
bors committed Sep 5, 2020
2 parents 7d289ae + 5a51293 commit 04f44fb
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -431,15 +431,15 @@ jobs:
- name: x86_64-mingw-1
env:
SCRIPT: make ci-mingw-subset-1
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-gnu"
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-gnu --enable-profiler"
CUSTOM_MINGW: 1
NO_DEBUG_ASSERTIONS: 1
NO_LLVM_ASSERTIONS: 1
os: windows-latest-xl
- name: x86_64-mingw-2
env:
SCRIPT: make ci-mingw-subset-2
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-gnu"
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-gnu --enable-profiler"
CUSTOM_MINGW: 1
os: windows-latest-xl
- name: dist-x86_64-msvc
Expand Down
2 changes: 1 addition & 1 deletion library/profiler_builtins/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ fn main() {
// Turn off various features of gcc and such, mostly copying
// compiler-rt's build system already
cfg.flag("-fno-builtin");
cfg.flag("-fvisibility=hidden");
cfg.flag("-fomit-frame-pointer");
cfg.define("VISIBILITY_HIDDEN", None);
if !target.contains("windows") {
cfg.flag("-fvisibility=hidden");
cfg.define("COMPILER_RT_HAS_UNAME", Some("1"));
} else {
profile_sources.push("WindowsMMap.c");
Expand Down
4 changes: 2 additions & 2 deletions src/ci/github-actions/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ jobs:
- name: x86_64-mingw-1
env:
SCRIPT: make ci-mingw-subset-1
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu --enable-profiler
CUSTOM_MINGW: 1
# FIXME(#59637)
NO_DEBUG_ASSERTIONS: 1
Expand All @@ -533,7 +533,7 @@ jobs:
- name: x86_64-mingw-2
env:
SCRIPT: make ci-mingw-subset-2
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu --enable-profiler
CUSTOM_MINGW: 1
<<: *job-windows-xl

Expand Down
2 changes: 1 addition & 1 deletion src/llvm-project
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# needs-profiler-support
# ignore-windows-gnu

# 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.

# ISSUE(76038): When targeting MSVC, Rust binaries built with both `-Z instrument-coverage` and
# `-C link-dead-code` typically crash (with a seg-fault) or at best generate an empty `*.profraw`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# needs-profiler-support
# ignore-msvc
# ignore-windows-gnu

# 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.

# LINK_DEAD_CODE requires ignore-msvc due to Issue #76038
LINK_DEAD_CODE=yes
Expand All @@ -8,4 +12,4 @@ LINK_DEAD_CODE=yes

# ISSUE(76038): When targeting MSVC, Rust binaries built with both `-Z instrument-coverage` and
# `-C link-dead-code` typically crash (with a seg-fault) or at best generate an empty `*.profraw`.
# See ../instrument-coverage/coverage_tools.mk for more information.
# See ../instrument-coverage/coverage_tools.mk for more information.
4 changes: 4 additions & 0 deletions src/test/run-make-fulldeps/pgo-branch-weights/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# needs-profiler-support
# ignore-windows-gnu

# 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

Expand Down
4 changes: 4 additions & 0 deletions src/test/run-make-fulldeps/pgo-gen-lto/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# needs-profiler-support
# ignore-windows-gnu

# 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

Expand Down
4 changes: 4 additions & 0 deletions src/test/run-make-fulldeps/pgo-gen/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# needs-profiler-support
# ignore-windows-gnu

# 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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# needs-profiler-support
# ignore-windows-gnu

# 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

Expand Down
4 changes: 4 additions & 0 deletions src/test/run-make-fulldeps/pgo-use/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# needs-profiler-support
# ignore-windows-gnu

# 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

Expand Down

0 comments on commit 04f44fb

Please sign in to comment.