<div dir="ltr">I don't recall any specific problems, but yeah, could be that there're some.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 22, 2016 at 10:29 AM, Hans Wennborg <span dir="ltr"><<a href="mailto:hans@chromium.org" target="_blank">hans@chromium.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In Chromium we only build the gold plugin with LTO though, not Clang<br>
itself. IIRC (but my memory is hazy), we ran into problems when we<br>
tried that?<br>
<div class="HOEnZb"><div class="h5"><br>
On Thu, Sep 22, 2016 at 10:21 AM, Ivan Krasin <<a href="mailto:krasin@google.com">krasin@google.com</a>> wrote:<br>
> Hi Mehdi,<br>
><br>
> yes, on Linux we do 2-stage build exactly for this reason.<br>
> For the reference, the code is<br>
> <a href="https://cs.chromium.org/chromium/src/tools/clang/scripts/update.py?q=update.py&sq=package:chromium&dr=C&l=564" rel="noreferrer" target="_blank">https://cs.chromium.org/<wbr>chromium/src/tools/clang/<wbr>scripts/update.py?q=update.py&<wbr>sq=package:chromium&dr=C&l=564</a><br>
> and we don't make use of LLVM_ENABLE_LTO at the moment (no good reason I can<br>
> think of)<br>
><br>
> krasin<br>
><br>
> On Thu, Sep 22, 2016 at 9:26 AM, Mehdi Amini <<a href="mailto:mehdi.amini@apple.com">mehdi.amini@apple.com</a>> wrote:<br>
>><br>
>><br>
>> On Sep 22, 2016, at 9:19 AM, Hans Wennborg <<a href="mailto:hans@chromium.org">hans@chromium.org</a>> wrote:<br>
>><br>
>> On Thu, Sep 22, 2016 at 9:09 AM, Mehdi Amini <<a href="mailto:mehdi.amini@apple.com">mehdi.amini@apple.com</a>><br>
>> wrote:<br>
>><br>
>><br>
>> On Sep 22, 2016, at 8:58 AM, Hans Wennborg <<a href="mailto:hans@chromium.org">hans@chromium.org</a>> wrote:<br>
>><br>
>> On Thu, Sep 22, 2016 at 12:51 AM, Sylvestre Ledru via cfe-dev<br>
>> <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br>
>><br>
>> Le 22/09/2016 à 03:33, Mehdi Amini a écrit :<br>
>><br>
>> Hi,<br>
>><br>
>> I was wondering the same thing recently and Hans pointed me to<br>
>> llvm/utils/release.<br>
>><br>
>> It turns out we’re not using LTO :(<br>
>> (Neither PGO…)<br>
>><br>
>> In the Debian/Ubuntu packages (and this is general to packaging), we are:<br>
>> * relying on the build system of the application itself<br>
>> * adding some flags like "-g -O2" and the fortify options<br>
>> <a href="https://wiki.debian.org/Hardening" rel="noreferrer" target="_blank">https://wiki.debian.org/<wbr>Hardening</a><br>
>><br>
>> For the linker, for the LLVM toolchain, it depends if the version of<br>
>> binutils in the distro has it or not (at least 2.23.1-1~exp3).<br>
>> Here, for the Debian & Ubuntu packages, I am using binutils gold but not<br>
>> sure the LTO option is set to the llvm build system?!<br>
>><br>
>> However, happy to try that (I think this should be part of the build<br>
>> system,<br>
>> at least for LTO).<br>
>><br>
>><br>
>> I think that's what the -LLVM_ENABLE_LTO={Full,Thin} option is for,<br>
>> but it's not enabled by default.<br>
>><br>
>><br>
>> So, what about changing this?<br>
>><br>
>><br>
>> I don't know how practical it would be at the moment. Would most build<br>
>> environments support it? It seems to assume Clang is being built by<br>
>> Clang, and that the gold plugin (which I think requires the binutils<br>
>> headers to build) is around.<br>
>><br>
>><br>
>> Aren’t you doing a 2-stage build? In which case the stage-2 always has<br>
>> clang available.<br>
>> It requires Gold on linux probably, but on OSX the system linker supports<br>
>> LTO.<br>
>><br>
>> At minima the OSX build could have it enabled without risk of failure.<br>
>><br>
>> —<br>
>> Mehdi<br>
>><br>
>><br>
><br>
</div></div></blockquote></div><br></div>