Cleanup Redox repo, update Rust, remove old target
This commit is contained in:
parent
98c76d36fd
commit
7cd2eff74c
30
Makefile
30
Makefile
|
@ -3,11 +3,11 @@ ARCH?=x86_64
|
|||
ROOT=$(PWD)
|
||||
export RUST_TARGET_PATH=$(ROOT)/targets
|
||||
|
||||
#TODO: Use libssp
|
||||
export CFLAGS=-nostartfiles -nostdlib -nodefaultlibs \
|
||||
export CFLAGS=-static -nostartfiles -nostdlib -nodefaultlibs \
|
||||
-undef -imacros $(ROOT)/libc-artifacts/define.h \
|
||||
-isystem $(ROOT)/libc-artifacts/usr/include \
|
||||
-L $(ROOT)/libc-artifacts/usr/lib \
|
||||
$(ROOT)/libc-artifacts/usr/lib/crt0.o -lm -lc -lgcc \
|
||||
-fno-stack-protector -U_FORTIFY_SOURCE
|
||||
|
||||
# Kernel variables
|
||||
|
@ -23,10 +23,10 @@ KCARGOFLAGS=--target $(KTARGET) --release -- -C soft-float
|
|||
export TARGET=$(ARCH)-unknown-redox
|
||||
BUILD=build/userspace
|
||||
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
|
||||
CARGO=RUSTC="$(RUSTC)" RUSTDOC="$(RUSTDOC)" cargo
|
||||
CARGOFLAGS=--target $(TARGET).json --release --
|
||||
CARGOFLAGS=--target $(TARGET) --release --
|
||||
|
||||
# Default targets
|
||||
.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:
|
||||
|
||||
clean:
|
||||
cargo clean
|
||||
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/e1000d/Cargo.toml
|
||||
cargo clean --manifest-path drivers/ps2d/Cargo.toml
|
||||
|
@ -82,7 +82,7 @@ doc: \
|
|||
|
||||
#FORCE to let cargo decide if docs need updating
|
||||
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
|
||||
$(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/
|
||||
|
||||
test:
|
||||
cargo test
|
||||
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/e1000d/Cargo.toml
|
||||
cargo test --manifest-path drivers/ps2d/Cargo.toml
|
||||
|
@ -129,8 +129,8 @@ test:
|
|||
cargo test --manifest-path schemes/udpd/Cargo.toml
|
||||
|
||||
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/e1000d/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
|
||||
$(KRUSTC) $(KRUSTCFLAGS) -o $@ $<
|
||||
|
||||
$(KBUILD)/libkernel.a: kernel/** $(KBUILD)/libcore.rlib $(KBUILD)/liballoc.rlib $(KBUILD)/libcollections.rlib $(BUILD)/initfs.rs
|
||||
$(KCARGO) rustc $(KCARGOFLAGS) -C lto -o $@
|
||||
$(KBUILD)/libkernel.a: kernel/Cargo.toml kernel/arch/** kernel/src/** $(KBUILD)/libcore.rlib $(KBUILD)/liballoc.rlib $(KBUILD)/libcollections.rlib $(BUILD)/initfs.rs
|
||||
$(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
|
||||
$(KCARGO) rustc --lib $(KCARGOFLAGS) --cfg 'feature="live"' -C lto --emit obj=$@
|
||||
$(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 --manifest-path $< --lib $(KCARGOFLAGS) --cfg 'feature="live"' -C lto --emit obj=$@
|
||||
|
||||
$(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
|
||||
$(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
|
||||
$(BUILD)/libstd.rlib: rust/src/libstd/Cargo.toml rust/src/libstd/**
|
||||
|
|
|
@ -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"
|
||||
}
|
|
@ -4,13 +4,13 @@ version = "0.1.0"
|
|||
|
||||
[lib]
|
||||
name = "kernel"
|
||||
path = "kernel/lib.rs"
|
||||
path = "src/lib.rs"
|
||||
crate-type = ["staticlib"]
|
||||
|
||||
[dependencies]
|
||||
bitflags = "*"
|
||||
spin = "*"
|
||||
redox_syscall = { path = "syscall/" }
|
||||
redox_syscall = { path = "../syscall/" }
|
||||
|
||||
[dependencies.goblin]
|
||||
git = "https://github.com/m4b/goblin.git"
|
|
@ -4,5 +4,5 @@ version = "0.1.0"
|
|||
|
||||
[dependencies]
|
||||
bitflags = "*"
|
||||
hole_list_allocator = { path = "../../crates/hole_list_allocator"}
|
||||
hole_list_allocator = { path = "../../../crates/hole_list_allocator"}
|
||||
spin = "*"
|
|
@ -4,11 +4,11 @@ version = "0.1.0"
|
|||
|
||||
[dependencies]
|
||||
bitflags = "*"
|
||||
hole_list_allocator = { path = "../../crates/hole_list_allocator/" }
|
||||
io = { path = "../../crates/io/" }
|
||||
hole_list_allocator = { path = "../../../crates/hole_list_allocator/" }
|
||||
io = { path = "../../../crates/io/" }
|
||||
raw-cpuid = { git = "https://github.com/gz/rust-cpuid" }
|
||||
spin = "*"
|
||||
redox_syscall = { path = "../../syscall/" }
|
||||
redox_syscall = { path = "../../../syscall/" }
|
||||
|
||||
[dependencies.x86]
|
||||
version = "0.7"
|
|
@ -15,7 +15,7 @@ mod gen {
|
|||
}
|
||||
|
||||
#[cfg(not(test))]
|
||||
#[path="../../build/userspace/initfs.rs"]
|
||||
#[path="../../../build/userspace/initfs.rs"]
|
||||
mod gen;
|
||||
|
||||
struct Handle {
|
|
@ -11,7 +11,7 @@ use syscall::error::*;
|
|||
use syscall::flag::{MODE_FILE, SEEK_SET, SEEK_CUR, SEEK_END};
|
||||
use syscall::scheme::Scheme;
|
||||
|
||||
static FILESYSTEM: &'static [u8] = include_bytes!("../../build/filesystem.bin");
|
||||
static FILESYSTEM: &'static [u8] = include_bytes!("../../../build/filesystem.bin");
|
||||
|
||||
struct Handle {
|
||||
path: &'static [u8],
|
2
rust
2
rust
|
@ -1 +1 @@
|
|||
Subproject commit 57950faeb68754451f94062c11e3fcf830392025
|
||||
Subproject commit c6858a1429895f27b4daafde9295deb494e2e29c
|
|
@ -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"
|
||||
}
|
Loading…
Reference in a new issue