Skip to content

Commit e3296cd

Browse files
committed
compiletest: //@ add-core-stubs implies -Cforce-unwind-tables=yes
To preserve CFI directives in assembly tests.
1 parent 1a5bf12 commit e3296cd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/tools/compiletest/src/runtest.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -1710,12 +1710,16 @@ impl<'test> TestCx<'test> {
17101710
rustc.args(&self.props.compile_flags);
17111711

17121712
// FIXME(jieyouxu): we should report a fatal error or warning if user wrote `-Cpanic=` with
1713-
// something that's not `abort`, however, by moving this last we should override previous
1714-
// `-Cpanic=`s
1713+
// something that's not `abort` and `-Cforce-unwind-tables` with a value that is not `yes`,
1714+
// however, by moving this last we should override previous `-Cpanic`s and
1715+
// `-Cforce-unwind-tables`s. Note that checking here is very fragile, because we'd have to
1716+
// account for all possible compile flag splittings (they have some... intricacies and are
1717+
// not yet normalized).
17151718
//
17161719
// `minicore` requires `#![no_std]` and `#![no_core]`, which means no unwinding panics.
17171720
if self.props.add_core_stubs {
17181721
rustc.arg("-Cpanic=abort");
1722+
rustc.arg("-Cforce-unwind-tables=yes");
17191723
}
17201724

17211725
rustc

0 commit comments

Comments
 (0)