-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Support for Harvey. Harvey is Plan 9 with GPL. #74038
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
Closed
Closed
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
use crate::spec::{LinkArgs, LinkerFlavor, RelroLevel, TargetOptions}; | ||
|
||
pub fn opts() -> TargetOptions { | ||
let mut args = LinkArgs::new(); | ||
args.insert( | ||
LinkerFlavor::Gcc, | ||
vec![ | ||
// We want to be able to strip as much executable code as possible | ||
// from the linker command line, and this flag indicates to the | ||
// linker that it can avoid linking in dynamic libraries that don't | ||
// actually satisfy any symbols up to that point (as with many other | ||
// resolutions the linker does). This option only applies to all | ||
// following libraries so we're sure to pass it as one of the first | ||
// arguments. | ||
"-Wl,--as-needed".to_string(), | ||
// Always enable NX protection when it is available | ||
"-Wl,-z,noexecstack".to_string(), | ||
], | ||
); | ||
|
||
TargetOptions { | ||
dynamic_linking: false, | ||
executables: true, | ||
target_family: Some("unix".to_string()), | ||
linker_is_gnu: true, | ||
has_rpath: true, | ||
pre_link_args: args, | ||
position_independent_executables: true, | ||
relro_level: RelroLevel::Full, | ||
has_elf_tls: false, | ||
..Default::default() | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// This defines the amd64 target for the Linux Kernel. See the linux-kernel-base module for | ||
// generic Linux kernel options. | ||
|
||
use crate::spec::{CodeModel, LinkerFlavor, Target, TargetResult}; | ||
|
||
pub fn target() -> TargetResult { | ||
let mut base = super::harvey_kernel_base::opts(); | ||
base.cpu = "x86-64".to_string(); | ||
base.max_atomic_width = Some(64); | ||
base.features = | ||
"-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-3dnow,-3dnowa,-avx,-avx2,+soft-float" | ||
.to_string(); | ||
base.code_model = Some(CodeModel::Kernel); | ||
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string()); | ||
|
||
Ok(Target { | ||
// FIXME: Some dispute, the linux-on-clang folks think this should use "Linux" | ||
rminnich marked this conversation as resolved.
Show resolved
Hide resolved
|
||
llvm_target: "x86_64-elf".to_string(), | ||
target_endian: "little".to_string(), | ||
target_pointer_width: "64".to_string(), | ||
target_c_int_width: "32".to_string(), | ||
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" | ||
.to_string(), | ||
target_os: "none".to_string(), | ||
target_env: "gnu".to_string(), | ||
target_vendor: "unknown".to_string(), | ||
arch: "x86_64".to_string(), | ||
linker_flavor: LinkerFlavor::Gcc, | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use crate::spec::{LinkerFlavor, Target, TargetResult}; | ||
|
||
pub fn target() -> TargetResult { | ||
let mut base = super::harvey_base::opts(); | ||
base.cpu = "x86-64".to_string(); | ||
base.max_atomic_width = Some(64); | ||
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string()); | ||
base.stack_probes = true; | ||
|
||
Ok(Target { | ||
llvm_target: "x86_64-unknown-harvey-gnu".to_string(), | ||
target_endian: "little".to_string(), | ||
target_pointer_width: "64".to_string(), | ||
target_c_int_width: "32".to_string(), | ||
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" | ||
.to_string(), | ||
arch: "x86_64".to_string(), | ||
target_os: "linux".to_string(), | ||
target_env: "gnu".to_string(), | ||
target_vendor: "unknown".to_string(), | ||
linker_flavor: LinkerFlavor::Gcc, | ||
options: base, | ||
}) | ||
} |
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.