Compile using real libstd, with no crate overrides
This commit is contained in:
parent
1566ed9060
commit
3853dfd5bc
43
Makefile
43
Makefile
|
@ -17,6 +17,7 @@ RUSTCFLAGS=--target $(TARGET).json -C opt-level=2 -C debuginfo=0
|
|||
RUSTDOC=./rustdoc.sh
|
||||
CARGO=RUSTC="$(RUSTC)" RUSTDOC="$(RUSTDOC)" cargo
|
||||
CARGOFLAGS=--target $(TARGET).json --release --
|
||||
export CFLAGS=-fno-stack-protector
|
||||
|
||||
# Default targets
|
||||
.PHONY: all live iso clean doc ref test update pull qemu bochs drivers schemes binutils coreutils extrautils netutils userutils wireshark FORCE
|
||||
|
@ -31,7 +32,7 @@ FORCE:
|
|||
|
||||
clean:
|
||||
cargo clean
|
||||
cargo clean --manifest-path libstd/Cargo.toml
|
||||
cargo clean --manifest-path rust/src/libstd/Cargo.toml
|
||||
cargo clean --manifest-path drivers/ahcid/Cargo.toml
|
||||
cargo clean --manifest-path drivers/e1000d/Cargo.toml
|
||||
cargo clean --manifest-path drivers/ps2d/Cargo.toml
|
||||
|
@ -74,7 +75,7 @@ doc-kernel: $(KBUILD)/libkernel.a FORCE
|
|||
$(KCARGO) doc --target $(KTARGET).json
|
||||
|
||||
doc-std: $(BUILD)/libstd.rlib FORCE
|
||||
$(CARGO) doc --target $(TARGET).json --manifest-path libstd/Cargo.toml
|
||||
$(CARGO) doc --target $(TARGET).json --manifest-path rust/src/libstd/Cargo.toml
|
||||
|
||||
ref: FORCE
|
||||
rm -rf filesystem/ref/
|
||||
|
@ -86,7 +87,7 @@ ref: FORCE
|
|||
|
||||
test:
|
||||
cargo test
|
||||
cargo test --manifest-path libstd/Cargo.toml
|
||||
cargo test --manifest-path rust/src/libstd/Cargo.toml
|
||||
cargo test --manifest-path drivers/ahcid/Cargo.toml
|
||||
cargo test --manifest-path drivers/e1000d/Cargo.toml
|
||||
cargo test --manifest-path drivers/ps2d/Cargo.toml
|
||||
|
@ -118,7 +119,7 @@ test:
|
|||
|
||||
update:
|
||||
cargo update
|
||||
cargo update --manifest-path libstd/Cargo.toml
|
||||
cargo update --manifest-path rust/src/libstd/Cargo.toml
|
||||
cargo update --manifest-path drivers/ahcid/Cargo.toml
|
||||
cargo update --manifest-path drivers/e1000d/Cargo.toml
|
||||
cargo update --manifest-path drivers/ps2d/Cargo.toml
|
||||
|
@ -351,32 +352,10 @@ $(KBUILD)/kernel_live: $(KBUILD)/libkernel_live.a
|
|||
$(LD) $(LDFLAGS) -z max-page-size=0x1000 -T arch/$(ARCH)/src/linker.ld -o $@ $<
|
||||
|
||||
# Userspace recipes
|
||||
$(BUILD)/libcore.rlib: rust/src/libcore/lib.rs
|
||||
$(BUILD)/libstd.rlib: rust/src/libstd/Cargo.toml rust/src/libstd/**
|
||||
mkdir -p $(BUILD)
|
||||
$(RUSTC) $(RUSTCFLAGS) -o $@ $<
|
||||
|
||||
$(BUILD)/liballoc.rlib: rust/src/liballoc/lib.rs $(BUILD)/libcore.rlib
|
||||
$(RUSTC) $(RUSTCFLAGS) -o $@ $<
|
||||
|
||||
$(BUILD)/libcollections.rlib: rust/src/libcollections/lib.rs $(BUILD)/libcore.rlib $(BUILD)/liballoc.rlib $(BUILD)/libstd_unicode.rlib
|
||||
$(RUSTC) $(RUSTCFLAGS) -o $@ $<
|
||||
|
||||
$(BUILD)/librand.rlib: rust/src/librand/lib.rs $(BUILD)/libcore.rlib
|
||||
$(RUSTC) $(RUSTCFLAGS) -o $@ $<
|
||||
|
||||
$(BUILD)/libstd_unicode.rlib: rust/src/libstd_unicode/lib.rs $(BUILD)/libcore.rlib
|
||||
$(RUSTC) $(RUSTCFLAGS) -o $@ $<
|
||||
|
||||
libstd/openlibm/libopenlibm.a:
|
||||
CFLAGS=-fno-stack-protector make -C libstd/openlibm libopenlibm.a
|
||||
|
||||
$(BUILD)/libopenlibm.a: libstd/openlibm/libopenlibm.a
|
||||
mkdir -p $(BUILD)
|
||||
cp $< $@
|
||||
|
||||
$(BUILD)/libstd.rlib: libstd/Cargo.toml rust/src/libstd/** $(BUILD)/libcore.rlib $(BUILD)/liballoc.rlib $(BUILD)/libstd_unicode.rlib $(BUILD)/libcollections.rlib $(BUILD)/librand.rlib $(BUILD)/libopenlibm.a
|
||||
$(CARGO) rustc --verbose --manifest-path $< $(CARGOFLAGS) -o $@
|
||||
cp libstd/target/$(TARGET)/release/deps/*.rlib $(BUILD)
|
||||
$(CARGO) rustc --verbose --manifest-path $< $(CARGOFLAGS) -L native=libc-artifacts/lib -o $@
|
||||
cp rust/src/target/$(TARGET)/release/deps/*.rlib $(BUILD)
|
||||
|
||||
initfs/bin/%: drivers/%/Cargo.toml drivers/%/src/** $(BUILD)/libstd.rlib
|
||||
mkdir -p initfs/bin
|
||||
|
@ -386,7 +365,7 @@ initfs/bin/%: drivers/%/Cargo.toml drivers/%/src/** $(BUILD)/libstd.rlib
|
|||
initfs/bin/%: programs/%/Cargo.toml programs/%/src/** $(BUILD)/libstd.rlib
|
||||
mkdir -p initfs/bin
|
||||
$(CARGO) rustc --manifest-path $< $(CARGOFLAGS) -o $@
|
||||
strip $@
|
||||
#strip $@
|
||||
|
||||
initfs/bin/%: schemes/%/Cargo.toml schemes/%/src/** $(BUILD)/libstd.rlib
|
||||
mkdir -p initfs/bin
|
||||
|
@ -540,8 +519,8 @@ netutils: \
|
|||
filesystem/bin/httpd \
|
||||
filesystem/bin/irc \
|
||||
filesystem/bin/nc \
|
||||
filesystem/bin/ntp \
|
||||
filesystem/bin/wget
|
||||
filesystem/bin/ntp
|
||||
#TODO filesystem/bin/wget
|
||||
|
||||
orbutils: \
|
||||
filesystem/ui/bin/browser \
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
#![deny(warnings)]
|
||||
#![feature(alloc)]
|
||||
#![feature(arc_counts)]
|
||||
#![feature(asm)]
|
||||
#![feature(collections)]
|
||||
#![feature(const_fn)]
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
[package]
|
||||
name = "redox_std"
|
||||
version = "0.1.0"
|
||||
authors = ["Jeremy Soller <jackpot51@gmail.com>"]
|
||||
build = "../rust/src/libstd/build.rs"
|
||||
|
||||
[lib]
|
||||
name = "std"
|
||||
path = "../rust/src/libstd/lib.rs"
|
||||
|
||||
[dependencies]
|
||||
alloc_system = { path = "alloc_system" }
|
||||
compiler_builtins = { path = "compiler_builtins" }
|
||||
panic_abort = { path = "panic_abort" }
|
||||
#panic_unwind = { path = "panic_unwind" }
|
||||
libc = { path = "libc" }
|
||||
unwind = { path = "unwind" }
|
||||
|
||||
[build-dependencies]
|
||||
build_helper = { path = "../rust/src/build_helper" }
|
||||
gcc = "0.3.27"
|
|
@ -1,10 +0,0 @@
|
|||
[package]
|
||||
name = "alloc_system"
|
||||
version = "0.0.0"
|
||||
authors = ["Jeremy Soller <jackpot51@gmail.com>"]
|
||||
|
||||
[dependencies.ralloc]
|
||||
git = "https://github.com/redox-os/ralloc.git"
|
||||
branch = "new_kernel"
|
||||
default-features = false
|
||||
features = ["allocator"]
|
|
@ -1,6 +0,0 @@
|
|||
#![allocator]
|
||||
#![feature(allocator)]
|
||||
#![no_std]
|
||||
|
||||
#[allocator]
|
||||
extern crate ralloc;
|
|
@ -1,7 +0,0 @@
|
|||
[package]
|
||||
name = "compiler_builtins"
|
||||
version = "0.1.0"
|
||||
authors = ["Jeremy Soller <jackpot51@gmail.com>"]
|
||||
|
||||
[lib]
|
||||
path = "../../rust/src/libcompiler_builtins/lib.rs"
|
|
@ -1,11 +0,0 @@
|
|||
[package]
|
||||
name = "libc"
|
||||
version = "0.1.0"
|
||||
authors = ["Jeremy Soller <jackpot51@gmail.com>"]
|
||||
build = "../../rust/src/rustc/libc_shim/build.rs"
|
||||
|
||||
[lib]
|
||||
name = "libc"
|
||||
path = "../../rust/src/liblibc/src/lib.rs"
|
||||
test = false
|
||||
bench = false
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 1581174c85f7b645b15ba1ac1c3a98fb601f0fe7
|
|
@ -1,7 +0,0 @@
|
|||
[package]
|
||||
name = "panic_abort"
|
||||
version = "0.0.0"
|
||||
authors = ["Jeremy Soller <jackpot51@gmail.com>"]
|
||||
|
||||
[lib]
|
||||
path = "../../rust/src/libpanic_abort/lib.rs"
|
|
@ -1,11 +0,0 @@
|
|||
[package]
|
||||
name = "panic_unwind"
|
||||
version = "0.0.0"
|
||||
authors = ["Jeremy Soller <jackpot51@gmail.com>"]
|
||||
|
||||
[lib]
|
||||
path = "../../rust/src/libpanic_unwind/lib.rs"
|
||||
|
||||
[dependencies]
|
||||
libc = { path = "../libc/" }
|
||||
unwind = { path = "../unwind/" }
|
|
@ -1,10 +0,0 @@
|
|||
[package]
|
||||
name = "unwind"
|
||||
version = "0.0.0"
|
||||
authors = ["Jeremy Soller <jackpot51@gmail.com>"]
|
||||
|
||||
[lib]
|
||||
path = "../../rust/src/libunwind/lib.rs"
|
||||
|
||||
[dependencies]
|
||||
libc = { path = "../libc/" }
|
|
@ -1 +1 @@
|
|||
Subproject commit a421d6485bd72b1366f66a2572ca0677c55c4e59
|
||||
Subproject commit ed85622c9f22400bfbe5c6ce393fb86a7d7b40a9
|
|
@ -1 +1 @@
|
|||
Subproject commit 24293ce46a3f97ea39694599115b612183388b7a
|
||||
Subproject commit 814ef74af0905730ef6d32bdb47f76ddfe52c127
|
|
@ -1 +1 @@
|
|||
Subproject commit 7d524f1af9cdc6310c0b5e9adc79025db0236db4
|
||||
Subproject commit 632a426febb1da816b2702667529ad19a71eca00
|
2
rust
2
rust
|
@ -1 +1 @@
|
|||
Subproject commit 92c8e0f352b1aecfb13195266bf134e6c3597849
|
||||
Subproject commit 63df8c19339c0d4876f6b3969c0654200dc4f2a0
|
|
@ -4,3 +4,4 @@ version = "0.1.0"
|
|||
|
||||
[dependencies]
|
||||
raw-cpuid = "2.*"
|
||||
redox_syscall = { path = "../../syscall/" }
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
"env": "",
|
||||
"vendor": "unknown",
|
||||
"target-family": "redox",
|
||||
"pre-link-args": ["-m64", "-nostdlib", "-static"],
|
||||
"pre-link-args": ["-m64", "-Wl,--as-needed", "-Wl,-z,noexecstack", "-nostartfiles", "-nostdlib", "-static"],
|
||||
"late-link-args": ["libc-artifacts/lib/crt0.o", "libc-artifacts/lib/libm.a", "libc-artifacts/lib/libc.a", "libc-artifacts/lib/libgcc.a"],
|
||||
"features": "",
|
||||
"dynamic-linking": false,
|
||||
"executables": true,
|
||||
|
@ -21,6 +22,8 @@
|
|||
"no-compiler-rt": true,
|
||||
"no-default-libraries": true,
|
||||
"position-independent-executables": false,
|
||||
"lib-allocation-crate": "alloc_system",
|
||||
"exe-allocation-crate": "alloc_system",
|
||||
"has-elf-tls": true,
|
||||
"panic-strategy": "abort"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue