lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6c4febd7-f826-9935-4163-138b1fed8278@redhat.com>
Date:   Mon, 3 May 2021 09:48:57 -0700
From:   Tom Stellard <tstellar@...hat.com>
To:     Dan Aloni <dan@...nelim.com>,
        Nick Desaulniers <ndesaulniers@...gle.com>
Cc:     Linus Torvalds <torvalds@...ux-foundation.org>,
        Masahiro Yamada <masahiroy@...nel.org>,
        Nathan Chancellor <nathan@...nel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        clang-built-linux <clang-built-linux@...glegroups.com>,
        Fangrui Song <maskray@...gle.com>,
        Serge Guelton <sguelton@...hat.com>,
        Sylvestre Ledru <sylvestre@...illa.com>
Subject: Re: Very slow clang kernel config ..

On 5/1/21 10:19 PM, Dan Aloni wrote:
> On Fri, Apr 30, 2021 at 06:48:11PM -0700, Nick Desaulniers wrote:
>> On Fri, Apr 30, 2021 at 6:22 PM Linus Torvalds
>> <torvalds@...ux-foundation.org> wrote:
>>>     0.92%  libLLVM-12.so       llvm::StringMapImpl::LookupBucketFor
>>
>> ^ wait a minute; notice how in your profile the `Shared Object` is
>> attributed to `libLLVM-12.so` while mine is `clang-13`?  Clang can be
>> built as either having libllvm statically linked or dynamically; see
>> the cmake variables
>> LLVM_BUILD_LLVM_DYLIB:BOOL
>> LLVM_LINK_LLVM_DYLIB:BOOL
>> BUILD_SHARED_LIBS:BOOL
>> https://llvm.org/docs/CMake.html
>>
>> I think those are frowned upon; useful for cutting down on developers
>> iteration speed due to not having to relink llvm when developing
>> clang. But shipping that in production? I just checked and it doesn't
>> look like we do that for AOSP's build of LLVM.
> 
> There's also `-DLLVM_ENABLE_LTO=Thin` that enables LTO for building LLVM
> and Clang themselves, considered they can be bootstrapped like this
> using a previous version of Clang. Combining that with a non-shared
> library build mode for both Clang and LLVM, the result is possibly the
> fastest and most optimized build that is achievable.  Unfortunately I
> see distributions neglecting to enable this in packaging this as well.
> 
> On a side note, I'm also a Fedora user and agree with Linus about this.
> I'd like to see an opt-in bypass of the shared library policy via
> something like `dnf install clang-optimized` that would install the
> fastest and most optimized Clang build regardless of RPM install size.
> 

I have experimented with creating a static version of clang in the past,
but never really found a solution I liked enough to upstream into Fedora.
e.g. This solution[1] that we're using to bootstrap clang in our internal
clang-as-the-default-cc Fedora buildroots that we use for testing.

If someone could file a bug[2] against the clang package in Fedora (or RHEL even)
with some data or other information that shows the downsides of the shared
build of of clang, that would be really helpful.

-Tom

[1] https://src.fedoraproject.org/fork/tstellar/rpms/clang/c/dea2413c6822cc7aa7a08ebe73d10abf8216259f?branch=clang-minimal
[2] https://bugzilla.redhat.com/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