Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
049a49b9
R
Rust
项目概览
int
/
Rust
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
049a49b9
编写于
3月 28, 2021
作者:
V
Vadim Petrochenkov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rustc_target: Avoid unwraps when adding linker flags
上级
9b0edb7f
变更
45
隐藏空白更改
内联
并排
Showing
45 changed file
with
61 addition
and
61 deletion
+61
-61
compiler/rustc_target/src/spec/android_base.rs
compiler/rustc_target/src/spec/android_base.rs
+2
-2
compiler/rustc_target/src/spec/armv7_linux_androideabi.rs
compiler/rustc_target/src/spec/armv7_linux_androideabi.rs
+1
-1
compiler/rustc_target/src/spec/i686_pc_windows_gnu.rs
compiler/rustc_target/src/spec/i686_pc_windows_gnu.rs
+2
-2
compiler/rustc_target/src/spec/i686_pc_windows_msvc.rs
compiler/rustc_target/src/spec/i686_pc_windows_msvc.rs
+3
-3
compiler/rustc_target/src/spec/i686_unknown_freebsd.rs
compiler/rustc_target/src/spec/i686_unknown_freebsd.rs
+1
-1
compiler/rustc_target/src/spec/i686_unknown_linux_gnu.rs
compiler/rustc_target/src/spec/i686_unknown_linux_gnu.rs
+1
-1
compiler/rustc_target/src/spec/i686_unknown_linux_musl.rs
compiler/rustc_target/src/spec/i686_unknown_linux_musl.rs
+2
-2
compiler/rustc_target/src/spec/i686_unknown_netbsd.rs
compiler/rustc_target/src/spec/i686_unknown_netbsd.rs
+1
-1
compiler/rustc_target/src/spec/i686_unknown_openbsd.rs
compiler/rustc_target/src/spec/i686_unknown_openbsd.rs
+2
-2
compiler/rustc_target/src/spec/i686_uwp_windows_gnu.rs
compiler/rustc_target/src/spec/i686_uwp_windows_gnu.rs
+2
-2
compiler/rustc_target/src/spec/i686_wrs_vxworks.rs
compiler/rustc_target/src/spec/i686_wrs_vxworks.rs
+1
-1
compiler/rustc_target/src/spec/powerpc64_unknown_freebsd.rs
compiler/rustc_target/src/spec/powerpc64_unknown_freebsd.rs
+1
-1
compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
...iler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
+1
-1
compiler/rustc_target/src/spec/powerpc64_unknown_linux_musl.rs
...ler/rustc_target/src/spec/powerpc64_unknown_linux_musl.rs
+1
-1
compiler/rustc_target/src/spec/powerpc64_wrs_vxworks.rs
compiler/rustc_target/src/spec/powerpc64_wrs_vxworks.rs
+1
-1
compiler/rustc_target/src/spec/powerpc64le_unknown_linux_gnu.rs
...er/rustc_target/src/spec/powerpc64le_unknown_linux_gnu.rs
+1
-1
compiler/rustc_target/src/spec/powerpc64le_unknown_linux_musl.rs
...r/rustc_target/src/spec/powerpc64le_unknown_linux_musl.rs
+1
-1
compiler/rustc_target/src/spec/powerpc_unknown_linux_gnu.rs
compiler/rustc_target/src/spec/powerpc_unknown_linux_gnu.rs
+1
-1
compiler/rustc_target/src/spec/powerpc_unknown_linux_gnuspe.rs
...ler/rustc_target/src/spec/powerpc_unknown_linux_gnuspe.rs
+1
-1
compiler/rustc_target/src/spec/powerpc_unknown_linux_musl.rs
compiler/rustc_target/src/spec/powerpc_unknown_linux_musl.rs
+1
-1
compiler/rustc_target/src/spec/powerpc_unknown_netbsd.rs
compiler/rustc_target/src/spec/powerpc_unknown_netbsd.rs
+1
-1
compiler/rustc_target/src/spec/powerpc_wrs_vxworks.rs
compiler/rustc_target/src/spec/powerpc_wrs_vxworks.rs
+2
-2
compiler/rustc_target/src/spec/powerpc_wrs_vxworks_spe.rs
compiler/rustc_target/src/spec/powerpc_wrs_vxworks_spe.rs
+2
-2
compiler/rustc_target/src/spec/sparc64_unknown_netbsd.rs
compiler/rustc_target/src/spec/sparc64_unknown_netbsd.rs
+1
-1
compiler/rustc_target/src/spec/sparc64_unknown_openbsd.rs
compiler/rustc_target/src/spec/sparc64_unknown_openbsd.rs
+1
-1
compiler/rustc_target/src/spec/sparc_unknown_linux_gnu.rs
compiler/rustc_target/src/spec/sparc_unknown_linux_gnu.rs
+1
-1
compiler/rustc_target/src/spec/thumbv7a_pc_windows_msvc.rs
compiler/rustc_target/src/spec/thumbv7a_pc_windows_msvc.rs
+3
-3
compiler/rustc_target/src/spec/thumbv7neon_linux_androideabi.rs
...er/rustc_target/src/spec/thumbv7neon_linux_androideabi.rs
+1
-1
compiler/rustc_target/src/spec/uefi_msvc_base.rs
compiler/rustc_target/src/spec/uefi_msvc_base.rs
+3
-3
compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs
compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs
+1
-1
compiler/rustc_target/src/spec/wasm32_unknown_unknown.rs
compiler/rustc_target/src/spec/wasm32_unknown_unknown.rs
+2
-2
compiler/rustc_target/src/spec/windows_uwp_msvc_base.rs
compiler/rustc_target/src/spec/windows_uwp_msvc_base.rs
+3
-3
compiler/rustc_target/src/spec/x86_64_linux_android.rs
compiler/rustc_target/src/spec/x86_64_linux_android.rs
+1
-1
compiler/rustc_target/src/spec/x86_64_pc_windows_gnu.rs
compiler/rustc_target/src/spec/x86_64_pc_windows_gnu.rs
+1
-1
compiler/rustc_target/src/spec/x86_64_unknown_dragonfly.rs
compiler/rustc_target/src/spec/x86_64_unknown_dragonfly.rs
+1
-1
compiler/rustc_target/src/spec/x86_64_unknown_freebsd.rs
compiler/rustc_target/src/spec/x86_64_unknown_freebsd.rs
+1
-1
compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs
compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs
+1
-1
compiler/rustc_target/src/spec/x86_64_unknown_linux_gnux32.rs
...iler/rustc_target/src/spec/x86_64_unknown_linux_gnux32.rs
+1
-1
compiler/rustc_target/src/spec/x86_64_unknown_linux_musl.rs
compiler/rustc_target/src/spec/x86_64_unknown_linux_musl.rs
+1
-1
compiler/rustc_target/src/spec/x86_64_unknown_netbsd.rs
compiler/rustc_target/src/spec/x86_64_unknown_netbsd.rs
+1
-1
compiler/rustc_target/src/spec/x86_64_unknown_none_linuxkernel.rs
.../rustc_target/src/spec/x86_64_unknown_none_linuxkernel.rs
+1
-1
compiler/rustc_target/src/spec/x86_64_unknown_openbsd.rs
compiler/rustc_target/src/spec/x86_64_unknown_openbsd.rs
+1
-1
compiler/rustc_target/src/spec/x86_64_unknown_redox.rs
compiler/rustc_target/src/spec/x86_64_unknown_redox.rs
+1
-1
compiler/rustc_target/src/spec/x86_64_uwp_windows_gnu.rs
compiler/rustc_target/src/spec/x86_64_uwp_windows_gnu.rs
+1
-1
compiler/rustc_target/src/spec/x86_64_wrs_vxworks.rs
compiler/rustc_target/src/spec/x86_64_wrs_vxworks.rs
+1
-1
未找到文件。
compiler/rustc_target/src/spec/android_base.rs
浏览文件 @
049a49b9
...
...
@@ -6,8 +6,8 @@ pub fn opts() -> TargetOptions {
// Many of the symbols defined in compiler-rt are also defined in libgcc.
// Android's linker doesn't like that by default.
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.
unwrap
()
.
entry
(
LinkerFlavor
::
Gcc
)
.
or_default
()
.push
(
"-Wl,--allow-multiple-definition"
.to_string
());
base
.dwarf_version
=
Some
(
2
);
base
.position_independent_executables
=
true
;
...
...
compiler/rustc_target/src/spec/armv7_linux_androideabi.rs
浏览文件 @
049a49b9
...
...
@@ -12,7 +12,7 @@ pub fn target() -> Target {
let
mut
base
=
super
::
android_base
::
opts
();
base
.features
=
"+v7,+thumb-mode,+thumb2,+vfp3,-d32,-neon"
.to_string
();
base
.max_atomic_width
=
Some
(
64
);
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-march=armv7-a"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-march=armv7-a"
.to_string
());
Target
{
llvm_target
:
"armv7-none-linux-android"
.to_string
(),
...
...
compiler/rustc_target/src/spec/i686_pc_windows_gnu.rs
浏览文件 @
049a49b9
...
...
@@ -12,8 +12,8 @@ pub fn target() -> Target {
// Mark all dynamic libraries and executables as compatible with the larger 4GiB address
// space available to x86 Windows binaries on x86_64.
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.
unwrap
()
.
entry
(
LinkerFlavor
::
Gcc
)
.
or_default
()
.push
(
"-Wl,--large-address-aware"
.to_string
());
Target
{
...
...
compiler/rustc_target/src/spec/i686_pc_windows_msvc.rs
浏览文件 @
049a49b9
...
...
@@ -14,10 +14,10 @@ pub fn target() -> Target {
// https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers
"/SAFESEH"
.to_string
(),
];
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Msvc
)
.unwrap
()
.extend
(
pre_link_args_msvc
.clone
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Msvc
)
.or_default
()
.extend
(
pre_link_args_msvc
.clone
());
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Lld
(
LldFlavor
::
Link
))
.
unwrap
()
.
entry
(
LinkerFlavor
::
Lld
(
LldFlavor
::
Link
))
.
or_default
()
.extend
(
pre_link_args_msvc
);
Target
{
...
...
compiler/rustc_target/src/spec/i686_unknown_freebsd.rs
浏览文件 @
049a49b9
...
...
@@ -4,7 +4,7 @@ pub fn target() -> Target {
let
mut
base
=
super
::
freebsd_base
::
opts
();
base
.cpu
=
"pentium4"
.to_string
();
base
.max_atomic_width
=
Some
(
64
);
let
pre_link_args
=
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
();
let
pre_link_args
=
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
();
pre_link_args
.push
(
"-m32"
.to_string
());
pre_link_args
.push
(
"-Wl,-znotext"
.to_string
());
base
.stack_probes
=
StackProbeType
::
InlineOrCall
{
min_llvm_version_for_inline
:
(
11
,
0
,
1
)
};
...
...
compiler/rustc_target/src/spec/i686_unknown_linux_gnu.rs
浏览文件 @
049a49b9
...
...
@@ -4,7 +4,7 @@ pub fn target() -> Target {
let
mut
base
=
super
::
linux_gnu_base
::
opts
();
base
.cpu
=
"pentium4"
.to_string
();
base
.max_atomic_width
=
Some
(
64
);
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-m32"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-m32"
.to_string
());
base
.stack_probes
=
StackProbeType
::
InlineOrCall
{
min_llvm_version_for_inline
:
(
11
,
0
,
1
)
};
Target
{
...
...
compiler/rustc_target/src/spec/i686_unknown_linux_musl.rs
浏览文件 @
049a49b9
...
...
@@ -4,8 +4,8 @@ pub fn target() -> Target {
let
mut
base
=
super
::
linux_musl_base
::
opts
();
base
.cpu
=
"pentium4"
.to_string
();
base
.max_atomic_width
=
Some
(
64
);
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-m32"
.to_string
());
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-Wl,-melf_i386"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-m32"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-Wl,-melf_i386"
.to_string
());
base
.stack_probes
=
StackProbeType
::
InlineOrCall
{
min_llvm_version_for_inline
:
(
11
,
0
,
1
)
};
// The unwinder used by i686-unknown-linux-musl, the LLVM libunwind
...
...
compiler/rustc_target/src/spec/i686_unknown_netbsd.rs
浏览文件 @
049a49b9
...
...
@@ -4,7 +4,7 @@ pub fn target() -> Target {
let
mut
base
=
super
::
netbsd_base
::
opts
();
base
.cpu
=
"pentium4"
.to_string
();
base
.max_atomic_width
=
Some
(
64
);
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-m32"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-m32"
.to_string
());
base
.stack_probes
=
StackProbeType
::
InlineOrCall
{
min_llvm_version_for_inline
:
(
11
,
0
,
1
)
};
Target
{
...
...
compiler/rustc_target/src/spec/i686_unknown_openbsd.rs
浏览文件 @
049a49b9
...
...
@@ -4,8 +4,8 @@ pub fn target() -> Target {
let
mut
base
=
super
::
openbsd_base
::
opts
();
base
.cpu
=
"pentium4"
.to_string
();
base
.max_atomic_width
=
Some
(
64
);
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-m32"
.to_string
());
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-fuse-ld=lld"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-m32"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-fuse-ld=lld"
.to_string
());
base
.stack_probes
=
StackProbeType
::
InlineOrCall
{
min_llvm_version_for_inline
:
(
11
,
0
,
1
)
};
Target
{
...
...
compiler/rustc_target/src/spec/i686_uwp_windows_gnu.rs
浏览文件 @
049a49b9
...
...
@@ -11,8 +11,8 @@ pub fn target() -> Target {
// Mark all dynamic libraries and executables as compatible with the larger 4GiB address
// space available to x86 Windows binaries on x86_64.
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.
unwrap
()
.
entry
(
LinkerFlavor
::
Gcc
)
.
or_default
()
.push
(
"-Wl,--large-address-aware"
.to_string
());
Target
{
...
...
compiler/rustc_target/src/spec/i686_wrs_vxworks.rs
浏览文件 @
049a49b9
...
...
@@ -4,7 +4,7 @@ pub fn target() -> Target {
let
mut
base
=
super
::
vxworks_base
::
opts
();
base
.cpu
=
"pentium4"
.to_string
();
base
.max_atomic_width
=
Some
(
64
);
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-m32"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-m32"
.to_string
());
base
.stack_probes
=
StackProbeType
::
InlineOrCall
{
min_llvm_version_for_inline
:
(
11
,
0
,
1
)
};
Target
{
...
...
compiler/rustc_target/src/spec/powerpc64_unknown_freebsd.rs
浏览文件 @
049a49b9
...
...
@@ -4,7 +4,7 @@
pub
fn
target
()
->
Target
{
let
mut
base
=
super
::
freebsd_base
::
opts
();
base
.cpu
=
"ppc64"
.to_string
();
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-m64"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-m64"
.to_string
());
base
.max_atomic_width
=
Some
(
64
);
Target
{
...
...
compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
浏览文件 @
049a49b9
...
...
@@ -4,7 +4,7 @@
pub
fn
target
()
->
Target
{
let
mut
base
=
super
::
linux_gnu_base
::
opts
();
base
.cpu
=
"ppc64"
.to_string
();
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-m64"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-m64"
.to_string
());
base
.max_atomic_width
=
Some
(
64
);
// ld.so in at least RHEL6 on ppc64 has a bug related to BIND_NOW, so only enable partial RELRO
...
...
compiler/rustc_target/src/spec/powerpc64_unknown_linux_musl.rs
浏览文件 @
049a49b9
...
...
@@ -4,7 +4,7 @@
pub
fn
target
()
->
Target
{
let
mut
base
=
super
::
linux_musl_base
::
opts
();
base
.cpu
=
"ppc64"
.to_string
();
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-m64"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-m64"
.to_string
());
base
.max_atomic_width
=
Some
(
64
);
Target
{
...
...
compiler/rustc_target/src/spec/powerpc64_wrs_vxworks.rs
浏览文件 @
049a49b9
...
...
@@ -4,7 +4,7 @@
pub
fn
target
()
->
Target
{
let
mut
base
=
super
::
vxworks_base
::
opts
();
base
.cpu
=
"ppc64"
.to_string
();
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-m64"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-m64"
.to_string
());
base
.max_atomic_width
=
Some
(
64
);
Target
{
...
...
compiler/rustc_target/src/spec/powerpc64le_unknown_linux_gnu.rs
浏览文件 @
049a49b9
...
...
@@ -3,7 +3,7 @@
pub
fn
target
()
->
Target
{
let
mut
base
=
super
::
linux_gnu_base
::
opts
();
base
.cpu
=
"ppc64le"
.to_string
();
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-m64"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-m64"
.to_string
());
base
.max_atomic_width
=
Some
(
64
);
Target
{
...
...
compiler/rustc_target/src/spec/powerpc64le_unknown_linux_musl.rs
浏览文件 @
049a49b9
...
...
@@ -3,7 +3,7 @@
pub
fn
target
()
->
Target
{
let
mut
base
=
super
::
linux_musl_base
::
opts
();
base
.cpu
=
"ppc64le"
.to_string
();
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-m64"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-m64"
.to_string
());
base
.max_atomic_width
=
Some
(
64
);
Target
{
...
...
compiler/rustc_target/src/spec/powerpc_unknown_linux_gnu.rs
浏览文件 @
049a49b9
...
...
@@ -3,7 +3,7 @@
pub
fn
target
()
->
Target
{
let
mut
base
=
super
::
linux_gnu_base
::
opts
();
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-m32"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-m32"
.to_string
());
base
.max_atomic_width
=
Some
(
32
);
Target
{
...
...
compiler/rustc_target/src/spec/powerpc_unknown_linux_gnuspe.rs
浏览文件 @
049a49b9
...
...
@@ -3,7 +3,7 @@
pub
fn
target
()
->
Target
{
let
mut
base
=
super
::
linux_gnu_base
::
opts
();
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-mspe"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-mspe"
.to_string
());
base
.max_atomic_width
=
Some
(
32
);
Target
{
...
...
compiler/rustc_target/src/spec/powerpc_unknown_linux_musl.rs
浏览文件 @
049a49b9
...
...
@@ -3,7 +3,7 @@
pub
fn
target
()
->
Target
{
let
mut
base
=
super
::
linux_musl_base
::
opts
();
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-m32"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-m32"
.to_string
());
base
.max_atomic_width
=
Some
(
32
);
Target
{
...
...
compiler/rustc_target/src/spec/powerpc_unknown_netbsd.rs
浏览文件 @
049a49b9
...
...
@@ -3,7 +3,7 @@
pub
fn
target
()
->
Target
{
let
mut
base
=
super
::
netbsd_base
::
opts
();
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-m32"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-m32"
.to_string
());
base
.max_atomic_width
=
Some
(
32
);
Target
{
...
...
compiler/rustc_target/src/spec/powerpc_wrs_vxworks.rs
浏览文件 @
049a49b9
...
...
@@ -3,8 +3,8 @@
pub
fn
target
()
->
Target
{
let
mut
base
=
super
::
vxworks_base
::
opts
();
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-m32"
.to_string
());
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"--secure-plt"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-m32"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"--secure-plt"
.to_string
());
base
.max_atomic_width
=
Some
(
32
);
Target
{
...
...
compiler/rustc_target/src/spec/powerpc_wrs_vxworks_spe.rs
浏览文件 @
049a49b9
...
...
@@ -3,8 +3,8 @@
pub
fn
target
()
->
Target
{
let
mut
base
=
super
::
vxworks_base
::
opts
();
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-mspe"
.to_string
());
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"--secure-plt"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-mspe"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"--secure-plt"
.to_string
());
base
.max_atomic_width
=
Some
(
32
);
Target
{
...
...
compiler/rustc_target/src/spec/sparc64_unknown_netbsd.rs
浏览文件 @
049a49b9
...
...
@@ -4,7 +4,7 @@
pub
fn
target
()
->
Target
{
let
mut
base
=
super
::
netbsd_base
::
opts
();
base
.cpu
=
"v9"
.to_string
();
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-m64"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-m64"
.to_string
());
base
.max_atomic_width
=
Some
(
64
);
Target
{
...
...
compiler/rustc_target/src/spec/sparc64_unknown_openbsd.rs
浏览文件 @
049a49b9
...
...
@@ -5,7 +5,7 @@ pub fn target() -> Target {
let
mut
base
=
super
::
openbsd_base
::
opts
();
base
.endian
=
Endian
::
Big
;
base
.cpu
=
"v9"
.to_string
();
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-m64"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-m64"
.to_string
());
base
.max_atomic_width
=
Some
(
64
);
Target
{
...
...
compiler/rustc_target/src/spec/sparc_unknown_linux_gnu.rs
浏览文件 @
049a49b9
...
...
@@ -6,7 +6,7 @@ pub fn target() -> Target {
base
.endian
=
Endian
::
Big
;
base
.cpu
=
"v9"
.to_string
();
base
.max_atomic_width
=
Some
(
64
);
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-mv8plus"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-mv8plus"
.to_string
());
Target
{
llvm_target
:
"sparc-unknown-linux-gnu"
.to_string
(),
...
...
compiler/rustc_target/src/spec/thumbv7a_pc_windows_msvc.rs
浏览文件 @
049a49b9
...
...
@@ -11,10 +11,10 @@ pub fn target() -> Target {
// where necessary, but this is not the observed behavior.
// Disabling the LBR optimization works around the issue.
let
pre_link_args_msvc
=
"/OPT:NOLBR"
.to_string
();
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Msvc
)
.unwrap
()
.push
(
pre_link_args_msvc
.clone
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Msvc
)
.or_default
()
.push
(
pre_link_args_msvc
.clone
());
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Lld
(
LldFlavor
::
Link
))
.
unwrap
()
.
entry
(
LinkerFlavor
::
Lld
(
LldFlavor
::
Link
))
.
or_default
()
.push
(
pre_link_args_msvc
);
// FIXME(jordanrh): use PanicStrategy::Unwind when SEH is
...
...
compiler/rustc_target/src/spec/thumbv7neon_linux_androideabi.rs
浏览文件 @
049a49b9
...
...
@@ -12,7 +12,7 @@ pub fn target() -> Target {
let
mut
base
=
super
::
android_base
::
opts
();
base
.features
=
"+v7,+thumb-mode,+thumb2,+vfp3,+neon"
.to_string
();
base
.max_atomic_width
=
Some
(
64
);
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-march=armv7-a"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-march=armv7-a"
.to_string
());
Target
{
llvm_target
:
"armv7-none-linux-android"
.to_string
(),
...
...
compiler/rustc_target/src/spec/uefi_msvc_base.rs
浏览文件 @
049a49b9
...
...
@@ -30,10 +30,10 @@ pub fn opts() -> TargetOptions {
// exit (default for applications).
"/subsystem:efi_application"
.to_string
(),
];
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Msvc
)
.unwrap
()
.extend
(
pre_link_args_msvc
.clone
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Msvc
)
.or_default
()
.extend
(
pre_link_args_msvc
.clone
());
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Lld
(
LldFlavor
::
Link
))
.
unwrap
()
.
entry
(
LinkerFlavor
::
Lld
(
LldFlavor
::
Link
))
.
or_default
()
.extend
(
pre_link_args_msvc
);
TargetOptions
{
...
...
compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs
浏览文件 @
049a49b9
...
...
@@ -4,7 +4,7 @@
pub
fn
target
()
->
Target
{
let
mut
options
=
wasm32_base
::
options
();
let
clang_args
=
options
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
();
let
clang_args
=
options
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
();
// Rust really needs a way for users to specify exports and imports in
// the source code. --export-dynamic isn't the right tool for this job,
...
...
compiler/rustc_target/src/spec/wasm32_unknown_unknown.rs
浏览文件 @
049a49b9
...
...
@@ -17,7 +17,7 @@ pub fn target() -> Target {
let
mut
options
=
wasm32_base
::
options
();
options
.os
=
"unknown"
.to_string
();
options
.linker_flavor
=
LinkerFlavor
::
Lld
(
LldFlavor
::
Wasm
);
let
clang_args
=
options
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
();
let
clang_args
=
options
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
();
// Make sure clang uses LLD as its linker and is configured appropriately
// otherwise
...
...
@@ -35,7 +35,7 @@ pub fn target() -> Target {
clang_args
.push
(
"-Wl,--export-dynamic"
.to_string
());
// Add the flags to wasm-ld's args too.
let
lld_args
=
options
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Lld
(
LldFlavor
::
Wasm
))
.unwrap
();
let
lld_args
=
options
.pre_link_args
.
entry
(
LinkerFlavor
::
Lld
(
LldFlavor
::
Wasm
))
.or_default
();
lld_args
.push
(
"--no-entry"
.to_string
());
lld_args
.push
(
"--export-dynamic"
.to_string
());
...
...
compiler/rustc_target/src/spec/windows_uwp_msvc_base.rs
浏览文件 @
049a49b9
...
...
@@ -5,10 +5,10 @@ pub fn opts() -> TargetOptions {
opts
.vendor
=
"uwp"
.to_string
();
let
pre_link_args_msvc
=
vec!
[
"/APPCONTAINER"
.to_string
(),
"mincore.lib"
.to_string
()];
opts
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Msvc
)
.unwrap
()
.extend
(
pre_link_args_msvc
.clone
());
opts
.pre_link_args
.
entry
(
LinkerFlavor
::
Msvc
)
.or_default
()
.extend
(
pre_link_args_msvc
.clone
());
opts
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Lld
(
LldFlavor
::
Link
))
.
unwrap
()
.
entry
(
LinkerFlavor
::
Lld
(
LldFlavor
::
Link
))
.
or_default
()
.extend
(
pre_link_args_msvc
);
opts
...
...
compiler/rustc_target/src/spec/x86_64_linux_android.rs
浏览文件 @
049a49b9
...
...
@@ -6,7 +6,7 @@ pub fn target() -> Target {
// https://developer.android.com/ndk/guides/abis.html#86-64
base
.features
=
"+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt"
.to_string
();
base
.max_atomic_width
=
Some
(
64
);
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-m64"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-m64"
.to_string
());
base
.stack_probes
=
StackProbeType
::
InlineOrCall
{
min_llvm_version_for_inline
:
(
11
,
0
,
1
)
};
Target
{
...
...
compiler/rustc_target/src/spec/x86_64_pc_windows_gnu.rs
浏览文件 @
049a49b9
...
...
@@ -3,7 +3,7 @@
pub
fn
target
()
->
Target
{
let
mut
base
=
super
::
windows_gnu_base
::
opts
();
base
.cpu
=
"x86-64"
.to_string
();
let
gcc_pre_link_args
=
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
();
let
gcc_pre_link_args
=
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
();
gcc_pre_link_args
.push
(
"-m64"
.to_string
());
// Use high-entropy 64 bit address space for ASLR
gcc_pre_link_args
.push
(
"-Wl,--high-entropy-va"
.to_string
());
...
...
compiler/rustc_target/src/spec/x86_64_unknown_dragonfly.rs
浏览文件 @
049a49b9
...
...
@@ -4,7 +4,7 @@ pub fn target() -> Target {
let
mut
base
=
super
::
dragonfly_base
::
opts
();
base
.cpu
=
"x86-64"
.to_string
();
base
.max_atomic_width
=
Some
(
64
);
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-m64"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-m64"
.to_string
());
base
.stack_probes
=
StackProbeType
::
InlineOrCall
{
min_llvm_version_for_inline
:
(
11
,
0
,
1
)
};
Target
{
...
...
compiler/rustc_target/src/spec/x86_64_unknown_freebsd.rs
浏览文件 @
049a49b9
...
...
@@ -4,7 +4,7 @@ pub fn target() -> Target {
let
mut
base
=
super
::
freebsd_base
::
opts
();
base
.cpu
=
"x86-64"
.to_string
();
base
.max_atomic_width
=
Some
(
64
);
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-m64"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-m64"
.to_string
());
base
.stack_probes
=
StackProbeType
::
InlineOrCall
{
min_llvm_version_for_inline
:
(
11
,
0
,
1
)
};
Target
{
...
...
compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs
浏览文件 @
049a49b9
...
...
@@ -4,7 +4,7 @@ pub fn target() -> Target {
let
mut
base
=
super
::
linux_gnu_base
::
opts
();
base
.cpu
=
"x86-64"
.to_string
();
base
.max_atomic_width
=
Some
(
64
);
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-m64"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-m64"
.to_string
());
base
.stack_probes
=
StackProbeType
::
InlineOrCall
{
min_llvm_version_for_inline
:
(
11
,
0
,
1
)
};
Target
{
...
...
compiler/rustc_target/src/spec/x86_64_unknown_linux_gnux32.rs
浏览文件 @
049a49b9
...
...
@@ -4,7 +4,7 @@ pub fn target() -> Target {
let
mut
base
=
super
::
linux_gnu_base
::
opts
();
base
.cpu
=
"x86-64"
.to_string
();
base
.max_atomic_width
=
Some
(
64
);
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-mx32"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-mx32"
.to_string
());
base
.stack_probes
=
StackProbeType
::
InlineOrCall
{
min_llvm_version_for_inline
:
(
11
,
0
,
1
)
};
base
.has_elf_tls
=
false
;
// BUG(GabrielMajeri): disabling the PLT on x86_64 Linux with x32 ABI
...
...
compiler/rustc_target/src/spec/x86_64_unknown_linux_musl.rs
浏览文件 @
049a49b9
...
...
@@ -4,7 +4,7 @@ pub fn target() -> Target {
let
mut
base
=
super
::
linux_musl_base
::
opts
();
base
.cpu
=
"x86-64"
.to_string
();
base
.max_atomic_width
=
Some
(
64
);
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-m64"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-m64"
.to_string
());
base
.stack_probes
=
StackProbeType
::
InlineOrCall
{
min_llvm_version_for_inline
:
(
11
,
0
,
1
)
};
base
.static_position_independent_executables
=
true
;
...
...
compiler/rustc_target/src/spec/x86_64_unknown_netbsd.rs
浏览文件 @
049a49b9
...
...
@@ -4,7 +4,7 @@ pub fn target() -> Target {
let
mut
base
=
super
::
netbsd_base
::
opts
();
base
.cpu
=
"x86-64"
.to_string
();
base
.max_atomic_width
=
Some
(
64
);
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-m64"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-m64"
.to_string
());
base
.stack_probes
=
StackProbeType
::
InlineOrCall
{
min_llvm_version_for_inline
:
(
11
,
0
,
1
)
};
Target
{
...
...
compiler/rustc_target/src/spec/x86_64_unknown_none_linuxkernel.rs
浏览文件 @
049a49b9
...
...
@@ -11,7 +11,7 @@ pub fn target() -> Target {
"-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-3dnow,-3dnowa,-avx,-avx2,+soft-float"
.to_string
();
base
.code_model
=
Some
(
CodeModel
::
Kernel
);
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-m64"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-m64"
.to_string
());
Target
{
// FIXME: Some dispute, the linux-on-clang folks think this should use
...
...
compiler/rustc_target/src/spec/x86_64_unknown_openbsd.rs
浏览文件 @
049a49b9
...
...
@@ -4,7 +4,7 @@ pub fn target() -> Target {
let
mut
base
=
super
::
openbsd_base
::
opts
();
base
.cpu
=
"x86-64"
.to_string
();
base
.max_atomic_width
=
Some
(
64
);
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-m64"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-m64"
.to_string
());
base
.stack_probes
=
StackProbeType
::
InlineOrCall
{
min_llvm_version_for_inline
:
(
11
,
0
,
1
)
};
Target
{
...
...
compiler/rustc_target/src/spec/x86_64_unknown_redox.rs
浏览文件 @
049a49b9
...
...
@@ -4,7 +4,7 @@ pub fn target() -> Target {
let
mut
base
=
super
::
redox_base
::
opts
();
base
.cpu
=
"x86-64"
.to_string
();
base
.max_atomic_width
=
Some
(
64
);
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-m64"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-m64"
.to_string
());
base
.stack_probes
=
StackProbeType
::
InlineOrCall
{
min_llvm_version_for_inline
:
(
11
,
0
,
1
)
};
Target
{
...
...
compiler/rustc_target/src/spec/x86_64_uwp_windows_gnu.rs
浏览文件 @
049a49b9
...
...
@@ -3,7 +3,7 @@
pub
fn
target
()
->
Target
{
let
mut
base
=
super
::
windows_uwp_gnu_base
::
opts
();
base
.cpu
=
"x86-64"
.to_string
();
let
gcc_pre_link_args
=
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
();
let
gcc_pre_link_args
=
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
();
gcc_pre_link_args
.push
(
"-m64"
.to_string
());
// Use high-entropy 64 bit address space for ASLR
gcc_pre_link_args
.push
(
"-Wl,--high-entropy-va"
.to_string
());
...
...
compiler/rustc_target/src/spec/x86_64_wrs_vxworks.rs
浏览文件 @
049a49b9
...
...
@@ -4,7 +4,7 @@ pub fn target() -> Target {
let
mut
base
=
super
::
vxworks_base
::
opts
();
base
.cpu
=
"x86-64"
.to_string
();
base
.max_atomic_width
=
Some
(
64
);
base
.pre_link_args
.
get_mut
(
&
LinkerFlavor
::
Gcc
)
.unwrap
()
.push
(
"-m64"
.to_string
());
base
.pre_link_args
.
entry
(
LinkerFlavor
::
Gcc
)
.or_default
()
.push
(
"-m64"
.to_string
());
base
.stack_probes
=
StackProbeType
::
InlineOrCall
{
min_llvm_version_for_inline
:
(
11
,
0
,
1
)
};
base
.disable_redzone
=
true
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录