Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1584121pxb; Thu, 4 Mar 2021 15:29:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJy9zWU//CcgwYfpSdU+lWb+JAeaAzc6vRTp5BfYJiMaodG9sDsMwoF7Gjr5UqomzEDG/zSb X-Received: by 2002:a02:7086:: with SMTP id f128mr6619038jac.104.1614900565220; Thu, 04 Mar 2021 15:29:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614900565; cv=none; d=google.com; s=arc-20160816; b=vunKHleNs9DG0whX5OD8LHrA6yH6z24pSm9ujw9teZdLp7y6EBHsWhGkiQAzW7DPYr DmqWKwBKFMzNcWyv/AVKdN1o9LbN72FetVk3AIf3DiRH2s4II8mWP7f1c6iVAfHHUL7Q OuzYbYTr+nKFWpLw0pCVPtUH8SylIvNvsMn0KC9bcXcOXgc+zdVnuC3FVM3FgRj4Z+Aj 0sho63Q3OupPFRqamBvPk++o+ZQ8JTxBECZoD8jz6spNvKeKXQMT4eY59siIjwECJEf0 PL/2tgySzjW+T99MwD6rWsgCUIiiwYPQ5yayjnM0D2j01Y4uKdwf1+uW5PQdTU4BF170 p7Iw== 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=/uIYiDtRjwD/TK3His/5CccHi6NH1uV5qRRXKXn4pqE=; b=aRargdeso+/clz7hN0gYs7tqfsSAxn6gH5oqoRX3G3gulrFPjwhoCLbNHTRqg6gLZF +R8gk4c7lcxvRdPDmty0P9FTgStj8WyR0iJKuwzwrKK4O0sXFxznAI4BjJPEFgxU4cfg L8NFYmOTxFVadx+vdRe4Hkoug8OAJlb5JXvnp3qRoxTrszCUwecEPZahbTrmP6H0D6qR I+1E4nm7WkGsbgPLLiXZTP43b5er8swn1XumkTELNdv4E6zVMTEbpZm4cjG1GU9kucBV UdlGpFLEDFARHTYAurgomeejM8X5i/Jtz6bTzAaiAwXOt1JR3bObqQTOPOGBLSnuCdSB WoKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=anJlRTpS; 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 g6si761437jaq.124.2021.03.04.15.29.12; Thu, 04 Mar 2021 15:29:25 -0800 (PST) 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=@linux-foundation.org header.s=google header.b=anJlRTpS; 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 S1345130AbhCDAAJ (ORCPT + 99 others); Wed, 3 Mar 2021 19:00:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1387388AbhCCT6d (ORCPT ); Wed, 3 Mar 2021 14:58:33 -0500 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16C96C06175F for ; Wed, 3 Mar 2021 11:57:53 -0800 (PST) Received: by mail-lf1-x129.google.com with SMTP id 18so30556943lff.6 for ; Wed, 03 Mar 2021 11:57:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/uIYiDtRjwD/TK3His/5CccHi6NH1uV5qRRXKXn4pqE=; b=anJlRTpSFljFjmADV7Piml2CFnNQDd6mlppzM5fOQlOKZqdn/dqwihmnbCYi/ya7eL IOGXc9od+7aat29BuDorbvsPFjCc+KX19Tc+zuOWG+E1k1hSl/KKaXZIT0FzQs8PEu5/ 54mDXOe8HZ0MXuwNEkdK10xJu7tBagwtXnmtQ= 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=/uIYiDtRjwD/TK3His/5CccHi6NH1uV5qRRXKXn4pqE=; b=TxFDrtlLsYLjJk2DRYPpVkfj+9xSOsEwQD/ckBJhjkrNABcS9CaWFyOAsY4Wajzj9Z Lj9Lj9Ft4OpVi99hSm8fWK36tZZXGHEZttwba2REVdOQGvy6dKztofKf4XzdRWa7UEwh eTUGuSnyyfvkfGOuvrveUzLBUiyR+N7ztxAhOhfE7uW0wc9doAf/BcyG6VdW+pMiCJxI a68XQgBiH8+DjcZcr1NdxNf7pp5n9kITuLdYTbg/BSHSBwDBRfXR5DppSulrechxhfS9 YZxg3IkjZSc0e/LYrB8e30R+JJoZeWwcrsl68rd98MSph2WzZPt0i4EgEEjILoLKIE3s 27jg== X-Gm-Message-State: AOAM530BVZ1buDWA3YppNOQns2CJoTDLhQssuJtTPfLPffbShmhzAfh+ fL6Rw0bp4CNbke6i7p3dQIjn9ghxhSrd0A== X-Received: by 2002:a05:6512:3b5:: with SMTP id v21mr226568lfp.54.1614801470732; Wed, 03 Mar 2021 11:57:50 -0800 (PST) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com. [209.85.167.48]) by smtp.gmail.com with ESMTPSA id z10sm1776226lfe.114.2021.03.03.11.57.49 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Mar 2021 11:57:49 -0800 (PST) Received: by mail-lf1-f48.google.com with SMTP id b1so28345825lfb.7 for ; Wed, 03 Mar 2021 11:57:49 -0800 (PST) X-Received: by 2002:a05:6512:398d:: with SMTP id j13mr191154lfu.41.1614801468954; Wed, 03 Mar 2021 11:57:48 -0800 (PST) MIME-Version: 1.0 References: <20210302232649.y2tutffhxsblwqlb@treble> <20210303191516.6ksxmng4pis7ue4p@treble> <20210303193806.oovupl4ubtkkyiih@treble> In-Reply-To: <20210303193806.oovupl4ubtkkyiih@treble> From: Linus Torvalds Date: Wed, 3 Mar 2021 11:57:33 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH RFC] gcc-plugins: Handle GCC version mismatch for OOT modules To: Josh Poimboeuf Cc: Masahiro Yamada , Linux Kernel Mailing List , Michal Marek , linux-hardening@vger.kernel.org, Linux Kbuild mailing list , Peter Zijlstra , Justin Forbes , Ondrej Mosnacek , Frank Eigler , Kees Cook Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 3, 2021 at 11:38 AM Josh Poimboeuf wrote: > > > But in the meantime, making the plugins depend on the gcc version some > > way is certainly better than not doing so. > > So currently, the plugins already so that. They require the GCC version > to be exact. If there's a mismatch, then it fails the OOT module build. That's not my experience. Yes, the build fails, but it fails not by _rebuilding_, but by failing with an error. IOW, it's a dependency problem. That said, I absolutely think that distros that think that stackleak is an important plugin should seriously have a plan to just move to clang, or push the gcc people to just add the "-ftrivial-auto-var-init" thing (and talk sense to the clang people who think that zero isn't good, and want to force a "pattern", but happily they haven't taken over the world yet). The kernel gcc plugins _will_ go away eventually. They are an unmitigated disaster. They always have been. I'm sorry I ever merged that support. It's not only a maintenance nightmare, it's just a horrible thing and interface in the first place. It's literally BAD TECHNOLOGY. Gcc plugins were badly done. They _should_ have been done twenty years ago as a proper IR (and people very much asked for them), but for political reasons the FSF was very much against any kind of intermediate representation that could be hooked into. It's one of the reasons clang has been so successful - having the whole LLVM IR model has made life _so_ much better for anybody working on any kind of compiler that it's not even funny. Gcc plugins were too little, too late, and are not even remotely a good model technically. LLVM did things right with a well-defined IR front and center, and while I dearly love gcc for a lot of reasons, I absolutely despise how badly gcc handled this all - and I despise how that horrible decision was never about technology, and was always due to bad politics on the part of FSF and rms. End result: gcc plugins are pure garbage, and you should shun them. If you really believe you need compiler plugins, you should look at clang. That really is the only sane technical answer. Linus