Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
15e34deb
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,发现更多精彩内容 >>
提交
15e34deb
编写于
9月 28, 2011
作者:
B
Brian Anderson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Eliminate glue.o. Closes #990
上级
e1ba559c
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
25 addition
and
79 deletion
+25
-79
Makefile.in
Makefile.in
+0
-2
mk/clean.mk
mk/clean.mk
+4
-4
mk/snap.mk
mk/snap.mk
+3
-3
mk/stageN.mk
mk/stageN.mk
+4
-21
src/comp/back/link.rs
src/comp/back/link.rs
+1
-2
src/comp/driver/rustc.rs
src/comp/driver/rustc.rs
+1
-11
src/comp/middle/trans.rs
src/comp/middle/trans.rs
+0
-31
src/comp/middle/trans_common.rs
src/comp/middle/trans_common.rs
+0
-3
src/etc/get-snapshot.py
src/etc/get-snapshot.py
+1
-1
src/etc/snapshot.py
src/etc/snapshot.py
+11
-1
未找到文件。
Makefile.in
浏览文件 @
15e34deb
...
...
@@ -172,7 +172,6 @@ SREQ$(1) = stage$(1)/rustc$(X) \
stage
$(1)
/
$
$(CFG_RUNTIME)
\
$
$(
call
CFG_STDLIB_DEFAULT,stage
$(1)
,stage
$(1)
)
\
stage
$(1)
/
$
$(CFG_RUSTLLVM)
\
stage
$(1)
/lib/glue.o
\
stage
$(1)
/lib/main.o
\
stage
$(1)
/lib/
$
$(CFG_RUNTIME)
\
$
$(MKFILES)
...
...
@@ -181,7 +180,6 @@ SREQ$(1) = stage$(1)/rustc$(X) \
stage
$(1)
/
$
$(CFG_RUNTIME)
\
$
$(
call
CFG_STDLIB_DEFAULT,stage
$(1)
,stage
$(1)
)
\
stage
$(1)
/
$
$(CFG_RUSTLLVM)
\
stage
$(1)
/lib/glue.o
\
stage
$(1)
/lib/main.o
\
stage
$(1)
/lib/
$
$(CFG_RUNTIME)
\
stage
$(1)
/lib/
$
$(CFG_STDLIB)
\
...
...
mk/clean.mk
浏览文件 @
15e34deb
...
...
@@ -13,22 +13,22 @@ clean:
$(Q)
rm
-f
$(C_DEPFILES:%.d=%.d.tmp)
$(Q)
rm
-f
$(CRATE_DEPFILES:%.d=%.d.tmp)
$(Q)
rm
-f
$(GENERATED)
$(Q)
rm
-f
stage0/rustc
$(X)
stage0/lib/
glue
*
stage0/lib/
main.o
$(Q)
rm
-f
stage0/rustc
$(X)
stage0/lib/main.o
$(Q)
rm
-f
stage0/lib/
$(CFG_RUNTIME)
stage0/lib/
$(CFG_STDLIB)
$(Q)
rm
-f
stage0/
$(CFG_RUNTIME)
stage0/
$(CFG_STDLIB)
$(Q)
rm
-f
stage0/lib/libstd.rlib
$(Q)
rm
-f
stage0/
$(CFG_RUSTLLVM)
stage0/lib/intrinsics.bc
$(Q)
rm
-f
stage1/rustc
$(X)
stage1/lib/
glue
*
stage1/lib/
main.o
$(Q)
rm
-f
stage1/rustc
$(X)
stage1/lib/main.o
$(Q)
rm
-f
stage1/lib/
$(CFG_RUNTIME)
stage1/lib/
$(CFG_STDLIB)
$(Q)
rm
-f
stage1/
$(CFG_RUNTIME)
stage1/
$(CFG_STDLIB)
$(Q)
rm
-f
stage1/
$(CFG_RUSTLLVM)
stage1/lib/intrinsics.bc
$(Q)
rm
-f
stage1/lib/libstd.rlib
$(Q)
rm
-f
stage2/rustc
$(X)
stage2/lib/
glue
*
stage2/lib/
main.o
$(Q)
rm
-f
stage2/rustc
$(X)
stage2/lib/main.o
$(Q)
rm
-f
stage2/lib/
$(CFG_RUNTIME)
stage2/lib/
$(CFG_STDLIB)
$(Q)
rm
-f
stage2/
$(CFG_RUNTIME)
stage2/
$(CFG_STDLIB)
$(Q)
rm
-f
stage2/
$(CFG_RUSTLLVM)
stage2/lib/intrinsics.bc
$(Q)
rm
-f
stage2/lib/libstd.rlib
$(Q)
rm
-f
stage3/rustc
$(X)
stage3/lib/
glue
*
stage3/lib/
main.o
$(Q)
rm
-f
stage3/rustc
$(X)
stage3/lib/main.o
$(Q)
rm
-f
stage3/lib/
$(CFG_RUNTIME)
stage3/lib/
$(CFG_STDLIB)
$(Q)
rm
-f
stage3/
$(CFG_RUNTIME)
stage3/
$(CFG_STDLIB)
$(Q)
rm
-f
stage3/
$(CFG_RUSTLLVM)
stage3/lib/intrinsics.bc
...
...
mk/snap.mk
浏览文件 @
15e34deb
snap-stage1
:
stage1/rustc$(X) stage1/lib/
glue.o stage1/lib/
$(CFG_RUNTIME)
\
snap-stage1
:
stage1/rustc$(X) stage1/lib/$(CFG_RUNTIME)
\
stage1/$(CFG_RUSTLLVM) stage1/lib/main.o
$(S)
src/etc/make-snapshot.py stage1
snap-stage2
:
stage2/rustc$(X) stage2/lib/
glue.o stage2/lib/
$(CFG_STDLIB)
\
snap-stage2
:
stage2/rustc$(X) stage2/lib/$(CFG_STDLIB)
\
stage2/lib/libstd.rlib stage2/lib/$(CFG_RUNTIME)
\
stage2/$(CFG_RUSTLLVM) stage2/lib/main.o
$(S)
src/etc/make-snapshot.py stage2
snap-stage3
:
stage3/rustc$(X) stage3/lib/
glue.o stage3/lib/
$(CFG_STDLIB)
\
snap-stage3
:
stage3/rustc$(X) stage3/lib/$(CFG_STDLIB)
\
stage3/lib/libstd.rlib stage3/lib/$(CFG_RUNTIME)
\
stage3/$(CFG_RUSTLLVM) stage3/lib/main.o
$(S)
src/etc/make-snapshot.py stage3
...
...
mk/stageN.mk
浏览文件 @
15e34deb
...
...
@@ -63,14 +63,6 @@ stage$(2)/lib/intrinsics.bc: $$(INTRINSICS_BC)
@
$
$(
call
E,
cp
:
$$
@
)
$
$(Q)
cp
$$
<
$$
@
stage$(2)/lib/glue.o
:
stage$(2)/rustc$$(X)
\
stage$(2)/$$(CFG_RUNTIME)
\
stage$(2)/$$(CFG_RUSTLLVM)
\
stage$(2)/lib/intrinsics.bc
\
$$(SREQ$(1))
@
$
$(
call
E, generate:
$$
@
)
$$
(
STAGE
$(2)
)
-c
-o
$$
@
--glue
stage$(2)/lib/main.o
:
rt/main.o
@
$
$(
call
E,
cp
:
$$
@
)
$
$(Q)
cp
$$
<
$$
@
...
...
@@ -84,7 +76,7 @@ stage$(2)/lib/$$(CFG_STDLIB): $$(STDLIB_CRATE) $$(STDLIB_INPUTS) \
stage$(2)/rustc$$(X)
\
stage$(2)/$$(CFG_RUNTIME)
\
stage$(2)/$$(CFG_RUSTLLVM)
\
stage$(2)/lib/
glue.o
\
stage$(2)/lib/
intrinsics.bc
\
$$(SREQ$(1))
@
$
$(
call
E, compile_and_link:
$$
@
)
$$
(
STAGE
$(2)
)
--lib
-o
$$
@
$$
<
...
...
@@ -93,7 +85,7 @@ stage$(2)/lib/libstd.rlib: $$(STDLIB_CRATE) $$(STDLIB_INPUTS) \
stage$(2)/rustc$$(X)
\
stage$(2)/$$(CFG_RUNTIME)
\
stage$(2)/$$(CFG_RUSTLLVM)
\
stage$(2)/lib/
glue.o
\
stage$(2)/lib/
intrinsics.bc
\
$$(SREQ$(1))
@
$
$(
call
E, compile_and_link:
$$
@
)
$$
(
STAGE
$(2)
)
--lib
--static
-o
$$
@
$$
<
...
...
@@ -111,15 +103,6 @@ stage$(2)/lib/rustc/$(3)/intrinsics.bc: $$(INTRINSICS_BC)
@
$
$(
call
E,
cp
:
$$
@
)
$
$(Q)
cp
$$
<
$$
@
stage$(2)/lib/rustc/$(3)/glue.o
:
\
stage$(2)/rustc$$(X)
\
stage$(2)/$$(CFG_RUNTIME)
\
stage$(2)/$$(CFG_RUSTLLVM)
\
stage$(2)/lib/intrinsics.bc
\
$$(SREQ$(1))
@
$
$(
call
E, generate:
$$
@
)
$$
(
STAGE
$(2)
)
-c
-o
$$
@
--glue
stage$(2)/lib/rustc/$(3)/main.o
:
rt/main.o
@
$
$(
call
E,
cp
:
$$
@
)
$
$(Q)
cp
$$
<
$$
@
...
...
@@ -135,7 +118,7 @@ stage$(2)/lib/rustc/$(3)/$$(CFG_STDLIB): \
stage$(2)/rustc$$(X)
\
stage$(2)/$$(CFG_RUNTIME)
\
stage$(2)/$$(CFG_RUSTLLVM)
\
stage$(2)/lib/
rustc/$(3)/glue.o
\
stage$(2)/lib/
intrinsics.bc
\
$$(SREQ$(1))
@
$
$(
call
E, compile_and_link:
$$
@
)
$$
(
STAGE
$(2)
)
--lib
-o
$$
@
$$
<
...
...
@@ -145,7 +128,7 @@ stage$(2)/lib/rustc/$(3)/libstd.rlib: \
stage$(2)/rustc$$(X)
\
stage$(2)/$$(CFG_RUNTIME)
\
stage$(2)/$$(CFG_RUSTLLVM)
\
stage$(2)/lib/
rustc/$(3)/glue.o
\
stage$(2)/lib/
intrinsics.bc
\
$$(SREQ$(1))
@
$
$(
call
E, compile_and_link:
$$
@
)
$$
(
STAGE
$(2)
)
--lib
--static
-o
$$
@
$$
<
...
...
src/comp/back/link.rs
浏览文件 @
15e34deb
...
...
@@ -497,14 +497,13 @@ fn mangle_internal_name_by_seq(ccx: @crate_ctxt, flav: str) -> str {
fn
link_binary
(
sess
:
session
::
session
,
binary_dir
:
str
,
saved_out_filename
:
str
)
{
let
glu
:
str
=
binary_dir
+
"/lib/glue.o"
;
let
main
:
str
=
binary_dir
+
"/lib/main.o"
;
let
stage
:
str
=
"-L"
+
binary_dir
+
"/lib"
;
let
prog
:
str
=
"gcc"
;
// The invocations of gcc share some flags across platforms
let
gcc_args
=
[
stage
,
"-Lrt"
,
"-lrustrt"
,
glu
,
"-m32"
,
"-o"
,
saved_out_filename
,
[
stage
,
"-Lrt"
,
"-lrustrt"
,
"-m32"
,
"-o"
,
saved_out_filename
,
saved_out_filename
+
".o"
];
let
lib_cmd
;
...
...
src/comp/driver/rustc.rs
浏览文件 @
15e34deb
...
...
@@ -238,7 +238,6 @@ fn usage(argv0: str) {
-v --version print version info and exit
-o <filename> write output to <filename>
--glue generate glue.bc file
--lib compile a library crate
--static use or produce static libraries
--pretty [type] pretty-print the input instead of compiling
...
...
@@ -424,7 +423,7 @@ fn parse_pretty(sess: session::session, name: str) -> pp_mode {
fn
opts
()
->
[
getopts
::
opt
]
{
ret
[
optflag
(
"h"
),
optflag
(
"help"
),
optflag
(
"v"
),
optflag
(
"version"
),
optflag
(
"
glue"
),
optflag
(
"
emit-llvm"
),
optflagopt
(
"pretty"
),
optflag
(
"emit-llvm"
),
optflagopt
(
"pretty"
),
optflag
(
"ls"
),
optflag
(
"parse-only"
),
optflag
(
"no-trans"
),
optflag
(
"O"
),
optopt
(
"OptLevel"
),
optmulti
(
"L"
),
optflag
(
"S"
),
optflag
(
"c"
),
optopt
(
"o"
),
optflag
(
"g"
),
optflag
(
"save-temps"
),
...
...
@@ -458,15 +457,6 @@ fn main(args: [str]) {
let
sess
=
build_session
(
sopts
);
let
n_inputs
=
vec
::
len
::
<
str
>
(
match
.free
);
let
output_file
=
getopts
::
opt_maybe_str
(
match
,
"o"
);
let
glue
=
opt_present
(
match
,
"glue"
);
if
glue
{
if
n_inputs
>
0u
{
sess
.fatal
(
"No input files allowed with --glue."
);
}
let
out
=
option
::
from_maybe
::
<
str
>
(
"glue.bc"
,
output_file
);
middle
::
trans
::
make_common_glue
(
sess
,
out
);
ret
;
}
if
n_inputs
==
0u
{
sess
.fatal
(
"No input filename given."
);
}
else
if
n_inputs
>
1u
{
...
...
src/comp/middle/trans.rs
浏览文件 @
15e34deb
...
...
@@ -6044,35 +6044,6 @@ fn decl_no_op_type_glue(llmod: ModuleRef, taskptr_type: TypeRef) -> ValueRef {
ret
decl_cdecl_fn
(
llmod
,
abi
::
no_op_type_glue_name
(),
ty
);
}
fn
make_glues
(
llmod
:
ModuleRef
,
taskptr_type
:
TypeRef
)
->
@
glue_fns
{
ret
@
{
no_op_type_glue
:
decl_no_op_type_glue
(
llmod
,
taskptr_type
)};
}
fn
make_common_glue
(
sess
:
session
::
session
,
output
:
str
)
{
// FIXME: part of this is repetitive and is probably a good idea
// to autogen it.
let
task_type
=
T_task
();
let
taskptr_type
=
T_ptr
(
task_type
);
let
llmod
=
str
::
as_buf
(
"rust_out"
,
{|
buf
|
llvm
::
LLVMModuleCreateWithNameInContext
(
buf
,
llvm
::
LLVMGetGlobalContext
())
});
let
_
:
()
=
str
::
as_buf
(
x86
::
get_data_layout
(),
{|
buf
|
llvm
::
LLVMSetDataLayout
(
llmod
,
buf
)
});
let
_
:
()
=
str
::
as_buf
(
x86
::
get_target_triple
(),
{|
buf
|
llvm
::
LLVMSetTarget
(
llmod
,
buf
)
});
mk_target_data
(
x86
::
get_data_layout
());
declare_intrinsics
(
llmod
);
let
_
:
()
=
str
::
as_buf
(
x86
::
get_module_asm
(),
{|
buf
|
llvm
::
LLVMSetModuleInlineAsm
(
llmod
,
buf
)
});
make_glues
(
llmod
,
taskptr_type
);
link
::
write
::
run_passes
(
sess
,
llmod
,
output
);
}
fn
create_module_map
(
ccx
:
@
crate_ctxt
)
->
ValueRef
{
let
elttype
=
T_struct
([
T_int
(),
T_int
()]);
let
maptype
=
T_array
(
elttype
,
ccx
.module_data
.size
()
+
1u
);
...
...
@@ -6183,7 +6154,6 @@ fn trans_crate(sess: session::session, crate: @ast::crate, tcx: ty::ctxt,
tn
.associate
(
"taskptr"
,
taskptr_type
);
let
tydesc_type
=
T_tydesc
(
taskptr_type
);
tn
.associate
(
"tydesc"
,
tydesc_type
);
let
glues
=
make_glues
(
llmod
,
taskptr_type
);
let
hasher
=
ty
::
hash_ty
;
let
eqer
=
ty
::
eq_ty
;
let
tag_sizes
=
map
::
mk_hashmap
::
<
ty
::
t
,
uint
>
(
hasher
,
eqer
);
...
...
@@ -6212,7 +6182,6 @@ fn trans_crate(sess: session::session, crate: @ast::crate, tcx: ty::ctxt,
tydescs
:
tydescs
,
module_data
:
new_str_hash
::
<
ValueRef
>
(),
lltypes
:
lltypes
,
glues
:
glues
,
names
:
namegen
(
0
),
sha
:
sha
,
type_sha1s
:
sha1s
,
...
...
src/comp/middle/trans_common.rs
浏览文件 @
15e34deb
...
...
@@ -41,8 +41,6 @@
type
derived_tydesc_info
=
{
lltydesc
:
ValueRef
,
escapes
:
bool
};
type
glue_fns
=
{
no_op_type_glue
:
ValueRef
};
tag
tydesc_kind
{
tk_static
;
// Static (monomorphic) type descriptor.
tk_param
;
// Type parameter.
...
...
@@ -111,7 +109,6 @@
tydescs
:
hashmap
<
ty
::
t
,
@
tydesc_info
>
,
module_data
:
hashmap
<
str
,
ValueRef
>
,
lltypes
:
hashmap
<
ty
::
t
,
TypeRef
>
,
glues
:
@
glue_fns
,
names
:
namegen
,
sha
:
std
::
sha1
::
sha1
,
type_sha1s
:
hashmap
<
ty
::
t
,
str
>
,
...
...
src/etc/get-snapshot.py
浏览文件 @
15e34deb
...
...
@@ -9,7 +9,7 @@ def unpack_snapshot(snap):
print
(
"opening snapshot "
+
dl_path
)
tar
=
tarfile
.
open
(
dl_path
)
kernel
=
get_kernel
()
for
name
in
snapshot_files
[
kernel
]:
for
name
in
old_
snapshot_files
[
kernel
]:
p
=
"rust-stage0/"
+
name
fp
=
os
.
path
.
join
(
"stage0"
,
name
)
print
(
"extracting "
+
fp
)
...
...
src/etc/snapshot.py
浏览文件 @
15e34deb
...
...
@@ -15,7 +15,8 @@ download_url_base = "http://dl.rust-lang.org/stage0-snapshots"
download_dir_base
=
"dl"
download_unpack_base
=
os
.
path
.
join
(
download_dir_base
,
"unpack"
)
snapshot_files
=
{
# FIXME: Transitional
old_snapshot_files
=
{
"linux"
:
[
"rustc"
,
"lib/glue.o"
,
"lib/libstd.so"
,
"lib/main.o"
,
"librustrt.so"
,
"librustllvm.so"
,
"lib/intrinsics.bc"
],
"macos"
:
[
"rustc"
,
"lib/glue.o"
,
"lib/libstd.dylib"
,
"lib/main.o"
,
...
...
@@ -24,6 +25,15 @@ snapshot_files = {
"rustrt.dll"
,
"rustllvm.dll"
,
"lib/intrinsics.bc"
]
}
snapshot_files
=
{
"linux"
:
[
"rustc"
,
"lib/libstd.so"
,
"lib/main.o"
,
"librustrt.so"
,
"librustllvm.so"
,
"lib/intrinsics.bc"
],
"macos"
:
[
"rustc"
,
"lib/libstd.dylib"
,
"lib/main.o"
,
"librustrt.dylib"
,
"librustllvm.dylib"
,
"lib/intrinsics.bc"
],
"winnt"
:
[
"rustc.exe"
,
"lib/std.dll"
,
"lib/main.o"
,
"rustrt.dll"
,
"rustllvm.dll"
,
"lib/intrinsics.bc"
]
}
def
parse_line
(
n
,
line
):
global
snapshotfile
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录