|
8 | 8 | // option. This file may not be copied, modified, or distributed
|
9 | 9 | // except according to those terms.
|
10 | 10 |
|
11 |
| -use spec::{LinkArgs, LinkerFlavor, TargetOptions}; |
| 11 | +use spec::{LldFlavor, LinkArgs, LinkerFlavor, TargetOptions}; |
12 | 12 | use std::default::Default;
|
13 | 13 |
|
14 | 14 | pub fn opts() -> TargetOptions {
|
15 | 15 | let mut args = LinkArgs::new();
|
16 |
| - args.insert(LinkerFlavor::Gcc, vec![ |
17 |
| - // We want to be able to strip as much executable code as possible |
18 |
| - // from the linker command line, and this flag indicates to the |
19 |
| - // linker that it can avoid linking in dynamic libraries that don't |
20 |
| - // actually satisfy any symbols up to that point (as with many other |
21 |
| - // resolutions the linker does). This option only applies to all |
22 |
| - // following libraries so we're sure to pass it as one of the first |
23 |
| - // arguments. |
24 |
| - // FIXME: figure out whether these linker args are desirable |
25 |
| - //"-Wl,--as-needed".to_string(), |
26 |
| - |
27 |
| - // Always enable NX protection when it is available |
28 |
| - //"-Wl,-z,noexecstack".to_string(), |
| 16 | + args.insert(LinkerFlavor::Lld(LldFlavor::Ld), vec![ |
| 17 | + "--build-id".to_string(), "--hash-style=gnu".to_string(), |
| 18 | + "-z".to_string(), "rodynamic".to_string(), |
29 | 19 | ]);
|
30 | 20 |
|
31 | 21 | TargetOptions {
|
| 22 | + linker: Some("rust-lld".to_owned()), |
| 23 | + lld_flavor: LldFlavor::Ld, |
32 | 24 | dynamic_linking: true,
|
33 | 25 | executables: true,
|
34 | 26 | target_family: Some("unix".to_string()),
|
|
0 commit comments