[Bug 52328] Cygwin compilation fails: undefined reference to `__chkstk_ms' in advapi32/tests/{security,service}.c

WineHQ Bugzilla wine-bugs at winehq.org
Mon Jan 3 11:25:52 CST 2022


https://bugs.winehq.org/show_bug.cgi?id=52328

--- Comment #2 from Saulius K. <saulius2 at 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=undefined%20reference%20to%20%60__chkstk_ms%27,-Reference%20to%20__chkstk_ms

-- 
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.


More information about the wine-bugs mailing list