Skip to content

Commit d3c71a5

Browse files
committed
enable DEP (NX bit) for 32-bit Windows executables
This is already enabled by default for x86_64 executables on Windows, but it needs to be manually enabled on x86. Closes #16533
1 parent cafa475 commit d3c71a5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/librustc/back/link.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1472,6 +1472,9 @@ fn link_args(cmd: &mut Command,
14721472
// [1] - https://sourceware.org/bugzilla/show_bug.cgi?id=13130
14731473
// [2] - https://code.google.com/p/go/issues/detail?id=2139
14741474
cmd.arg("-Wl,--enable-long-section-names");
1475+
1476+
// Always enable DEP (NX bit) when it is available
1477+
cmd.arg("-Wl,--nxcompat");
14751478
}
14761479

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

0 commit comments

Comments
 (0)