Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4086254ybl; Mon, 13 Jan 2020 07:37:30 -0800 (PST) X-Google-Smtp-Source: APXvYqyin0zjUGlK8UNFr5ytZJF14mikU5MyjPOQf232GxCR53lJPYCtqX53X5kdg9awgnmeqHzA X-Received: by 2002:a05:6830:605:: with SMTP id w5mr14070967oti.79.1578929850549; Mon, 13 Jan 2020 07:37:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578929850; cv=none; d=google.com; s=arc-20160816; b=nqn0yzBolRssJY8i2uWbgGCoS4offQWutUpgUvNFHXr7P08tvUhSS/ybDoikaLFunr 4vb9RDnwsvUJIPEVUl96R084YvB+NysgByf1EZAjTgtqxlj2+mEJdyHDER+6HbD2D+OT LOYwAkdGT8hqP31n2l88rOUTZFrIOBezk5scs7xh6ul1hWWIl71DSpPSYPiRYDAuBtqB oF5NXgQAkwMSYNEa9FIq6/Lo2dBp3reAnyJzTtMEgPEEHqCRRWQFIcsA5b7e3/fgwkKf eAx4EPge4UdU9sYJVA63Zijp+gZoJdghXAYSSz3sWL+P+bzoEXDp6Tx2JNQhqBLfCTAP RWtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=WvM/gJrWjdVgUnU+HkAKdEIOMw3oFE5evrhjYDUHO8Y=; b=dKSXAX7KukK3QqyECvzBzVlrMGfgzoZANL4mZZDh4mzwG2snmTu5nJeyFUUEJUF0RN 0aG4N4O3k8aNoBDDZ1yCpJ44OoKJSRNjtWCBI2dQ/carIC2Nu27OH+slsinDUO9cUs7q A5TX1K0p63EKhSXiMmiUlI/HBXf/VtxqOxZP0q0UBFf3jlcCkoiwLjdbm1gh+bBsHPLm 31lEanN0b9yMsB7pEW24AXVDLh9jYvSshqnQbUm+bqqSlgWn37lGVwLXaydZcjGcxxn3 nH5D3P8FpE3jMx8hnvKLxTTHJIZVJcVejac4u0rPfx4OiDaigpMh7AM3kFOzu1ptStO+ ryVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=AjXElao0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f25si6834644otl.36.2020.01.13.07.37.17; Mon, 13 Jan 2020 07:37:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=AjXElao0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728640AbgAMPgS (ORCPT + 99 others); Mon, 13 Jan 2020 10:36:18 -0500 Received: from conssluserg-03.nifty.com ([210.131.2.82]:37266 "EHLO conssluserg-03.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726163AbgAMPgR (ORCPT ); Mon, 13 Jan 2020 10:36:17 -0500 Received: from mail-ua1-f51.google.com (mail-ua1-f51.google.com [209.85.222.51]) (authenticated) by conssluserg-03.nifty.com with ESMTP id 00DFaChC004910; Tue, 14 Jan 2020 00:36:13 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com 00DFaChC004910 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1578929773; bh=WvM/gJrWjdVgUnU+HkAKdEIOMw3oFE5evrhjYDUHO8Y=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=AjXElao0UYggxb1dkHr7ah6ygIJcmjkZePTnf6OsVB3Lgu5XNgfXf2FY9+giU267w kY73r1h5UIzJ8M02jk5Xe+ukHDIA7ZdcpwkbHGY3SlBEm6IKHctwhK++HLkDZJy8bW X6XudRapkHOsXyiOLFjdalyK+kjBktvH/fjcwjEoWrqEpvZQtpvnqBG95EQw9ZcyfS vJ39FrMmstmZLRow9aXXVv3Yf62v1qqhCKqxuMpUXklb93bABavyVym2qhbzSg1wgA XZqnC10iPqgmNrBjYEnJKWSpJSQSO2qCYo70crJmNlIUHHVy+9u5Wq9TmdRZMEG2SB d6p0YsC9RTXmQ== X-Nifty-SrcIP: [209.85.222.51] Received: by mail-ua1-f51.google.com with SMTP id a12so3502781uan.0; Mon, 13 Jan 2020 07:36:12 -0800 (PST) X-Gm-Message-State: APjAAAVnuYDfPDfKgmaQ/oUR9h0ehVjm0+jb5e4wfC/xd2sZMKgwdD4f InF9vO2gqFtMa5119IHA8RvQgEfUN1ME/qcSQeU= X-Received: by 2002:ab0:14ea:: with SMTP id f39mr7599928uae.40.1578929771582; Mon, 13 Jan 2020 07:36:11 -0800 (PST) MIME-Version: 1.0 References: <20200110165636.28035-1-will@kernel.org> <20200110165636.28035-2-will@kernel.org> <8fe4f81699517758b44afbe0e1a53bc080f64a62.camel@perches.com> In-Reply-To: From: Masahiro Yamada Date: Tue, 14 Jan 2020 00:35:35 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 1/8] compiler/gcc: Emit build-time warning for GCC prior to version 4.8 To: Arnd Bergmann Cc: Joe Perches , Will Deacon , "linux-kernel@vger.kernel.org" , linux-arch , Android Kernel Team , Michael Ellerman , Peter Zijlstra , Linus Torvalds , Segher Boessenkool , Christian Borntraeger , Luc Van Oostenryck Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 13, 2020 at 11:40 PM Arnd Bergmann wrote: > > On Fri, Jan 10, 2020 at 6:54 PM Joe Perches wrote: > > > > On Fri, 2020-01-10 at 18:35 +0100, Arnd Bergmann wrote: > > > On Fri, Jan 10, 2020 at 5:56 PM Will Deacon wrote: > > > > Prior to version 4.8, GCC may miscompile READ_ONCE() by erroneously > > > > discarding the 'volatile' qualifier: > > > > > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58145 > > > > > > > > We've been working around this using some nasty hacks which make > > > > READ_ONCE() both horribly complicated and also prevent us from enforcing > > > > that it is only used on scalar types. Since GCC 4.8 is pretty old for > > > > kernel builds now, emit a warning if we detect it during the build. > > > > > > No objection to recommending gcc-4.8, but I think this should either > > > just warn once during the kernel build instead of for every file, or > > > it should become a hard requirement. > > > > It might as well be a hard requirement as > > gcc 4.8.0 is already nearly 7 years old. > > > > gcc 4.6.0 released 2011-03-25 > > gcc 4.8.0 released 2013-03-22 > > > > Perhaps there are exceedingly few to zero new > > instances using gcc compiler versions < 4.8 > > The last time we had this discussion, the result was that gcc-4.8 is > probably ok as a minimum version, but moving to 5.1+ (from 2015) > was not an obvious choice: > > https://www.spinics.net/lists/linux-kbuild/msg23648.html > > If nobody complains about the move to 4.8, we can try moving to > gcc-5.1 and GNU99/GNU11 next year ;-) > > Arnd I agree. "Your compiler is old and may miscompile the kernel due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58145 - please upgrade it." sounds like an error rather than a warning. -- Best Regards Masahiro Yamada