Skip to content
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

SCons: Add 'split_libmodules' option to workaround linker issue #34227

Merged

Conversation

akien-mga
Copy link
Member

@akien-mga akien-mga commented Dec 9, 2019

The new 'split_libmodules=yes' option is useful to work around linker
command line size limitations when linking a huge number of objects.
We're currently over 64k chars when linking libmodules.a on Windows
with MinGW, which triggers issues as seen in #30892.

Even on Linux, we can also reach linker command line size limitations
by adding more custom modules.

We force this option to True for MinGW on Windows, which fixes #30892.

Additional changes:

Additional changes to lib splitting:

  • Fix linking of the split module libs with interdependent symbols,
    hacking our way into LINKCOM and SHLINKCOM to set the --start-group
    and --end-group flags.
  • Fix Python 3 compatibility in methods.split_lib().
  • Drop seemingly obsolete condition for 'msys' on 'posix'.
  • Drop the unnecessary 'split_drivers' as the drivers lib is no longer
    too big since we moved all thirdparty builds to modules.

Co-authored-by: @hpvb

@bdbaddog
Copy link

@akien-mga - try this change without your current changes and see if that resolves the issue: bdbaddog@ea7b293

@akien-mga
Copy link
Member Author

akien-mga commented Dec 10, 2019

@bdbaddog That seems to work well for libmodules.a, thanks a lot!

I still get the same linking issue eventually as I do with this workaround PR, not sure yet why:

