diff --git a/Makefile b/Makefile index ae6cbe1..ee86cc4 100644 --- a/Makefile +++ b/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 \ diff --git a/kernel/lib.rs b/kernel/lib.rs index ecb34b1..5027cde 100644 --- a/kernel/lib.rs +++ b/kernel/lib.rs @@ -5,7 +5,6 @@ #![deny(warnings)] #![feature(alloc)] -#![feature(arc_counts)] #![feature(asm)] #![feature(collections)] #![feature(const_fn)] diff --git a/libstd/Cargo.toml b/libstd/Cargo.toml deleted file mode 100644 index d17633e..0000000 --- a/libstd/Cargo.toml +++ /dev/null @@ -1,21 +0,0 @@ -[package] -name = "redox_std" -version = "0.1.0" -authors = ["Jeremy Soller "] -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" diff --git a/libstd/alloc_system/Cargo.toml b/libstd/alloc_system/Cargo.toml deleted file mode 100644 index ff91e53..0000000 --- a/libstd/alloc_system/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "alloc_system" -version = "0.0.0" -authors = ["Jeremy Soller "] - -[dependencies.ralloc] -git = "https://github.com/redox-os/ralloc.git" -branch = "new_kernel" -default-features = false -features = ["allocator"] diff --git a/libstd/alloc_system/src/lib.rs b/libstd/alloc_system/src/lib.rs deleted file mode 100644 index c877fda..0000000 --- a/libstd/alloc_system/src/lib.rs +++ /dev/null @@ -1,6 +0,0 @@ -#![allocator] -#![feature(allocator)] -#![no_std] - -#[allocator] -extern crate ralloc; diff --git a/libstd/compiler_builtins/Cargo.toml b/libstd/compiler_builtins/Cargo.toml deleted file mode 100644 index a1f447c..0000000 --- a/libstd/compiler_builtins/Cargo.toml +++ /dev/null @@ -1,7 +0,0 @@ -[package] -name = "compiler_builtins" -version = "0.1.0" -authors = ["Jeremy Soller "] - -[lib] -path = "../../rust/src/libcompiler_builtins/lib.rs" diff --git a/libstd/libc/Cargo.toml b/libstd/libc/Cargo.toml deleted file mode 100644 index 67a2985..0000000 --- a/libstd/libc/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "libc" -version = "0.1.0" -authors = ["Jeremy Soller "] -build = "../../rust/src/rustc/libc_shim/build.rs" - -[lib] -name = "libc" -path = "../../rust/src/liblibc/src/lib.rs" -test = false -bench = false diff --git a/libstd/openlibm b/libstd/openlibm deleted file mode 160000 index 1581174..0000000 --- a/libstd/openlibm +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1581174c85f7b645b15ba1ac1c3a98fb601f0fe7 diff --git a/libstd/panic_abort/Cargo.toml b/libstd/panic_abort/Cargo.toml deleted file mode 100644 index c660cf8..0000000 --- a/libstd/panic_abort/Cargo.toml +++ /dev/null @@ -1,7 +0,0 @@ -[package] -name = "panic_abort" -version = "0.0.0" -authors = ["Jeremy Soller "] - -[lib] -path = "../../rust/src/libpanic_abort/lib.rs" diff --git a/libstd/panic_unwind/Cargo.toml b/libstd/panic_unwind/Cargo.toml deleted file mode 100644 index 9ddf81e..0000000 --- a/libstd/panic_unwind/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "panic_unwind" -version = "0.0.0" -authors = ["Jeremy Soller "] - -[lib] -path = "../../rust/src/libpanic_unwind/lib.rs" - -[dependencies] -libc = { path = "../libc/" } -unwind = { path = "../unwind/" } diff --git a/libstd/unwind/Cargo.toml b/libstd/unwind/Cargo.toml deleted file mode 100644 index a43c8c3..0000000 --- a/libstd/unwind/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "unwind" -version = "0.0.0" -authors = ["Jeremy Soller "] - -[lib] -path = "../../rust/src/libunwind/lib.rs" - -[dependencies] -libc = { path = "../libc/" } diff --git a/programs/coreutils b/programs/coreutils index a421d64..ed85622 160000 --- a/programs/coreutils +++ b/programs/coreutils @@ -1 +1 @@ -Subproject commit a421d6485bd72b1366f66a2572ca0677c55c4e59 +Subproject commit ed85622c9f22400bfbe5c6ce393fb86a7d7b40a9 diff --git a/programs/netutils b/programs/netutils index 24293ce..814ef74 160000 --- a/programs/netutils +++ b/programs/netutils @@ -1 +1 @@ -Subproject commit 24293ce46a3f97ea39694599115b612183388b7a +Subproject commit 814ef74af0905730ef6d32bdb47f76ddfe52c127 diff --git a/programs/orbutils b/programs/orbutils index 7d524f1..632a426 160000 --- a/programs/orbutils +++ b/programs/orbutils @@ -1 +1 @@ -Subproject commit 7d524f1af9cdc6310c0b5e9adc79025db0236db4 +Subproject commit 632a426febb1da816b2702667529ad19a71eca00 diff --git a/rust b/rust index 92c8e0f..63df8c1 160000 --- a/rust +++ b/rust @@ -1 +1 @@ -Subproject commit 92c8e0f352b1aecfb13195266bf134e6c3597849 +Subproject commit 63df8c19339c0d4876f6b3969c0654200dc4f2a0 diff --git a/schemes/randd/Cargo.toml b/schemes/randd/Cargo.toml index 92e12d5..5ecdeff 100644 --- a/schemes/randd/Cargo.toml +++ b/schemes/randd/Cargo.toml @@ -4,3 +4,4 @@ version = "0.1.0" [dependencies] raw-cpuid = "2.*" +redox_syscall = { path = "../../syscall/" } diff --git a/x86_64-unknown-redox.json b/x86_64-unknown-redox.json index 337e7a7..362ef9c 100644 --- a/x86_64-unknown-redox.json +++ b/x86_64-unknown-redox.json @@ -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" }