From 423a90043d8dc6cb27a2183ace86a398f2abdd8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20T=2E=20Listwon?= Date: Sun, 30 Jan 2022 16:26:24 +0100 Subject: [PATCH] Prevent LTCG (MSVC LTO) from removing "pck" section (cherry picked from commit e4bde938a17ee4b0f643240d71a174c63c2e263b) --- platform/windows/godot_windows.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platform/windows/godot_windows.cpp b/platform/windows/godot_windows.cpp index 2a561e71067..ed0fba3dd8e 100644 --- a/platform/windows/godot_windows.cpp +++ b/platform/windows/godot_windows.cpp @@ -140,6 +140,11 @@ __declspec(dllexport) int widechar_main(int argc, wchar_t **argv) { setlocale(LC_CTYPE, ""); +#ifndef TOOLS_ENABLED + // Workaround to prevent LTCG (MSVC LTO) from removing "pck" section + char *dummy_guard = dummy; +#endif + char **argv_utf8 = new char *[argc]; for (int i = 0; i < argc; ++i) {