Merge pull request #294 from alexcrichton/no-submodule

Remove `compiler-rt` submodule from this repository
master
Alex Crichton 2019-05-16 10:10:58 -05:00 committed by GitHub
commit f3f5f06d55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 20 additions and 18 deletions

3
.gitmodules vendored
View File

@ -1,6 +1,3 @@
[submodule "compiler-rt"]
path = compiler-rt
url = https://github.com/rust-lang/compiler-rt
[submodule "libm"] [submodule "libm"]
path = libm path = libm
url = https://github.com/rust-lang-nursery/libm url = https://github.com/rust-lang-nursery/libm

View File

@ -76,7 +76,7 @@ mod c {
use std::collections::BTreeMap; use std::collections::BTreeMap;
use std::env; use std::env;
use std::path::Path; use std::path::PathBuf;
struct Sources { struct Sources {
// SYMBOL -> PATH TO SOURCE // SYMBOL -> PATH TO SOURCE
@ -411,15 +411,19 @@ mod c {
sources.remove(&["__aeabi_cdcmp", "__aeabi_cfcmp"]); sources.remove(&["__aeabi_cdcmp", "__aeabi_cfcmp"]);
} }
// When compiling in rustbuild (the rust-lang/rust repo) this build // When compiling the C code we require the user to tell us where the
// script runs from a directory other than this root directory. // source code is, and this is largely done so when we're compiling as
let root = if cfg!(feature = "rustbuild") { // part of rust-lang/rust we can use the same llvm-project repository as
Path::new("../../libcompiler_builtins") // rust-lang/rust.
} else { let root = match env::var_os("RUST_COMPILER_RT_ROOT") {
Path::new(".") Some(s) => PathBuf::from(s),
None => panic!("RUST_COMPILER_RT_ROOT is not set"),
}; };
if !root.exists() {
panic!("RUST_COMPILER_RT_ROOT={} does not exist", root.display());
}
let src_dir = root.join("compiler-rt/lib/builtins"); let src_dir = root.join("lib/builtins");
for (sym, src) in sources.map.iter() { for (sym, src) in sources.map.iter() {
let src = src_dir.join(src); let src = src_dir.join(src);
cfg.file(&src); cfg.file(&src);

View File

@ -4,13 +4,15 @@ steps:
- template: azure-install-rust.yml - template: azure-install-rust.yml
- script: rustup component add rust-src
displayName: Install Rust sources
condition: eq( variables['XARGO'], '1' )
- bash: rustup target add $TARGET - bash: rustup target add $TARGET
displayName: Install Rust target displayName: Install Rust target
condition: ne( variables['XARGO'], '1' )
- bash: |
set -e
curl -L https://github.com/rust-lang/llvm-project/archive/rustc/8.0-2019-03-18.tar.gz | \
tar xzf - --strip-components 1 llvm-project-rustc-8.0-2019-03-18/compiler-rt
echo '##vso[task.setvariable variable=RUST_COMPILER_RT_ROOT]./compiler-rt'
displayName: "Download compiler-rt reference sources"
- bash: ./ci/run.sh $TARGET - bash: ./ci/run.sh $TARGET
condition: ne( variables['Agent.OS'], 'Linux' ) condition: ne( variables['Agent.OS'], 'Linux' )

View File

@ -18,6 +18,7 @@ run() {
--user $(id -u):$(id -g) \ --user $(id -u):$(id -g) \
-e CARGO_HOME=/cargo \ -e CARGO_HOME=/cargo \
-e CARGO_TARGET_DIR=/target \ -e CARGO_TARGET_DIR=/target \
-e RUST_COMPILER_RT_ROOT \
-v $HOME/.cargo:/cargo \ -v $HOME/.cargo:/cargo \
-v `pwd`/target:/target \ -v `pwd`/target:/target \
-v `pwd`:/checkout:ro \ -v `pwd`:/checkout:ro \

View File

@ -1,6 +1,5 @@
set -ex set -ex
export CARGO_INCREMENTAL=0
cargo=cargo cargo=cargo
# Test our implementation # Test our implementation

@ -1 +0,0 @@
Subproject commit 03fc28f9273eeab16f1005f982dfde5900bddb29