linker: Use --as-needed by default when linker supports it

This commit is contained in:
Vadim Petrochenkov
2021-03-28 00:02:23 +03:00
parent afaf33dcaf
commit 6615ee89be
21 changed files with 30 additions and 94 deletions

View File

@@ -4,10 +4,7 @@ use crate::spec::{
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()],
);
pre_link_args.insert(LinkerFlavor::Gcc, vec!["-Wl,-z,noexecstack".to_string()]);
TargetOptions {
env: "gnu".to_string(),