Cleanup Redox repo, update Rust, remove old target

This commit is contained in:
Jeremy Soller 2017-01-03 15:55:00 -07:00
parent 98c76d36fd
commit 7cd2eff74c
97 changed files with 24 additions and 79 deletions

View file

@ -3,11 +3,11 @@ ARCH?=x86_64
ROOT=$(PWD) ROOT=$(PWD)
export RUST_TARGET_PATH=$(ROOT)/targets export RUST_TARGET_PATH=$(ROOT)/targets
#TODO: Use libssp export CFLAGS=-static -nostartfiles -nostdlib -nodefaultlibs \
export CFLAGS=-nostartfiles -nostdlib -nodefaultlibs \
-undef -imacros $(ROOT)/libc-artifacts/define.h \ -undef -imacros $(ROOT)/libc-artifacts/define.h \
-isystem $(ROOT)/libc-artifacts/usr/include \ -isystem $(ROOT)/libc-artifacts/usr/include \
-L $(ROOT)/libc-artifacts/usr/lib \ -L $(ROOT)/libc-artifacts/usr/lib \
$(ROOT)/libc-artifacts/usr/lib/crt0.o -lm -lc -lgcc \
-fno-stack-protector -U_FORTIFY_SOURCE -fno-stack-protector -U_FORTIFY_SOURCE
# Kernel variables # Kernel variables
@ -23,10 +23,10 @@ KCARGOFLAGS=--target $(KTARGET) --release -- -C soft-float
export TARGET=$(ARCH)-unknown-redox export TARGET=$(ARCH)-unknown-redox
BUILD=build/userspace BUILD=build/userspace
RUSTC=./rustc.sh RUSTC=./rustc.sh
RUSTCFLAGS=--target $(TARGET).json -C opt-level=2 -C debuginfo=0 RUSTCFLAGS=--target $(TARGET) -C opt-level=2 -C debuginfo=0
RUSTDOC=./rustdoc.sh RUSTDOC=./rustdoc.sh
CARGO=RUSTC="$(RUSTC)" RUSTDOC="$(RUSTDOC)" cargo CARGO=RUSTC="$(RUSTC)" RUSTDOC="$(RUSTDOC)" cargo
CARGOFLAGS=--target $(TARGET).json --release -- CARGOFLAGS=--target $(TARGET) --release --
# Default targets # Default targets
.PHONY: all live iso clean doc ref test update pull qemu bochs drivers schemes binutils coreutils extrautils netutils userutils wireshark FORCE .PHONY: all live iso clean doc ref test update pull qemu bochs drivers schemes binutils coreutils extrautils netutils userutils wireshark FORCE
@ -40,8 +40,8 @@ iso: build/livedisk.iso
FORCE: FORCE:
clean: clean:
cargo clean
cargo clean --manifest-path rust/src/libstd/Cargo.toml cargo clean --manifest-path rust/src/libstd/Cargo.toml
cargo clean --manifest-path kernel/Cargo.toml
cargo clean --manifest-path drivers/ahcid/Cargo.toml cargo clean --manifest-path drivers/ahcid/Cargo.toml
cargo clean --manifest-path drivers/e1000d/Cargo.toml cargo clean --manifest-path drivers/e1000d/Cargo.toml
cargo clean --manifest-path drivers/ps2d/Cargo.toml cargo clean --manifest-path drivers/ps2d/Cargo.toml
@ -82,7 +82,7 @@ doc: \
#FORCE to let cargo decide if docs need updating #FORCE to let cargo decide if docs need updating
doc-kernel: $(KBUILD)/libkernel.a FORCE doc-kernel: $(KBUILD)/libkernel.a FORCE
$(KCARGO) doc --target $(KTARGET).json $(KCARGO) doc --target $(KTARGET).json --manifest-path kernel/Cargo.toml
doc-std: $(BUILD)/libstd.rlib FORCE doc-std: $(BUILD)/libstd.rlib FORCE
$(CARGO) doc --target $(TARGET).json --manifest-path rust/src/libstd/Cargo.toml $(CARGO) doc --target $(TARGET).json --manifest-path rust/src/libstd/Cargo.toml
@ -96,8 +96,8 @@ ref: FORCE
cargo run --manifest-path crates/docgen/Cargo.toml -- programs/netutils/src/ filesystem/ref/ cargo run --manifest-path crates/docgen/Cargo.toml -- programs/netutils/src/ filesystem/ref/
test: test:
cargo test
cargo test --manifest-path rust/src/libstd/Cargo.toml cargo test --manifest-path rust/src/libstd/Cargo.toml
cargo test --manifest-path kernel/Cargo.toml
cargo test --manifest-path drivers/ahcid/Cargo.toml cargo test --manifest-path drivers/ahcid/Cargo.toml
cargo test --manifest-path drivers/e1000d/Cargo.toml cargo test --manifest-path drivers/e1000d/Cargo.toml
cargo test --manifest-path drivers/ps2d/Cargo.toml cargo test --manifest-path drivers/ps2d/Cargo.toml
@ -129,8 +129,8 @@ test:
cargo test --manifest-path schemes/udpd/Cargo.toml cargo test --manifest-path schemes/udpd/Cargo.toml
update: update:
cargo update #cargo update --manifest-path rust/src/libstd/Cargo.toml
cargo update --manifest-path rust/src/libstd/Cargo.toml cargo update --manifest-path kernel/Cargo.toml
cargo update --manifest-path drivers/ahcid/Cargo.toml cargo update --manifest-path drivers/ahcid/Cargo.toml
cargo update --manifest-path drivers/e1000d/Cargo.toml cargo update --manifest-path drivers/e1000d/Cargo.toml
cargo update --manifest-path drivers/ps2d/Cargo.toml cargo update --manifest-path drivers/ps2d/Cargo.toml
@ -350,17 +350,17 @@ $(KBUILD)/libstd_unicode.rlib: rust/src/libstd_unicode/lib.rs $(KBUILD)/libcore.
$(KBUILD)/libcollections.rlib: rust/src/libcollections/lib.rs $(KBUILD)/libcore.rlib $(KBUILD)/liballoc.rlib $(KBUILD)/libstd_unicode.rlib $(KBUILD)/libcollections.rlib: rust/src/libcollections/lib.rs $(KBUILD)/libcore.rlib $(KBUILD)/liballoc.rlib $(KBUILD)/libstd_unicode.rlib
$(KRUSTC) $(KRUSTCFLAGS) -o $@ $< $(KRUSTC) $(KRUSTCFLAGS) -o $@ $<
$(KBUILD)/libkernel.a: kernel/** $(KBUILD)/libcore.rlib $(KBUILD)/liballoc.rlib $(KBUILD)/libcollections.rlib $(BUILD)/initfs.rs $(KBUILD)/libkernel.a: kernel/Cargo.toml kernel/arch/** kernel/src/** $(KBUILD)/libcore.rlib $(KBUILD)/liballoc.rlib $(KBUILD)/libcollections.rlib $(BUILD)/initfs.rs
$(KCARGO) rustc $(KCARGOFLAGS) -C lto -o $@ $(KCARGO) rustc --manifest-path $< --lib $(KCARGOFLAGS) -C lto --emit obj=$@
$(KBUILD)/libkernel_live.a: kernel/** $(KBUILD)/libcore.rlib $(KBUILD)/liballoc.rlib $(KBUILD)/libcollections.rlib $(BUILD)/initfs.rs build/filesystem.bin $(KBUILD)/libkernel_live.a: kernel/Cargo.toml kernel/arch/** kernel/src/** $(KBUILD)/libcore.rlib $(KBUILD)/liballoc.rlib $(KBUILD)/libcollections.rlib $(BUILD)/initfs.rs build/filesystem.bin
$(KCARGO) rustc --lib $(KCARGOFLAGS) --cfg 'feature="live"' -C lto --emit obj=$@ $(KCARGO) rustc --manifest-path $< --lib $(KCARGOFLAGS) --cfg 'feature="live"' -C lto --emit obj=$@
$(KBUILD)/kernel: $(KBUILD)/libkernel.a $(KBUILD)/kernel: $(KBUILD)/libkernel.a
$(LD) $(LDFLAGS) -z max-page-size=0x1000 -T arch/$(ARCH)/src/linker.ld -o $@ $< $(LD) $(LDFLAGS) -z max-page-size=0x1000 -T kernel/arch/$(ARCH)/src/linker.ld -o $@ $<
$(KBUILD)/kernel_live: $(KBUILD)/libkernel_live.a $(KBUILD)/kernel_live: $(KBUILD)/libkernel_live.a
$(LD) $(LDFLAGS) -z max-page-size=0x1000 -T arch/$(ARCH)/src/linker.ld -o $@ $< $(LD) $(LDFLAGS) -z max-page-size=0x1000 -T kernel/arch/$(ARCH)/src/linker.ld -o $@ $<
# Userspace recipes # Userspace recipes
$(BUILD)/libstd.rlib: rust/src/libstd/Cargo.toml rust/src/libstd/** $(BUILD)/libstd.rlib: rust/src/libstd/Cargo.toml rust/src/libstd/**

View file

@ -1,26 +0,0 @@
{
"llvm-target": "arm-unknown-redox",
"target-endian": "little",
"target-pointer-width": "32",
"data-layout": "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64",
"arch": "arm",
"os": "redox",
"env": "",
"vendor": "unknown",
"target-family": "redox",
"pre-link-args": ["-nostdlib", "-static"],
"features": "+soft-float",
"dynamic-linking": false,
"executables": true,
"relocation-model": "static",
"code-model": "default",
"disable-redzone": true,
"eliminate-frame-pointer": false,
"exe-suffix": "",
"has-rpath": false,
"no-compiler-rt": true,
"no-default-libraries": true,
"position-independent-executables": false,
"has-elf-tls": true,
"panic-strategy": "abort"
}

View file

@ -4,13 +4,13 @@ version = "0.1.0"
[lib] [lib]
name = "kernel" name = "kernel"
path = "kernel/lib.rs" path = "src/lib.rs"
crate-type = ["staticlib"] crate-type = ["staticlib"]
[dependencies] [dependencies]
bitflags = "*" bitflags = "*"
spin = "*" spin = "*"
redox_syscall = { path = "syscall/" } redox_syscall = { path = "../syscall/" }
[dependencies.goblin] [dependencies.goblin]
git = "https://github.com/m4b/goblin.git" git = "https://github.com/m4b/goblin.git"

View file

@ -4,5 +4,5 @@ version = "0.1.0"
[dependencies] [dependencies]
bitflags = "*" bitflags = "*"
hole_list_allocator = { path = "../../crates/hole_list_allocator"} hole_list_allocator = { path = "../../../crates/hole_list_allocator"}
spin = "*" spin = "*"

View file

@ -4,11 +4,11 @@ version = "0.1.0"
[dependencies] [dependencies]
bitflags = "*" bitflags = "*"
hole_list_allocator = { path = "../../crates/hole_list_allocator/" } hole_list_allocator = { path = "../../../crates/hole_list_allocator/" }
io = { path = "../../crates/io/" } io = { path = "../../../crates/io/" }
raw-cpuid = { git = "https://github.com/gz/rust-cpuid" } raw-cpuid = { git = "https://github.com/gz/rust-cpuid" }
spin = "*" spin = "*"
redox_syscall = { path = "../../syscall/" } redox_syscall = { path = "../../../syscall/" }
[dependencies.x86] [dependencies.x86]
version = "0.7" version = "0.7"

View file

@ -15,7 +15,7 @@ mod gen {
} }
#[cfg(not(test))] #[cfg(not(test))]
#[path="../../build/userspace/initfs.rs"] #[path="../../../build/userspace/initfs.rs"]
mod gen; mod gen;
struct Handle { struct Handle {

View file

@ -11,7 +11,7 @@ use syscall::error::*;
use syscall::flag::{MODE_FILE, SEEK_SET, SEEK_CUR, SEEK_END}; use syscall::flag::{MODE_FILE, SEEK_SET, SEEK_CUR, SEEK_END};
use syscall::scheme::Scheme; use syscall::scheme::Scheme;
static FILESYSTEM: &'static [u8] = include_bytes!("../../build/filesystem.bin"); static FILESYSTEM: &'static [u8] = include_bytes!("../../../build/filesystem.bin");
struct Handle { struct Handle {
path: &'static [u8], path: &'static [u8],

2
rust

@ -1 +1 @@
Subproject commit 57950faeb68754451f94062c11e3fcf830392025 Subproject commit c6858a1429895f27b4daafde9295deb494e2e29c

View file

@ -1,29 +0,0 @@
{
"llvm-target": "x86_64-unknown-redox",
"target-endian": "little",
"target-pointer-width": "64",
"data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128",
"arch": "x86_64",
"os": "redox",
"env": "",
"vendor": "unknown",
"target-family": "redox",
"pre-link-args": ["-m64", "-Wl,--as-needed", "-Wl,-z,noexecstack", "-nostartfiles", "-nostdlib", "-static"],
"late-link-args": ["libc-artifacts/usr/lib/crt0.o", "libc-artifacts/usr/lib/libm.a", "libc-artifacts/usr/lib/libc.a", "libc-artifacts/usr/lib/libgcc.a"],
"features": "",
"dynamic-linking": false,
"executables": true,
"relocation-model": "static",
"code-model": "default",
"disable-redzone": true,
"eliminate-frame-pointer": false,
"exe-suffix": "",
"has-rpath": false,
"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"
}