Skip to content

Commit 5c39879

Browse files
committed
auto merge of #17053 : thestinger/rust/large_address_aware, r=sfackler,cmr
By default, 32-bit Windows executables are restricted to 2GiB of address space even when running on 64-bit Windows when 4GiB is available. Closes #17043
2 parents ab7b1c8 + c6633fd commit 5c39879

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/librustc/back/link.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,12 @@ fn link_args(cmd: &mut Command,
10151015

10161016
// Mark all dynamic libraries and executables as compatible with ASLR
10171017
cmd.arg("-Wl,--dynamicbase");
1018+
1019+
// Mark all dynamic libraries and executables as compatible with the larger 4GiB address
1020+
// space available to x86 Windows binaries on x86_64.
1021+
if sess.targ_cfg.arch == abi::X86 {
1022+
cmd.arg("-Wl,--large-address-aware");
1023+
}
10181024
}
10191025

10201026
if sess.targ_cfg.os == abi::OsAndroid {

0 commit comments

Comments
 (0)