[cfe-dev] How clang from packages is build?

Mehdi Amini via cfe-dev cfe-dev at lists.llvm.org
Thu Sep 22 11:53:13 PDT 2016


> On Sep 22, 2016, at 11:27 AM, Sylvestre Ledru <sylvestre at debian.org> wrote:
> 
> I just tried and, with gcc 6.1 and GNU gold (GNU Binutils for Debian 2.26.1) 1.11
> 
> I am getting:
> lto1: internal compiler error: in lhd_decl_printable_name, at langhooks.c:222
> 0x7fb47a lhd_decl_printable_name(tree_node*, int)
> 	../../src/gcc/langhooks.c:222
> 0x69a45e gen_namespace_die
> […]

The idea is to enable LTO on the stage-2 only, here you have a crash in GCC LTO during the stage-1 right?

— 
Mehdi


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




More information about the cfe-dev mailing list