-
-
Notifications
You must be signed in to change notification settings - Fork 584
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
Fix #1064 and LINKFLAGS typo for "-static" #1082
Conversation
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.
Probably it should be an option (enabled by default), similar to the Godot build configs:
BoolVariable("use_static_cpp", "Link MinGW/MSVC C++ runtime libraries statically", True)
And also forced for MSVC build:
env.AppendUnique(CCFLAGS=["/MT"])
I'm not sure why we are setting -O3
for debug build, but since it's done for cross-build, it should be the same for native/msys build (or removed from both).
A wrong link? This issue seems to be unrelated to static linking. |
Unrelated to this issue, but tools\my_spawn.py has a (deadlock?) bug spoiling MinGW build. |
("-O3" overridden and handled by Scons options "debug_symbols" and "optimize" in tools/targets.py)
|
Discussed at the GDExtension meeting: overall, we think this makes sense, however, we think it should be an option that is enabled by default as suggested by @bruvzg in an earlier comment. |
I just tested this one and it fixed the problem for me! I think the only thing that still needs to be done here is adding the option that's enabled by default. If the OP doesn't have time to do this, I may pick it up some time this week. |
Superseded by #1203. Thanks for the contribution! |
This PR closes #1064, and #976 if it happens to MinGW only.
I suggest applying PR #1059 's patch before test this one.
Statically linked DLL will not depend on external MinGW DLLs (like libgcc_s_seh-1.dll, libstdc++-6.dll and libwinpthread-1.dll), thus it can be loaded by itself.
BTW, "--static" should be "-static".
FYI:
gcc: -static
ld: -static