adapt L4Bender implementation
- Fix style errors. - L4-bender does not yet support dynamic linking. - Stack unwinding is not yet supported for x86_64-unknown-l4re-uclibc. For now, just abort on panics. - Use GNU-style linker options where possible. As suggested by review: - Use standard GNU-style ld syntax for relro flags. - Use standard GNU-style optimization flags and logic. - Use standard GNU-style ld syntax for --subsystem. - Don't read environment variables in L4Bender linker. Thanks to CARGO_ENCODED_RUSTFLAGS introduced in #9601, l4-bender's arguments can now be passed from the L4Re build system without resorting to custom parsing of environment variables.
This commit is contained in:
parent
d98428711e
commit
660d993c64
4 changed files with 75 additions and 90 deletions
|
@ -1,16 +1,16 @@
|
|||
use crate::spec::{LinkArgs, LinkerFlavor, PanicStrategy, TargetOptions};
|
||||
use crate::spec::{LinkerFlavor, PanicStrategy, TargetOptions};
|
||||
use std::default::Default;
|
||||
|
||||
pub fn opts() -> TargetOptions {
|
||||
TargetOptions {
|
||||
os: "l4re".to_string(),
|
||||
env: "uclibc".to_string(),
|
||||
linker_flavor: LinkerFlavor::Ld,
|
||||
linker_flavor: LinkerFlavor::L4Bender,
|
||||
executables: true,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
linker: Some("l4-bender".to_string()),
|
||||
pre_link_args: args,
|
||||
os_family: Some("unix".to_string()),
|
||||
linker_is_gnu: false,
|
||||
families: vec!["unix".to_string()],
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
use crate::spec::Target;
|
||||
use crate::spec::{PanicStrategy, Target};
|
||||
|
||||
pub fn target() -> Target {
|
||||
let mut base = super::l4re_base::opts();
|
||||
base.cpu = "x86-64".to_string();
|
||||
base.max_atomic_width = Some(64);
|
||||
base.crt_static_allows_dylibs = false;
|
||||
base.dynamic_linking = false;
|
||||
base.panic_strategy = PanicStrategy::Abort;
|
||||
|
||||
Target {
|
||||
llvm_target: "x86_64-unknown-l4re-uclibc".to_string(),
|
||||
|
@ -11,10 +14,6 @@ pub fn target() -> Target {
|
|||
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: "l4re".to_string(),
|
||||
target_env: "uclibc".to_string(),
|
||||
target_vendor: "unknown".to_string(),
|
||||
linker_flavor: LinkerFlavor::L4Bender,
|
||||
options: base,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue