Skip to content

Commit c6633fd

Browse files
committed
mark win32 binaries as large address aware
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
1 parent d8a2618 commit c6633fd

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
@@ -1019,6 +1019,12 @@ fn link_args(cmd: &mut Command,
10191019

10201020
// Mark all dynamic libraries and executables as compatible with ASLR
10211021
cmd.arg("-Wl,--dynamicbase");
1022+
1023+
// Mark all dynamic libraries and executables as compatible with the larger 4GiB address
1024+
// space available to x86 Windows binaries on x86_64.
1025+
if sess.targ_cfg.arch == abi::X86 {
1026+
cmd.arg("-Wl,--large-address-aware");
1027+
}
10221028
}
10231029

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

0 commit comments

Comments
 (0)