diff options
| author | Jieyou Xu <jieyouxu@outlook.com> | 2025-04-23 17:05:40 +0800 |
|---|---|---|
| committer | Jieyou Xu <jieyouxu@outlook.com> | 2025-04-23 17:11:07 +0800 |
| commit | e3296cdcab7f0ee21cbc958985005b835cd605c6 (patch) | |
| tree | 46139c0fbc63722648f93ae2405cd66666040c1a /src/tools/compiletest | |
| parent | 1a5bf12f6586d724ed5ff40e58e06c0233560c0e (diff) | |
| download | rust-e3296cdcab7f0ee21cbc958985005b835cd605c6.tar.gz rust-e3296cdcab7f0ee21cbc958985005b835cd605c6.zip | |
compiletest: `//@ add-core-stubs` implies `-Cforce-unwind-tables=yes`
To preserve CFI directives in assembly tests.
Diffstat (limited to 'src/tools/compiletest')
| -rw-r--r-- | src/tools/compiletest/src/runtest.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index cc09463c358..fe23cce81e9 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -1710,12 +1710,16 @@ impl<'test> TestCx<'test> { rustc.args(&self.props.compile_flags); // FIXME(jieyouxu): we should report a fatal error or warning if user wrote `-Cpanic=` with - // something that's not `abort`, however, by moving this last we should override previous - // `-Cpanic=`s + // something that's not `abort` and `-Cforce-unwind-tables` with a value that is not `yes`, + // however, by moving this last we should override previous `-Cpanic`s and + // `-Cforce-unwind-tables`s. Note that checking here is very fragile, because we'd have to + // account for all possible compile flag splittings (they have some... intricacies and are + // not yet normalized). // // `minicore` requires `#![no_std]` and `#![no_core]`, which means no unwinding panics. if self.props.add_core_stubs { rustc.arg("-Cpanic=abort"); + rustc.arg("-Cforce-unwind-tables=yes"); } rustc |
