<html xmlns:v="urn:schemas-microsoft-com:vml" 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:"MS Gothic";
panose-1:2 11 6 9 7 2 5 8 2 4;}
@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;}
@font-face
{font-family:"\@MS Gothic";
panose-1:2 11 6 9 7 2 5 8 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Let me just throw out there that any interface involved `-Xclang` is not a proper user-facing interface. The -Xclang options aren’t intended for use by end users.<o:p></o:p></p>
<p class="MsoNormal">--paulr<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> cfe-dev <cfe-dev-bounces@lists.llvm.org> <b>On Behalf Of
</b>chuanqi.xcq via cfe-dev<br>
<b>Sent:</b> Wednesday, October 27, 2021 2:28 AM<br>
<b>To:</b> Richard Smith <richard@metafoo.co.uk>; David Blaikie <dblaikie@gmail.com>; Nathan Sidwell <nathanmsidwell@gmail.com><br>
<b>Cc:</b> cfe-dev <cfe-dev@lists.llvm.org><br>
<b>Subject:</b> Re: [cfe-dev] Make command line support for C++20 module uniform with GCC<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Tahoma",sans-serif;color:black">I got it. The key point here is that since clang's module is already used in scale. So we couldn't change it arbitrarily before we get a clear solution.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Tahoma",sans-serif;color:black">Thanks,</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Tahoma",sans-serif;color:black">Chuanqi</span><o:p></o:p></p>
</div>
<blockquote style="margin-right:0in">
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Tahoma",sans-serif;color:black">------------------------------------------------------------------</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Tahoma",sans-serif;color:black">From:Nathan Sidwell <nathan@acm.org></span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Tahoma",sans-serif;color:black">Send Time:2021</span><span style="font-size:10.5pt;font-family:"MS Gothic";color:black">年</span><span style="font-size:10.5pt;font-family:"Tahoma",sans-serif;color:black">10</span><span style="font-size:10.5pt;font-family:"MS Gothic";color:black">月</span><span style="font-size:10.5pt;font-family:"Tahoma",sans-serif;color:black">26</span><span style="font-size:10.5pt;font-family:"MS Gothic";color:black">日</span><span style="font-size:10.5pt;font-family:"Tahoma",sans-serif;color:black">(</span><span style="font-size:10.5pt;font-family:"MS Gothic";color:black">星期二</span><span style="font-size:10.5pt;font-family:"Tahoma",sans-serif;color:black">)
18:48</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Tahoma",sans-serif;color:black">To:chuanqi.xcq <yedeng.yd@linux.alibaba.com>; Richard Smith <richard@metafoo.co.uk>; David Blaikie <dblaikie@gmail.com></span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Tahoma",sans-serif;color:black">Cc:cfe-dev <cfe-dev@lists.llvm.org></span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Tahoma",sans-serif;color:black">Subject:Re: [cfe-dev] Make command line support for C++20 module uniform with GCC</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">On 10/25/21 22:04, chuanqi.xcq via cfe-dev wrote:<br>
> Hi Blaikie,<br>
> <br>
>>> This sort of interaction is probably not going to be how modules are generally built/supported<br>
>>> as far as I understand it - it's opaque to the build system, so may make it more difficult for the<br>
>>> build system to know when things need to be rebuilt, and also wouldn't support any kind of distributed<br>
>>> build system.<br>
>>> <br>
>>> The specifics of how GCC, Clang, (& maybe other compilers) and various build systems may end up interacting<br>
>>> on the command line and filesystem (module discovery outside the current build for system-installed library<br>
>>> dependencies) is still being discussed and debated in places like C++'s SG15 tooling working group.<br>
> ---<br>
> Understood. My point is that we could make clang support for C++20 more <br>
> friendly by adding extra default behavior.<br>
> And your point is that it may not be true in distributed build system.<br>
> <br>
>>> The specifics of how GCC, Clang, (& maybe other compilers) and various <br>
> build systems may end up interacting on<br>
>>> the command line and filesystem (module discovery outside the current build for system-installed library dependencies)<br>
>>> is still being discussed and debated in places like C++'s SG15 tooling <br>
> working group.<br>
> ---<br>
> I have a basic question about the Clang/LLVM policy. I remember that one <br>
> of the policy of Clang/LLVM's command line system<br>
> is to be compatible with GCC. This is basically true so that we could <br>
> transfer the compiler used in various projects.<br>
> Is this policy not true now?<br>
<br>
GCC had the advantage of seeing clang's experiments. The history is <br>
different for the two compilers here -- clang developed 'implicit <br>
modules', driven by a large build system. with GCC I was very mindful <br>
that 'hello world' should be simple to drive -- as you have found. <br>
Clang has the tricky job of not breaking its existing interface.<br>
<br>
As David says, what the best way to drive module compilations is no yet <br>
clear.<br>
<br>
nathan<br>
<br>
> <br>
> Thanks,<br>
> <br>
> Chuanqi<br>
> <br>
> <br>
> <br>
> ------------------------------------------------------------------<br>
> From:David Blaikie <dblaikie@gmail.com><br>
> Send Time:2021<span style="font-family:"MS Gothic"">年</span>10<span style="font-family:"MS Gothic"">月</span>26<span style="font-family:"MS Gothic"">日</span>(<span style="font-family:"MS Gothic"">星期二</span>) 00:36<br>
> To:chuanqi.xcq <yedeng.yd@linux.alibaba.com>; Nathan Sidwell<br>
> <nathan@acm.org>; Richard Smith <richard@metafoo.co.uk><br>
> Cc:cfe-dev <cfe-dev@lists.llvm.org><br>
> Subject:Re: [cfe-dev] Make command line support for C++20 module<br>
> uniform with GCC<br>
> <br>
> +Nathan and Richard as folks with some context here.<br>
> <br>
> On Mon, Oct 25, 2021 at 1:57 AM chuanqi.xcq via cfe-dev<br>
> <cfe-dev@lists.llvm.org <mailto:cfe-dev@lists.llvm.org>> wrote:<br>
> Hi all,<br>
> <br>
> Recently I am playing with C++20 modules and I found that the<br>
> command line support of GCC<br>
> is much better than Clang. Here is an example:<br>
> <br>
> ```C++<br>
> // say_hello.cpp<br>
> module;<br>
> #include <iostream><br>
> #include <string_view><br>
> export module Hello;<br>
> export void SayHello<br>
> (std::string_view const &name)<br>
> {<br>
> std::cout << "Hello " << name << "!\n";<br>
> }<br>
> // main.cpp<br>
> #include <string_view><br>
> import Hello;<br>
> int main() {<br>
> SayHello("world");<br>
> return 0;<br>
> }<br>
> ```<br>
> <br>
> To compile the example, in gcc we need:<br>
> ```<br>
> g++ -std=c++20 -fmodules-ts say_hello.cpp main.cpp<br>
> ```<br>
> <br>
> And in clang, we need:<br>
> ```<br>
> <br>
> clang++ -std=c++20 -fmodules-ts -Xclang -emit-module-interface -c<br>
> say_hello.cpp -o Hello.pcm<br>
> <br>
> clang++ -std=c++20 -fmodules-ts -fprebuilt-module-path=. main.cpp<br>
> say_hello.cpp<br>
> <br>
> ```<br>
> <br>
> Yeah, in clang we need to another line to emit module interface<br>
> explicitly and another option<br>
> to tell the prebuilt-module-path. And in GCC, this happens by<br>
> default, when GCC find it is compiling<br>
> a c++20 module, it would generate the module interface automatically<br>
> to the path:<br>
> ```<br>
> gcm.cache/filename.gcm<br>
> ```<br>
> It would create `gcm.cache` in case it doesn't exist.<br>
> <br>
> And GCC would search prebuilt module interface in `gcm.cache`<br>
> automatically.<br>
> <br>
> It looks much more friendly to me. The intention of this mail is to<br>
> ask if you think it is the right direction<br>
> to make the clang's command line support for c++20 module more like<br>
> GCC. The different I see now includes:<br>
> - Generate prebuilt module interface automatically. (And generate it<br>
> to a specific directory automatically)<br>
> - Have a default value for prebuilt module path.<br>
> <br>
> This sort of interaction is probably not going to be how modules are<br>
> generally built/supported as far as I understand it - it's opaque to<br>
> the build system, so may make it more difficult for the build system<br>
> to know when things need to be rebuilt, and also wouldn't support<br>
> any kind of distributed build system.<br>
> <br>
> The specifics of how GCC, Clang, (& maybe other compilers) and<br>
> various build systems may end up interacting on the command line and<br>
> filesystem (module discovery outside the current build for<br>
> system-installed library dependencies) is still being discussed and<br>
> debated in places like C++'s SG15 tooling working group.<br>
> <br>
> That doesn't mean we can't experiment further with things like this,<br>
> but I'm not sure we will/should be supporting cross-compiler<br>
> interface compatibility until we are a bit more sure about what the<br>
> best thing to standardize no is.<br>
> I am wondering if any one more familiar with the clang's command<br>
> line and file system would love to<br>
> support this (I am not so familiar with it). Although It may take<br>
> more time, I would love to support if others are busy.<br>
> <br>
> Thanks,<br>
> Chuanqi<br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> cfe-dev@lists.llvm.org <mailto:cfe-dev@lists.llvm.org><br>
> <a href="https://urldefense.com/v3/__https:/lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev__;!!JmoZiZGBv3RvKRSx!uljSy7xXR8IA-mBJrdxW-dpf-pOxmqiFrjUb1s50CZEGX-U311wC0tWXT2-YetWnMQ$">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
> <<a href="https://urldefense.com/v3/__https:/lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev*3E__;JQ!!JmoZiZGBv3RvKRSx!uljSy7xXR8IA-mBJrdxW-dpf-pOxmqiFrjUb1s50CZEGX-U311wC0tWXT283UKuIOw$">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev></a><br>
> <br>
> <br>
> <br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> cfe-dev@lists.llvm.org<br>
> <a href="https://urldefense.com/v3/__https:/lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev__;!!JmoZiZGBv3RvKRSx!uljSy7xXR8IA-mBJrdxW-dpf-pOxmqiFrjUb1s50CZEGX-U311wC0tWXT2-YetWnMQ$">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
> <br>
<br>
<br>
-- <br>
Nathan Sidwell<o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</body>
</html>