From a6fe3feacdfce00f42aadd4880cba3b67ff9a5d4 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sun, 17 Nov 2024 19:29:16 +0900 Subject: [PATCH] Win32: Remove unreferenced COMDAT from object files Windows 11 SDK Version 10.0.26100.0 introduced a new internal inline function in ucrt/corecrt_math.h. Even it appears in object files and will be included in the DEF file, it will be removed from the DLL and result in a linker error. --- win32/Makefile.sub | 3 +++ win32/mkexports.rb | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/win32/Makefile.sub b/win32/Makefile.sub index b508b50124..ce4ea06c92 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -163,6 +163,9 @@ OPTFLAGS = -O2b2xg- OPTFLAGS = -O2sy- !endif !endif +!if $(MSC_VER) >= 1900 +OPTFLAGS = $(OPTFLAGS) -Zc:inline +!endif !if !defined(incflags) incflags = !endif diff --git a/win32/mkexports.rb b/win32/mkexports.rb index 1250673c6f..1a37c7ee91 100755 --- a/win32/mkexports.rb +++ b/win32/mkexports.rb @@ -122,7 +122,6 @@ class Exports::Mswin < Exports elsif !l.sub!(/^(\S+) \([^@?\`\']*\)$/, '\1') next end - next if /\A_?ucrt_/ =~ l when /DLL/ next unless l.sub!(/^\s*\d+\s+[[:xdigit:]]+\s+[[:xdigit:]]+\s+/, '') else