gcc: Add kernel32 ot linker after msvcrt.

This commit is contained in:
Alexey Pavlov
2020-05-30 19:24:58 +03:00
parent 5952cae6db
commit a31b88b2cd
2 changed files with 32 additions and 2 deletions

View File

@@ -0,0 +1,27 @@
From aa56b2ce5e717d798e0e9cd0b46cd6537d637114 Mon Sep 17 00:00:00 2001
From: Liu Hao <lh_mouse@126.com>
Date: Fri, 29 May 2020 21:14:56 +0800
Subject: [PATCH] gcc/config/i386/mingw32.h: Ensure `-lmsvcrt` precede
`-lkernel32`
Signed-off-by: Liu Hao <lh_mouse@126.com>
---
gcc/config/i386/mingw32.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 %{!mcrtdll=*:-lmsvcrt} %{mcrtdll=*:-l%*}"
+ -lmoldname -lmingwex %{!mcrtdll=*:-lmsvcrt} %{mcrtdll=*:-l%*} -lkernel32"
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "%{shared|mdll:dllcrt2%O%s} \
--
2.26.2

View File

@@ -21,7 +21,7 @@ pkgver=10.1.0
#_majorver=${pkgver:0:1}
#_sourcedir=${_realname}-${_majorver}-${_snapshot}
_sourcedir=${_realname}-${pkgver}
pkgrel=2
pkgrel=3
pkgdesc="GCC for the MinGW-w64"
arch=('any')
url="https://gcc.gnu.org"
@@ -61,6 +61,7 @@ source=("https://ftp.gnu.org/gnu/gcc/${_realname}-${pkgver%%+*}/${_realname}-${p
0014-gcc-9-branch-clone_function_name_1-Retain-any-stdcall-suffix.patch
0015-makedeps-properly-handle-win-paths.patch
0020-libgomp-Don-t-hard-code-MS-printf-attributes.patch
0021-gcc-config-i386-mingw32.h-Ensure-lmsvcrt-precede-lke.patch
0130-libstdc++-in-out.patch
0140-gcc-8.2.0-diagnostic-color.patch)
sha256sums=('b6898a23844b656f1b68691c5c012036c2e694ac4b53a8918d4712ad876e7ea2'
@@ -80,6 +81,7 @@ sha256sums=('b6898a23844b656f1b68691c5c012036c2e694ac4b53a8918d4712ad876e7ea2'
'21e31addcf13bc6fa6650b02ed0f2e195a1226260ae48c536840cc9230de2cfc'
'4233a8d893787413b316de3ac320fd65c46844d463b98c0a98fdc17100cca505'
'276ecc392c777d4b17d771a987e80dca50ff25d8f65671d5de139be73997064b'
'c7359f4c7015bc1fb02bc13449fa9826669273bd1f0663ba898decb67e8487fc'
'441d63d95622ffcc2fa5dd688aecad20d2ab16d7d275c567865a754e1d3d4b7a'
'5240a9e731b45c17a164066c7eb193c1fbee9fd8d9a2a5afa2edbcde9510da47')
@@ -122,7 +124,8 @@ prepare() {
0012-Handle-spaces-in-path-for-default-manifest.patch \
0014-gcc-9-branch-clone_function_name_1-Retain-any-stdcall-suffix.patch \
0015-makedeps-properly-handle-win-paths.patch \
0020-libgomp-Don-t-hard-code-MS-printf-attributes.patch
0020-libgomp-Don-t-hard-code-MS-printf-attributes.patch \
0021-gcc-config-i386-mingw32.h-Ensure-lmsvcrt-precede-lke.patch
apply_patch_with_msg \
0130-libstdc++-in-out.patch