<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">I believe you'd want to modify _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS and _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS instead, since they're applied to explicit instantiation declarations and definitions, respectively. _LIBCPP_TEMPLATE_VIS is applied
 to class templates in general, not explicit instantiations specifically.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-left:.5in"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">libcxx-dev <libcxx-dev-bounces@lists.llvm.org> on behalf of Martin Storsjö via libcxx-dev <libcxx-dev@lists.llvm.org><br>
<b>Reply-To: </b>Martin Storsjö <martin@martin.st><br>
<b>Date: </b>Tuesday, January 8, 2019 at 2:21 PM<br>
<b>To: </b>Maarten Verhage <m_r_verhage@hotmail.com><br>
<b>Cc: </b>"libcxx-dev@lists.llvm.org" <libcxx-dev@lists.llvm.org><br>
<b>Subject: </b>Re: [libcxx-dev] build issue on mingw gcc, need some help<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">On Tue, 8 Jan 2019, Martin Storsjö via libcxx-dev wrote:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<blockquote style="border:none;border-left:solid #B5C4DF 4.5pt;padding:0in 0in 0in 4.0pt;margin-left:3.75pt;margin-right:0in" id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE">
<blockquote style="border:none;border-left:solid #B5C4DF 4.5pt;padding:0in 0in 0in 4.0pt;margin-left:3.75pt;margin-right:0in" id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE">
<blockquote style="border:none;border-left:solid #B5C4DF 4.5pt;padding:0in 0in 0in 4.0pt;margin-left:3.75pt;margin-right:0in" id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE">
<div>
<p class="MsoNormal" style="margin-left:.5in">In the end, I top it off by linking the DLL with -Wl,--export-all-symbols.
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">Without that, for me, a number of symbols aren't exported even if they are
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">expected to. I believe that's a Clang-specific issue though, but I haven't
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">analyzed it further yet, as this hack/workaround seems to work well enough
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">for now.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
</blockquote>
</blockquote>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">I've looked a bit closer on that matter now, and it's related to how
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">libcxx does explicit template instantiation with visibility attributes
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">(dllexport). Neither g++ nor clang in mingw mode will create dllexports
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">for symbols from an explicit template instantiation with a dllexport
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">attribute, while msvc and clang in msvc mode does. I can open a bug report
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">with full details later.<o:p></o:p></p>
</div>
</blockquote>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">This issue is now at <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.llvm.org_show-5Fbug.cgi-3Fid-3D40256&d=DwIDaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=Xzf_1sBH1qmEq7dOB681bB7Kr5aEKtioAROquk-WdDE&s=mHBeLiIFp-vzhV1dFYbBMX_JCqbeV7Ta9C13XFNjHW0&e=">
https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.llvm.org_show-5Fbug.cgi-3Fid-3D40256&d=DwIDaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=Xzf_1sBH1qmEq7dOB681bB7Kr5aEKtioAROquk-WdDE&s=mHBeLiIFp-vzhV1dFYbBMX_JCqbeV7Ta9C13XFNjHW0&e=</a>, framed
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">as a Clang issue. If Clang is fixed to behave like GCC with respect to
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">this (which probably makes the most sense, instead of making it behave
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">like MSVC even thogh operating in MinGW mode), or already now with GCC, it
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">should be possible to get the necessary export directives with the
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">following untested patch for libcxx:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">diff --git a/include/__config b/include/__config<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">index b8c2c33..fc1a472 100644<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">--- a/include/__config<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">+++ b/include/__config<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">@@ -706,7 +706,11 @@ namespace std {<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">  #define _LIBCPP_EXCEPTION_ABI       _LIBCPP_DLL_VIS<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">  #define _LIBCPP_HIDDEN<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">  #define _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">+#if defined(__MINGW32__) && defined(_LIBCPP_BUILDING_LIBRARY)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">+#define _LIBCPP_TEMPLATE_VIS        _LIBCPP_DLL_VIS<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">+#else<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">  #define _LIBCPP_TEMPLATE_VIS<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">+#endif<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">  #define _LIBCPP_ENUM_VIS<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">  #endif // defined(_LIBCPP_OBJECT_FORMAT_COFF)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">// Martin<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
</div>
</body>
</html>