Skip to content

Commit

Permalink
[EXPERIMENTAL] What if we forced unwind tables?
Browse files Browse the repository at this point in the history
  • Loading branch information
jieyouxu committed Mar 25, 2024
1 parent e0f17c0 commit d6a0c2a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 16 deletions.
16 changes: 3 additions & 13 deletions src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3185,25 +3185,15 @@ impl Step for TestHelpers {
}
cfg.compiler(builder.cc(target));
}

let build = cfg
.cargo_metadata(false)
cfg.cargo_metadata(false)
.out_dir(&dst)
.target(&target.triple)
.host(&builder.config.build.triple)
.opt_level(0)
.warnings(false)
.debug(false)
.file(builder.src.join("tests/auxiliary/rust_test_helpers.c"));

// Needed to have line number tables
if target.is_msvc() {
build.flag("/Zi");
} else {
build.flag("-g1");
}

build.compile("rust_test_helpers");
.file(builder.src.join("tests/auxiliary/rust_test_helpers.c"))
.compile("rust_test_helpers");
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/debuginfo/auxiliary/dylib-dep-helper-aux.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -g -Cstrip=none
//@ compile-flags: -g -Cstrip=none -Cforce-unwind-tables=yes

#[inline(never)]
pub fn callback<F>(f: F)
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/debuginfo/auxiliary/dylib-dep-helper.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -g -Cstrip=none
//@ compile-flags: -g -Cstrip=none -Cforce-unwind-tables=yes

#![crate_type = "cdylib"]
#![crate_type = "rlib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/debuginfo/backtrace-dylib-dep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//@ ignore-fuchsia Backtraces not symbolized
//@ ignore-musl musl doesn't support dynamic libraries (at least when the original test was written).
//@ needs-unwind
//@ compile-flags: -g -Copt-level=0 -Cstrip=none
//@ compile-flags: -g -Copt-level=0 -Cstrip=none -Cforce-unwind-tables=yes
//@ aux-crate: dylib_dep_helper=dylib-dep-helper.rs
//@ aux-crate: auxiliary=dylib-dep-helper-aux.rs
//@ run-pass
Expand Down

0 comments on commit d6a0c2a

Please sign in to comment.