[Bug 52328] New: Cygwin compilation fails: undefined reference to `__chkstk_ms' in advapi32/tests/{security,service}.c
https://bugs.winehq.org/show_bug.cgi?id=52328 Bug ID: 52328 Summary: Cygwin compilation fails: undefined reference to `__chkstk_ms' in advapi32/tests/{security,service}.c Product: Wine Version: 7.0-rc4 Hardware: x86-64 OS: Windows Status: UNCONFIRMED Severity: blocker Priority: P2 Component: -unknown Assignee: wine-bugs(a)winehq.org Reporter: saulius2(a)gmail.com (This is continuation from the bug 52292) Now make fails here: --- snip --- tools/winegcc/winegcc.exe -o dlls/advapi32/tests/advapi32_test.exe --wine-objdir . -Wl,--disable-stdcall-fixup \ -fasynchronous-unwind-tables -mno-cygwin dlls/advapi32/tests/cred.o dlls/advapi32/tests/crypt.o \ dlls/advapi32/tests/crypt_lmhash.o dlls/advapi32/tests/crypt_md4.o dlls/advapi32/tests/crypt_md5.o \ dlls/advapi32/tests/crypt_sha.o dlls/advapi32/tests/eventlog.o dlls/advapi32/tests/lsa.o \ dlls/advapi32/tests/perf.o dlls/advapi32/tests/registry.o dlls/advapi32/tests/security.o \ dlls/advapi32/tests/service.o dlls/advapi32/tests/testlist.o dlls/advapi32/tests/rsrc.res \ dlls/ole32/libole32.a dlls/advapi32/libadvapi32.a dlls/winecrt0/libwinecrt0.a \ dlls/msvcrt/libmsvcrt.a dlls/kernel32/libkernel32.a dlls/ntdll/libntdll.a /usr/lib/gcc/i686-pc-cygwin/7.4.0/../../../../i686-pc-cygwin/bin/ld: dlls/advapi32/tests/security.o: in function `test_security_descriptor': /home/saukrs/src/wine/dlls/advapi32/tests/security.c:2746: undefined reference to `__chkstk_ms' /usr/lib/gcc/i686-pc-cygwin/7.4.0/../../../../i686-pc-cygwin/bin/ld: dlls/advapi32/tests/security.o: in function `test_ConvertSecurityDescriptorToString': /home/saukrs/src/wine/dlls/advapi32/tests/security.c:4351: undefined reference to `__chkstk_ms' /usr/lib/gcc/i686-pc-cygwin/7.4.0/../../../../i686-pc-cygwin/bin/ld: dlls/advapi32/tests/service.o: in function `test_open_svc': /home/saukrs/src/wine/dlls/advapi32/tests/service.c:123: undefined reference to `__chkstk_ms' /usr/lib/gcc/i686-pc-cygwin/7.4.0/../../../../i686-pc-cygwin/bin/ld: dlls/advapi32/tests/service.o: in function `test_get_displayname': /home/saukrs/src/wine/dlls/advapi32/tests/service.c:439: undefined reference to `__chkstk_ms' /usr/lib/gcc/i686-pc-cygwin/7.4.0/../../../../i686-pc-cygwin/bin/ld: dlls/advapi32/tests/service.o: in function `test_get_servicekeyname': /home/saukrs/src/wine/dlls/advapi32/tests/service.c:724: undefined reference to `__chkstk_ms' collect2: error: ld returned 1 exit status winegcc: /usr/bin/gcc.exe failed make: *** [Makefile:3496: dlls/advapi32/tests/advapi32_test.exe] Error 2 --- snip --- -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52328 Saulius K. <saulius2(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |ntdll Priority|P2 |P4 --- Comment #1 from Saulius K. <saulius2(a)gmail.com> --- Matches in text files: --- snip --- $ grep -r chkstk include | wc -l 0 $ grep -r chkstk dlls |& awk 'BEGIN {FS="[: ]+"} !/^grep/ {print $1}' dlls/kernel32/kernel32.spec dlls/kernelbase/kernelbase.spec dlls/ntdll/ntdll.spec dlls/ntdll/ntdll.spec dlls/ntdll/signal_arm.c dlls/ntdll/signal_arm.c dlls/ntdll/signal_arm64.c dlls/ntdll/signal_arm64.c dlls/ntdll/signal_i386.c dlls/ntdll/signal_i386.c dlls/ntdll/signal_x86_64.c dlls/ntdll/signal_x86_64.c dlls/ntoskrnl.exe/ntoskrnl.c dlls/ntoskrnl.exe/ntoskrnl.c dlls/ntoskrnl.exe/ntoskrnl.c dlls/ntoskrnl.exe/ntoskrnl.c dlls/ntoskrnl.exe/ntoskrnl.c dlls/ntoskrnl.exe/ntoskrnl.exe.spec dlls/ntoskrnl.exe/ntoskrnl.exe.spec --- snip --- Matches in binaries: --- snip --- $ grep -r chkstk dlls |& awk 'BEGIN {FS="[: ]+"} /^grep/ {print $2}' dlls/advapi32/tests/security.o dlls/advapi32/tests/service.o dlls/ntdll/libntdll.a --- snip --- Judging by the results, the component now is "ntddll", I guess. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52328 --- Comment #2 from Saulius K. <saulius2(a)gmail.com> --- Maybe not. Quoting [Mingw-w64-public] message by Rastislav Stanik [2]: ––– quote ––– Reference to __chkstk_ms() is added by compiler when some function declares local variables exceeding page size (~4k). In my case the function that exceeds the limit is in PRCE, so I cannot simply work around it in my code. The function __chkstk_ms() is provided by libgcc.a located in directory {MinGW-root}/lib/gcc/x86_64-w64-mingw32/8.1.0/32/ So if I add linking of that libgcc.a then the linking stage succeeds. ––– quote ––– Indeed, I can find the full symbol name inside compiler libs: --- snip --- $ grep -r __chkstk_ms /lib/gcc grep: /lib/gcc/i686-pc-cygwin/11/cc1.exe: binary file matches grep: /lib/gcc/i686-pc-cygwin/11/libgcc.a: binary file matches grep: /lib/gcc/i686-pc-cygwin/11/libgcc_eh.a: binary file matches grep: /lib/gcc/i686-pc-cygwin/11/libgcov.a: binary file matches grep: /lib/gcc/i686-pc-cygwin/11/libgomp.a: binary file matches grep: /lib/gcc/i686-pc-cygwin/11/libquadmath.a: binary file matches grep: /lib/gcc/i686-pc-cygwin/11/lto1.exe: binary file matches --- snip --- So maybe it's winegcc bug after all? [2] https://sourceforge.net/p/mingw-w64/mailman/message/36679650/#:~:text=undefi... -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52328 --- Comment #3 from Saulius K. <saulius2(a)gmail.com> --- Umm, after I append `-lgcc` to cmd-line, the binary gets built: --- snip --- $ tools/winegcc/winegcc.exe -o dlls/advapi32/tests/advapi32_test.exe --wine-objdir . -Wl,--disable-stdcall-fixup -fasynchronous-unwind-tables -mno-cygwin dlls/advapi32/tests/cred.o dlls/advapi32/tests/crypt.o dlls/advapi32/tests/crypt_lmhash.o dlls/advapi32/tests/crypt_md4.o dlls/advapi32/tests/crypt_md5.o dlls/advapi32/tests/crypt_sha.o dlls/advapi32/tests/eventlog.o dlls/advapi32/tests/lsa.o dlls/advapi32/tests/perf.o dlls/advapi32/tests/registry.o dlls/advapi32/tests/security.o dlls/advapi32/tests/service.o dlls/advapi32/tests/testlist.o dlls/advapi32/tests/rsrc.res dlls/ole32/libole32.a dlls/advapi32/libadvapi32.a dlls/winecrt0/libwinecrt0.a dlls/msvcrt/libmsvcrt.a dlls/kernel32/libkernel32.a dlls/ntdll/libntdll.a -lgcc $ ls -l dlls/advapi32/tests/advapi32_test.exe -rwxr-xr-x 1 saukrs None 1696330 Jan 3 19:27 dlls/advapi32/tests/advapi32_test.exe --- snip --- Setting component to "advapi32" as the best guess. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52328 Saulius K. <saulius2(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|ntdll |advapi32 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52328 Zebediah Figura <z.figura12(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|advapi32 |build-env -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52328 Jacek Caban <jacek(a)codeweavers.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jacek(a)codeweavers.com --- Comment #4 from Jacek Caban <jacek(a)codeweavers.com> --- Created attachment 71491 --> https://bugs.winehq.org/attachment.cgi?id=71491 fix The attached patch should help. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52328 Saulius K. <saulius2(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|build-env |advapi32 Summary|Cygwin compilation fails: |Cygwin compilation fails: |undefined reference to |undefined references to |`__chkstk_ms' in |__chkstk_ms, __popcountsi2, |advapi32/tests/{security,se |__divdi3, __udivmoddi4 |rvice}.c |(etc.) in dlls/ --- Comment #5 from Saulius K. <saulius2(a)gmail.com> --- Yes, it does. Thank you. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52328 Nikolay Sivov <bunglehead(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|advapi32 |build-env -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52328 Jacek Caban <jacek(a)codeweavers.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Fixed by SHA1| |099ba1b4101103a5758b7d457b1 | |179946c914dee Resolution|--- |FIXED --- Comment #6 from Jacek Caban <jacek(a)codeweavers.com> --- https://source.winehq.org/git/wine.git/commitdiff/099ba1b4101103a5758b7d457b... -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52328 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #7 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 7.0-rc5. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla