-
-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for std
#1069
base: theseus_main
Are you sure you want to change the base?
Add support for std
#1069
Changes from 4 commits
37872aa
c0c8eb1
13ff8f7
0149e3c
df89103
06ed1fd
e3c5f2b
55b1f96
2fb6d5d
56af34a
0e0c8b4
1e62cc1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,3 +39,6 @@ github_pages/doc/ | |
|
||
# library lock files | ||
/libs/**/Cargo.lock | ||
|
||
# TODO: Remove once std is upstreamed | ||
.cargo/ | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ports/rust | ||
kevinaboos marked this conversation as resolved.
Show resolved
Hide resolved
tsoutsman marked this conversation as resolved.
Show resolved
Hide resolved
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,8 @@ default-members = [ | |
|
||
|
||
exclude = [ | ||
"shim", | ||
|
||
## Exclude the build directories | ||
"build", | ||
"target", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[package] | ||
name = "test_std" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
use std::{string::String, vec::Vec}; | ||
|
||
pub fn main(_: Vec<String>) -> isize { | ||
println!("Hello, world!"); | ||
println!("Task ID: {}", std::process::id()); | ||
0 | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,7 +70,7 @@ endif | |
## Also ensure that core memory functions (e.g., memcpy) are included in the build and not name-mangled. | ||
## We keep these flags separate from the regular CARGOFLAGS for purposes of easily creating a sysroot directory. | ||
BUILD_STD_CARGOFLAGS += -Z unstable-options | ||
BUILD_STD_CARGOFLAGS += -Z build-std=core,alloc | ||
BUILD_STD_CARGOFLAGS += -Z build-std | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this no longer needed? Or is this just a change that's left over from experimenting with building std? If we only need this for "normal" builds of Theseus (without the new std lib) but we cannot use it for builds of the new std lib, then we can change it elsewhere, e.g., as an export override on one of the non-std make targets |
||
BUILD_STD_CARGOFLAGS += -Z build-std-features=compiler-builtins-mem | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[package] | ||
name = "libtheseus" | ||
version = "0.1.0" | ||
authors = ["Klim Tsoutsman <klim@tsoutsman.com>"] | ||
description = "Implementation of shim functions for std linkage boundary" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
app_io = { path = "../app_io" } | ||
core2 = { version = "0.4.0", default-features = false, features = ["alloc", "nightly"] } | ||
environment = { path = "../environment" } | ||
path = { path = "../path" } | ||
random = { path = "../random" } | ||
theseus_ffi = { path = "../../libs/theseus_ffi" } | ||
task = { path = "../task" } | ||
thread_local_macro = { path = "../thread_local_macro" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this, something that the build of
rust
generates?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we set the specific path to our custom
rustc
installation in.cargo/config.toml
.