Skip to content

Commit 4e5cc19

Browse files
committed
Disable identical COMDAT folding linker optimization on Windows.
1 parent 9f439a8 commit 4e5cc19

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ci/run.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ export RUSTFLAGS="${RUSTFLAGS} -D warnings -Z merge-functions=disabled "
1515
export STDARCH_DISABLE_DEDUP_GUARD=1
1616

1717
case ${TARGET} in
18+
# On Windows the linker performs identical COMDAT folding (ICF) by default
19+
# in release mode which removes identical COMDAT sections. This interferes
20+
# with our instruction assertions just like LLVM's MergeFunctions pass so
21+
# we disable it.
1822
*-pc-windows-msvc)
23+
export RUSTFLAGS="${RUSTFLAGS} -Clink-args=/OPT:NOICF"
1924
;;
2025
# On 32-bit use a static relocation model which avoids some extra
2126
# instructions when dealing with static data, notably allowing some

0 commit comments

Comments
 (0)