rustc_target/spec/targets/
i686_win7_windows_msvc.rs

1use crate::spec::{LinkerFlavor, Lld, RustcAbi, SanitizerSet, Target, base};
2
3pub(crate) fn target() -> Target {
4    let mut base = base::windows_msvc::opts();
5    base.vendor = "win7".into();
6    base.rustc_abi = Some(RustcAbi::X86Sse2);
7    base.cpu = "pentium4".into();
8    base.max_atomic_width = Some(64);
9    base.supported_sanitizers = SanitizerSet::ADDRESS;
10
11    base.add_pre_link_args(
12        LinkerFlavor::Msvc(Lld::No),
13        &[
14            // Mark all dynamic libraries and executables as compatible with the larger 4GiB address
15            // space available to x86 Windows binaries on x86_64.
16            "/LARGEADDRESSAWARE",
17            // Ensure the linker will only produce an image if it can also produce a table of
18            // the image's safe exception handlers.
19            // https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers
20            "/SAFESEH",
21        ],
22    );
23
24    Target {
25        llvm_target: "i686-pc-windows-msvc".into(),
26        metadata: crate::spec::TargetMetadata {
27            description: Some("32-bit MSVC (Windows 7+)".into()),
28            tier: Some(3),
29            host_tools: Some(false),
30            std: Some(true),
31        },
32        pointer_width: 32,
33        data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
34            i64:64-i128:128-f80:128-n8:16:32-a:0:32-S32"
35            .into(),
36        arch: "x86".into(),
37        options: base,
38    }
39}