Skip to content

Commit 04f44fb

Browse files
committed
Auto merge of #75872 - mati865:pgo-tests, r=petrochenkov
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.
2 parents 7d289ae + 5a51293 commit 04f44fb

File tree

11 files changed

+35
-7
lines changed

11 files changed

+35
-7
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -431,15 +431,15 @@ jobs:
431431
- name: x86_64-mingw-1
432432
env:
433433
SCRIPT: make ci-mingw-subset-1
434-
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-gnu"
434+
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-gnu --enable-profiler"
435435
CUSTOM_MINGW: 1
436436
NO_DEBUG_ASSERTIONS: 1
437437
NO_LLVM_ASSERTIONS: 1
438438
os: windows-latest-xl
439439
- name: x86_64-mingw-2
440440
env:
441441
SCRIPT: make ci-mingw-subset-2
442-
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-gnu"
442+
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-gnu --enable-profiler"
443443
CUSTOM_MINGW: 1
444444
os: windows-latest-xl
445445
- name: dist-x86_64-msvc

library/profiler_builtins/build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ fn main() {
4848
// Turn off various features of gcc and such, mostly copying
4949
// compiler-rt's build system already
5050
cfg.flag("-fno-builtin");
51-
cfg.flag("-fvisibility=hidden");
5251
cfg.flag("-fomit-frame-pointer");
5352
cfg.define("VISIBILITY_HIDDEN", None);
5453
if !target.contains("windows") {
54+
cfg.flag("-fvisibility=hidden");
5555
cfg.define("COMPILER_RT_HAS_UNAME", Some("1"));
5656
} else {
5757
profile_sources.push("WindowsMMap.c");

src/ci/github-actions/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ jobs:
523523
- name: x86_64-mingw-1
524524
env:
525525
SCRIPT: make ci-mingw-subset-1
526-
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu
526+
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu --enable-profiler
527527
CUSTOM_MINGW: 1
528528
# FIXME(#59637)
529529
NO_DEBUG_ASSERTIONS: 1
@@ -533,7 +533,7 @@ jobs:
533533
- name: x86_64-mingw-2
534534
env:
535535
SCRIPT: make ci-mingw-subset-2
536-
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu
536+
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu --enable-profiler
537537
CUSTOM_MINGW: 1
538538
<<: *job-windows-xl
539539

src/test/run-make-fulldeps/instrument-coverage-cov-reports-base/Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# needs-profiler-support
2+
# ignore-windows-gnu
3+
4+
# FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
5+
# properly. Since we only have GCC on the CI ignore the test for now.
26

37
# ISSUE(76038): When targeting MSVC, Rust binaries built with both `-Z instrument-coverage` and
48
# `-C link-dead-code` typically crash (with a seg-fault) or at best generate an empty `*.profraw`.
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# needs-profiler-support
22
# ignore-msvc
3+
# ignore-windows-gnu
4+
5+
# FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
6+
# properly. Since we only have GCC on the CI ignore the test for now.
37

48
# LINK_DEAD_CODE requires ignore-msvc due to Issue #76038
59
LINK_DEAD_CODE=yes
@@ -8,4 +12,4 @@ LINK_DEAD_CODE=yes
812

913
# ISSUE(76038): When targeting MSVC, Rust binaries built with both `-Z instrument-coverage` and
1014
# `-C link-dead-code` typically crash (with a seg-fault) or at best generate an empty `*.profraw`.
11-
# See ../instrument-coverage/coverage_tools.mk for more information.
15+
# See ../instrument-coverage/coverage_tools.mk for more information.

src/test/run-make-fulldeps/pgo-branch-weights/Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# needs-profiler-support
2+
# ignore-windows-gnu
3+
4+
# FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
5+
# properly. Since we only have GCC on the CI ignore the test for now.
26

37
-include ../tools.mk
48

src/test/run-make-fulldeps/pgo-gen-lto/Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# needs-profiler-support
2+
# ignore-windows-gnu
3+
4+
# FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
5+
# properly. Since we only have GCC on the CI ignore the test for now.
26

37
-include ../tools.mk
48

src/test/run-make-fulldeps/pgo-gen/Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# needs-profiler-support
2+
# ignore-windows-gnu
3+
4+
# FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
5+
# properly. Since we only have GCC on the CI ignore the test for now.
26

37
-include ../tools.mk
48

src/test/run-make-fulldeps/pgo-indirect-call-promotion/Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# needs-profiler-support
2+
# ignore-windows-gnu
3+
4+
# FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
5+
# properly. Since we only have GCC on the CI ignore the test for now.
26

37
-include ../tools.mk
48

src/test/run-make-fulldeps/pgo-use/Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# needs-profiler-support
2+
# ignore-windows-gnu
3+
4+
# FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
5+
# properly. Since we only have GCC on the CI ignore the test for now.
26

37
-include ../tools.mk
48

0 commit comments

Comments
 (0)