Skip to content

Commit

Permalink
move to the WIP Rust port of compiler-rt
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorge Aparicio committed Oct 10, 2016
1 parent 2c21f38 commit b0d0db7
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 30 deletions.
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@
[submodule "src/liblibc"]
path = src/liblibc
url = https://github.com/rust-lang/libc.git
[submodule "src/libcompiler_builtins"]
path = src/libcompiler_builtins
url = git://github.com/japaric/rustc-builtins.git
branch = upstream
1 change: 1 addition & 0 deletions mk/crates.mk
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,4 @@ $(foreach crate,$(TOOLS),$(eval $(call RUST_TOOL,$(crate))))

CRATEFILE_libc := $(SREL)src/liblibc/src/lib.rs
RUSTFLAGS_libc := --cfg stdbuild
CRATEFILE_compiler_builtins := $(SREL)src/libcompiler_builtins/src/lib.rs
29 changes: 3 additions & 26 deletions mk/rt.mk
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ COMPRT_OBJS_$(1) += \
arm/clzsi2.o \
arm/comparesf2.o \
arm/divmodsi4.o \
arm/divsi3.o \
arm/modsi3.o \
arm/switch16.o \
arm/switch32.o \
Expand Down Expand Up @@ -400,13 +399,9 @@ endif

$(foreach intrinsic,absvdi2.o \
absvsi2.o \
adddf3.o \
addsf3.o \
addvdi3.o \
addvsi3.o \
apple_versioning.o \
ashldi3.o \
ashrdi3.o \
clear_cache.o \
clzdi2.o \
clzsi2.o \
Expand All @@ -417,12 +412,8 @@ $(foreach intrinsic,absvdi2.o \
ctzsi2.o \
divdc3.o \
divdf3.o \
divdi3.o \
divmoddi4.o \
divmodsi4.o \
divsc3.o \
divsf3.o \
divsi3.o \
divxc3.o \
extendsfdf2.o \
extendhfsf2.o \
Expand All @@ -449,14 +440,8 @@ $(foreach intrinsic,absvdi2.o \
floatunsidf.o \
floatunsisf.o \
int_util.o \
lshrdi3.o \
moddi3.o \
modsi3.o \
muldc3.o \
muldf3.o \
muldi3.o \
mulodi4.o \
mulosi4.o \
muloti4.o \
mulsc3.o \
mulsf3.o \
Expand All @@ -472,8 +457,6 @@ $(foreach intrinsic,absvdi2.o \
paritysi2.o \
popcountdi2.o \
popcountsi2.o \
powidf2.o \
powisf2.o \
powixf2.o \
subdf3.o \
subsf3.o \
Expand All @@ -482,13 +465,7 @@ $(foreach intrinsic,absvdi2.o \
truncdfhf2.o \
truncdfsf2.o \
truncsfhf2.o \
ucmpdi2.o \
udivdi3.o \
udivmoddi4.o \
udivmodsi4.o \
udivsi3.o \
umoddi3.o \
umodsi3.o,
ucmpdi2.o,
$(call ADD_INTRINSIC,$(1),$(intrinsic)))

ifeq ($$(findstring ios,$(1)),)
Expand Down Expand Up @@ -585,12 +562,12 @@ endif

COMPRT_OBJS_$(1) := $$(COMPRT_OBJS_$(1):%=$$(COMPRT_BUILD_DIR_$(1))/%)

$$(COMPRT_BUILD_DIR_$(1))/%.o: $(S)src/compiler-rt/lib/builtins/%.c
$$(COMPRT_BUILD_DIR_$(1))/%.o: $(S)src/libcompiler_builtins/compiler-rt/compiler-rt-cdylib/compiler-rt/lib/builtins/%.c
@mkdir -p $$(@D)
@$$(call E, compile: $$@)
$$(Q)$$(call CFG_COMPILE_C_$(1),$$@,$$<)

$$(COMPRT_BUILD_DIR_$(1))/%.o: $(S)src/compiler-rt/lib/builtins/%.S \
$$(COMPRT_BUILD_DIR_$(1))/%.o: $(S)src/libcompiler_builtins/compiler-rt/compiler-rt-cdylib/compiler-rt/lib/builtins/%.S \
$$(LLVM_CONFIG_$$(CFG_BUILD))
@mkdir -p $$(@D)
@$$(call E, compile: $$@)
Expand Down
3 changes: 2 additions & 1 deletion mk/tests.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ $(eval $(call RUST_CRATE,coretest))
DEPS_collectionstest :=
$(eval $(call RUST_CRATE,collectionstest))

# compiler_builtins is tested out of tree
TEST_TARGET_CRATES = $(filter-out core rustc_unicode alloc_system libc \
alloc_jemalloc panic_unwind \
alloc_jemalloc panic_unwind compiler_builtins \
panic_abort,$(TARGET_CRATES)) \
collectionstest coretest
TEST_DOC_CRATES = $(DOC_CRATES) arena flate fmt_macros getopts graphviz \
Expand Down
7 changes: 7 additions & 0 deletions src/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -578,8 +578,8 @@ impl Build {
.args(&["clean", "-fdx"]));
},
State::NotInitialized => {
self.run(git_submodule().arg("init").arg(submodule.path));
self.run(git_submodule().arg("update").arg(submodule.path));
self.run(git_submodule().arg("update").arg("--recursive").arg("--init")
.arg(submodule.path));
},
State::OutOfSync => {
// drops submodule commits that weren't reported to the (outer) git repository
Expand Down
1 change: 1 addition & 0 deletions src/libcompiler_builtins
Submodule libcompiler_builtins added at 24c024
2 changes: 1 addition & 1 deletion src/libstd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ collections = { path = "../libcollections" }
core = { path = "../libcore" }
libc = { path = "../rustc/libc_shim" }
rand = { path = "../librand" }
compiler_builtins = { path = "../libcompiler_builtins" }
compiler_builtins = { path = "../rustc/libcompiler_builtins_shim" }
rustc_unicode = { path = "../librustc_unicode" }
unwind = { path = "../libunwind" }

Expand Down
25 changes: 25 additions & 0 deletions src/rustc/libcompiler_builtins_shim/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This is a shim Cargo.toml over the "real Cargo.toml" found in the compiler-builtins
# repository itself. See ../libc_shim/Cargo.toml for details

[package]
name = "compiler_builtins"
version = "0.0.0"
authors = ["The Rust Project Developers"]
build = "../../libcompiler_builtins/build.rs"

[lib]
name = "compiler_builtins"
path = "../../libcompiler_builtins/src/lib.rs"
test = false

[build-dependencies]
gcc = "0.3.27"
rustc-cfg = "0.2.0"

[dependencies]
core = { path = "../../libcore" }

[features]
default = ["c", "rustbuild"]
c = []
rustbuild = []

0 comments on commit b0d0db7

Please sign in to comment.