From: Jonathan Yong <10walls@gmail.com> Date: Sat, 30 May 2020 03:53:16 +0000 (+0000) Subject: gcc/config/i386/mingw32.h: Ensure `-lmsvcrt` precede `-lkernel32` X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=850533ab160ef40eccfd039e1e3b138cf26e76b8;p=gcc.git gcc/config/i386/mingw32.h: Ensure `-lmsvcrt` precede `-lkernel32` 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 Signed-off-by: Jonathan Yong <10walls@gmail.com> --- diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h index 1bbabfe8bed..321c30e41cc 100644 --- a/gcc/config/i386/mingw32.h +++ b/gcc/config/i386/mingw32.h @@ -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} \