Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ACS
Public
third-party
toyos-rs
Commits
04b9f120
Commit
04b9f120
authored
Nov 08, 2015
by
Eric Kidd
Browse files
Generalize runtime building support
parent
303b9175
Changes
2
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
04b9f120
...
...
@@ -14,12 +14,6 @@ assembly_source_files := $(wildcard src/arch/$(arch)/*.asm)
assembly_object_files
:=
$(
patsubst
src/arch/
$(arch)
/%.asm,
\
build/arch/
$(arch)
/%.o,
$(assembly_source_files)
)
libcore_nofp_patch
:=
build/libcore_nofp.patch
libcore_nofp_url
:=
\
https://raw.githubusercontent.com/thepowersgang/rust-barebones-kernel/master/libcore_nofp.patch
installed_target_libs
:=
\
~/.multirust/toolchains/nightly/lib/rustlib/
$(target)
/lib
.PHONY
:
all fmt clean run debug iso cargo
all
:
$(kernel)
...
...
@@ -65,14 +59,29 @@ build/arch/$(arch)/%.o: src/arch/$(arch)/%.asm $(assembly_header_files)
#==========================================================================
# Building the Rust runtime for our bare-metal target
libcore_nofp_patch
:=
build/libcore_nofp.patch
libcore_nofp_url
:=
\
https://raw.githubusercontent.com/thepowersgang/rust-barebones-kernel/master/libcore_nofp.patch
installed_target_libs
:=
\
~/.multirust/toolchains/nightly/lib/rustlib/
$(target)
/lib
runtime_rlibs
:=
\
$(installed_target_libs)
/libcore.rlib
\
$(installed_target_libs)
/liballoc.rlib
\
$(installed_target_libs)
/librustc_unicode.rlib
\
$(installed_target_libs)
/libcollections.rlib
RUSTC
:=
\
rustc
--verbose
--target
$(target)
\
-Z
no-landing-pads
\
--cfg
disable_float
\
--out-dir
$(installed_target_libs)
.PHONY
:
runtime
patch core alloc rustc_unicode collections
.PHONY
:
runtime
runtime
:
core alloc rustc_unicode collections
runtime
:
$(runtime_rlibs)
patch
:
$(libcore_nofp_patch)
@
echo
Patching libcore to remove floating point.
...
...
@@ -83,22 +92,9 @@ $(libcore_nofp_patch):
@
mkdir
-p
$(
shell
dirname
$(libcore_nofp_patch)
)
@
curl
-o
$(libcore_nofp_patch)
$(libcore_nofp_url)
core
:
@
echo
RUSTC libcore
$(installed_target_libs)
:
@
mkdir
-p
$(installed_target_libs)
@
$(RUSTC)
--cfg
disable_float rust/src/libcore/lib.rs
alloc
:
@
echo
RUSTC liballoc
@
mkdir
-p
$(installed_target_libs)
@
$(RUSTC)
rust/src/liballoc/lib.rs
rustc_unicode
:
@
echo
RUSTC librustc_unicode
@
mkdir
-p
$(installed_target_libs)
@
$(RUSTC)
rust/src/librustc_unicode/lib.rs
collections
:
@
echo
RUSTC libcollections
@
mkdir
-p
$(installed_target_libs)
@
$(RUSTC)
rust/src/libcollections/lib.rs
$(installed_target_libs)/%.rlib
:
rust/src/%/lib.rs $(installed_target_libs)
@
echo
RUSTC
$<
@
$(RUSTC)
$<
README.md
View file @
04b9f120
...
...
@@ -33,12 +33,12 @@ git clone https://github.com/rust-lang/rust
(
cd
rust
&&
git checkout 2e07996a9
)
```
Now you can try to patch
`libcore`
and install
it where
`rustc`
and
`cargo`
will find
i
t:
Now you can try to patch
`libcore`
and install
a set of basic runtime
libraries where
`rustc`
and
`cargo`
will find t
hem
:
```
make patch
make
cor
e
make
runtim
e
```
You may need to manually fix the
`libcore`
build to hide any new
`f32`
or
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment