[llvm-bugs] [Bug 24395] New: (mingw) undefined reference to `__chkstk_ms'

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Aug 7 12:02:07 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=24395

            Bug ID: 24395
           Summary: (mingw) undefined reference to `__chkstk_ms'
           Product: clang
           Version: 3.7
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: t.poechtrager at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

I am getting the following linker errors when I am tryink to link a MinGW
project on Linux with Clang.

config.o:(.text+0x29a): undefined reference to `_alloca'
/usr/i686-w64-mingw32/lib/libmingw32.a(lib32_libmingw32_a-pseudo-reloc.o): In
function `pei386_runtime_relocator':
/build/mingw-w64-crt/src/mingw-w64-v4.0.2/mingw-w64-crt/crt/pseudo-reloc.c:476:
undefined reference to `__chkstk_ms'
/usr/i686-w64-mingw32/lib/libmingwex.a(lib32_libmingwex_a-mingw_vfscanf.o): In
function `_mingw_vfscanf':
/build/mingw-w64-crt/src/mingw-w64-v4.0.2/mingw-w64-crt/stdio/mingw_vfscanf.c:1614:
undefined reference to `__chkstk_ms'
/usr/i686-w64-mingw32/lib/libmingwex.a(lib32_libmingwex_a-mingw_vfscanf.o): In
function `_mingw_vsscanf':
/build/mingw-w64-crt/src/mingw-w64-v4.0.2/mingw-w64-crt/stdio/mingw_vfscanf.c:1623:
undefined reference to `__chkstk_ms'
/usr/i686-w64-mingw32/lib/libmingwex.a(lib32_libmingwex_a-mingw_pformat.o): In
function `_pformat_emit_radix_point':
/build/mingw-w64-crt/src/mingw-w64-v4.0.2/mingw-w64-crt/stdio/mingw_pformat.c:1183:
undefined reference to `__chkstk_ms'
/usr/i686-w64-mingw32/lib/libmingwex.a(lib32_libmingwex_a-mingw_pformat.o): In
function `_pformat_int':
/build/mingw-w64-crt/src/mingw-w64-v4.0.2/mingw-w64-crt/stdio/mingw_pformat.c:685:
undefined reference to `__chkstk_ms'
/usr/i686-w64-mingw32/lib/libmingwex.a(lib32_libmingwex_a-mingw_pformat.o):/build/mingw-w64-crt/src/mingw-w64-v4.0.2/mingw-w64-crt/stdio/mingw_pformat.c:860:
more undefined references to `__chkstk_ms' follow
clang-3.7: error: linker command failed with exit code 1 (use -v to see
invocation)

>From comparing gcc's and clang's linker flags it looks like -lgcc went missing.

Clang:
 -ldl -lconfig -lGeoIP -lenet -lz -lws2_32 -lwinmm -lshlwapi -lstdc++
 -lmingw32 -lgcc_s -lmoldname -lmingwex -lmsvcrt -lpthread -ladvapi32
 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lmoldname -lmingwex
 -lmsvcrt /usr/lib/gcc/i686-w64-mingw32/5.2.0/crtend.o

GCC:
 -ldl -lconfig -lGeoIP -lenet -lz -lws2_32 -lwinmm -lshlwapi -lstdc++
 -lmingw32 -lgcc_s --> -lgcc <-- -lmoldname -lmingwex -lmsvcrt -lpthread
-ladvapi32
 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s --> -lgcc <-- -lmoldname
-lmingwex
 -lmsvcrt /usr/lib/gcc/i686-w64-mingw32/5.2.0/crtend.o

$ clang --version                                                               
clang version 3.7.0 (branches/release_37 244340)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150807/f7b62a65/attachment.html>


More information about the llvm-bugs mailing list