gcc/config/i386/mingw32.h: Ensure `-lmsvcrt` precede `-lkernel32`
authorJonathan Yong <10walls@gmail.com>
Sat, 30 May 2020 03:53:16 +0000 (03:53 +0000)
committerJonathan Yong <10walls@gmail.com>
Sat, 30 May 2020 04:03:57 +0000 (04:03 +0000)
This is necessary as libmsvcrt.a is not a pure import library, but
also contains some functions that invoke others in KERNEL32.DLL.

gcc/
* config/i386/mingw32.h (REAL_LIBGCC_SPEC): Insert -lkernel32
after -lmsvcrt. This is necessary as libmsvcrt.a is not a pure
import library, but also contains some functions that invoke
others in KERNEL32.DLL.

Signed-off-by: Liu Hao <lh_mouse@126.com>
Signed-off-by: Jonathan Yong <10walls@gmail.com>
gcc/config/i386/mingw32.h

index 1bbabfe8bed51c5aa228e9e715a07c795183f5bb..321c30e41cc5ade9da44e94d6e909cbb71eba628 100644 (file)
@@ -165,7 +165,7 @@ along with GCC; see the file COPYING3.  If not see
 #define REAL_LIBGCC_SPEC \
   "%{mthreads:-lmingwthrd} -lmingw32 \
    " SHARED_LIBGCC_SPEC " \
-   -lmoldname -lmingwex -lmsvcrt"
+   -lmoldname -lmingwex -lmsvcrt -lkernel32"
 
 #undef STARTFILE_SPEC
 #define STARTFILE_SPEC "%{shared|mdll:dllcrt2%O%s} \