From dc4361f4cb49f376993129fea6768a978a28711e Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Tue, 13 Oct 2015 19:30:22 +0800 Subject: [PATCH] MSVC 2010+ builds: Explicitly use /LTCG The Visual Studio projects used a default setting for link-time code generation, which is a part of the various linker optimizations that is available, which is set as /LTCG for Visual Studio 2013 and earlier. This changed in Visual Studio 2015 to become /LTCG:incremental, which would cause GResources-generated code to be optimized out during linking, unless they were referred to directly in the main line code (such as when the GResource is manually registered), causing programs to crash as a result as they can't find the needed code/data at run time. Fix this by explicitly setting /LTCG for all release builds, for Visual Studio 2010 and later. https://bugzilla.gnome.org/show_bug.cgi?id=752837 --- build/win32/vs10/gdbus.vcxproj | 2 ++ build/win32/vs10/gio-querymodules.vcxproj | 2 ++ build/win32/vs10/gio.vcxprojin | 10 ++++++---- .../vs10/glib-compile-resources.vcxprojin | 2 ++ .../win32/vs10/glib-compile-schemas.vcxprojin | 2 ++ build/win32/vs10/glib-genmarshal.vcxproj | 2 ++ build/win32/vs10/glib.vcxprojin | 20 +++++++++++-------- build/win32/vs10/gmodule.vcxproj | 10 ++++++---- build/win32/vs10/gobject.vcxprojin | 10 ++++++---- build/win32/vs10/gresource.vcxproj | 2 ++ build/win32/vs10/gsettings.vcxproj | 2 ++ .../vs10/gspawn-win32-helper-console.vcxproj | 2 ++ build/win32/vs10/gspawn-win32-helper.vcxproj | 2 ++ build/win32/vs10/gthread.vcxproj | 10 ++++++---- 14 files changed, 54 insertions(+), 24 deletions(-) diff --git a/build/win32/vs10/gdbus.vcxproj b/build/win32/vs10/gdbus.vcxproj index 759143f2b..010b91f01 100644 --- a/build/win32/vs10/gdbus.vcxproj +++ b/build/win32/vs10/gdbus.vcxproj @@ -132,6 +132,7 @@ Console true true + UseLinkTimeCodeGeneration MachineX86 @@ -154,6 +155,7 @@ false + UseLinkTimeCodeGeneration MachineX64 diff --git a/build/win32/vs10/gio-querymodules.vcxproj b/build/win32/vs10/gio-querymodules.vcxproj index b33a1d186..c2168c4b0 100644 --- a/build/win32/vs10/gio-querymodules.vcxproj +++ b/build/win32/vs10/gio-querymodules.vcxproj @@ -132,6 +132,7 @@ Console true true + UseLinkTimeCodeGeneration MachineX86 @@ -154,6 +155,7 @@ false + UseLinkTimeCodeGeneration MachineX64 diff --git a/build/win32/vs10/gio.vcxprojin b/build/win32/vs10/gio.vcxprojin index 627a9af60..5f156ccdf 100644 --- a/build/win32/vs10/gio.vcxprojin +++ b/build/win32/vs10/gio.vcxprojin @@ -90,11 +90,11 @@ $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).dll true $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).pdb + $(TargetDir)$(ProjectName)-$(ApiVersion).lib Windows false - $(TargetDir)$(ProjectName)-$(ApiVersion).lib MachineX86 @@ -114,13 +114,14 @@ $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).dll true $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).pdb + $(TargetDir)$(ProjectName)-$(ApiVersion).lib Windows true true false - $(TargetDir)$(ProjectName)-$(ApiVersion).lib + UseLinkTimeCodeGeneration MachineX86 @@ -143,11 +144,11 @@ $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).dll true $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).pdb + $(TargetDir)$(ProjectName)-$(ApiVersion).lib Windows false - $(TargetDir)$(ProjectName)-$(ApiVersion).lib MachineX64 @@ -167,13 +168,14 @@ $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).dll true $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).pdb + $(TargetDir)$(ProjectName)-$(ApiVersion).lib Windows true true false - $(TargetDir)$(ProjectName)-$(ApiVersion).lib + UseLinkTimeCodeGeneration MachineX64 diff --git a/build/win32/vs10/glib-compile-resources.vcxprojin b/build/win32/vs10/glib-compile-resources.vcxprojin index e098347b6..44462bf0e 100644 --- a/build/win32/vs10/glib-compile-resources.vcxprojin +++ b/build/win32/vs10/glib-compile-resources.vcxprojin @@ -132,6 +132,7 @@ Console true true + UseLinkTimeCodeGeneration MachineX86 @@ -154,6 +155,7 @@ false + UseLinkTimeCodeGeneration MachineX64 diff --git a/build/win32/vs10/glib-compile-schemas.vcxprojin b/build/win32/vs10/glib-compile-schemas.vcxprojin index fff97fb42..e696a070d 100644 --- a/build/win32/vs10/glib-compile-schemas.vcxprojin +++ b/build/win32/vs10/glib-compile-schemas.vcxprojin @@ -132,6 +132,7 @@ Console true true + UseLinkTimeCodeGeneration MachineX86 @@ -154,6 +155,7 @@ false + UseLinkTimeCodeGeneration MachineX64 diff --git a/build/win32/vs10/glib-genmarshal.vcxproj b/build/win32/vs10/glib-genmarshal.vcxproj index 8f31f7b26..05a032054 100644 --- a/build/win32/vs10/glib-genmarshal.vcxproj +++ b/build/win32/vs10/glib-genmarshal.vcxproj @@ -112,6 +112,7 @@ false + UseLinkTimeCodeGeneration MachineX86 @@ -155,6 +156,7 @@ false + UseLinkTimeCodeGeneration MachineX64 diff --git a/build/win32/vs10/glib.vcxprojin b/build/win32/vs10/glib.vcxprojin index db5550a54..9602c65fa 100644 --- a/build/win32/vs10/glib.vcxprojin +++ b/build/win32/vs10/glib.vcxprojin @@ -152,11 +152,11 @@ $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).dll true $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).pdb + $(TargetDir)$(ProjectName)-$(ApiVersion).lib Windows false - $(TargetDir)$(ProjectName)-$(ApiVersion).lib MachineX86 @@ -178,11 +178,11 @@ $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).dll true $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).pdb + $(TargetDir)$(ProjectName)-$(ApiVersion).lib Windows false - $(TargetDir)$(ProjectName)-$(ApiVersion).lib MachineX86 @@ -204,11 +204,11 @@ $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).dll true $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).pdb + $(TargetDir)$(ProjectName)-$(ApiVersion).lib Windows false - $(TargetDir)$(ProjectName)-$(ApiVersion).lib MachineX64 @@ -230,11 +230,11 @@ $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).dll true $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).pdb + $(TargetDir)$(ProjectName)-$(ApiVersion).lib Windows false - $(TargetDir)$(ProjectName)-$(ApiVersion).lib MachineX64 @@ -253,13 +253,14 @@ $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).dll true $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).pdb + $(TargetDir)$(ProjectName)-$(ApiVersion).lib Windows true true false - $(TargetDir)$(ProjectName)-$(ApiVersion).lib + UseLinkTimeCodeGeneration MachineX86 @@ -278,13 +279,14 @@ $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).dll true $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).pdb + $(TargetDir)$(ProjectName)-$(ApiVersion).lib Windows true true false - $(TargetDir)$(ProjectName)-$(ApiVersion).lib + UseLinkTimeCodeGeneration MachineX86 @@ -303,13 +305,14 @@ $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).dll true $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).pdb + $(TargetDir)$(ProjectName)-$(ApiVersion).lib Windows true true false - $(TargetDir)$(ProjectName)-$(ApiVersion).lib + UseLinkTimeCodeGeneration MachineX64 @@ -328,13 +331,14 @@ $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).dll true $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).pdb + $(TargetDir)$(ProjectName)-$(ApiVersion).lib Windows true true false - $(TargetDir)$(ProjectName)-$(ApiVersion).lib + UseLinkTimeCodeGeneration MachineX64 diff --git a/build/win32/vs10/gmodule.vcxproj b/build/win32/vs10/gmodule.vcxproj index 93e73285a..ce65f3f2d 100644 --- a/build/win32/vs10/gmodule.vcxproj +++ b/build/win32/vs10/gmodule.vcxproj @@ -89,11 +89,11 @@ $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).dll true $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).pdb + $(TargetDir)$(ProjectName)-$(ApiVersion).lib Windows false - $(TargetDir)$(ProjectName)-$(ApiVersion).lib MachineX86 @@ -111,13 +111,14 @@ $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).dll true $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).pdb + $(TargetDir)$(ProjectName)-$(ApiVersion).lib Windows true true false - $(TargetDir)$(ProjectName)-$(ApiVersion).lib + UseLinkTimeCodeGeneration MachineX86 @@ -138,11 +139,11 @@ $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).dll true $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).pdb + $(TargetDir)$(ProjectName)-$(ApiVersion).lib Windows false - $(TargetDir)$(ProjectName)-$(ApiVersion).lib MachineX64 @@ -160,13 +161,14 @@ $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).dll true $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).pdb + $(TargetDir)$(ProjectName)-$(ApiVersion).lib Windows true true false - $(TargetDir)$(ProjectName)-$(ApiVersion).lib + UseLinkTimeCodeGeneration MachineX64 diff --git a/build/win32/vs10/gobject.vcxprojin b/build/win32/vs10/gobject.vcxprojin index 03cc978f6..997136fac 100644 --- a/build/win32/vs10/gobject.vcxprojin +++ b/build/win32/vs10/gobject.vcxprojin @@ -89,11 +89,11 @@ $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).dll true $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).pdb + $(TargetDir)$(ProjectName)-$(ApiVersion).lib Windows false - $(TargetDir)$(ProjectName)-$(ApiVersion).lib MachineX86 @@ -111,13 +111,14 @@ $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).dll true $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).pdb + $(TargetDir)$(ProjectName)-$(ApiVersion).lib Windows true true false - $(TargetDir)$(ProjectName)-$(ApiVersion).lib + UseLinkTimeCodeGeneration MachineX86 @@ -138,11 +139,11 @@ $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).dll true $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).pdb + $(TargetDir)$(ProjectName)-$(ApiVersion).lib Windows false - $(TargetDir)$(ProjectName)-$(ApiVersion).lib MachineX64 @@ -160,13 +161,14 @@ $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).dll true $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).pdb + $(TargetDir)$(ProjectName)-$(ApiVersion).lib Windows true true false - $(TargetDir)$(ProjectName)-$(ApiVersion).lib + UseLinkTimeCodeGeneration MachineX64 diff --git a/build/win32/vs10/gresource.vcxproj b/build/win32/vs10/gresource.vcxproj index f52b38acc..6c26b9e9c 100644 --- a/build/win32/vs10/gresource.vcxproj +++ b/build/win32/vs10/gresource.vcxproj @@ -132,6 +132,7 @@ Console true true + UseLinkTimeCodeGeneration MachineX86 @@ -154,6 +155,7 @@ false + UseLinkTimeCodeGeneration MachineX64 diff --git a/build/win32/vs10/gsettings.vcxproj b/build/win32/vs10/gsettings.vcxproj index f74913b80..331c5ec9b 100644 --- a/build/win32/vs10/gsettings.vcxproj +++ b/build/win32/vs10/gsettings.vcxproj @@ -133,6 +133,7 @@ Console true true + UseLinkTimeCodeGeneration MachineX86 @@ -155,6 +156,7 @@ false + UseLinkTimeCodeGeneration MachineX64 diff --git a/build/win32/vs10/gspawn-win32-helper-console.vcxproj b/build/win32/vs10/gspawn-win32-helper-console.vcxproj index 6cbb67cd9..ef278b7fa 100644 --- a/build/win32/vs10/gspawn-win32-helper-console.vcxproj +++ b/build/win32/vs10/gspawn-win32-helper-console.vcxproj @@ -112,6 +112,7 @@ false + UseLinkTimeCodeGeneration MachineX86 @@ -136,6 +137,7 @@ false + UseLinkTimeCodeGeneration MachineX64 diff --git a/build/win32/vs10/gspawn-win32-helper.vcxproj b/build/win32/vs10/gspawn-win32-helper.vcxproj index 581515e9b..c3bdf4511 100644 --- a/build/win32/vs10/gspawn-win32-helper.vcxproj +++ b/build/win32/vs10/gspawn-win32-helper.vcxproj @@ -136,6 +136,7 @@ false + UseLinkTimeCodeGeneration MachineX86 @@ -159,6 +160,7 @@ false + UseLinkTimeCodeGeneration MachineX64 diff --git a/build/win32/vs10/gthread.vcxproj b/build/win32/vs10/gthread.vcxproj index 8d16faf43..d384797e7 100644 --- a/build/win32/vs10/gthread.vcxproj +++ b/build/win32/vs10/gthread.vcxproj @@ -89,11 +89,11 @@ $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).dll true $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).pdb + $(TargetDir)$(ProjectName)-$(ApiVersion).lib Windows false - $(TargetDir)$(ProjectName)-$(ApiVersion).lib MachineX86 @@ -111,13 +111,14 @@ $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).dll true $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).pdb + $(TargetDir)$(ProjectName)-$(ApiVersion).lib Windows true true false - $(TargetDir)$(ProjectName)-$(ApiVersion).lib + UseLinkTimeCodeGeneration MachineX86 @@ -138,11 +139,11 @@ $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).dll true $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).pdb + $(TargetDir)$(ProjectName)-$(ApiVersion).lib Windows false - $(TargetDir)$(ProjectName)-$(ApiVersion).lib MachineX64 @@ -160,13 +161,14 @@ $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).dll true $(OutDir)$(GlibDllPrefix)$(ProjectName)$(GlibDllSuffix).pdb + $(TargetDir)$(ProjectName)-$(ApiVersion).lib Windows true true false - $(TargetDir)$(ProjectName)-$(ApiVersion).lib + UseLinkTimeCodeGeneration MachineX64