mv compiler to compiler/
This commit is contained in:
24
compiler/rustc_target/src/spec/linux_kernel_base.rs
Normal file
24
compiler/rustc_target/src/spec/linux_kernel_base.rs
Normal file
@@ -0,0 +1,24 @@
|
||||
use crate::spec::{LinkArgs, LinkerFlavor, PanicStrategy, RelocModel, RelroLevel, TargetOptions};
|
||||
|
||||
pub fn opts() -> TargetOptions {
|
||||
let mut pre_link_args = LinkArgs::new();
|
||||
pre_link_args.insert(
|
||||
LinkerFlavor::Gcc,
|
||||
vec!["-Wl,--as-needed".to_string(), "-Wl,-z,noexecstack".to_string()],
|
||||
);
|
||||
|
||||
TargetOptions {
|
||||
disable_redzone: true,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
stack_probes: true,
|
||||
eliminate_frame_pointer: false,
|
||||
linker_is_gnu: true,
|
||||
position_independent_executables: true,
|
||||
needs_plt: true,
|
||||
relro_level: RelroLevel::Full,
|
||||
relocation_model: RelocModel::Static,
|
||||
pre_link_args,
|
||||
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user