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

[qt6-static] needs -Wl,--start-group to link successfully #21689

Open
2 of 7 tasks
pitti98 opened this issue Aug 19, 2024 · 0 comments
Open
2 of 7 tasks

[qt6-static] needs -Wl,--start-group to link successfully #21689

pitti98 opened this issue Aug 19, 2024 · 0 comments
Labels

Comments

@pitti98
Copy link

pitti98 commented Aug 19, 2024

Description / Steps to reproduce the issue

Try to do a qt6-static build of a (non-trivial) Qt application that builds fine with qt5-static (after #21612 has been fixed) and dynamically with qt5 and 6.

Expected behavior

Compiles and links successfully.

Actual behavior

Link step fails with unresolved externals:

D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/qt6-static/share/qt6/plugins/networkinformation/libqnetworklistmanager.a(qnetworklistmanagerevents.cpp.obj):(.text$_ZN25QNetworkListManagerEvents24checkBehindCaptivePortalEv+0x9b): undefined reference to `__imp_VariantInit'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/qt6-static/share/qt6/plugins/networkinformation/libqnetworklistmanager.a(qnetworklistmanagerevents.cpp.obj):(.text$_ZN25QNetworkListManagerEvents24checkBehindCaptivePortalEv+0xb1): undefined reference to `__imp_VariantClear'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/qt6-static/share/qt6/plugins/networkinformation/libqnetworklistmanager.a(qnetworklistmanagerevents.cpp.obj):(.text$_ZN25QNetworkListManagerEvents24checkBehindCaptivePortalEv+0x209): undefined reference to `__imp_VariantClear'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/qt6-static/share/qt6/plugins/networkinformation/libqnetworklistmanager.a(qnetworklistmanagerevents.cpp.obj):(.text$_ZN25QNetworkListManagerEvents24checkBehindCaptivePortalEv+0x27b): undefined reference to `__imp_VariantClear'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0x18c): undefined reference to `gr_make_face_with_ops'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0x226): undefined reference to `gr_face_destroy'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0x386): undefined reference to `gr_face_featureval_for_lang'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0x3a6): undefined reference to `gr_face_find_fref'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0x3ba): undefined reference to `gr_fref_set_feature_value'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0x45a): undefined reference to `gr_make_seg'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0x472): undefined reference to `gr_seg_n_slots'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0x5c7): undefined reference to `gr_seg_first_slot'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0x617): undefined reference to `gr_slot_before'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0x621): undefined reference to `gr_slot_after'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0x62d): undefined reference to `gr_slot_gid'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0x688): undefined reference to `gr_slot_can_insert_before'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0x6ee): undefined reference to `gr_slot_origin_X'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0x774): undefined reference to `gr_slot_next_in_segment'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0x847): undefined reference to `gr_seg_first_slot'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0x881): undefined reference to `gr_slot_advance_Y'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0x89b): undefined reference to `gr_slot_next_in_segment'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0x8af): undefined reference to `gr_slot_origin_X'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0x8d2): undefined reference to `gr_slot_origin_Y'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0x966): undefined reference to `gr_seg_advance_X'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0x9d6): undefined reference to `gr_slot_origin_X'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0xa04): undefined reference to `gr_featureval_destroy'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0xa0e): undefined reference to `gr_seg_destroy'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0xacf): undefined reference to `gr_seg_advance_X'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0xae3): undefined reference to `gr_seg_first_slot'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0xb21): undefined reference to `gr_slot_advance_Y'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0xb3b): undefined reference to `gr_slot_origin_X'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0xb78): undefined reference to `gr_slot_origin_Y'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0xb9b): undefined reference to `gr_slot_next_in_segment'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0xc19): undefined reference to `gr_featureval_destroy'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0xc31): undefined reference to `gr_featureval_destroy'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0xc3b): undefined reference to `gr_seg_destroy'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0xc55): undefined reference to `gr_seg_first_slot'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0xc5d): undefined reference to `gr_slot_origin_X'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0xc72): undefined reference to `gr_seg_advance_X'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0xc94): undefined reference to `gr_seg_first_slot'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0xcd0): undefined reference to `gr_featureval_destroy'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0xcda): undefined reference to `gr_seg_destroy'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-graphite2.cc.obj):(.text+0xcf0): undefined reference to `gr_seg_advance_X'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libharfbuzz.a(hb-uniscribe.cc.obj):(.text+0x79d): undefined reference to `__imp_UuidCreate'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libfreetype.a(src_bzip2_ftbzip2.c.obj):(.text+0x6c): undefined reference to `BZ2_bzDecompressEnd'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libfreetype.a(src_bzip2_ftbzip2.c.obj):(.text+0x11d): undefined reference to `BZ2_bzDecompress'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libfreetype.a(src_bzip2_ftbzip2.c.obj):(.text+0x32a): undefined reference to `BZ2_bzDecompressEnd'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libfreetype.a(src_bzip2_ftbzip2.c.obj):(.text+0x380): undefined reference to `BZ2_bzDecompressInit'
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../lib\libfreetype.a(src_bzip2_ftbzip2.c.obj):(.text+0x5fe): undefined reference to `BZ2_bzDecompressInit'
collect2.exe: error: ld returned 1 exit status

The project links fine if you add "QMAKE_LFLAGS += -Wl,--start-group" (except for the "missing --end-group;" warning)

I have only tested this on MINGW64, but it's possibly the same for the other subsystems.

Verification

Windows Version

MINGW64_NT-10.0-19045

MINGW environments affected

  • MINGW64
  • MINGW32
  • UCRT64
  • CLANG64
  • CLANG32
  • CLANGARM64

Are you willing to submit a PR?

No response

@pitti98 pitti98 added the bug label Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant