Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
832f7b75
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
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,发现更多精彩内容 >>
提交
832f7b75
编写于
5月 02, 2013
作者:
L
Luqman Aden
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
librustc: Add argument to allow choosing "linker"
上级
9a31cdb9
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
24 addition
and
12 deletion
+24
-12
src/librustc/back/link.rs
src/librustc/back/link.rs
+18
-10
src/librustc/driver/driver.rs
src/librustc/driver/driver.rs
+3
-1
src/librustc/driver/session.rs
src/librustc/driver/session.rs
+3
-1
未找到文件。
src/librustc/back/link.rs
浏览文件 @
832f7b75
...
...
@@ -752,18 +752,26 @@ pub fn link_binary(sess: Session,
// instead of hard-coded gcc.
// For win32, there is no cc command,
// so we add a condition to make it use gcc.
let
cc_prog
:
~
str
=
if
sess
.targ_cfg.os
==
session
::
os_android
{
match
&
sess
.opts.android_cross_path
{
&
Some
(
copy
path
)
=>
{
fmt!
(
"%s/bin/arm-linux-androideabi-gcc"
,
path
)
}
&
None
=>
{
sess
.fatal
(
~
"need Android NDK path for linking
\
(--android-cross-path)"
)
let
cc_prog
:
~
str
=
match
sess
.opts.linker
{
Some
(
copy
linker
)
=>
linker
,
None
=>
{
if
sess
.targ_cfg.os
==
session
::
os_android
{
match
&
sess
.opts.android_cross_path
{
&
Some
(
copy
path
)
=>
{
fmt!
(
"%s/bin/arm-linux-androideabi-gcc"
,
path
)
}
&
None
=>
{
sess
.fatal
(
~
"need Android NDK path for linking
\
(--android-cross-path)"
)
}
}
}
else
if
sess
.targ_cfg.os
==
session
::
os_win32
{
~
"gcc"
}
else
{
~
"cc"
}
}
}
else
if
sess
.targ_cfg.os
==
session
::
os_win32
{
~
"gcc"
}
else
{
~
"cc"
};
};
// The invocations of cc share some flags across platforms
...
...
src/librustc/driver/driver.rs
浏览文件 @
832f7b75
...
...
@@ -650,7 +650,7 @@ pub fn build_session_options(binary: @~str,
};
let
addl_lib_search_paths
=
getopts
::
opt_strs
(
matches
,
~
"L"
)
.map
(|
s
|
Path
(
*
s
));
let
linker
=
getopts
::
opt_maybe_str
(
matches
,
~
"linker"
);
let
linker_args
=
getopts
::
opt_strs
(
matches
,
~
"link-args"
)
.flat_map
(
|
a
|
{
let
mut
args
=
~
[];
for
str
::
each_split_char
(
*
a
,
' '
)
|
arg
|
{
...
...
@@ -676,6 +676,7 @@ pub fn build_session_options(binary: @~str,
jit
:
jit
,
output_type
:
output_type
,
addl_lib_search_paths
:
addl_lib_search_paths
,
linker
:
linker
,
linker_args
:
linker_args
,
maybe_sysroot
:
sysroot_opt
,
target_triple
:
target
,
...
...
@@ -760,6 +761,7 @@ pub fn optgroups() -> ~[getopts::groups::OptGroup] {
optmulti
(
"L"
,
""
,
"Add a directory to the library search path"
,
"PATH"
),
optflag
(
""
,
"lib"
,
"Compile a library crate"
),
optopt
(
""
,
"linker"
,
"Program to use for linking instead of the default."
,
"LINKER"
),
optmulti
(
""
,
"link-args"
,
"FLAGS is a space-separated list of flags
passed to the linker"
,
"FLAGS"
),
optflag
(
""
,
"ls"
,
"List the symbols defined by a library crate"
),
...
...
src/librustc/driver/session.rs
浏览文件 @
832f7b75
...
...
@@ -124,6 +124,7 @@ pub struct options {
jit
:
bool
,
output_type
:
back
::
link
::
output_type
,
addl_lib_search_paths
:
~
[
Path
],
linker
:
Option
<~
str
>
,
linker_args
:
~
[
~
str
],
maybe_sysroot
:
Option
<
Path
>
,
target_triple
:
~
str
,
...
...
@@ -302,7 +303,8 @@ pub fn basic_options() -> @options {
jit
:
false
,
output_type
:
link
::
output_type_exe
,
addl_lib_search_paths
:
~
[],
linker_args
:
~
[],
linker
:
None
,
linker_args
:
~
[],
maybe_sysroot
:
None
,
target_triple
:
host_triple
(),
target_feature
:
~
""
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录