Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b0d0db7

Browse files
author
Jorge Aparicio
committedOct 10, 2016
move to the WIP Rust port of compiler-rt
1 parent 2c21f38 commit b0d0db7

File tree

9 files changed

+46
-30
lines changed

9 files changed

+46
-30
lines changed
 

‎.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@
1414
[submodule "src/liblibc"]
1515
path = src/liblibc
1616
url = https://github.com/rust-lang/libc.git
17+
[submodule "src/libcompiler_builtins"]
18+
path = src/libcompiler_builtins
19+
url = git://github.com/japaric/rustc-builtins.git
20+
branch = upstream

‎mk/crates.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,3 +228,4 @@ $(foreach crate,$(TOOLS),$(eval $(call RUST_TOOL,$(crate))))
228228

229229
CRATEFILE_libc := $(SREL)src/liblibc/src/lib.rs
230230
RUSTFLAGS_libc := --cfg stdbuild
231+
CRATEFILE_compiler_builtins := $(SREL)src/libcompiler_builtins/src/lib.rs

‎mk/rt.mk

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,6 @@ COMPRT_OBJS_$(1) += \
319319
arm/clzsi2.o \
320320
arm/comparesf2.o \
321321
arm/divmodsi4.o \
322-
arm/divsi3.o \
323322
arm/modsi3.o \
324323
arm/switch16.o \
325324
arm/switch32.o \
@@ -400,13 +399,9 @@ endif
400399

401400
$(foreach intrinsic,absvdi2.o \
402401
absvsi2.o \
403-
adddf3.o \
404-
addsf3.o \
405402
addvdi3.o \
406403
addvsi3.o \
407404
apple_versioning.o \
408-
ashldi3.o \
409-
ashrdi3.o \
410405
clear_cache.o \
411406
clzdi2.o \
412407
clzsi2.o \
@@ -417,12 +412,8 @@ $(foreach intrinsic,absvdi2.o \
417412
ctzsi2.o \
418413
divdc3.o \
419414
divdf3.o \
420-
divdi3.o \
421-
divmoddi4.o \
422-
divmodsi4.o \
423415
divsc3.o \
424416
divsf3.o \
425-
divsi3.o \
426417
divxc3.o \
427418
extendsfdf2.o \
428419
extendhfsf2.o \
@@ -449,14 +440,8 @@ $(foreach intrinsic,absvdi2.o \
449440
floatunsidf.o \
450441
floatunsisf.o \
451442
int_util.o \
452-
lshrdi3.o \
453-
moddi3.o \
454-
modsi3.o \
455443
muldc3.o \
456444
muldf3.o \
457-
muldi3.o \
458-
mulodi4.o \
459-
mulosi4.o \
460445
muloti4.o \
461446
mulsc3.o \
462447
mulsf3.o \
@@ -472,8 +457,6 @@ $(foreach intrinsic,absvdi2.o \
472457
paritysi2.o \
473458
popcountdi2.o \
474459
popcountsi2.o \
475-
powidf2.o \
476-
powisf2.o \
477460
powixf2.o \
478461
subdf3.o \
479462
subsf3.o \
@@ -482,13 +465,7 @@ $(foreach intrinsic,absvdi2.o \
482465
truncdfhf2.o \
483466
truncdfsf2.o \
484467
truncsfhf2.o \
485-
ucmpdi2.o \
486-
udivdi3.o \
487-
udivmoddi4.o \
488-
udivmodsi4.o \
489-
udivsi3.o \
490-
umoddi3.o \
491-
umodsi3.o,
468+
ucmpdi2.o,
492469
$(call ADD_INTRINSIC,$(1),$(intrinsic)))
493470

494471
ifeq ($$(findstring ios,$(1)),)
@@ -585,12 +562,12 @@ endif
585562

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

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

593-
$$(COMPRT_BUILD_DIR_$(1))/%.o: $(S)src/compiler-rt/lib/builtins/%.S \
570+
$$(COMPRT_BUILD_DIR_$(1))/%.o: $(S)src/libcompiler_builtins/compiler-rt/compiler-rt-cdylib/compiler-rt/lib/builtins/%.S \
594571
$$(LLVM_CONFIG_$$(CFG_BUILD))
595572
@mkdir -p $$(@D)
596573
@$$(call E, compile: $$@)

‎mk/tests.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ $(eval $(call RUST_CRATE,coretest))
2222
DEPS_collectionstest :=
2323
$(eval $(call RUST_CRATE,collectionstest))
2424

25+
# compiler_builtins is tested out of tree
2526
TEST_TARGET_CRATES = $(filter-out core rustc_unicode alloc_system libc \
26-
alloc_jemalloc panic_unwind \
27+
alloc_jemalloc panic_unwind compiler_builtins \
2728
panic_abort,$(TARGET_CRATES)) \
2829
collectionstest coretest
2930
TEST_DOC_CRATES = $(DOC_CRATES) arena flate fmt_macros getopts graphviz \

‎src/Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/bootstrap/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,8 +578,8 @@ impl Build {
578578
.args(&["clean", "-fdx"]));
579579
},
580580
State::NotInitialized => {
581-
self.run(git_submodule().arg("init").arg(submodule.path));
582-
self.run(git_submodule().arg("update").arg(submodule.path));
581+
self.run(git_submodule().arg("update").arg("--recursive").arg("--init")
582+
.arg(submodule.path));
583583
},
584584
State::OutOfSync => {
585585
// drops submodule commits that weren't reported to the (outer) git repository

‎src/libcompiler_builtins

Submodule libcompiler_builtins added at 24c0247

‎src/libstd/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ collections = { path = "../libcollections" }
1919
core = { path = "../libcore" }
2020
libc = { path = "../rustc/libc_shim" }
2121
rand = { path = "../librand" }
22-
compiler_builtins = { path = "../libcompiler_builtins" }
22+
compiler_builtins = { path = "../rustc/libcompiler_builtins_shim" }
2323
rustc_unicode = { path = "../librustc_unicode" }
2424
unwind = { path = "../libunwind" }
2525

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# This is a shim Cargo.toml over the "real Cargo.toml" found in the compiler-builtins
2+
# repository itself. See ../libc_shim/Cargo.toml for details
3+
4+
[package]
5+
name = "compiler_builtins"
6+
version = "0.0.0"
7+
authors = ["The Rust Project Developers"]
8+
build = "../../libcompiler_builtins/build.rs"
9+
10+
[lib]
11+
name = "compiler_builtins"
12+
path = "../../libcompiler_builtins/src/lib.rs"
13+
test = false
14+
15+
[build-dependencies]
16+
gcc = "0.3.27"
17+
rustc-cfg = "0.2.0"
18+
19+
[dependencies]
20+
core = { path = "../../libcore" }
21+
22+
[features]
23+
default = ["c", "rustbuild"]
24+
c = []
25+
rustbuild = []

0 commit comments

Comments
 (0)
Please sign in to comment.