-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add x86_64-unknown-linux-none target #125023
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a3ef01b
Add x86_64-unknown-linux-none target
morr0ne 9cf0800
docs: Document x86_64-unknown-linux-none target
morr0ne 923cdb3
test: Add assembly tests for x86_64-unknown-linux-none target
morr0ne a6f237c
docs: fix typo in platform-support docs
morr0ne 68407f9
fix typo in x86_64-unknown-linux-none docs
morr0ne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_none.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target}; | ||
|
||
pub fn target() -> Target { | ||
let mut base = base::linux::opts(); | ||
base.cpu = "x86-64".into(); | ||
base.max_atomic_width = Some(64); | ||
base.stack_probes = StackProbeType::Inline; | ||
base.linker_flavor = LinkerFlavor::Gnu(Cc::No, Lld::Yes); | ||
base.linker = Some("rust-lld".into()); | ||
|
||
Target { | ||
llvm_target: "x86_64-unknown-linux-none".into(), | ||
metadata: crate::spec::TargetMetadata { | ||
description: None, | ||
tier: None, | ||
host_tools: None, | ||
std: None, | ||
}, | ||
pointer_width: 64, | ||
data_layout: | ||
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(), | ||
arch: "x86_64".into(), | ||
options: base, | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/doc/rustc/src/platform-support/x86_64-unknown-linux-none.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# `x86_64-unknown-linux-none` | ||
|
||
**Tier: 3** | ||
|
||
Freestanding x86-64 linux binary with no dependency on libc. | ||
|
||
## Target maintainers | ||
|
||
- [morr0ne](https://github.com/morr0ne/) | ||
|
||
## Requirements | ||
|
||
This target is cross compiled and can be built from any host. | ||
|
||
This target has no support for host tools, std and alloc. | ||
|
||
## Building the target | ||
|
||
The target can be built by enabling it for a `rustc` build: | ||
|
||
```toml | ||
[build] | ||
build-stage = 1 | ||
target = ["x86_64-unknown-linux-none"] | ||
``` | ||
|
||
## Building Rust programs | ||
|
||
Rust does not yet ship pre-compiled artifacts for this target. To compile for | ||
this target, you will either need to build Rust with the target enabled (see | ||
"Building the target" above), or build your own copy of `core` by using | ||
`build-std` or similar. | ||
|
||
## Testing | ||
|
||
Created binaries will run on linux without any external requirements | ||
|
||
## Cross-compilation toolchains and C code | ||
|
||
Support for C code is currently untested |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.