Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp681784pxy; Wed, 5 May 2021 11:07:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx31Cvm582lIjulmyeobjvLMeBu/EM0pn+YygsKRpjIlFg0qx6Td7Aa1qZddivTljOrv4MF X-Received: by 2002:a5d:6484:: with SMTP id o4mr376839wri.8.1620238046641; Wed, 05 May 2021 11:07:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620238046; cv=none; d=google.com; s=arc-20160816; b=CezSzW6NfXUm+AZ8nfJoje6mb0n9IH+102dvllNxgoRbwpSgHqdHwuz4LFBtnm8LxM s3XcKqUK/m53scP04Sow2zgBIK+xsNHPoafdDnAz/6QwjMZMSm3BzZAWswnKbBTh5Wtj zx16jPvwj4hN2BSy/a1wcE0UyRczYrmZtMRhGMwkXUns0Ld87KmmEEvivfM8h8cVVwDS 1WohvGKDNYj9ICwzJpbQsqGnijXBayB8gGCZrtrhJgmMaw2VaOaXpleGu8mVCLi2dM+I bC7ApEOtVhcuWynG8Lmzu4j4ReGZI7XDwH+gwcAre7sEbSmGpFf/EUEYEF6gLyQSRPY0 ZehA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=JRrWDm6hzoXBYkMYgzRKxH03l5/cMdlHpkGRxjVY6Vc=; b=lkLkZYVCL5VKhLAX2aWjgE1kyEtjHja/KuJDxcavEvYHNU6J/iAOKFzThYf4qBr29d i7c+AZXvsLDUPeq6B3lY8w+NsA+RhvLAmB8UMWupD7xFbKHj56l1sXK4FqwJiiK2zKg6 mJTASwc+B3IX8kVPZKnf6k0p6naiWNmjAboOhocua2YievWnX7LRDFB/qVAa3GnMUK5k MkKDToTXo6PgZsI397BkRPR7gRvPd4WyO1rHaZ/vrDK3U6odWytFg5ZORCAPIxu2XUck BMqxR1kn/gjXUv+U+Ra3su4LvrrJfxxj2rIEtxs36mbEAN+NG0KfnaO9BcUBPuUUcEfx Jn2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eQKGx1gu; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m3si83566edc.293.2021.05.05.11.07.01; Wed, 05 May 2021 11:07:26 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eQKGx1gu; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235687AbhEESFg (ORCPT + 99 others); Wed, 5 May 2021 14:05:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235911AbhEESEe (ORCPT ); Wed, 5 May 2021 14:04:34 -0400 Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com [IPv6:2607:f8b0:4864:20::b36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E296EC04682F for ; Wed, 5 May 2021 10:55:23 -0700 (PDT) Received: by mail-yb1-xb36.google.com with SMTP id g38so3780849ybi.12 for ; Wed, 05 May 2021 10:55:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JRrWDm6hzoXBYkMYgzRKxH03l5/cMdlHpkGRxjVY6Vc=; b=eQKGx1guDvHwxN5vTy0GDXI58bnIFoJ0vFbeT43gm2kxemZAHNKxXjR+6J2fEvdWyS 0iJBNRookiebnuLF9MaEFtDfcmO1JhwGICRlMFglMOBbup0HVeQcQl/b7+aUUVu89+rL uEt0JPUFptZSyQvf16g3d9BRHJVqU2PGcD2eo5OpAZBL0RJdp696Xjs699Cb9AMUQLdf iwyQcx8oiQ6gCxsVMkSvZMI3Xj0qMaHE03MsOrQ0sBiGDQcg76Rawzf/IPv+MrUAkRB1 0Ox2xBfa4LIONi8LqCF3ubT4Bi8BOosO9QOewt1+22tt5hJf/2c3pl7URDok2BZEtGgv P2Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JRrWDm6hzoXBYkMYgzRKxH03l5/cMdlHpkGRxjVY6Vc=; b=aMds1Wme7nGS2yrnGZ/+4jhPdOPtxah9ITesnnQsxcgVRFkc2TofW5tTejW2TGKGuw 80Yqmkf3QX5bqtuT70TrMSjnv5rWvATj2Uh78fo9k96tEVZmFGbm8TORCkzQRq/bfA/I GJTzNgRwF6HBJO0V/wZA915oNv8iQREnwHZEkL9izmKaN6NeGkxCQLWBrsbo8YfzEs3E 8zCHtPw1LADeBkkgga4xuwj/hy4mxsIU1Uu++1kiuKnl3O926CuML09FNVK/YIXpxfZZ TV4I+rIgEf7v5USdMErnCJ0cDPR5RDs5hmfxVDj2oERYWLZR3JEXFlNhFxtmC/KvUOhn vdRg== X-Gm-Message-State: AOAM531lMIFAGVvGkXo7sp5bi42vWuLtbRd8h3U3LC90GKDUpOqihTwi tc/EALaGO+6fMdDrx8z+iFHZY5vb/H5awtZpFEE= X-Received: by 2002:a25:bc8b:: with SMTP id e11mr44494005ybk.115.1620237323235; Wed, 05 May 2021 10:55:23 -0700 (PDT) MIME-Version: 1.0 References: <1c5e05fa-a246-9456-ff4e-287960acb18c@redhat.com> <20210502093123.GC12293@localhost> <5256ed6b6f7d423daeb36fcbfc837fbc@AcuMS.aculab.com> <3ab89c4f8b1d455ba46781b392ef0b2d@AcuMS.aculab.com> <42fdc9f1b4b44136b4eeffa0957ebc3e@AcuMS.aculab.com> In-Reply-To: <42fdc9f1b4b44136b4eeffa0957ebc3e@AcuMS.aculab.com> From: Miguel Ojeda Date: Wed, 5 May 2021 19:55:12 +0200 Message-ID: Subject: Re: Very slow clang kernel config .. To: David Laight Cc: Adrian Bunk , Linus Torvalds , Tom Stellard , Nick Desaulniers , Masahiro Yamada , Nathan Chancellor , Linux Kernel Mailing List , clang-built-linux , Fangrui Song , Serge Guelton , Sylvestre Ledru Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 5, 2021 at 6:25 PM David Laight wrote: > > But it is the customer's customer who comes back to you saying > that something in your library is broken. > This is when you really don't what static linking - ever. In that case, you need to refer them to your (direct) customer. I understand where you are coming from (e.g. Microsoft also encourages developers to avoid static linking their CRT), but there is no good solution for that -- some of your direct customers will require you provide the version for static linking nevertheless, so your only approach would be gating access to the static version somehow. > Static linking is much worse because different parts of the 'system' > are provided by different people. > With a little care a C shared library can be implemented by different > companies while still meeting the same ABI. I assume you are talking about things like program plugins in the form of shared libraries (e.g. a different renderers in 3D suites, different chess engines, mods in a videogame, etc.). In that case, well, if you really need a customer of yours to swap libraries without rebuilding the host program, because you want other companies to provide plugins, then obviously static linking is not the way to go. But shared libraries are just one possible solution in that space anyway, there is also IPC of different kinds, bytecode VMs, interpreters, etc. > It this case it was done to give the software engineers some > experience of writing C++. > Technically it was a big mistake. > > Bad C++ is also infinitely worse that bad C. > Exception handling (which you might think of as a gain) > is very easy to get badly wrong. > Class member overloads make it impossible to work out where data is used. > Function overloads are sometimes nice - but unnecessary. Agreed! While, in general, this applies to any language, it is specially dangerous in languages with UB. And, among those, C++ is very complex, which in turn can produce very subtle UB issues. This was understood by Rust designers, and the language is an attempt to minimize UB while, at the same time, providing higher-level features than C. Cheers, Miguel