Skip to content
Browse files

WIP: Fix cargo unable to link libstd with dependencies

  • Loading branch information...
1 parent a9cca5c commit ebbea07ad8285573df2222cacff0eeac0f902481 @jackpot51 jackpot51 committed
Showing with 32 additions and 27 deletions.
  1. +2 −2 Makefile
  2. +19 −0 crates/io/io.rs
  3. +2 −20 crates/io/lib.rs
  4. +1 −1 crates/io/mmio.rs
  5. +1 −1 crates/io/pio.rs
  6. +1 −1 crates/ion
  7. +1 −1 crates/system/syscall/redox.rs
  8. +1 −1 crates/system/syscall/unix.rs
  9. +2 −0 rustc-i386.sh
  10. +2 −0 rustc-x86_64.sh
View
4 Makefile
@@ -6,8 +6,8 @@ BUILD=build/$(ARCH)-unknown-redox/debug
QEMU?=qemu-system-$(ARCH)
-CARGO=CARGO_TARGET_DIR=build cargo rustc
-CARGOFLAGS=--target=$(ARCH)-unknown-redox.json -- -L $(BUILD) \
+CARGO=CARGO_TARGET_DIR=build RUSTC="./rustc-$(ARCH).sh" cargo rustc
+CARGOFLAGS=--verbose --target=$(ARCH)-unknown-redox.json -- -L $(BUILD) \
-C no-prepopulate-passes -C no-stack-check -C opt-level=2 \
-Z no-landing-pads \
-A dead_code
View
19 crates/io/io.rs
@@ -0,0 +1,19 @@
+use core::cmp::PartialEq;
+use core::ops::{BitAnd, BitOr, Not};
+
+pub trait Io<T> {
+ fn read(&self) -> T;
+ fn write(&mut self, value: T);
+
+ fn readf(&self, flags: T) -> bool where T: BitAnd<Output = T> + PartialEq<T> + Copy {
+ (self.read() & flags) as T == flags
+ }
+
+ fn writef(&mut self, flags: T, value: bool) where T: BitAnd<Output = T> + BitOr<Output = T> + Not<Output = T> {
+ let tmp: T = match value {
+ true => self.read() | flags,
+ false => self.read() & !flags,
+ };
+ self.write(tmp);
+ }
+}
View
22 crates/io/lib.rs
@@ -4,28 +4,10 @@
#![feature(core_intrinsics)]
#![no_std]
-use core::cmp::PartialEq;
-use core::ops::{BitAnd, BitOr, Not};
-
+pub use self::io::*;
pub use self::mmio::*;
pub use self::pio::*;
+mod io;
mod mmio;
mod pio;
-
-pub trait Io<T> {
- fn read(&self) -> T;
- fn write(&mut self, value: T);
-
- fn readf(&self, flags: T) -> bool where T: BitAnd<Output = T> + PartialEq<T> + Copy {
- (self.read() & flags) as T == flags
- }
-
- fn writef(&mut self, flags: T, value: bool) where T: BitAnd<Output = T> + BitOr<Output = T> + Not<Output = T> {
- let tmp: T = match value {
- true => self.read() | flags,
- false => self.read() & !flags,
- };
- self.write(tmp);
- }
-}
View
2 crates/io/mmio.rs
@@ -1,6 +1,6 @@
use core::intrinsics::{volatile_load, volatile_store};
-use super::Io;
+use super::io::Io;
#[repr(packed)]
pub struct Mmio<T> {
View
2 crates/io/pio.rs
@@ -1,6 +1,6 @@
use core::marker::PhantomData;
-use super::Io;
+use super::io::Io;
/// Generic PIO
#[derive(Copy, Clone)]
2 crates/ion
@@ -1 +1 @@
-Subproject commit f3fd7098f4696a58f6cce671a41efd58fda03580
+Subproject commit 861748f6d53a708504a33ba6535214f3a2cf3e93
View
2 crates/system/syscall/redox.rs
@@ -1,4 +1,4 @@
-use syscall::{syscall1, syscall2};
+use syscall::arch::{syscall1, syscall2};
use error::Result;
pub const SYS_DEBUG: usize = 0;
View
2 crates/system/syscall/unix.rs
@@ -1,4 +1,4 @@
-use syscall::{syscall0, syscall1, syscall2, syscall3};
+use syscall::arch::{syscall0, syscall1, syscall2, syscall3};
use error::Result;
pub const SYS_BRK: usize = 45;
View
2 rustc-i386.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+rustc -L build/i386-unknown-redox/debug $*
View
2 rustc-x86_64.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+rustc -L build/x86_64-unknown-redox/debug $*

0 comments on commit ebbea07

Please sign in to comment.
Something went wrong with that request. Please try again.