|
1 |
| -use crate::spec::{LinkerFlavor, Target, TargetResult}; |
| 1 | +use crate::spec::{LinkerFlavor, LldFlavor, Target, TargetResult}; |
2 | 2 |
|
3 | 3 | pub fn target() -> TargetResult {
|
4 | 4 | let mut base = super::windows_msvc_base::opts();
|
5 | 5 | base.cpu = "pentium4".to_string();
|
6 | 6 | base.max_atomic_width = Some(64);
|
7 | 7 |
|
8 |
| - // Mark all dynamic libraries and executables as compatible with the larger 4GiB address |
9 |
| - // space available to x86 Windows binaries on x86_64. |
10 |
| - base.pre_link_args.get_mut(&LinkerFlavor::Msvc).unwrap().push("/LARGEADDRESSAWARE".to_string()); |
| 8 | + let pre_link_args = vec![ |
| 9 | + // Mark all dynamic libraries and executables as compatible with the larger 4GiB address |
| 10 | + // space available to x86 Windows binaries on x86_64. |
| 11 | + "/LARGEADDRESSAWARE".to_string(), |
| 12 | + // Ensure the linker will only produce an image if it can also produce a table of |
| 13 | + // the image's safe exception handlers. |
| 14 | + // https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers |
| 15 | + "/SAFESEH".to_string(), |
| 16 | + ]; |
11 | 17 |
|
12 |
| - // Ensure the linker will only produce an image if it can also produce a table of |
13 |
| - // the image's safe exception handlers. |
14 |
| - // https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers |
15 |
| - base.pre_link_args.get_mut(&LinkerFlavor::Msvc).unwrap().push("/SAFESEH".to_string()); |
| 18 | + base.pre_link_args.get_mut(&LinkerFlavor::Msvc).unwrap().extend_from_slice(&pre_link_args); |
| 19 | + base.pre_link_args |
| 20 | + .get_mut(&LinkerFlavor::Lld(LldFlavor::Link)) |
| 21 | + .unwrap() |
| 22 | + .extend_from_slice(&pre_link_args); |
16 | 23 |
|
17 | 24 | Ok(Target {
|
18 | 25 | llvm_target: "i686-pc-windows-msvc".to_string(),
|
|
0 commit comments