-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Windows] Fix loading debug symbol files over 2GB. #100281
Conversation
The changes look super straightforward and correct. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this fixes the 2GB debug symbol limit, shouldn't we also remove the current separate_debug_symbols
workaround?
platform/windows/SCsub | 2 +-
platform/windows/platform_windows_builders.py | 8 +++-----
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/platform/windows/SCsub b/platform/windows/SCsub
index 1ddefb9c33..4d4d69cbe9 100644
--- a/platform/windows/SCsub
+++ b/platform/windows/SCsub
@@ -125,7 +125,7 @@ if env["d3d12"]:
)
if not os.getenv("VCINSTALLDIR"):
- if env["debug_symbols"]:
+ if env["debug_symbols"] and env["separate_debug_symbols"]:
env.AddPostAction(prog, env.Run(platform_windows_builders.make_debug_mingw))
if env["windows_subsystem"] == "gui":
env.AddPostAction(prog_wrap, env.Run(platform_windows_builders.make_debug_mingw))
diff --git a/platform/windows/platform_windows_builders.py b/platform/windows/platform_windows_builders.py
index 2020e68748..1bd9ab3070 100644
--- a/platform/windows/platform_windows_builders.py
+++ b/platform/windows/platform_windows_builders.py
@@ -5,8 +5,6 @@ import os
def make_debug_mingw(target, source, env):
dst = str(target[0])
- # Force separate debug symbols if executable size is larger than 1.9 GB.
- if env["separate_debug_symbols"] or os.stat(dst).st_size >= 2040109465:
- os.system("{0} --only-keep-debug {1} {1}.debugsymbols".format(env["OBJCOPY"], dst))
- os.system("{0} --strip-debug --strip-unneeded {1}".format(env["STRIP"], dst))
- os.system("{0} --add-gnu-debuglink={1}.debugsymbols {1}".format(env["OBJCOPY"], dst))
+ os.system("{0} --only-keep-debug {1} {1}.debugsymbols".format(env["OBJCOPY"], dst))
+ os.system("{0} --strip-debug --strip-unneeded {1}".format(env["STRIP"], dst))
+ os.system("{0} --add-gnu-debuglink={1}.debugsymbols {1}".format(env["OBJCOPY"], dst))
No, it fixes loading separate symbols over 2GB, Windows still can't load |
Tested that locally, it seems to work well. All those binaries have a working backtrace:
I tried too with LTO, and those binaries have a working backtrace but without any Godot specific symbols:
Not sure what's the state of GCC LTO and debugging, so this is probably not related to this change. This might be a problem for our goal of providing debuginfo for official builds though, so maybe something to look at next. |
Thanks! |
No description provided.