Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clang: add patch enabling -flto-visibility-public-std (#2917)
It fixes undefined reference to _imp___cxa* errors Signed-off-by: Mateusz Mikula <mati865@gmail.com>
- Loading branch information
Showing
7 changed files
with
48 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
mingw-w64-clang/0106-MinGW-use-flto-visibility-public-std-CC1-arg-to-get-.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
From a719447157a7cb8746f0779dc1fa5e3de56b86ee Mon Sep 17 00:00:00 2001 | ||
From: Mateusz Mikula <mati865@gmail.com> | ||
Date: Mon, 18 Sep 2017 12:25:11 +0200 | ||
Subject: [PATCH 6/6] MinGW: use -flto-visibility-public-std CC1 arg to get rid | ||
of undefined reference to _imp___cxa* errors | ||
|
||
--- | ||
lib/Driver/ToolChains/Clang.cpp | 5 +++++ | ||
1 file changed, 5 insertions(+) | ||
|
||
diff --git a/lib/Driver/ToolChains/Clang.cpp b/lib/Driver/ToolChains/Clang.cpp | ||
index f7967fe79b..46e7998a72 100644 | ||
--- a/lib/Driver/ToolChains/Clang.cpp | ||
+++ b/lib/Driver/ToolChains/Clang.cpp | ||
@@ -3200,6 +3200,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, | ||
IsHosted = false; | ||
} | ||
|
||
+ if (Triple.isWindowsGNUEnvironment() && | ||
+ Args.hasArg(options::OPT_static) && | ||
+ getToolChain().GetCXXStdlibType(Args) == ToolChain::CST_Libstdcxx) | ||
+ CmdArgs.push_back("-flto-visibility-public-std"); | ||
+ | ||
// Forward -f (flag) options which we can pass directly. | ||
Args.AddLastArg(CmdArgs, options::OPT_femit_all_decls); | ||
Args.AddLastArg(CmdArgs, options::OPT_fheinous_gnu_extensions); | ||
-- | ||
2.14.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters