Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move to the WIP Rust port of compiler-rt #36992

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
move to the WIP Rust port of compiler-rt
Jorge Aparicio committed Oct 10, 2016
commit b0d0db7d54e8be8f60ab3dc5051db849354b7dd7
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before we land this I think we'll want to be sure to move this to rust-lang-nursery under the name "compiler-builtins"

branch = upstream
1 change: 1 addition & 0 deletions mk/crates.mk
Original file line number Diff line number Diff line change
@@ -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
@@ -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 \
@@ -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 \
@@ -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 \
@@ -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 \
@@ -472,8 +457,6 @@ $(foreach intrinsic,absvdi2.o \
paritysi2.o \
popcountdi2.o \
popcountsi2.o \
powidf2.o \
powisf2.o \
powixf2.o \
subdf3.o \
subsf3.o \
@@ -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)),)
@@ -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: $$@)
3 changes: 2 additions & 1 deletion mk/tests.mk
Original file line number Diff line number Diff line change
@@ -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 \
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
@@ -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
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
@@ -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" }

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 = []