Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
f900ee33
R
Rust
项目概览
int
/
Rust
11 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
f900ee33
编写于
3月 23, 2021
作者:
H
hyd-dev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Allow not emitting `uwtable` on Android
上级
2b8fbe6b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
34 addition
and
2 deletion
+34
-2
compiler/rustc_session/src/session.rs
compiler/rustc_session/src/session.rs
+1
-1
compiler/rustc_target/src/spec/android_base.rs
compiler/rustc_target/src/spec/android_base.rs
+4
-1
compiler/rustc_target/src/spec/mod.rs
compiler/rustc_target/src/spec/mod.rs
+7
-0
src/test/codegen/default-requires-uwtable.rs
src/test/codegen/default-requires-uwtable.rs
+15
-0
src/test/codegen/force-no-unwind-tables.rs
src/test/codegen/force-no-unwind-tables.rs
+7
-0
未找到文件。
compiler/rustc_session/src/session.rs
浏览文件 @
f900ee33
...
...
@@ -863,7 +863,7 @@ pub fn must_emit_unwind_tables(&self) -> bool {
}
else
if
self
.target.requires_uwtable
{
true
}
else
{
self
.opts.cg.force_unwind_tables
.unwrap_or
(
fals
e
)
self
.opts.cg.force_unwind_tables
.unwrap_or
(
self
.target.default_uwtabl
e
)
}
}
...
...
compiler/rustc_target/src/spec/android_base.rs
浏览文件 @
f900ee33
...
...
@@ -12,7 +12,10 @@ pub fn opts() -> TargetOptions {
base
.dwarf_version
=
Some
(
2
);
base
.position_independent_executables
=
true
;
base
.has_elf_tls
=
false
;
base
.requires_uwtable
=
true
;
// This is for backward compatibility, see https://github.com/rust-lang/rust/issues/49867
// for context. (At that time, there was no `-C force-unwind-tables`, so the only solution
// was to always emit `uwtable`).
base
.default_uwtable
=
true
;
base
.crt_static_respected
=
false
;
base
}
compiler/rustc_target/src/spec/mod.rs
浏览文件 @
f900ee33
...
...
@@ -1111,6 +1111,10 @@ pub struct TargetOptions {
/// unwinders.
pub
requires_uwtable
:
bool
,
/// Whether or not to emit `uwtable` attributes on functions if `-C force-unwind-tables`
/// is not specified and `uwtable` is not required on this target.
pub
default_uwtable
:
bool
,
/// Whether or not SIMD types are passed by reference in the Rust ABI,
/// typically required if a target can be compiled with a mixed set of
/// target features. This is `true` by default, and `false` for targets like
...
...
@@ -1248,6 +1252,7 @@ fn default() -> TargetOptions {
default_hidden_visibility
:
false
,
emit_debug_gdb_scripts
:
true
,
requires_uwtable
:
false
,
default_uwtable
:
false
,
simd_types_indirect
:
true
,
limit_rdylib_exports
:
true
,
override_export_symbols
:
None
,
...
...
@@ -1711,6 +1716,7 @@ pub fn from_json(obj: Json) -> Result<Target, String> {
key!
(
default_hidden_visibility
,
bool
);
key!
(
emit_debug_gdb_scripts
,
bool
);
key!
(
requires_uwtable
,
bool
);
key!
(
default_uwtable
,
bool
);
key!
(
simd_types_indirect
,
bool
);
key!
(
limit_rdylib_exports
,
bool
);
key!
(
override_export_symbols
,
opt_list
);
...
...
@@ -1947,6 +1953,7 @@ fn to_json(&self) -> Json {
target_option_val!
(
default_hidden_visibility
);
target_option_val!
(
emit_debug_gdb_scripts
);
target_option_val!
(
requires_uwtable
);
target_option_val!
(
default_uwtable
);
target_option_val!
(
simd_types_indirect
);
target_option_val!
(
limit_rdylib_exports
);
target_option_val!
(
override_export_symbols
);
...
...
src/test/codegen/default-requires-uwtable.rs
0 → 100644
浏览文件 @
f900ee33
// revisions: WINDOWS ANDROID
// needs-llvm-components: x86 arm
// compile-flags: -C panic=abort
// [WINDOWS] compile-flags: --target=x86_64-pc-windows-msvc
// [ANDROID] compile-flags: --target=armv7-linux-androideabi
#![feature(no_core,
lang_items)]
#![crate_type
=
"lib"
]
#![no_core]
#[lang
=
"sized"
]
trait
Sized
{}
// CHECK: attributes #{{.*}} uwtable
pub
fn
foo
()
{}
src/test/codegen/force-no-unwind-tables.rs
0 → 100644
浏览文件 @
f900ee33
// compile-flags: -C no-prepopulate-passes -C panic=abort -C force-unwind-tables=n
// ignore-windows
#![crate_type=
"lib"
]
// CHECK-NOT: attributes #{{.*}} uwtable
pub
fn
foo
()
{}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录