Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5710634ybl; Tue, 14 Jan 2020 13:41:37 -0800 (PST) X-Google-Smtp-Source: APXvYqyLgqrXq+W4gNmN0hiofYY0jvhx/uG2ciEsNhu3pEFJTf5CpfqtiGO/OhRW1CWwNXG38T6E X-Received: by 2002:aca:5bd6:: with SMTP id p205mr18914974oib.132.1579038097370; Tue, 14 Jan 2020 13:41:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579038097; cv=none; d=google.com; s=arc-20160816; b=vf09q3uEQ6KmX2YbagGl02PMYXbmiD5CTPlG3JZiY0Hom5q/DobbAdVhJWQHYghiXH oQl35izKr43oaRXbnbRZnkhsnIU/GZ0dSlkCNDVStvTh6SEpimRxnIPdK8KXgGNRCywH g6AR6mIySVy8thvz9LIfeuoMDW/b/ZKaDIEbsosoOPqiAbWGQ+Tt39jfMjJyi1qoqoay ejfIAMtGIGf1Ahm/8j2Uc9zw5JqPG2DQnksoxrFQ5cYSnKlo+keciLs5L49iO3bsbKuN NkH3zT+p+yja7HPrYJqgKqE5Jgnlu7ETfVmgvOgk50xiFg3krXG2lwBeVHvxtdVQYJ1e JSDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references :mime-version:message-id:in-reply-to:date:dkim-signature; bh=ogwhwUXjz2D7m/McSi2ptUkkZ3HC7rjK02YCOSGV8GE=; b=GlU/3i82vIWewdht4K38bl+nWmW+3L2AuhPABQuOsaa1lIgb6tmSvbfPZ+MHFXoL0B /t3H9MCstU7rigFAxH1P7Pj5oHHBcgfjDvlBnoEBJQUzv6A0dwZzLIPLsPYeNn2zRZ5l KgxRJSNdRezEUuR9GUGEqxg74zSCM2ijRNYfSXQsFmc9Ac3P0GlfvR12zQmTmAkUeL+5 W1iJ/3IPaVHY5j9rEuHohu6bcMPzGKabuAcEtDj6ifAUoOMEWPwYioI8CyhPl5i+g90o cNNX/VbVyA4TFioBlXzNJPrQjzvETPJlDuS/Kbn2FdYGYoNyZYdSVQxQ6HOI5hca5ZO9 7QWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=OhW4irqs; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1si8148867oic.245.2020.01.14.13.41.24; Tue, 14 Jan 2020 13:41:37 -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=@google.com header.s=20161025 header.b=OhW4irqs; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729012AbgANVjR (ORCPT + 99 others); Tue, 14 Jan 2020 16:39:17 -0500 Received: from mail-pj1-f74.google.com ([209.85.216.74]:55001 "EHLO mail-pj1-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728656AbgANVjR (ORCPT ); Tue, 14 Jan 2020 16:39:17 -0500 Received: by mail-pj1-f74.google.com with SMTP id a31so8823954pje.4 for ; Tue, 14 Jan 2020 13:39:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=ogwhwUXjz2D7m/McSi2ptUkkZ3HC7rjK02YCOSGV8GE=; b=OhW4irqszOSJyDSvCfs5rVBGVRl1LZh4zh4uVXI73J5klWOhLw/5SDmpqhDOKCnM2X NGos6pYg0iLuzFx3qJueCMUI1/L11oDhEn/FYXQuc8gdgfAmVRk4YpHcQUI67TUzTXj/ 4lJM/xG1EBxMa5+lehOz78N6V9Y8s+gW7uCIfcwox73+wxv1FgiA1DXCJSPIVGhB5gXY 7AlKOIg1lTrxmm5r2M6gy+KxRQmbuZKjXMrQM4YPYOIwCS/TrJiIV1zPpiLTp1Q7MOK7 hboocq7wQmlGwoz5x1UopoCo+SNAP8fRSgZygJXJ0lAslC3tt407KsUlCSKfFTA4GcMB kgog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=ogwhwUXjz2D7m/McSi2ptUkkZ3HC7rjK02YCOSGV8GE=; b=SdfDC1CPi9YYf0m4YbymkWjYcvoat8y2wEW28m0jFnOLPvh4fXbECxlk0UvyTNxb89 aEzv96HuauoMdChcuRm51LZlTNp8zv8Two4cuWdyy/JLYefgjFfEVkz35RswBrRFNiOe ywpPf0MsAc7dXxX07FU/YcJLUWORfKZspZCiT4RstQ1/ewXWPSaqeLn/bIbuin7M+5yX zzWG+BRc2AYVz+GIBfty2jap0BIlMF5uQ6RVfSmC5ZGAoO/naVu9fz5NHMM6YmsesOj0 14sP57ssE6Z1vkgu91x68hNRdKPRYTj2xPMcu09LvRXyYJK9ZS/FcaH2b9IYvubAcZfW J+vw== X-Gm-Message-State: APjAAAXfWmF79DqBINXM+3+FoFre0gM7Y3NtRjkMAFsHrWCNh9ViypVF jdE9/VqSUpDHf6hJuWUJTp/ZPua+4GJEIJE/Wm0= X-Received: by 2002:a63:201d:: with SMTP id g29mr30212874pgg.427.1579037956432; Tue, 14 Jan 2020 13:39:16 -0800 (PST) Date: Tue, 14 Jan 2020 13:39:14 -0800 In-Reply-To: Message-Id: <20200114213914.198223-1-ndesaulniers@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.25.0.rc1.283.g88dfdc4193-goog Subject: Re: [RFC PATCH 1/8] compiler/gcc: Emit build-time warning for GCC prior to version 4.8 From: Nick Desaulniers To: arnd@arndb.de Cc: borntraeger@de.ibm.com, kernel-team@android.com, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, luc.vanoostenryck@gmail.com, mpe@ellerman.id.au, peterz@infradead.org, segher@kernel.crashing.org, torvalds@linux-foundation.org, will@kernel.org, masahiroy@kernel.org 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 Fri, Jan 10, 2020 at 06:35:02PM +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. Yeah, hard requirement sounds good to me. Arnd, do you have stats on which distros have which versions of GCC (IIRC, you had some stats for the GCC 4.6 upgrade)? This allows us to clean up more cruft in the kernel (grep for GCC_VERSION). Will, Documentation/process/changes.rst should also be modified. Android is still using GCC 4.9 (which is more like GCC 4.8 plus patches), but I've been actively moving them (to Clang) over the past 2 years. I'll check with our other internal distro's and give them a heads up.