Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
c95f5e31
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,发现更多精彩内容 >>
提交
c95f5e31
编写于
4月 29, 2019
作者:
M
Michael Woerister
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bootstrap: Don't add LLVM's bin directory to the PATH for tool invocations.
上级
29cf3f54
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
11 addition
and
62 deletion
+11
-62
src/bootstrap/tool.rs
src/bootstrap/tool.rs
+0
-51
src/test/run-make-fulldeps/cross-lang-lto-clang/Makefile
src/test/run-make-fulldeps/cross-lang-lto-clang/Makefile
+6
-6
src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile
.../run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile
+2
-2
src/test/run-make-fulldeps/cross-lang-lto/Makefile
src/test/run-make-fulldeps/cross-lang-lto/Makefile
+2
-2
src/test/run-make-fulldeps/pgo-use/Makefile
src/test/run-make-fulldeps/pgo-use/Makefile
+1
-1
未找到文件。
src/bootstrap/tool.rs
浏览文件 @
c95f5e31
...
@@ -9,7 +9,6 @@
...
@@ -9,7 +9,6 @@
use
crate
::
builder
::{
Step
,
RunConfig
,
ShouldRun
,
Builder
};
use
crate
::
builder
::{
Step
,
RunConfig
,
ShouldRun
,
Builder
};
use
crate
::
util
::{
exe
,
add_lib_path
};
use
crate
::
util
::{
exe
,
add_lib_path
};
use
crate
::
compile
;
use
crate
::
compile
;
use
crate
::
native
;
use
crate
::
channel
::
GitInfo
;
use
crate
::
channel
::
GitInfo
;
use
crate
::
channel
;
use
crate
::
channel
;
use
crate
::
cache
::
Interned
;
use
crate
::
cache
::
Interned
;
...
@@ -698,56 +697,6 @@ fn prepare_tool_cmd(&self, compiler: Compiler, tool: Tool, cmd: &mut Command) {
...
@@ -698,56 +697,6 @@ fn prepare_tool_cmd(&self, compiler: Compiler, tool: Tool, cmd: &mut Command) {
}
}
}
}
// Add the llvm/bin directory to PATH since it contains lots of
// useful, platform-independent tools
if
tool
.uses_llvm_tools
()
&&
!
self
.config.dry_run
{
let
mut
additional_paths
=
vec!
[];
if
let
Some
(
llvm_bin_path
)
=
self
.llvm_bin_path
()
{
additional_paths
.push
(
llvm_bin_path
);
}
// If LLD is available, add that too.
if
self
.config.lld_enabled
{
let
lld_install_root
=
self
.ensure
(
native
::
Lld
{
target
:
self
.config.build
,
});
let
lld_bin_path
=
lld_install_root
.join
(
"bin"
);
additional_paths
.push
(
lld_bin_path
);
}
if
host
.contains
(
"windows"
)
{
// On Windows, PATH and the dynamic library path are the same,
// so we just add the LLVM bin path to lib_path
lib_paths
.extend
(
additional_paths
);
}
else
{
let
old_path
=
env
::
var_os
(
"PATH"
)
.unwrap_or_default
();
let
new_path
=
env
::
join_paths
(
additional_paths
.into_iter
()
.chain
(
env
::
split_paths
(
&
old_path
)))
.expect
(
"Could not add LLVM bin path to PATH"
);
cmd
.env
(
"PATH"
,
new_path
);
}
}
add_lib_path
(
lib_paths
,
cmd
);
add_lib_path
(
lib_paths
,
cmd
);
}
}
fn
llvm_bin_path
(
&
self
)
->
Option
<
PathBuf
>
{
if
self
.config
.llvm_enabled
()
{
let
llvm_config
=
self
.ensure
(
native
::
Llvm
{
target
:
self
.config.build
,
emscripten
:
false
,
});
// Add the llvm/bin directory to PATH since it contains lots of
// useful, platform-independent tools
let
llvm_bin_path
=
llvm_config
.parent
()
.expect
(
"Expected llvm-config to be contained in directory"
);
assert
!
(
llvm_bin_path
.is_dir
());
Some
(
llvm_bin_path
.to_path_buf
())
}
else
{
None
}
}
}
}
src/test/run-make-fulldeps/cross-lang-lto-clang/Makefile
浏览文件 @
c95f5e31
...
@@ -9,17 +9,17 @@ all: cpp-executable rust-executable
...
@@ -9,17 +9,17 @@ all: cpp-executable rust-executable
cpp-executable
:
cpp-executable
:
$(RUSTC)
-Clinker-plugin-lto
=
on
-o
$(TMPDIR)
/librustlib-xlto.a
-Copt-level
=
2
-Ccodegen-units
=
1 ./rustlib.rs
$(RUSTC)
-Clinker-plugin-lto
=
on
-o
$(TMPDIR)
/librustlib-xlto.a
-Copt-level
=
2
-Ccodegen-units
=
1 ./rustlib.rs
$(
LD_LIB_PATH_ENVVAR)
=
$(REAL_LD_LIBRARY_PATH)
$(
CLANG)
-flto
=
thin
-fuse-ld
=
lld
-L
$(TMPDIR)
-lrustlib-xlto
-o
$(TMPDIR)
/cmain ./cmain.c
-O3
$(CLANG)
-flto
=
thin
-fuse-ld
=
lld
-L
$(TMPDIR)
-lrustlib-xlto
-o
$(TMPDIR)
/cmain ./cmain.c
-O3
# Make sure we don't find a call instruction to the function we expect to
# Make sure we don't find a call instruction to the function we expect to
# always be inlined.
# always be inlined.
$(LD_LIB_PATH_ENVVAR)
=
$(REAL_LD_LIBRARY_PATH)
llvm-objdump
-d
$(TMPDIR)
/cmain |
$(CGREP)
-v
-e
"call.*rust_always_inlined"
"
$(LLVM_BIN_DIR)
"
/
llvm-objdump
-d
$(TMPDIR)
/cmain |
$(CGREP)
-v
-e
"call.*rust_always_inlined"
# As a sanity check, make sure we do find a call instruction to a
# As a sanity check, make sure we do find a call instruction to a
# non-inlined function
# non-inlined function
$(LD_LIB_PATH_ENVVAR)
=
$(REAL_LD_LIBRARY_PATH)
llvm-objdump
-d
$(TMPDIR)
/cmain |
$(CGREP)
-e
"call.*rust_never_inlined"
"
$(LLVM_BIN_DIR)
"
/
llvm-objdump
-d
$(TMPDIR)
/cmain |
$(CGREP)
-e
"call.*rust_never_inlined"
rust-executable
:
rust-executable
:
$(
LD_LIB_PATH_ENVVAR)
=
$(REAL_LD_LIBRARY_PATH)
$(
CLANG)
./clib.c
-flto
=
thin
-c
-o
$(TMPDIR)
/clib.o
-O2
$(CLANG)
./clib.c
-flto
=
thin
-c
-o
$(TMPDIR)
/clib.o
-O2
(
cd
$(TMPDIR)
;
$(AR)
crus ./libxyz.a ./clib.o
)
(
cd
$(TMPDIR)
;
$(AR)
crus ./libxyz.a ./clib.o
)
$(RUSTC)
-Clinker-plugin-lto
=
on
-L
$(TMPDIR)
-Copt-level
=
2
-Clinker
=
$(CLANG)
-Clink-arg
=
-fuse-ld
=
lld ./main.rs
-o
$(TMPDIR)
/rsmain
$(RUSTC)
-Clinker-plugin-lto
=
on
-L
$(TMPDIR)
-Copt-level
=
2
-Clinker
=
$(CLANG)
-Clink-arg
=
-fuse-ld
=
lld ./main.rs
-o
$(TMPDIR)
/rsmain
$(LD_LIB_PATH_ENVVAR)
=
$(REAL_LD_LIBRARY_PATH)
llvm-objdump
-d
$(TMPDIR)
/rsmain |
$(CGREP)
-e
"call.*c_never_inlined"
"
$(LLVM_BIN_DIR)
"
/
llvm-objdump
-d
$(TMPDIR)
/rsmain |
$(CGREP)
-e
"call.*c_never_inlined"
$(LD_LIB_PATH_ENVVAR)
=
$(REAL_LD_LIBRARY_PATH)
llvm-objdump
-d
$(TMPDIR)
/rsmain |
$(CGREP)
-v
-e
"call.*c_always_inlined"
"
$(LLVM_BIN_DIR)
"
/
llvm-objdump
-d
$(TMPDIR)
/rsmain |
$(CGREP)
-v
-e
"call.*c_always_inlined"
src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile
浏览文件 @
c95f5e31
...
@@ -12,7 +12,7 @@ all: staticlib.rs upstream.rs
...
@@ -12,7 +12,7 @@ all: staticlib.rs upstream.rs
# Check No LTO
# Check No LTO
$(RUSTC)
staticlib.rs
-C
linker-plugin-lto
-Ccodegen-units
=
1
-L
.
-o
$(TMPDIR)
/staticlib.a
$(RUSTC)
staticlib.rs
-C
linker-plugin-lto
-Ccodegen-units
=
1
-L
.
-o
$(TMPDIR)
/staticlib.a
(cd
$(TMPDIR);
$(LD_LIB_PATH_ENVVAR)
=
$(REAL_LD_LIBRARY_PATH)
llvm-ar x ./staticlib.a
)
(cd
$(TMPDIR);
"$(LLVM_BIN_DIR)"
/
llvm-ar
x
./staticlib.a)
# Make sure the upstream object file was included
# Make sure the upstream object file was included
ls
$(TMPDIR)/upstream.*.rcgu.o
ls
$(TMPDIR)/upstream.*.rcgu.o
...
@@ -22,7 +22,7 @@ all: staticlib.rs upstream.rs
...
@@ -22,7 +22,7 @@ all: staticlib.rs upstream.rs
# Check ThinLTO
# Check ThinLTO
$(RUSTC)
upstream.rs
-C
linker-plugin-lto
-Ccodegen-units
=
1
-Clto
=
thin
$(RUSTC)
upstream.rs
-C
linker-plugin-lto
-Ccodegen-units
=
1
-Clto
=
thin
$(RUSTC)
staticlib.rs
-C
linker-plugin-lto
-Ccodegen-units
=
1
-Clto
=
thin
-L
.
-o
$(TMPDIR)
/staticlib.a
$(RUSTC)
staticlib.rs
-C
linker-plugin-lto
-Ccodegen-units
=
1
-Clto
=
thin
-L
.
-o
$(TMPDIR)
/staticlib.a
(cd
$(TMPDIR);
$(LD_LIB_PATH_ENVVAR)
=
$(REAL_LD_LIBRARY_PATH)
llvm-ar x ./staticlib.a
)
(cd
$(TMPDIR);
"$(LLVM_BIN_DIR)"
/
llvm-ar
x
./staticlib.a)
ls
$(TMPDIR)/upstream.*.rcgu.o
ls
$(TMPDIR)/upstream.*.rcgu.o
else
else
...
...
src/test/run-make-fulldeps/cross-lang-lto/Makefile
浏览文件 @
c95f5e31
...
@@ -10,8 +10,8 @@ ifndef IS_WINDOWS
...
@@ -10,8 +10,8 @@ ifndef IS_WINDOWS
# -Clinker-plugin-lto.
# -Clinker-plugin-lto.
# this only succeeds for bitcode files
# this only succeeds for bitcode files
ASSERT_IS_BITCODE_OBJ
=(
$(LD_LIB_PATH_ENVVAR)
=
$(REAL_LD_LIBRARY_PATH)
llvm-bcanalyzer
$(1)
)
ASSERT_IS_BITCODE_OBJ
=(
"
$(LLVM_BIN_DIR)
"
/
llvm-bcanalyzer
$(1)
)
EXTRACT_OBJS
=(
cd
$(TMPDIR)
;
rm
-f
./
*
.o
;
$(LD_LIB_PATH_ENVVAR)
=
$(REAL_LD_LIBRARY_PATH)
llvm-ar x
$(1)
)
EXTRACT_OBJS
=(
cd
$(TMPDIR)
;
rm
-f
./
*
.o
;
"
$(LLVM_BIN_DIR)
"
/
llvm-ar x
$(1)
)
BUILD_LIB
=
$(RUSTC)
lib.rs
-Copt-level
=
2
-Clinker-plugin-lto
-Ccodegen-units
=
1
BUILD_LIB
=
$(RUSTC)
lib.rs
-Copt-level
=
2
-Clinker-plugin-lto
-Ccodegen-units
=
1
BUILD_EXE
=
$(RUSTC)
main.rs
-Copt-level
=
2
-Clinker-plugin-lto
-Ccodegen-units
=
1
--emit
=
obj
BUILD_EXE
=
$(RUSTC)
main.rs
-Copt-level
=
2
-Clinker-plugin-lto
-Ccodegen-units
=
1
--emit
=
obj
...
...
src/test/run-make-fulldeps/pgo-use/Makefile
浏览文件 @
c95f5e31
...
@@ -29,7 +29,7 @@ all:
...
@@ -29,7 +29,7 @@ all:
# Run it in order to generate some profiling data
# Run it in order to generate some profiling data
$(
call
RUN,main some-argument
)
||
exit
1
$(
call
RUN,main some-argument
)
||
exit
1
# Postprocess the profiling data so it can be used by the compiler
# Postprocess the profiling data so it can be used by the compiler
$(LD_LIB_PATH_ENVVAR)
=
$(REAL_LD_LIBRARY_PATH)
llvm-profdata merge
\
"
$(LLVM_BIN_DIR)
"
/
llvm-profdata merge
\
-o
"
$(TMPDIR)
"
/merged.profdata
\
-o
"
$(TMPDIR)
"
/merged.profdata
\
"
$(TMPDIR)
"
/default_
*
.profraw
"
$(TMPDIR)
"
/default_
*
.profraw
# Compile the test program again, making use of the profiling data
# Compile the test program again, making use of the profiling data
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录