Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp2295913pxy; Sun, 2 May 2021 18:04:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4xySsDbOgrsA11bKA7eQ0GcC0SqDqOp6B80dHEzJ1W1xVrYmMSuyhCqmm4GFrAZPi//Mf X-Received: by 2002:a62:bd13:0:b029:25f:cd51:7bb5 with SMTP id a19-20020a62bd130000b029025fcd517bb5mr16692204pff.74.1620003859158; Sun, 02 May 2021 18:04:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620003859; cv=none; d=google.com; s=arc-20160816; b=duYjTV30H/OoHf/4Fz0QtSpqRJAXA0U32+7sJ6134hO1SfBsEm7QHMMqdBxV+WEu25 bqBAny9bl5KtJLO0E7Rcb4bHo6pAaLvqX6aCKtYh1DxaKK8Pio/+Fx+rcGwGliulXr6m S4OaWq+kMuxSA8jjMZU6qXVqDqYU5V6JWeuP15KHWBiiGzJNDXTV2JDQFW5yIbNhM9nf I8blQHtvvonMqEWcV7x3ikkbT4ax9+j3UGzDu/RV+Y8aJwPL1AGOw4ceRDz6nCGvZQnl GfDmNtrXQxmkK4jh1AGSboTphMaCt4RDZ0YiCcP7KD528NCMQbPuZV4P+eh/ovlp+UAt AE8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=xnGTJkiS118ZTcYahCmsgqZh0YNMV1gqNvwB2mIfbb0=; b=QymfNGlUMyQblCu7SlaJtdtZ+6Vi2kb8rh/zMUz08yCBr4W7Wgjz93AUuPBVMr78LV j/JgJprRziUl1uHo1BFXyq7QsXjcyXWZwtsUIIYccYQ2QZgm9RjNpr/tMkZGSuSd67Ee cYEf7oIwh7Yp1kwucyokZsmo9rsVHBG6W9PWIDpI5XlXj7qdgB6BURvzcuKzcbFhcRpa /99dYrQ5DlkRuiF0lgHOkU2srkNfA8kz8wSn/oNa/ZSHJYG/rHzkUaOB83GqeOjyEa6P purhhFHP9ZeKKOCRpUq2zYpufGpRfh9MgyBN7jI6cf2Sst0oilBYGg5C3ih9TUhMyVxV TXPA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e64si23581978pjc.65.2021.05.02.18.04.06; Sun, 02 May 2021 18:04:19 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232767AbhECBE0 (ORCPT + 99 others); Sun, 2 May 2021 21:04:26 -0400 Received: from angie.orcam.me.uk ([157.25.102.26]:39794 "EHLO angie.orcam.me.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232758AbhECBEZ (ORCPT ); Sun, 2 May 2021 21:04:25 -0400 Received: by angie.orcam.me.uk (Postfix, from userid 500) id 30AE692009C; Mon, 3 May 2021 03:03:31 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 2A1E992009B; Mon, 3 May 2021 03:03:31 +0200 (CEST) Date: Mon, 3 May 2021 03:03:31 +0200 (CEST) From: "Maciej W. Rozycki" 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 .. In-Reply-To: Message-ID: References: <1c5e05fa-a246-9456-ff4e-287960acb18c@redhat.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 1 May 2021, Linus Torvalds wrote: > > Yes, it's intentional. Dynamic linking libraries from other packages is > > the Fedora policy[1], and clang and llvm are separate packages (in Fedora). > > Side note: I really wish Fedora stopped doing that. I wish they never stop. > Shared libraries are not a good thing in general. They add a lot of > overhead in this case, but more importantly they also add lots of > unnecessary dependencies and complexity, and almost no shared > libraries are actually version-safe, so it adds absolutely zero > upside. I agree shared libraries are a tough compromise, but there is an important upside. Let me quote myself from a recent discussion : "Dynamic shared objects (libraries) were invented in early 1990s for two reasons: 1. To limit the use of virtual memory. Memory conservation may not be as important nowadays in many applications where vast amounts of RAM are available, though of course this does not apply everywhere, and still it has to be weighed up whether any waste of resources is justified and compensated by a gain elsewhere. 2. To make it easy to replace a piece of code shared among many programs, so that you don't have to relink them all (or recompile if sources are available) when say an issue is found or a feature is added that is transparent to applications (for instance a new protocol or a better algorithm). This still stands very much nowadays. People went through great efforts to support shared libraries, sacrificed performance for it even back then when the computing power was much lower than nowadays. Support was implemented in Linux for the a.out binary format even, despite the need to go through horrible hoops to get a.out shared libraries built. Some COFF environments were adapted for shared library support too." And the context here is a bug in the linker caused all programs built by Golang to be broken WRT FPU handling for the 32-bit MIPS configuration, due to a bad ABI annotation causing the wrong per-process FPU mode being set up at run time (Golang seemed to have got stuck in early 2000s as far the MIPS ABI goes and chose to produce what has been considered legacy objects for some 10 years now, and nobody noticed in 10 years or so that the GNU linker does not handle legacy MIPS objects correctly anymore). This could have been fixed easily by rebuilding the Go runtime, but as it happens Google chose not to create a shared Go runtime and all programs are linked statically except for libc. This had led to a desperate attempt to work the issue around crudely in the kernel (which cannot be done in a completely foolproof way, because there's missing information) so that Debian does not have to rebuild 2000+ packages in a stable distribution, which OTOH is a no-no for them. Whether distributions package shared libraries in a reasonable manner is another matter, and I've lost hope it will ever happen, at least widely (there has been an attempt to address that with a distribution called PLD, where the policy used to have it that shared libraries coming from a given source package need to go into a separate binary package on their own, so that several versions of different SONAMEs each of the same shared library package can safely coexist in a single system, but I haven't checked it in many years whether the policy has been retained, nor actually ever used PLD myself). Maciej