Skip to content

Commit e23a5fc

Browse files
committed
Enable -Zfunction-sections by default for *-windows-{gnu,cygwin}
The comment here was a bit misleading, #13846 was about an LLVM assertion that failed when `-Zfunction-sections` was enabled. However, that bug has been fixed for a long time and the actual issue was that older `ld` versions would not correctly link binaries (see #75604 for the prior attempt at this change). This bug was fixed in version 2.32 of binutils and Rust now ships binutils 2.42 as of #119229 so we can remove this workaround!
1 parent 843f8ce commit e23a5fc

File tree

2 files changed

+0
-4
lines changed

2 files changed

+0
-4
lines changed

compiler/rustc_target/src/spec/base/cygwin.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ pub(crate) fn opts() -> TargetOptions {
2626
TargetOptions {
2727
os: "cygwin".into(),
2828
vendor: "pc".into(),
29-
// FIXME(#13846) this should be enabled for cygwin
30-
function_sections: false,
3129
linker: Some("gcc".into()),
3230
dynamic_linking: true,
3331
dll_prefix: "".into(),

compiler/rustc_target/src/spec/base/windows_gnu.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ pub(crate) fn opts() -> TargetOptions {
8080
os: "windows".into(),
8181
env: "gnu".into(),
8282
vendor: "pc".into(),
83-
// FIXME(#13846) this should be enabled for windows
84-
function_sections: false,
8583
linker: Some("gcc".into()),
8684
dynamic_linking: true,
8785
dll_tls_export: false,

0 commit comments

Comments
 (0)