summaryrefslogtreecommitdiffstats
path: root/PATCHES/0006-Windows-New-feature-to-allow-overriding.patch
blob: 9899224cc858f7a44ec3045f7d10c697f88de027 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From d8cd8d0211dcd606a3753a6b3c36c19a7b1672dc Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Wed, 5 Aug 2015 23:36:13 +0100
Subject: [PATCH 05/19] master Windows: New feature to allow overriding
 -lmsvcrt

Added in support of the MinGW-w64 WIP feature "agile mscvrt dll" where
a process' loaded msvc runtime is used by a newly loaded DLL rather than
always using msvcrt.dll
---
 gcc/config/i386/cygming.opt | 3 +++
 gcc/config/i386/mingw32.h   | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/config/i386/cygming.opt b/gcc/config/i386/cygming.opt
index a9074bf..e1d89e2 100644
--- a/gcc/config/i386/cygming.opt
+++ b/gcc/config/i386/cygming.opt
@@ -22,6 +22,9 @@ mconsole
 Target RejectNegative
 Create console application.
 
+mcrtdll=
+Target RejectNegative Joined
+
 mdll
 Target RejectNegative
 Generate code for a DLL.
diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h
index 4ac5f68..f875e7b 100644
--- a/gcc/config/i386/mingw32.h
+++ b/gcc/config/i386/mingw32.h
@@ -140,7 +140,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 %{!mcrtdll=*:-lmsvcrt} %{mcrtdll=*:-l%*}"
 
 #undef STARTFILE_SPEC
 #define STARTFILE_SPEC "%{shared|mdll:dllcrt2%O%s} \
-- 
2.7.1