-
Notifications
You must be signed in to change notification settings - Fork 788
Allowing to build for riscv32imac-unknown-none-elf #2703
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
base: main
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
|
|
@@ -284,6 +284,7 @@ const HURD: &str = "hurd"; | |
| const ILLUMOS: &str = "illumos"; | ||
| const LINUX: &str = "linux"; | ||
| const NETBSD: &str = "netbsd"; | ||
| const NONE: &str = "none"; | ||
| const NTO: &str = "nto"; | ||
| const OPENBSD: &str = "openbsd"; | ||
| const REDOX: &str = "redox"; | ||
|
|
@@ -605,6 +606,12 @@ fn configure_cc(c: &mut cc::Build, target: &Target, c_root_dir: &Path, include_d | |
| let _ = c.flag(f); | ||
| } | ||
|
|
||
| if target.os == NONE { | ||
| let _ = c.flag("-ffreestanding"); | ||
|
Owner
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. I am not sure this is correct for all "none" targets, e.g. wasm32v1. I found when targeting some -none targets in the past that I didn't need to build with
Author
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. The compiler can't find I'm also not sure what the best filter for that target is |
||
| let _ = c.flag("-nostdlib"); | ||
| let _ = c.define("RING_CORE_NOSTDLIBINC", "1"); | ||
| } | ||
|
|
||
| if APPLE_ABI.contains(&target.os.as_str()) { | ||
| // ``-gfull`` is required for Darwin's |-dead_strip|. | ||
| let _ = c.flag("-gfull"); | ||
|
|
||
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.
Please combine this with the
if (target.arch == WASM32) || (target.os == "linux" && target.env == "musl" && target.arch != X86_64)below.If you need to support GCC then you could change the test in that block to also include
is_like_gccor whatever.