Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp2200877pxy; Sun, 2 May 2021 14:54:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyL4UwLu2Nit7ntMVDAHlfqvi//FnjfRQ+g4eDCrOXhNH/bB/+p+pYjkeCQkV6Rlqdl7f3B X-Received: by 2002:a17:906:a1c5:: with SMTP id bx5mr14543244ejb.166.1619992445567; Sun, 02 May 2021 14:54:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619992445; cv=none; d=google.com; s=arc-20160816; b=J0H4T1YtJgTaIEgl+K7fSqyQ3VZqtFZBv/7M3G4UqrAF3FBJwWjTY7f7XXOoMyx3DL I173MljeDnVtE2w3IW5Y6zo3EsqlIVzzElydBshurHNv44fCwTiV2pAVVPdGhYeaXvAf O98m3gqvgToMKZuSmC/3qWEb0KI0yJKlWGNSYDJX0swsPGgbY2KPyT4K0uXgmakmU/BC 9godjRgRfWisbNsWuHEmVm7NYW7qgAgrWlTKA9/r8uDtti01PgFIcZ3w4xw9uwhaMnYC bGiE3poyi8+UWjXxzV2nrpEUuHhN+yOkCU8mije7O/V8RSHQ7d8XGRY6OxxuyEFV6x+G MnsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=R1fWxSmRaPTKOL8xnH8MzhkBpIX/oMOMoU4DA1R+hgs=; b=RSeCWSBD0EdczdlnBkPpJKOY2Y4h1ph+lJ84b8oAUtOnnAr34jhCX5e8Ty+PCXrecn QqEBeOR29zk/M7/CZXbN0E25mf1NOfiI628hl7fUDuicpmPiNH/V6wDUQwYxMCzFpR8r 9Trur9jx/ivTM+FjRJzT3Cpj+8kDDf213A/ycwrf8MboQJUk1XkzjTc/u3PEgdibqsok EAMgNuPILhHyU8ngKD+iTcZfWS9LzcHSc9Gp8lbqLWgMYUf85CiLmfC5OLuMfCQfL8NF 48G21eeyqXAQlZ+ELVosY2Dlyl+F9dC70N+/wi+KZBFHI1nUMH2HRQ03d2U57I8bYBEk onuA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n23si8925011eje.216.2021.05.02.14.53.30; Sun, 02 May 2021 14:54:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232492AbhEBVtB (ORCPT + 99 others); Sun, 2 May 2021 17:49:01 -0400 Received: from mail.stusta.mhn.de ([141.84.69.5]:55764 "EHLO mail.stusta.mhn.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232338AbhEBVtB (ORCPT ); Sun, 2 May 2021 17:49:01 -0400 X-Greylist: delayed 44201 seconds by postgrey-1.27 at vger.kernel.org; Sun, 02 May 2021 17:49:00 EDT Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail.stusta.mhn.de (Postfix) with ESMTPSA id 4FYKTy0CH6z1n; Sun, 2 May 2021 23:48:05 +0200 (CEST) Date: Mon, 3 May 2021 00:48:04 +0300 From: Adrian Bunk To: Linus Torvalds Cc: Tom Stellard , Nick Desaulniers , Masahiro Yamada , Nathan Chancellor , Linux Kernel Mailing List , clang-built-linux , Fangrui Song , Serge Guelton , Sylvestre Ledru Subject: Re: Very slow clang kernel config .. Message-ID: <20210502214803.GA7951@localhost> References: <1c5e05fa-a246-9456-ff4e-287960acb18c@redhat.com> <20210502093123.GC12293@localhost> <20210502164542.GA4522@localhost> <20210502175510.GB4522@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 02, 2021 at 10:59:10AM -0700, Linus Torvalds wrote: > On Sun, May 2, 2021 at 10:55 AM Adrian Bunk wrote: > > > > Are you happy about libclang.so being a shared library? > > Honestly, considering how I don't have any other package that I care > about than clang itself, and how this seems to be a *huge* performance > problem, then no. > > But you are still entirely avoiding the real issue: the Fedora rule > that everything should be a shared library is simply bogus. It is not a Fedora-specific rule, we have something similar in Debian. And in general, static libraries in the C/C++ ecosystem often feel like a rarely used remnant from the last millenium (except for convenience libraries during the build). > Even if the llvm/clang maintainers decide that that is what they want, > I know for a fact that that rule is completely the wrong thing in > other situations where people did *not* want that. libdivecomputer is now a submodule of subsurface. If this is the only copy of libdivecomputer in a distribution, then linking subsurface statically with it and not shipping it as a separate library at all is fine for distributions. The Fedora policy that was linked to also states that this is OK. The important part for a distribution is to ship only one copy of the code and having to rebuild only the one package containing it when fixing a bug. > Can you please stop dancing around that issue, and just admit that the > whole "you should always use shared libraries" is simply WRONG. > > Shared libraries really can have huge downsides, and the blind "shared > libraries are good" standpoint is just wrong. Good for distributions or good for performance? These two are quite distinct here, and distribution rules care about what is good for distributions. Library packages in ecosystems like Go or Rust are copies of the source code, and when an application package is built with these "libraries" (might even be using LTO) this is expected to be faster than using shared libraries. But for distributions not using shared libraries can be a huge pain. Compared to LTO compilation of all code used in an application, static linking gives the same pain to distributions with smaller benefits. I agree that on the performance side you have a valid point regarding the disadvantages of shared libraries, but not using them is bad for distributions since it makes maintaining and supporting the software much harder and security support often impossible. > Linus cu Adrian