<div dir="ltr">There's a manual step involved in updating our documentation for some reason. Looks like this manual step has been missed or only done piecemeal for specific options. I think this led to -mspeculative-load-hardening not being in the docs. I've resynced the documentation with the latest source so hopefully <div>the webpage will be updated in the next day or so.</div><div><br></div><div>Not sure why clang doesn't print all the options. I normally work in the backend. Hopefully someone from the frontend can chime in here.</div><div><br></div><div><div><div dir="ltr" data-smartmail="gmail_signature">~Craig</div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 10, 2020 at 12:40 AM Gaier, Bjoern via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="DE">
<div>
<p class="MsoNormal"><span lang="EN-GB">Hello everyone,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">(There is a TL;DR down there)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">I started to look into the Spectre Mitigation features of the MSVC compiler - we are planning to apply those to our code base finally. I was able to find out, that the MSVC compiler supports 3 flags for this:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">/Qspectre -> "Specifies compiler generation of instructions to mitigate certain Spectre variant 1 security vulnerabilities."<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">/Qspectre-load -> "Specifies compiler generation of serializing instructions for every load instruction."<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">/Qspectre-load-cf -> "Specifies compiler generation of serializing instructions for every control-flow instruction that contains a load."<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">That was surprisingly helpful! However, we are also using the Clang-Cl compiler, so I wanted to find out which features are supported in terms of the Spectre Mitigation. This was difficult! I found at least this website:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><a href="https://llvm.org/docs/SpeculativeLoadHardening.html" target="_blank">https://llvm.org/docs/SpeculativeLoadHardening.html</a> - Which is really interesting but... too much for me >o<<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Next hint I got was the attribute "speculative_load_hardening" but there the 'frustration' started. On the site, the compiler flag "-mno-speculative-load-hardening" was mentioned - I figured that the flag "-mspeculative-load-hardening"
 would be a thing. The link <a href="https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-mspeculative-load-hardening" target="_blank">https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-mspeculative-load-hardening</a> was of no help however, because the flag isn't mentioned there as it seems. Sooo... Next thing I did was executing "clang -help"
 and "clang --help-hidden" to my surprise the flag wasn't mentioned there as well...<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">So I went to one of our projects and added it by hand, checking if it will throw an error or not - it did not.
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">TL;DR:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">My problem as a user is... I'm really unsure how many undocumented flags are supported by Clang and which one might be of interested for me. For example, do I know all the flags now that are related to the spectre mitigation?
 I know that there is also -mreptoline (or something), but I can't know about the flags I don't know about - and when not even Clang itself dumps them, then I'm really screwed.
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Also, how can I be sure, that the flag is also supported by Clang-Cl? Or by Clang-Cl -Xclang?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Also a kinda confusing thing... When I go to the LLVM/Clang online documentation, then it says Clang 11, when I ask my Clang about the version it replies with Clang 9 - also on the website I can only download LLVM 9 -
 That makes me feel like I missed 2 Versions already - even though I think to recall that LLVM 10 is next.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Yet it seems like I'm the only one with that issue .w.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Kind greetings<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Björn<u></u><u></u></span></p>
</div>
Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr. DE 114 165 789 Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko Lampert, Takashi Nagano, Takeshi Fukushima. Junichi Tajika
</div>

_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>