Skip to content

Commit 32c4531

Browse files
committed
Add i686-pc-windows-gnullvm triple
1 parent 26f4b72 commit 32c4531

File tree

4 files changed

+30
-1
lines changed

4 files changed

+30
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
use crate::spec::{Cc, FramePointer, LinkerFlavor, Lld, Target};
2+
3+
pub fn target() -> Target {
4+
let mut base = super::windows_gnullvm_base::opts();
5+
base.cpu = "pentium4".into();
6+
base.max_atomic_width = Some(64);
7+
base.frame_pointer = FramePointer::Always; // Required for backtraces
8+
base.linker = Some("i686-w64-mingw32-clang".into());
9+
10+
// Mark all dynamic libraries and executables as compatible with the larger 4GiB address
11+
// space available to x86 Windows binaries on x86_64.
12+
base.add_pre_link_args(
13+
LinkerFlavor::Gnu(Cc::No, Lld::No),
14+
&["-m", "i386pe", "--large-address-aware"],
15+
);
16+
17+
Target {
18+
llvm_target: "i686-pc-windows-gnu".into(),
19+
pointer_width: 32,
20+
data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
21+
i64:64-f80:32-n8:16:32-a:0:32-S32"
22+
.into(),
23+
arch: "x86".into(),
24+
options: base,
25+
}
26+
}

compiler/rustc_target/src/spec/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1420,6 +1420,7 @@ supported_targets! {
14201420
("x86_64-uwp-windows-gnu", x86_64_uwp_windows_gnu),
14211421

14221422
("aarch64-pc-windows-gnullvm", aarch64_pc_windows_gnullvm),
1423+
("i686-pc-windows-gnullvm", i686_pc_windows_gnullvm),
14231424
("x86_64-pc-windows-gnullvm", x86_64_pc_windows_gnullvm),
14241425

14251426
("aarch64-pc-windows-msvc", aarch64_pc_windows_msvc),

src/doc/rustc/src/platform-support.md

+1
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ target | std | host | notes
267267
[`i586-pc-nto-qnx700`](platform-support/nto-qnx.md) | * | | 32-bit x86 QNX Neutrino 7.0 RTOS |
268268
`i686-apple-darwin` | ✓ | ✓ | 32-bit macOS (10.7+, Lion+)
269269
`i686-pc-windows-msvc` | * | | 32-bit Windows XP support
270+
[`i686-pc-windows-gnullvm`](platform-support/pc-windows-gnullvm.md) | ✓ | ✓ |
270271
`i686-unknown-haiku` | ✓ | ✓ | 32-bit Haiku
271272
[`i686-unknown-netbsd`](platform-support/netbsd.md) | ✓ | ✓ | NetBSD/i386 with SSE2
272273
[`i686-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | 32-bit OpenBSD

src/doc/rustc/src/platform-support/pc-windows-gnullvm.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Windows targets similar to `*-pc-windows-gnu` but using UCRT as the runtime and
66

77
Target triples available so far:
88
- `aarch64-pc-windows-gnullvm`
9+
- `i686-pc-windows-gnullvm`
910
- `x86_64-pc-windows-gnullvm`
1011

1112
## Target maintainers
@@ -42,7 +43,7 @@ Once these targets bootstrap themselves on native hardware they should pass Rust
4243

4344
## Cross-compilation toolchains and C code
4445

45-
Compatible C code can be built with Clang's `aarch64-pc-windows-gnu` and `x86_64-pc-windows-gnu` targets as long as LLVM based C toolchains are used.
46+
Compatible C code can be built with Clang's `aarch64-pc-windows-gnu`, `i686-pc-windows-gnullvm` and `x86_64-pc-windows-gnu` targets as long as LLVM based C toolchains are used.
4647
Those include:
4748
- [llvm-mingw](https://github.com/mstorsjo/llvm-mingw)
4849
- [MSYS2 with CLANG* environment](https://www.msys2.org/docs/environments)

0 commit comments

Comments
 (0)