Skip to content

Commit

Permalink
Add linker arguments from i686-pc-windows-msvc to LLD too
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc committed Jan 29, 2020
1 parent 3761dcd commit 4ca5795
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/librustc_target/spec/i686_pc_windows_msvc.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
use crate::spec::{LinkerFlavor, Target, TargetResult};
use crate::spec::{LinkerFlavor, LldFlavor, Target, TargetResult};

pub fn target() -> TargetResult {
let mut base = super::windows_msvc_base::opts();
base.cpu = "pentium4".to_string();
base.max_atomic_width = Some(64);

// Mark all dynamic libraries and executables as compatible with the larger 4GiB address
// space available to x86 Windows binaries on x86_64.
base.pre_link_args.get_mut(&LinkerFlavor::Msvc).unwrap().push("/LARGEADDRESSAWARE".to_string());
let pre_link_args = vec![
// Mark all dynamic libraries and executables as compatible with the larger 4GiB address
// space available to x86 Windows binaries on x86_64.
"/LARGEADDRESSAWARE".to_string(),
// Ensure the linker will only produce an image if it can also produce a table of
// the image's safe exception handlers.
// https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers
"/SAFESEH".to_string(),
];

// Ensure the linker will only produce an image if it can also produce a table of
// the image's safe exception handlers.
// https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers
base.pre_link_args.get_mut(&LinkerFlavor::Msvc).unwrap().push("/SAFESEH".to_string());
base.pre_link_args.get_mut(&LinkerFlavor::Msvc).unwrap().extend_from_slice(&pre_link_args);
base.pre_link_args
.get_mut(&LinkerFlavor::Lld(LldFlavor::Link))
.unwrap()
.extend_from_slice(&pre_link_args);

Ok(Target {
llvm_target: "i686-pc-windows-msvc".to_string(),
Expand Down

0 comments on commit 4ca5795

Please sign in to comment.