b"C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: modules/libmodules.windows.opt.tools.64.a(register_module_types.gen.windows.opt.tools.64.o): in function `register_module_types()':
C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:53: undefined reference to `register_assimp_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:56: undefined reference to `register_bmp_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:59: undefined reference to `register_bullet_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:62: undefined reference to `register_camera_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:65: undefined reference to `register_csg_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:68: undefined reference to `register_cvtt_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:71: undefined reference to `register_dds_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:74: undefined reference to `register_enet_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:77: undefined reference to `register_etc_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:80: undefined reference to `register_freetype_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:83: undefined reference to `register_gdnative_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:86: undefined reference to `register_gdscript_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:89: undefined reference to `register_gridmap_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:92: undefined reference to `register_hdr_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:95: undefined reference to `register_jpg_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:98: undefined reference to `register_jsonrpc_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:101: undefined reference to `register_mbedtls_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:104: undefined reference to `register_mobile_vr_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:110: undefined reference to `register_ogg_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:113: undefined reference to `register_opensimplex_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:116: undefined reference to `register_opus_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:119: undefined reference to `register_pvr_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:122: undefined reference to `register_recast_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:125: undefined reference to `register_regex_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:128: undefined reference to `register_squish_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:131: undefined reference to `register_stb_vorbis_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:134: undefined reference to `register_svg_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:137: undefined reference to `register_tga_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:140: undefined reference to `register_theora_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:143: undefined reference to `register_tinyexr_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:146: undefined reference to `register_upnp_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:149: undefined reference to `register_vhacd_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:152: undefined reference to `register_visual_script_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:155: undefined reference to `register_vorbis_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:158: undefined reference to `register_webm_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:161: undefined reference to `register_webp_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:164: undefined reference to `register_webrtc_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:167: undefined reference to `register_websocket_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: modules/libmodules.windows.opt.tools.64.a(register_module_types.gen.windows.opt.tools.64.o): in function `unregister_module_types()':
C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:180: undefined reference to `unregister_assimp_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:183: undefined reference to `unregister_bmp_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:186: undefined reference to `unregister_bullet_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:189: undefined reference to `unregister_camera_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:192: undefined reference to `unregister_csg_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:195: undefined reference to `unregister_cvtt_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:198: undefined reference to `unregister_dds_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:201: undefined reference to `unregister_enet_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:204: undefined reference to `unregister_etc_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:207: undefined reference to `unregister_freetype_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:210: undefined reference to `unregister_gdnative_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:213: undefined reference to `unregister_gdscript_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:216: undefined reference to `unregister_gridmap_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:219: undefined reference to `unregister_hdr_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:222: undefined reference to `unregister_jpg_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:225: undefined reference to `unregister_jsonrpc_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:228: undefined reference to `unregister_mbedtls_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:231: undefined reference to `unregister_mobile_vr_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:237: undefined reference to `unregister_ogg_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:240: undefined reference to `unregister_opensimplex_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:243: undefined reference to `unregister_opus_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:246: undefined reference to `unregister_pvr_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:249: undefined reference to `unregister_recast_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:252: undefined reference to `unregister_regex_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:255: undefined reference to `unregister_squish_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:258: undefined reference to `unregister_stb_vorbis_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:261: undefined reference to `unregister_svg_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:264: undefined reference to `unregister_tga_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:267: undefined reference to `unregister_theora_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:270: undefined reference to `unregister_tinyexr_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:273: undefined reference to `unregister_upnp_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:276: undefined reference to `unregister_vhacd_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:279: undefined reference to `unregister_visual_script_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:282: undefined reference to `unregister_vorbis_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:285: undefined reference to `unregister_webm_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:288: undefined reference to `unregister_webp_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:291: undefined reference to `unregister_webrtc_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/modules/register_module_types.gen.cpp:294: undefined reference to `unregister_websocket_types()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: editor/libeditor.windows.opt.tools.64.a(editor_themes.windows.opt.tools.64.o): in function `editor_generate_icon(int, bool, float, bool)':
C:\\Dev\\Godot\\godot.git/editor/editor_themes.cpp:92: undefined reference to `ImageLoaderSVG::create_image_from_string(Ref<Image>, char const*, float, bool, bool)'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: editor/libeditor.windows.opt.tools.64.a(editor_themes.windows.opt.tools.64.o): in function `editor_register_and_generate_icons(Ref<Theme>, bool, int, bool)':
C:\\Dev\\Godot\\godot.git/editor/editor_themes.cpp:208: undefined reference to `ImageLoaderSVG::set_convert_colors(Dictionary*)'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/editor/editor_themes.cpp:241: undefined reference to `ImageLoaderSVG::set_convert_colors(Dictionary*)'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: editor/libeditor.windows.opt.tools.64.a(editor_scene_importer_gltf.windows.opt.tools.64.o): in function `EditorSceneImporterGLTF::_sanitize_scene_name(String const&)':
C:\\Dev\\Godot\\godot.git/editor/import/editor_scene_importer_gltf.cpp:159: undefined reference to `RegEx::RegEx(String const&)'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/editor/import/editor_scene_importer_gltf.cpp:160: undefined reference to `RegEx::sub(String const&, String const&, bool, int, int) const'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/editor/import/editor_scene_importer_gltf.cpp:159: undefined reference to `RegEx::~RegEx()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/editor/import/editor_scene_importer_gltf.cpp:159: undefined reference to `RegEx::~RegEx()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: editor/libeditor.windows.opt.tools.64.a(editor_scene_importer_gltf.windows.opt.tools.64.o): in function `EditorSceneImporterGLTF::_sanitize_bone_name(String const&)':
C:\\Dev\\Godot\\godot.git/editor/import/editor_scene_importer_gltf.cpp:190: undefined reference to `RegEx::RegEx(String const&)'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/editor/import/editor_scene_importer_gltf.cpp:191: undefined reference to `RegEx::sub(String const&, String const&, bool, int, int) const'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/editor/import/editor_scene_importer_gltf.cpp:193: undefined reference to `RegEx::RegEx(String const&)'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/editor/import/editor_scene_importer_gltf.cpp:194: undefined reference to `RegEx::sub(String const&, String const&, bool, int, int) const'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/editor/import/editor_scene_importer_gltf.cpp:196: undefined reference to `RegEx::RegEx(String const&)'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/editor/import/editor_scene_importer_gltf.cpp:197: undefined reference to `RegEx::sub(String const&, String const&, bool, int, int) const'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/editor/import/editor_scene_importer_gltf.cpp:199: undefined reference to `RegEx::RegEx(String const&)'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/editor/import/editor_scene_importer_gltf.cpp:200: undefined reference to `RegEx::sub(String const&, String const&, bool, int, int) const'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/editor/import/editor_scene_importer_gltf.cpp:199: undefined reference to `RegEx::~RegEx()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/editor/import/editor_scene_importer_gltf.cpp:196: undefined reference to `RegEx::~RegEx()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/editor/import/editor_scene_importer_gltf.cpp:193: undefined reference to `RegEx::~RegEx()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/editor/import/editor_scene_importer_gltf.cpp:190: undefined reference to `RegEx::~RegEx()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/editor/import/editor_scene_importer_gltf.cpp:199: undefined reference to `RegEx::~RegEx()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: editor/libeditor.windows.opt.tools.64.a(editor_scene_importer_gltf.windows.opt.tools.64.o):C:\\Dev\\Godot\\godot.git/editor/import/editor_scene_importer_gltf.cpp:196: more undefined references to `RegEx::~RegEx()' follow
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: editor/libeditor.windows.opt.tools.64.a(rename_dialog.windows.opt.tools.64.o): in function `RenameDialog::_regex(String const&, String const&, String const&)':
C:\\Dev\\Godot\\godot.git/editor/rename_dialog.cpp:516: undefined reference to `RegEx::RegEx(String const&)'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/editor/rename_dialog.cpp:518: undefined reference to `RegEx::sub(String const&, String const&, bool, int, int) const'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/editor/rename_dialog.cpp:516: undefined reference to `RegEx::~RegEx()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/editor/rename_dialog.cpp:516: undefined reference to `RegEx::~RegEx()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: editor/libeditor.windows.opt.tools.64.a(rename_dialog.windows.opt.tools.64.o): in function `RenameDialog::_postprocess(String const&)':
C:\\Dev\\Godot\\godot.git/editor/rename_dialog.cpp:536: undefined reference to `RegEx::RegEx(String const&)'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/editor/rename_dialog.cpp:537: undefined reference to `RegEx::search_all(String const&, int, int) const'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/editor/rename_dialog.cpp:545: undefined reference to `RegExMatch::get_start(Variant const&) const'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/editor/rename_dialog.cpp:536: undefined reference to `RegEx::~RegEx()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/editor/rename_dialog.cpp:536: undefined reference to `RegEx::~RegEx()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: scene/libscene.windows.opt.tools.64.a(rich_text_label.windows.opt.tools.64.o): in function `RichTextLabel::parse_expressions_for_values(Vector<String>)':
C:\\Dev\\Godot\\godot.git/scene/gui/rich_text_label.cpp:2855: undefined reference to `RegEx::RegEx()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/scene/gui/rich_text_label.cpp:2856: undefined reference to `RegEx::compile(String const&)'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/scene/gui/rich_text_label.cpp:2857: undefined reference to `RegEx::RegEx()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/scene/gui/rich_text_label.cpp:2858: undefined reference to `RegEx::compile(String const&)'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/scene/gui/rich_text_label.cpp:2859: undefined reference to `RegEx::RegEx()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/scene/gui/rich_text_label.cpp:2860: undefined reference to `RegEx::compile(String const&)'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/scene/gui/rich_text_label.cpp:2861: undefined reference to `RegEx::RegEx()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/scene/gui/rich_text_label.cpp:2862: undefined reference to `RegEx::compile(String const&)'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/scene/gui/rich_text_label.cpp:2863: undefined reference to `RegEx::RegEx()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/scene/gui/rich_text_label.cpp:2864: undefined reference to `RegEx::compile(String const&)'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/scene/gui/rich_text_label.cpp:2867: undefined reference to `RegEx::search(String const&, int, int) const'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/scene/gui/rich_text_label.cpp:2863: undefined reference to `RegEx::~RegEx()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/scene/gui/rich_text_label.cpp:2861: undefined reference to `RegEx::~RegEx()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/scene/gui/rich_text_label.cpp:2859: undefined reference to `RegEx::~RegEx()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/scene/gui/rich_text_label.cpp:2857: undefined reference to `RegEx::~RegEx()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/scene/gui/rich_text_label.cpp:2855: undefined reference to `RegEx::~RegEx()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/scene/gui/rich_text_label.cpp:2869: undefined reference to `RegEx::search(String const&, int, int) const'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/scene/gui/rich_text_label.cpp:2874: undefined reference to `RegEx::search(String const&, int, int) const'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/scene/gui/rich_text_label.cpp:2880: undefined reference to `RegEx::search(String const&, int, int) const'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/scene/gui/rich_text_label.cpp:2882: undefined reference to `RegEx::search(String const&, int, int) const'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/scene/gui/rich_text_label.cpp:2863: undefined reference to `RegEx::~RegEx()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/scene/gui/rich_text_label.cpp:2861: undefined reference to `RegEx::~RegEx()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/scene/gui/rich_text_label.cpp:2859: undefined reference to `RegEx::~RegEx()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/scene/gui/rich_text_label.cpp:2857: undefined reference to `RegEx::~RegEx()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\\Dev\\Godot\\godot.git/scene/gui/rich_text_label.cpp:2855: undefined reference to `RegEx::~RegEx()'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: core/libcore.windows.opt.tools.64.a(crypto_core.windows.opt.tools.64.o): in function `CryptoCore::MD5Context::~MD5Context()':
C:\\Dev\\Godot\\godot.git/core/crypto/crypto_core.cpp:46: undefined reference to `mbedtls_md5_free'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: core/libcore.windows.opt.tools.64.a(crypto_core.windows.opt.tools.64.o): in function `CryptoCore::MD5Context::start()':
C:\\Dev\\Godot\\godot.git/core/crypto/crypto_core.cpp:51: undefined reference to `mbedtls_md5_starts_ret'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: core/libcore.windows.opt.tools.64.a(crypto_core.windows.opt.tools.64.o): in function `CryptoCore::MD5Context::update(unsigned char const*, unsigned long long)':
C:\\Dev\\Godot\\godot.git/core/crypto/crypto_core.cpp:56: undefined reference to `mbedtls_md5_update_ret'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: core/libcore.windows.opt.tools.64.a(crypto_core.windows.opt.tools.64.o): in function `CryptoCore::MD5Context::finish(unsigned char*)':
C:\\Dev\\Godot\\godot.git/core/crypto/crypto_core.cpp:61: undefined reference to `mbedtls_md5_finish_ret'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: core/libcore.windows.opt.tools.64.a(crypto_core.windows.opt.tools.64.o): in function `CryptoCore::SHA1Context::~SHA1Context()':
C:\\Dev\\Godot\\godot.git/core/crypto/crypto_core.cpp:72: undefined reference to `mbedtls_sha1_free'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: core/libcore.windows.opt.tools.64.a(crypto_core.windows.opt.tools.64.o): in function `CryptoCore::SHA1Context::start()':
C:\\Dev\\Godot\\godot.git/core/crypto/crypto_core.cpp:77: undefined reference to `mbedtls_sha1_starts_ret'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: core/libcore.windows.opt.tools.64.a(crypto_core.windows.opt.tools.64.o): in function `CryptoCore::SHA1Context::update(unsigned char const*, unsigned long long)':
C:\\Dev\\Godot\\godot.git/core/crypto/crypto_core.cpp:82: undefined reference to `mbedtls_sha1_update_ret'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: core/libcore.windows.opt.tools.64.a(crypto_core.windows.opt.tools.64.o): in function `CryptoCore::SHA1Context::finish(unsigned char*)':
C:\\Dev\\Godot\\godot.git/core/crypto/crypto_core.cpp:87: undefined reference to `mbedtls_sha1_finish_ret'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: core/libcore.windows.opt.tools.64.a(crypto_core.windows.opt.tools.64.o): in function `CryptoCore::SHA256Context::~SHA256Context()':
C:\\Dev\\Godot\\godot.git/core/crypto/crypto_core.cpp:98: undefined reference to `mbedtls_sha256_free'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: core/libcore.windows.opt.tools.64.a(crypto_core.windows.opt.tools.64.o): in function `CryptoCore::SHA256Context::start()':
C:\\Dev\\Godot\\godot.git/core/crypto/crypto_core.cpp:103: undefined reference to `mbedtls_sha256_starts_ret'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: core/libcore.windows.opt.tools.64.a(crypto_core.windows.opt.tools.64.o): in function `CryptoCore::SHA256Context::update(unsigned char const*, unsigned long long)':
C:\\Dev\\Godot\\godot.git/core/crypto/crypto_core.cpp:108: undefined reference to `mbedtls_sha256_update_ret'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: core/libcore.windows.opt.tools.64.a(crypto_core.windows.opt.tools.64.o): in function `CryptoCore::SHA256Context::finish(unsigned char*)':
C:\\Dev\\Godot\\godot.git/core/crypto/crypto_core.cpp:113: undefined reference to `mbedtls_sha256_finish_ret'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: core/libcore.windows.opt.tools.64.a(crypto_core.windows.opt.tools.64.o): in function `CryptoCore::AESContext::~AESContext()':
C:\\Dev\\Godot\\godot.git/core/crypto/crypto_core.cpp:124: undefined reference to `mbedtls_aes_free'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: core/libcore.windows.opt.tools.64.a(crypto_core.windows.opt.tools.64.o): in function `CryptoCore::AESContext::set_encode_key(unsigned char const*, unsigned long long)':
C:\\Dev\\Godot\\godot.git/core/crypto/crypto_core.cpp:129: undefined reference to `mbedtls_aes_setkey_enc'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: core/libcore.windows.opt.tools.64.a(crypto_core.windows.opt.tools.64.o): in function `CryptoCore::AESContext::set_decode_key(unsigned char const*, unsigned long long)':
C:\\Dev\\Godot\\godot.git/core/crypto/crypto_core.cpp:134: undefined reference to `mbedtls_aes_setkey_dec'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: core/libcore.windows.opt.tools.64.a(crypto_core.windows.opt.tools.64.o): in function `CryptoCore::AESContext::encrypt_ecb(unsigned char const*, unsigned char*)':
C:\\Dev\\Godot\\godot.git/core/crypto/crypto_core.cpp:139: undefined reference to `mbedtls_aes_crypt_ecb'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: core/libcore.windows.opt.tools.64.a(crypto_core.windows.opt.tools.64.o): in function `CryptoCore::AESContext::decrypt_ecb(unsigned char const*, unsigned char*)':
C:\\Dev\\Godot\\godot.git/core/crypto/crypto_core.cpp:144: undefined reference to `mbedtls_aes_crypt_ecb'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: core/libcore.windows.opt.tools.64.a(crypto_core.windows.opt.tools.64.o): in function `CryptoCore::b64_encode(unsigned char*, int, unsigned long long*, unsigned char const*, int)':
C:\\Dev\\Godot\\godot.git/core/crypto/crypto_core.cpp:161: undefined reference to `mbedtls_base64_encode'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: core/libcore.windows.opt.tools.64.a(crypto_core.windows.opt.tools.64.o): in function `CryptoCore::b64_decode(unsigned char*, int, unsigned long long*, unsigned char const*, int)':
C:\\Dev\\Godot\\godot.git/core/crypto/crypto_core.cpp:166: undefined reference to `mbedtls_base64_decode'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: core/libcore.windows.opt.tools.64.a(crypto_core.windows.opt.tools.64.o): in function `CryptoCore::md5(unsigned char const*, int, unsigned char*)':
C:\\Dev\\Godot\\godot.git/core/crypto/crypto_core.cpp:171: undefined reference to `mbedtls_md5_ret'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: core/libcore.windows.opt.tools.64.a(crypto_core.windows.opt.tools.64.o): in function `CryptoCore::sha1(unsigned char const*, int, unsigned char*)':
C:\\Dev\\Godot\\godot.git/core/crypto/crypto_core.cpp:176: undefined reference to `mbedtls_sha1_ret'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: core/libcore.windows.opt.tools.64.a(crypto_core.windows.opt.tools.64.o): in function `CryptoCore::sha256(unsigned char const*, int, unsigned char*)':
C:\\Dev\\Godot\\godot.git/core/crypto/crypto_core.cpp:181: undefined reference to `mbedtls_sha256_ret'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: core/libcore.windows.opt.tools.64.a(crypto_core.windows.opt.tools.64.o): in function `CryptoCore::b64_encode(unsigned char*, int, unsigned long long*, unsigned char const*, int)':
C:\\Dev\\Godot\\godot.git/core/crypto/crypto_core.cpp:161: undefined reference to `mbedtls_base64_encode'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: core/libcore.windows.opt.tools.64.a(crypto_core.windows.opt.tools.64.o): in function `CryptoCore::MD5Context::MD5Context()':
C:\\Dev\\Godot\\godot.git/core/crypto/crypto_core.cpp:42: undefined reference to `mbedtls_md5_init'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: core/libcore.windows.opt.tools.64.a(crypto_core.windows.opt.tools.64.o): in function `CryptoCore::SHA1Context::SHA1Context()':
C:\\Dev\\Godot\\godot.git/core/crypto/crypto_core.cpp:68: undefined reference to `mbedtls_sha1_init'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: core/libcore.windows.opt.tools.64.a(crypto_core.windows.opt.tools.64.o): in function `CryptoCore::SHA256Context::SHA256Context()':
C:\\Dev\\Godot\\godot.git/core/crypto/crypto_core.cpp:94: undefined reference to `mbedtls_sha256_init'
C:/Dev/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: core/libcore.windows.opt.tools.64.a(crypto_core.windows.opt.tools.64.o): in function `CryptoCore::AESContext::AESContext()':
C:\\Dev\\Godot\\godot.git/core/crypto/crypto_core.cpp:120: undefined reference to `mbedtls_aes_init'
collect2.exe: error: ld returned 1 exit status"
=====
scons: *** [bin/godot.windows.opt.tools.64.exe] Error 1

@bdbaddog
Copy link

Not sure what's causing that. Could it be the order of the built libraries isn't correct. .a's only have the .o's with undefined references to them pulled out and linked. and/or you may need a flag to tell the linker to always include all .o's from the .a's.. ?

@akien-mga
Copy link
Member Author

akien-mga commented Dec 11, 2019

I did some testing but I don't understand what causes the issue. As you suggested, I tried to ensure that the linker will parse the .a repeatedly to look for symbols when resolving undefined references in other .a's. I came up with this ugly hack:

diff --git a/modules/SCsub b/modules/SCsub
index 42d89d6ce2..50d75e2009 100644
--- a/modules/SCsub
+++ b/modules/SCsub
@@ -1,5 +1,7 @@
 #!/usr/bin/env python

+import os
+
 Import('env')

 env_modules = env.Clone()
@@ -21,4 +23,5 @@ if env.split_modules:
 else:
     lib = env_modules.add_library("modules", env.modules_sources)

-    env.Prepend(LIBS=[lib])
+    env.Append(LINKCOM=" -Wl,--start-group {} -Wl,--end-group".format(os.path.join("modules", env.GetBuildPath(lib)[0])))
+    print(env['LINKCOM'])

But it still fails with the same error.

It's puzzling since as per the ar man file, your $AR qS $TARGET $SOURCES', '$RANLIB $TARGET should indeed be equivalent to $AR q $TARGET $SOURCES. So I don't understand why it fails now when it works with the default $ARCOM (albeit with the super slow creation of the archive).

I tested using MinGW on Linux and there it does not have any issue linking, so it might be a bug in the Windows version of ld.exe.

Edit: For the reference, I'm building with scons p=windows tools=yes target=release_debug use_mingw=yes.

@akien-mga akien-mga changed the title [WIP] SCons: Make split_libmodules a build option SCons: Fix split_libs, make it a command line option Dec 11, 2019
@akien-mga akien-mga changed the title SCons: Fix split_libs, make it a command line option SCons: Add 'split_libmodules' option to workaround linker issue Dec 11, 2019
@akien-mga akien-mga requested a review from hpvb December 11, 2019 14:24
@@ -294,7 +294,10 @@ def configure_mingw(env):
## Compiler configuration

if (os.name == "nt"):
env['ENV']['TMP'] = os.environ['TMP'] # way to go scons, you can be so stupid sometimes
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was redundant with a call already made in configure() (and we can do without the comment...).

The new 'split_libmodules=yes' option is useful to work around linker
command line size limitations when linking a huge number of objects.
We're currently over 64k chars when linking libmodules.a on Windows
with MinGW, which triggers issues as seen in godotengine#30892.

Even on Linux, we can also reach linker command line size limitations
by adding more custom modules.

We force this option to True for MinGW on Windows, which fixes godotengine#30892.

Additional changes to lib splitting:

- Fix linking of the split module libs with interdependent symbols,
  hacking our way into LINKCOM and SHLINKCOM to set the `--start-group`
  and `--end-group` flags.
- Fix Python 3 compatibility in `methods.split_lib()`.
- Drop seemingly obsolete condition for 'msys' on 'posix'.
- Drop the unnecessary 'split_drivers' as the drivers lib is no longer
  too big since we moved all thirdparty builds to modules.

Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
env.Replace(ARFLAGS=['rcsT'])
lib = env_lib.add_library(libname + "_collated", lib_list)
lib_list = [lib]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this was not strictly necessary for the use cases I tried (MinGW from MSYS2 on Windows and MinGW from Scoop in Powershell on Windows (both nt and win32), and MinGW from distro repos on Linux), but I'm not sure any recent MinGW distribution would be posix and msys.

So better drop this old code and make sure that all platforms that may use this method use the same code. If an issue pops up on a specific platform, we can handle it and document it as such.

@akien-mga akien-mga merged commit 70a8c37 into godotengine:master Dec 11, 2019
@akien-mga akien-mga deleted the scons-mingw-split-libmodules branch December 11, 2019 15:21
@akien-mga
Copy link
Member Author

try this change without your current changes and see if that resolves the issue: bdbaddog/godot@ea7b293

I still plan to look further into this change, which would have been cleaner than what this PR eventually implements. My current hypothesis is that since we have more than 64k chars on the command line, ar qS might get a truncated line, which would explain why symbols are missing.

@bdbaddog
Copy link

@akien-mga - you can double check your hypothesis by getting a list of files included in the archive.

ar t <archive file name
Should do that.

I'm dubious this is the case. I've never seen a command line too long silently drop the arguments. You usually get an error and then SCons would exit with error.

@akien-mga
Copy link
Member Author

Cherry-picked for 3.1.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compilation problem: stuck on linking static library with MinGW on Windows
2 participants